domain

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainAgent

type DomainAgent interface {
	// Name returns the unique name of the agent.
	Name() string
	// Domain returns the domain this agent specializes in (e.g., "data", "research").
	Domain() string
	// Description provides a brief summary of the agent's capabilities.
	Description() string
	// GetCapabilities returns the list of capabilities this agent provides.
	GetCapabilities() []string

	// CanHandle checks if the agent can handle the given task and returns a confidence score.
	CanHandle(task *sdktypes.Task) (bool, float64)

	// ExecuteAsync executes a task asynchronously and returns a handle for streaming results.
	ExecuteAsync(ctx context.Context, task *sdktypes.Task) (*sdktypes.ExecutionHandle, error)
	// Execute executes a task synchronously and returns the final result.
	Execute(ctx context.Context, task *sdktypes.Task) (*sdktypes.Result, error)

	// Initialize configures and starts the agent.
	Initialize(ctx context.Context, config types.MCPAgentConfig) error
	// SetLLM provides the agent with a language model client.
	SetLLM(llm *llm.ChatModelWrapper) error
	// Shutdown stops the agent and releases resources.
	Shutdown(ctx context.Context) error

	// StreamingProgressHandler 嵌入流式进度处理接口
	// 这样Domain Agent就可以处理来自Strategy的流式进度更新
	StreamingProgressHandler
}

DomainAgent represents the interface for a domain-specific agent. All domain agents (e.g., DataAgent, ResearchAgent) must implement this interface.

type StreamingProgressHandler

type StreamingProgressHandler interface {
	// OnStrategyProgress 当Strategy报告进度时被调用
	// 使用Strategy层专用的进度类型,与SDK主流程解耦
	OnStrategyProgress(progress *strategy_types.StrategyProgress)
}

StreamingProgressHandler 定义流式进度处理接口 Domain Agent 使用此接口来处理来自Strategy的流式进度更新

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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