feat: add DeepSeek official API support and capture reasoning content

- Add DeepSeek provider routing: deepseek-chat/deepseek-reasoner use
  api.deepseek.com, other models use SiliconFlow
- Add stream_with_reasoning() using raw OpenAI SDK to capture
  reasoning_content (langchain_openai strips this field)
- RAG chain and conversation chain both use stream_with_reasoning
  for proper reasoning display in thinking models
- Frontend model selector: grouped by provider (DeepSeek official +
  SiliconFlow), default changed to deepseek-chat
- Regenerate message converted to streaming with reasoning capture
- Minor UI: globals.css additions, chat store refactoring

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 12:37:31 +08:00
parent 51d6fd22c0
commit ecd5c7ff31
9 changed files with 385 additions and 215 deletions
+4
View File
@@ -3,6 +3,10 @@ SILICONFLOW_API_KEY=your-api-key-here
SILICONFLOW_BASE_URL=https://api.siliconflow.cn/v1
SILICONFLOW_MODEL=Qwen/Qwen3-30B-A3B-Thinking-2507
# DeepSeek官方API配置(可选,不配则走硅基流动)
# DEEPSEEK_API_KEY=your-deepseek-api-key-here
DEEPSEEK_BASE_URL=https://api.deepseek.com
# 数据库配置(本地开发默认使用SQLite)
DATABASE_URL=sqlite:///../data/database/course_agent.db
# Docker部署使用PostgreSQL