mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 09:49:19 +08:00
feat: 贯通 context_window 配置并按 token 预算裁剪对话历史
This commit is contained in:
@@ -104,6 +104,8 @@ class LlmRuntimeConfig:
|
||||
api_key: str
|
||||
model: str
|
||||
extra_headers: dict[str, str] = field(default_factory=dict)
|
||||
# 租户配置的上下文窗口;None 表示由 Agent 按模型名估计
|
||||
context_window: int | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
@@ -89,7 +89,7 @@ class ChatStreamer(ABC):
|
||||
llm: LlmRuntimeConfig,
|
||||
history: list[ChatMessage],
|
||||
user_text: str,
|
||||
system_prompt: str,
|
||||
tools: list[Any] | None = None,
|
||||
memory_count: int = 0,
|
||||
memory_just_saved: str | None = None,
|
||||
max_tool_result_chars: int = 8000,
|
||||
) -> AsyncIterator[StreamEvent]: ...
|
||||
|
||||
Reference in New Issue
Block a user