Provider 模型提供商接口
| 233 | |
| 234 | // Provider 模型提供商接口 |
| 235 | type Provider interface { |
| 236 | // Stream 流式对话 |
| 237 | Stream(ctx context.Context, messages []types.Message, opts *StreamOptions) (<-chan StreamChunk, error) |
| 238 | |
| 239 | // Complete 非流式对话(阻塞式,返回完整响应) |
| 240 | Complete(ctx context.Context, messages []types.Message, opts *StreamOptions) (*CompleteResponse, error) |
| 241 | |
| 242 | // Config 返回配置 |
| 243 | Config() *types.ModelConfig |
| 244 | |
| 245 | // Capabilities 返回模型能力 |
| 246 | Capabilities() ProviderCapabilities |
| 247 | |
| 248 | // SetSystemPrompt 设置系统提示词 |
| 249 | SetSystemPrompt(prompt string) error |
| 250 | |
| 251 | // GetSystemPrompt 获取系统提示词 |
| 252 | GetSystemPrompt() string |
| 253 | |
| 254 | // Close 关闭连接 |
| 255 | Close() error |
| 256 | } |
| 257 | |
| 258 | // Factory 模型提供商工厂 |
| 259 | type Factory interface { |
no outgoing calls
no test coverage detected