Documentation
¶
Index ¶
- func AvailableThinkingForModel(model agentcore.ChatModel) []agentcore.ThinkingLevel
- func ParseThinkingLevel(s string) (agentcore.ThinkingLevel, error)
- func ResolveThinkingForModel(model agentcore.ChatModel, level agentcore.ThinkingLevel) (agentcore.ThinkingLevel, bool)
- type ApplyThinking
- type FlowBoundaryHook
- type UsageRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableThinkingForModel ¶ added in v0.5.3
func AvailableThinkingForModel(model agentcore.ChatModel) []agentcore.ThinkingLevel
func ParseThinkingLevel ¶ added in v0.5.2
func ParseThinkingLevel(s string) (agentcore.ThinkingLevel, error)
ParseThinkingLevel 把配置字符串转 agentcore.ThinkingLevel。 "" 合法(= 不覆盖/继承);其余须是 off/low/medium/high/xhigh/max 之一, 否则返回 error(启动时降级当空并 warn,运行时把 error 回显给用户)。
func ResolveThinkingForModel ¶ added in v0.5.3
func ResolveThinkingForModel(model agentcore.ChatModel, level agentcore.ThinkingLevel) (agentcore.ThinkingLevel, bool)
Types ¶
type ApplyThinking ¶ added in v0.5.2
type ApplyThinking func(role string, level agentcore.ThinkingLevel)
ApplyThinking 把某具体角色的推理强度应用到 live agent(运行时 /model 调整用)。 coordinator → Agent.SetThinkingLevel;architect → 两个 architect_* 子代理; writer/editor → 对应子代理。空 level = 沿用模型/provider 默认。其它 role 名忽略。
func BuildCoordinator ¶
func BuildCoordinator( cfg bootstrap.Config, store *store.Store, models *bootstrap.ModelSet, bundle assets.Bundle, recordUsage UsageRecorder, onFlowBoundary FlowBoundaryHook, ) (*agentcore.Agent, *tools.AskUserTool, *ctxpack.WriterRestorePack, *corecontext.ContextEngine, ApplyThinking)
BuildCoordinator 组装 Coordinator Agent 及其 SubAgent。 返回 Agent、AskUserTool、WriterRestorePack、Coordinator 的 ContextEngine 引用, 以及 ApplyThinking 闭包——Host 层 /model 切换时需要直接调 SetContextWindow + SetReserveTokens 联动新模型的窗口(writer/architect/editor 走 ContextManagerFactory 自动重建,不需要 ref;只有常驻的 coordinator 需要),并通过 ApplyThinking 联动各角色 推理强度。Host 层通过 Agent.Subscribe 获取事件流,不再需要 emit 回调。
type FlowBoundaryHook ¶ added in v0.5.5
type FlowBoundaryHook func(toolName string)
FlowBoundaryHook runs synchronously after a Coordinator tool that advances the durable story state succeeds. Host uses it to queue the next flow instruction before the Coordinator gets another LLM turn.
type UsageRecorder ¶ added in v0.1.2
type UsageRecorder func(agentName string, msg agentcore.AgentMessage)
UsageRecorder 是 BuildCoordinator 可选的用量回调;签名与 OnMessage 一致, 每条 agent 消息都会调一次,由 Host 层负责聚合。nil 表示不追踪。