agent

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 7 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,
	encoder thinker.Encoder[A],
	decoder thinker.Decoder[B],
	reasoner thinker.Reasoner[B],
) *Automata[A, B]

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]) PromptOnce added in v0.0.16

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

Forget the agent state and prompt within a new session

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

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

Purge automata's memory

type Manifold added in v0.0.20

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

func NewManifold added in v0.0.20

func NewManifold[A, B any](
	llm chatter.Chatter,
	encoder thinker.Encoder[A],
	decoder thinker.Decoder[B],
	registry thinker.Registry,
) *Manifold[A, B]

func (*Manifold[A, B]) Prompt added in v0.0.20

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

type Prompter added in v0.0.11

type Prompter[A any] struct {
	*Automata[A, *chatter.Reply]
}

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.Message, error)) *Prompter[A]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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