feat: 提炼模板弹窗加宽,后端配置上下文压缩测试值
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4f0494a97a
commit
c21a1127f8
3 files changed
+30
-5
No files matched your search
@@ -304,7 +304,7 @@ export function ExtractTemplateManageDialog({
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-4xl">
|
||||
<DialogContent className="w-[95vw] max-w-[95vw] sm:max-w-[1800px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>抽取提示词模板</DialogTitle>
|
||||
<DialogDescription>
|
||||
|
||||
@@ -190,6 +190,28 @@ title:
|
||||
User: {user_msg}
|
||||
Assistant: {assistant_msg}
|
||||
|
||||
# 上下文压缩(对话摘要):长对话接近上下文上限时,把较早的消息总结成一段摘要,
|
||||
# 只保留最近若干条原始消息,避免撑爆模型上下文窗口。
|
||||
# - trigger:触发条件,可配多个,任意一个先满足就压缩(OR 关系)。真正决定何时
|
||||
# 压缩的是 trigger(不是 keep)。type=tokens 按 token 总数;type=messages 按条数。
|
||||
# - keep:压缩后保留多少最近的上下文(tokens / messages)。
|
||||
# - trim_tokens_to_summarize:喂给摘要模型的消息最多裁到多少 token。
|
||||
# 当前为「测试值(易触发)」:发到服务器后稍微聊几句就会触发,可在 Gateway 日志里
|
||||
# grep「上下文压缩」/「context compaction」确认生效;确认后再调回生产值
|
||||
# (trigger tokens 60000 / messages 80,keep tokens 16000)。
|
||||
summarization:
|
||||
enabled: true
|
||||
# model_name: deepseek-chat # 留空则用主对话模型
|
||||
trigger:
|
||||
- type: tokens
|
||||
value: 8000
|
||||
- type: messages
|
||||
value: 12
|
||||
keep:
|
||||
type: messages
|
||||
value: 6
|
||||
trim_tokens_to_summarize: 4000
|
||||
|
||||
tool_groups:
|
||||
- name: web
|
||||
- name: file:read
|
||||
|
||||
@@ -307,9 +307,9 @@ summarization:
|
||||
# model_name: deepseek-chat
|
||||
trigger:
|
||||
- type: tokens
|
||||
value: 60000
|
||||
value: 8000
|
||||
- type: messages
|
||||
value: 80
|
||||
value: 12
|
||||
# Keep a small *token* budget of recent context (same unit as the token
|
||||
# trigger, well below it). This is what the model receives after compaction:
|
||||
# [summary, ~16000 tokens of recent turns]. Small keep = small model context
|
||||
@@ -318,6 +318,9 @@ summarization:
|
||||
# which spans many turns. The full conversation still stays in state for the
|
||||
# page; only what is sent to the model is compressed.
|
||||
keep:
|
||||
type: tokens
|
||||
value: 16000
|
||||
type: messages # 测试值:压缩后只保留最近 6 条原始消息
|
||||
value: 6
|
||||
# 生产值改用 token 预算:
|
||||
# type: tokens
|
||||
# value: 16000
|
||||
trim_tokens_to_summarize: 4000
|
||||
Reference in new issue
Block a user