mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 09:09:19 +08:00
feat: 贯通 context_window 配置并按 token 预算裁剪对话历史
This commit is contained in:
@@ -38,6 +38,13 @@ class Settings(BaseSettings):
|
||||
mcp_tools_enabled: bool = True
|
||||
|
||||
chat_history_limit: int = 40
|
||||
# 从 Mongo 最多拉多少条再按 token 裁剪(应 ≥ 条数窗口时代的 limit)
|
||||
chat_history_fetch_limit: int = 200
|
||||
# 未配置 context_window 且模型名无法识别时的默认
|
||||
llm_default_context_window: int = 128000
|
||||
# 为模型输出与本轮 tool 预留的 token
|
||||
context_reserve_output_tokens: int = 4096
|
||||
context_reserve_tool_tokens: int = 8192
|
||||
|
||||
@property
|
||||
def cors_origin_list(self) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user