agent

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRunResponse

func BuildRunResponse(params ...chat.Parameter) (*chat.RunResponse, error)

Types

type Agent

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

func New

func New(model *provider.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, runResponse *chat.RunResponse) error

func (*Agent) RunStreaming

func (a *Agent) RunStreaming(ctx context.Context, runResponse *chat.RunResponse, bufferSize int) (provider.ResponseChannel, error)

func (*Agent) RunStreamingWithParams

func (a *Agent) RunStreamingWithParams(ctx context.Context, bufferSize int, params ...chat.Parameter) (*chat.RunResponse, provider.ResponseChannel, error)

func (*Agent) RunWithParams

func (a *Agent) RunWithParams(ctx context.Context, params ...chat.Parameter) (*chat.RunResponse, error)

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

func (*Agent) Skills

func (a *Agent) Skills() ([]tools.SkillCard, error)

type AgentImpl

type AgentImpl interface {
	Name() (string, error)
	Description() (string, error)
	Skills() ([]tools.SkillCard, error)
	Run(context.Context, *chat.RunResponse) error
	RunStreaming(context.Context, *chat.RunResponse, int) (provider.ResponseChannel, error)
}

type AgentOption

type AgentOption interface {
	Apply(*Agent) error
}

func WithChatOptions

func WithChatOptions(chatOptions chat.Options) AgentOption

func WithDescription

func WithDescription(description string) AgentOption

func WithExpectedOutput

func WithExpectedOutput(expectedOutput string) AgentOption

func WithGoal

func WithGoal(goal 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 WithRole

func WithRole(role 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
internal/client command
internal/server command

Jump to

Keyboard shortcuts

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