agent

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Identity `yaml:",inline" json:",inline"`
	Source   *Source `yaml:"source,omitempty" json:"source,omitempty"` // Source of the agent

	llm.ModelSelection `yaml:",inline" json:",inline"`

	Temperature float64        `yaml:"temperature,omitempty" json:"temperature,omitempty"` // Temperature
	Description string         `yaml:"description,omitempty" json:"description,omitempty"` // Description of the agent
	Prompt      *prompt.Prompt `yaml:"prompt,omitempty" json:"prompt,omitempty"`           // Prompt template
	Knowledge   []*Knowledge   `yaml:"knowledge,omitempty" json:"knowledge,omitempty"`

	SystemPrompt    *prompt.Prompt `yaml:"systemPrompt,omitempty" json:"systemPrompt,omitempty"`
	SystemKnowledge []*Knowledge   `yaml:"systemKnowledge,omitempty" json:"systemKnowledge,omitempty"`
	Tool            []*llm.Tool    `yaml:"tool,omitempty" json:"tool,omitempty"`

	// ParallelToolCalls requests providers that support it to execute
	// multiple tool calls in parallel within a single reasoning step.
	// Honored only when the selected model implements the feature.
	ParallelToolCalls bool `yaml:"parallelToolCalls,omitempty" json:"parallelToolCalls,omitempty"`

	// ToolCallExposure defines how tool calls are exposed to the LLM
	ToolCallExposure ToolCallExposure `yaml:"toolCallExposure,omitempty" json:"toolCallExposure,omitempty"`

	// Elicitation optionally defines required context schema that must be
	// satisfied before the agent can execute its workflow. When provided, the
	// runtime checks incoming QueryInput.Context against the schema and, if
	// required properties are missing, responds with an elicitation request
	// to gather the missing data from the caller.
	Elicitation *plan.Elicitation `yaml:"elicitation,omitempty" json:"elicitation,omitempty"`

	// Persona defines the default conversational persona the agent uses when
	// sending messages. When nil the role defaults to "assistant".
	Persona *prompt.Persona `yaml:"persona,omitempty" json:"persona,omitempty"`

	// ToolExport controls automatic exposure of this agent as a virtual tool
	ToolExport *ToolExport `yaml:"toolExport,omitempty" json:"toolExport,omitempty"`
}

Agent represents an agent

func (*Agent) Validate

func (a *Agent) Validate() error

type Finder

type Finder interface {
	Find(ctx context.Context, id string) (*Agent, error)
}

Finder is an interface for finding Agents by their ID.

type Identity

type Identity struct {
	ID   string `yaml:"id,omitempty" json:"id,omitempty"`
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	Icon string `yaml:"icon,omitempty" json:"icon,omitempty"`
}

type Knowledge

type Knowledge struct {
	Description   string          `yaml:"description,omitempty" json:"description,omitempty"`
	Match         *option.Options `json:"match,omitempty"` // Optional matching options
	URL           string          `yaml:"url,omitempty" json:"url,omitempty"`
	InclusionMode string          `yaml:"inclusionMode,omitempty" json:"inclusionMode,omitempty"` // Inclusion mode for the knowledge base
}

type Loader

type Loader interface {
	// Add stores an in-memory representation of an Agent so it becomes
	// available for subsequent queries.
	Add(name string, agent *Agent)

	//Load retrieves an Agent by its name. If the Agent does not exist, it
	Load(ctx context.Context, name string) (*Agent, error)
}

Loader exposes operations required by higher-level services on top of the concrete Loader implementation. The interface is intentionally minimal to keep package dependencies low – additional Loader methods should be added only when they are genuinely used by an upstream layer.

type Source

type Source struct {
	URL string `yaml:"url,omitempty" json:"url,omitempty"`
}

type ToolCallExposure added in v0.2.0

type ToolCallExposure string

ToolCallExposure controls how tool calls are exposed back to the LLM prompt and templates. Supported modes: - "turn": include only tool calls from the current turn - "conversation": include tool calls from the whole conversation - "semantic": reserved for future use (provider-native tool semantics)

type ToolExport

type ToolExport struct {
	Expose  bool     `yaml:"expose,omitempty" json:"expose,omitempty"`   // opt-in flag
	Service string   `yaml:"service,omitempty" json:"service,omitempty"` // MCP service name (default "agentExec")
	Method  string   `yaml:"method,omitempty" json:"method,omitempty"`   // Method name (default agent.id)
	Domains []string `yaml:"domains,omitempty" json:"domains,omitempty"` // Allowed parent domains
}

ToolExport defines optional settings to expose an agent as a runtime tool.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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