feat: 完成项目助手与监控演示并修复聊天及云部署配置
This commit is contained in:
@@ -9,6 +9,7 @@ from langchain_core.messages import HumanMessage, AIMessage
|
||||
from config import get_rag_mode
|
||||
from graph.prompt_builder import build_system_prompt
|
||||
from graph.session_manager import session_manager
|
||||
from graph.chat_model_options import chat_model_options
|
||||
from tools import get_all_tools
|
||||
|
||||
|
||||
@@ -39,6 +40,7 @@ class AgentManager:
|
||||
api_base=os.getenv("DEEPSEEK_BASE_URL", "https://api.deepseek.com"),
|
||||
temperature=0.7,
|
||||
streaming=True,
|
||||
**chat_model_options(),
|
||||
)
|
||||
|
||||
session_manager.initialize(base_dir)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
"""Explicit chat-only provider compatibility, without exposing reasoning as answers."""
|
||||
import os
|
||||
|
||||
|
||||
def chat_model_options():
|
||||
mode = os.getenv("CHAT_THINKING_MODE", "").strip().lower()
|
||||
if mode not in ("", "disabled", "enabled"):
|
||||
raise ValueError("CHAT_THINKING_MODE 只允许 disabled、enabled 或留空")
|
||||
options = {"timeout": 60, "max_retries": 0}
|
||||
if mode:
|
||||
options["extra_body"] = {"thinking": {"type": mode}}
|
||||
return options
|
||||
Reference in New Issue
Block a user