agents

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseThinkingLevel added in v0.5.2

func ParseThinkingLevel(s string) (agentcore.ThinkingLevel, error)

ParseThinkingLevel 把配置字符串转 agentcore.ThinkingLevel。 "" 合法(= 不覆盖/继承);其余须是 off/minimal/low/medium/high/xhigh 之一, 否则返回 error(启动时降级当空并 warn,运行时把 error 回显给用户)。

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

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 UsageRecorder added in v0.1.2

type UsageRecorder func(agentName string, msg agentcore.AgentMessage)

UsageRecorder 是 BuildCoordinator 可选的用量回调;签名与 OnMessage 一致, 每条 agent 消息都会调一次,由 Host 层负责聚合。nil 表示不追踪。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL