agent

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Automata

type Automata[A, B any] struct {
	// contains filtered or unexported fields
}

Generic agent automata

func NewAutomata

func NewAutomata[A, B any](
	llm chatter.Chatter,
	memory thinker.Memory,
	reasoner thinker.Reasoner[B],
	encoder thinker.Encoder[A],
	decoder thinker.Decoder[B],
) *Automata[A, B]

func (*Automata[A, B]) Echo added in v0.0.11

func (automata *Automata[A, B]) Echo(in A) (B, error)

Prompting agent to perform a work and forgeting the state. The operation is composable using Go-channels

func (*Automata[A, B]) Prompt

func (automata *Automata[A, B]) Prompt(ctx context.Context, input A, opt ...chatter.Opt) (B, error)

Prompt agent

func (*Automata[A, B]) Purge added in v0.0.11

func (automata *Automata[A, B]) Purge()

Purge automata's memory

func (*Automata[A, B]) Seek added in v0.0.11

func (automata *Automata[A, B]) Seek(in A) (B, error)

Prompting agent to perform a work and prerve the state. The operation is composable using Go-channels

type Prompter added in v0.0.11

type Prompter[A any] struct {
	*Automata[A, string]
}

Prompter is memoryless and stateless agent, implementing request/response to LLMs

func NewPrompter added in v0.0.11

func NewPrompter[A any](llm chatter.Chatter, f func(A) (chatter.Prompt, error)) *Prompter[A]

type Worker added in v0.0.9

type Worker[A any] struct {
	*Automata[A, thinker.CmdOut]
	// contains filtered or unexported fields
}

The agent tailored for executing prompt driven workflow.

func NewWorker added in v0.0.9

func NewWorker[A any](
	llm chatter.Chatter,
	attempts int,
	encoder thinker.Encoder[A],
	registry *command.Registry,
) *Worker[A]

Jump to

Keyboard shortcuts

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