agent

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DELEGATE_TASK_TOOL_DESC = "Delegates the task to one or more subordinates"
View Source
const DELEGATE_TASK_TOOL_NAME = "delegate_task"

Variables

This section is empty.

Functions

func BuildRun added in v0.0.4

func BuildRun(params ...types.Parameter) (*types.Run, error)

Types

type Agent

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

func New

func New(model *providers.Model, options ...AgentOption) (*Agent, error)

func (*Agent) ComputeSystemMessage

func (a *Agent) ComputeSystemMessage() (string, error)

Build the system message for the Agent

func (*Agent) Description

func (a *Agent) Description() (string, error)

func (*Agent) Name

func (a *Agent) Name() (string, error)

func (*Agent) Run

func (a *Agent) Run(ctx context.Context, run *types.Run) error

func (*Agent) RunStreaming

func (a *Agent) RunStreaming(ctx context.Context, run *types.Run, bufferSize int) (streaming.ResponseChannel, error)

func (*Agent) RunStreamingWithParams

func (a *Agent) RunStreamingWithParams(ctx context.Context, bufferSize int, params ...types.Parameter) (*types.Run, streaming.ResponseChannel, error)

func (*Agent) RunWithParams

func (a *Agent) RunWithParams(ctx context.Context, params ...types.Parameter) (*types.Run, error)

Convenience method to run an agent without [run.Parameters] declaration

func (*Agent) Tools added in v0.0.2

func (a *Agent) Tools() ([]tools.Tool, error)

type AgentImpl

type AgentImpl interface {
	Name() (string, error)
	Description() (string, error)
	Tools() ([]tools.Tool, error)
	Run(context.Context, *types.Run) error
	RunStreaming(context.Context, *types.Run, int) (streaming.ResponseChannel, error)
}

type AgentOption

type AgentOption interface {
	Apply(*Agent) error
}

func WithChatOptions

func WithChatOptions(chatOptions types.Options) AgentOption

func WithDescription

func WithDescription(description string) AgentOption

func WithExpectedOutput

func WithExpectedOutput(expectedOutput string) AgentOption

func WithID

func WithID(id uuid.UUID) AgentOption

func WithInstructions

func WithInstructions(instructions string) AgentOption

func WithMCP

func WithMCP(ctx context.Context, session *mcp.ClientSession) AgentOption

func WithName

func WithName(name string) AgentOption

func WithSubordinate

func WithSubordinate(subordinate AgentImpl) AgentOption

func WithTool

func WithTool(tool tools.Tool) AgentOption

type AgentOptionFunc

type AgentOptionFunc func(*Agent) error

func (AgentOptionFunc) Apply

func (s AgentOptionFunc) Apply(r *Agent) error

type ErrBuilderParams

type ErrBuilderParams struct {
	Param string
	Msg   string
}

func (ErrBuilderParams) Error

func (e ErrBuilderParams) Error() string

type ErrModelResponse

type ErrModelResponse struct {
	Msg string
}

func (ErrModelResponse) Error

func (e ErrModelResponse) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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