runtime

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 15 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
	MaxLoopIterations        int
	MaxConcurrency           int
	MemoryManager            agent.MemoryManager
	ToolManager              agent.ToolManager
	RetrievalProvider        agent.RetrievalProvider
	ToolStateProvider        agent.ToolStateProvider
	EventBus                 agent.EventBus
	LSPClient                agent.LSPClientRunner
	ExecutionOptionsResolver agent.ExecutionOptionsResolver
	ChatRequestAdapter       agent.ChatRequestAdapter
	ToolProtocolRuntime      agent.ToolProtocolRuntime
	ReasoningRuntime         agent.ReasoningRuntime

	// Optional pass-throughs for AgentBuilder advanced wiring.
	PromptStore       agent.PromptStoreProvider
	ConversationStore agent.ConversationStoreProvider
	RunStore          agent.RunStoreProvider
	CheckpointManager *agent.CheckpointManager
	Orchestrator      agent.OrchestratorRunner
	ReasoningRegistry *reasoning.PatternRegistry
	// ReasoningExposure controls which non-default reasoning strategies are
	// registered into the runtime when ReasoningRegistry is not provided.
	ReasoningExposure agent.ReasoningExposureLevel

	// 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(gateway llmcore.Gateway, logger *zap.Logger) *Builder

NewBuilder 创建 runtime builder。logger 为必选参数,nil 时 panic。

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) WithLedger added in v1.6.0

func (b *Builder) WithLedger(ledger llmobs.Ledger) *Builder

WithLedger 设置 cost/usage 落账器。

func (*Builder) WithOptions added in v1.4.6

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

WithOptions 设置构建选项。

func (*Builder) WithToolGateway added in v1.11.0

func (b *Builder) WithToolGateway(gateway llmcore.Gateway) *Builder

WithToolGateway 设置工具调用专用 Gateway(双模型模式)。 未设置时,工具调用退化使用主 gateway。

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