Chat 定义了聊天接口
| 85 | |
| 86 | // Chat 定义了聊天接口 |
| 87 | type Chat interface { |
| 88 | // Chat 进行非流式聊天 |
| 89 | Chat(ctx context.Context, messages []Message, opts *ChatOptions) (*types.ChatResponse, error) |
| 90 | |
| 91 | // ChatStream 进行流式聊天 |
| 92 | ChatStream(ctx context.Context, messages []Message, opts *ChatOptions) (<-chan types.StreamResponse, error) |
| 93 | |
| 94 | // GetModelName 获取模型名称 |
| 95 | GetModelName() string |
| 96 | |
| 97 | // GetModelID 获取模型ID |
| 98 | GetModelID() string |
| 99 | } |
| 100 | |
| 101 | type ChatConfig struct { |
| 102 | Source types.ModelSource |
no outgoing calls
no test coverage detected