feat: 增强模型选择和错误处理机制

优化模型ID传递逻辑,支持请求级别的模型覆盖;完善流式响应的错误处理
This commit is contained in:
wizardchen
2025-12-31 15:23:35 +08:00
committed by lyingbug
parent 7cf5dfff6a
commit 884153aeb8
10 changed files with 83 additions and 26 deletions
+2 -1
View File
@@ -189,7 +189,8 @@ func (c *OllamaChat) ChatStream(
logger.GetLogger(ctx).Errorf("流式聊天请求失败: %v", err)
// 发送错误响应
streamChan <- types.StreamResponse{
ResponseType: types.ResponseTypeAnswer,
ResponseType: types.ResponseTypeError,
Content: err.Error(),
Done: true,
}
}