action

package
v0.0.0-...-bb1ca51 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

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

Action is a type to hold the content needed for an upcoming action. An Action can be of type 'tool' or 'user', e.q. it is meant to be executed by a tool or a user.

func MakeTool

func MakeTool(calls []tool.Call, reason string) Action

func MakeUser

func MakeUser(content string) Action

func (Action) Reason

func (a Action) Reason() (reason string, ok bool)

Reason reports if the action provides a reason. If true the reason is returned.

func (Action) Tool

func (a Action) Tool() (content []tool.Call, ok bool)

Tool reports if the action is of type tool. If true a slice of calls to the tool services is returned.

func (Action) User

func (a Action) User() (content string, ok bool)

User reports if the action is of type user. If true the content for the user action is returned.

type Actor

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

func NewActor

func NewActor(discovery tool.Discovery, transport Transporter, log *slog.Logger) *Actor

func (*Actor) Act

func (ac *Actor) Act(ctx context.Context, action Action) ([]percept.Percept, error)

Act executes all given tool calls concurrently and returns their results as a slice of perceptions.

type Transporter

type Transporter interface {
	Post(ctx context.Context, addr string, header map[string][]string, body io.Reader) ([]byte, error)
}

Jump to

Keyboard shortcuts

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