Files
AutoZero/agent/helpers_test.go
T
Sakurasan d5dac5a6fc feat: AutoZero 通用 Agent 框架(从 AutoGo 五阶段拆分完成)
llm(三协议 Provider)/ session(JSONL 持久化)/ tools(Registry、围栏、
builtin、computer)/ cdp(browser)/ skills / mcp / agent(循环、两级压缩、
编排、审批门控)+ 底座 jsonl/textx/execx/diag/scratch/spill/imagecache。

产品装配代码(config 桥接、schedule 工具、memory/plan/retro/prompt)
留在 AutoGo,宿主接入方式见 MIGRATION.md。
2026-10-26 00:54:46 +08:00

28 lines
748 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package agent
import (
"context"
"git.gopher.ink/mirrors2/AutoZero/llm"
)
// stubProvider 是最小 Provider:记录收到的 system/user 内容,回固定文本。
// (AutoGo 侧同名脚手架在 retro_test.go,随复盘功能留在宿主。)
type stubProvider struct {
gotSystem string
gotUser string
reply string
}
func (p *stubProvider) Stream(ctx context.Context, system string, msgs []llm.Message,
tools []llm.ToolDef, opts llm.StreamOptions, onDelta func(llm.StreamDelta)) (llm.Message, error) {
p.gotSystem = system
if len(msgs) > 0 {
p.gotUser = msgs[len(msgs)-1].Content
}
if onDelta != nil {
onDelta(llm.StreamDelta{Text: p.reply})
}
return llm.Message{Role: llm.RoleAssistant, Content: p.reply}, nil
}