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。
28 lines
748 B
Go
28 lines
748 B
Go
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
|
||
}
|