runtime

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions struct {
	EnableAll bool

	EnableReflection     bool
	EnableToolSelection  bool
	EnablePromptEnhancer bool
	EnableSkills         bool
	EnableMCP            bool
	EnableLSP            bool
	EnableEnhancedMemory bool
	EnableObservability  bool

	SkillsDirectory string
	SkillsConfig    *skills.SkillManagerConfig

	MCPServerName    string
	MCPServerVersion string
	LSPServerName    string
	LSPServerVersion string

	EnhancedMemoryConfig *memory.EnhancedMemoryConfig

	// 设定时使用可观察性系统代替默认执行.
	ObservabilitySystem agent.ObservabilityRunner

	// Optional pass-throughs for AgentBuilder runtime controls.
	MaxReActIterations int
	MemoryManager      agent.MemoryManager
	ToolManager        agent.ToolManager
	EventBus           agent.EventBus
	LSPClient          agent.LSPClientRunner

	// Optional pass-throughs for AgentBuilder advanced wiring.
	PromptStore       agent.PromptStoreProvider
	ConversationStore agent.ConversationStoreProvider
	RunStore          agent.RunStoreProvider
	Orchestrator      agent.OrchestratorRunner
	ReasoningRegistry *reasoning.PatternRegistry

	// InitAgent在接线后呼叫Init(ctx).
	InitAgent bool
}

为可选子系统构建可选控件外接线.

func DefaultBuildOptions

func DefaultBuildOptions() BuildOptions

type Builder added in v1.4.6

type Builder struct {
	// contains filtered or unexported fields
}

Builder 是 agent/runtime 的唯一构建入口。

func NewBuilder added in v1.4.6

func NewBuilder(provider llm.Provider, logger *zap.Logger) *Builder

NewBuilder 创建 runtime builder。

func (*Builder) Build added in v1.4.6

func (b *Builder) Build(ctx context.Context, cfg types.AgentConfig) (*agent.BaseAgent, error)

Build 构造一个 BaseAgent 并按选项接线可选子系统。

func (*Builder) WithOptions added in v1.4.6

func (b *Builder) WithOptions(opts BuildOptions) *Builder

WithOptions 设置构建选项。

func (*Builder) WithToolProvider added in v1.4.6

func (b *Builder) WithToolProvider(provider llm.Provider) *Builder

WithToolProvider 设置工具调用专用 Provider(双模型模式)。 未设置时,工具调用退化使用主 provider。

func (*Builder) WithToolScope added in v1.4.6

func (b *Builder) WithToolScope(toolNames []string) *Builder

WithToolScope limits the tools available to the built agent. Only tools whose names appear in the whitelist will be accessible. An empty list means all tools are available (no restriction).

Jump to

Keyboard shortcuts

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