feat: 增强模型选择日志和验证
- 在 chatService 中添加模型选择详细日志 - 在 modelServiceManager 中添加请求/响应确认日志 - 创建模型选择验证指南文档 - 帮助用户确认所选模型是否被正确使用 新增日志: - 🎯 用户选择的模型 - ✅ 找到匹配服务 - 🔍 最终选择确认 - 📋 请求体 model 字段 - �� 最终发送确认 - ✅ API 响应模型确认 用户现在可以在控制台清晰看到: - 选择了哪个模型 - 找到了哪个服务 - 实际发送了什么模型参数 - API 返回了什么模型 - 请求模型和响应模型是否一致
This commit is contained in:
@@ -618,16 +618,28 @@ class ChatService {
|
||||
|
||||
// 如果指定了模型,尝试找到拥有该模型的服务
|
||||
if (model) {
|
||||
console.log('🎯 [callModelStream] 用户选择的模型:', model)
|
||||
const foundService = services.find(s =>
|
||||
s.models && s.models.includes(model)
|
||||
)
|
||||
if (foundService) {
|
||||
service = foundService
|
||||
selectedModel = model
|
||||
console.log('✅ [callModelStream] 找到匹配服务:', foundService.name)
|
||||
} else {
|
||||
console.warn('⚠️ [callModelStream] 未找到包含该模型的服务,使用默认服务')
|
||||
}
|
||||
} else {
|
||||
console.log('ℹ️ [callModelStream] 未指定模型,使用默认模型')
|
||||
}
|
||||
|
||||
console.log('🔍 [callModelStream] 使用流式服务:', service.name, '模型:', selectedModel)
|
||||
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━')
|
||||
console.log('🔍 [callModelStream] 最终选择:')
|
||||
console.log(' 服务:', service.name, `(${service.type})`)
|
||||
console.log(' 模型:', selectedModel)
|
||||
console.log(' MCP:', mcpServerId || '未选择')
|
||||
console.log(' 工具:', tools.length, '个')
|
||||
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━')
|
||||
console.log('🚀 [callModelStream] === 开始真正的流式请求 ===')
|
||||
|
||||
// 调用真正的流式API
|
||||
|
||||
Reference in New Issue
Block a user