agents

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 把某具体角色的推理强度应用到 Worker(运行时 /model 调整用)。 architect → 两个 architect_* 子代理;writer/editor → 对应子代理。 空 level = 沿用模型/provider 默认。其它 role 名忽略。

func BuildWorkers added in v0.7.0

func BuildWorkers(
	cfg bootstrap.Config,
	store *store.Store,
	styleStats *tools.StyleStatsIndex,
	models *bootstrap.ModelSet,
	bundle assets.Bundle,
	recordUsage UsageRecorder,
	onGuardBlock guard.BlockHook,
) (*subagent.Runner, *ctxpack.WriterRestorePack, ApplyThinking)

BuildWorkers 组装三个 Worker(architect_short/long、writer、editor)为可程序化 调用的 subagent.Runner。Engine 直接调用其类型化入口,无 LLM 工具层 (docs/engine-rfc.md §1)。 返回 Runner、WriterRestorePack 与 ApplyThinking(运行时 /model 联动各角色推理强度; writer/architect/editor 的 ContextManager 走工厂自动重建)。 onGuardBlock 可选(nil 安全):各 Worker StopGuard 的拦截/升级审计回调。

type UsageRecorder added in v0.1.2

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

UsageRecorder 是 BuildWorkers 可选的用量回调;签名与 OnMessage 一致, 每条 agent 消息都会调一次,由 Host 层负责聚合。task 是本次 spawn 的任务文本 作为会话身份,供缓存链断裂检测按会话重置基线。 nil 表示不追踪。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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