feat(agent): 支持持久化 /btw 旁路提问

This commit is contained in:
ji ruo committed 2026-09-10 21:42:25 +08:00
1 parent 8dae851b9b
commit 555539bc8e
34 files changed
+3744 -314

No files matched your search

+2 -1
View File
@@ -147,7 +147,7 @@ func (c *ChatAgent) Chat(ctx context.Context, agentKey, sessionID, message strin
// (自定义 agent 各自一份;留空/0 用通用默认:10 轮)。
Settlement: wrapupSettlement(agentKey, nil),
NonStreaming: c.nonStreaming(), // 该 profile 选非流式时走 Provider.Complete
MaxTokens: c.maxTokens(), // 0 = 不发上限,由服务端默认值决定
MaxTokens: c.maxTokens(), // 0 = 不发上限,由服务端默认值决定
}
if c.guard != nil {
opts.Hooks = c.guard.Hooks()
@@ -156,6 +156,7 @@ func (c *ChatAgent) Chat(ctx context.Context, agentKey, sessionID, message strin
opts.Transcript = c.tx
opts.SessionID = sessionID
}
ctx = attachSideCapture(ctx, &opts)
s := agentcore.NewSession(opts)
defer s.Close()
// reload prior conversation so the agent has context across turns (each Chat is