reasoner

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From[A, B any](f func(thinker.State[A, B]) (thinker.Phase, chatter.Prompt, error)) thinker.Reasoner[A, B]

From is helper to build Reasoner[A, B any] interface from pure function.

Types

type Cmd added in v0.0.2

type Cmd[A any] struct{}

The cmd (command) reasoner set the goal for agent to execute a single command. It returns right after the command return results.

func NewCmd added in v0.0.2

func NewCmd[A any]() *Cmd[A]

Creates new command reasoner.

func (*Cmd[A]) Deduct added in v0.0.2

func (task *Cmd[A]) Deduct(state thinker.State[A, thinker.CmdOut]) (thinker.Phase, chatter.Prompt, error)

type CmdSeq added in v0.0.2

type CmdSeq[A any] struct{}

The sequence of cmd (commands) reasoner set the goal for agent to execute a sequence of commands. The reason returns only after LLM uses return command.

func NewCmdSeq added in v0.0.2

func NewCmdSeq[A any]() *CmdSeq[A]

func (*CmdSeq[A]) Deduct added in v0.0.2

func (task *CmdSeq[A]) Deduct(state thinker.State[A, thinker.CmdOut]) (thinker.Phase, chatter.Prompt, error)

type Epoch

type Epoch[A, B any] struct {
	thinker.Reasoner[A, B]
	// contains filtered or unexported fields
}

The epoch reasoner limits the number of agent iterations per step. It aborts execution if the maximum limit is reached.

func NewEpoch

func NewEpoch[A, B any](max int, reasoner thinker.Reasoner[A, B]) Epoch[A, B]

Creates new epoch reasoner that limits the number of agent iterations per step.

func (Epoch[A, B]) Deduct

func (epoch Epoch[A, B]) Deduct(state thinker.State[A, B]) (thinker.Phase, chatter.Prompt, error)

Deduct new goal for the agent to pursue.

type Void

type Void[A, B any] struct{}

The void reasoner always sets a new goal to return results.

func NewVoid

func NewVoid[A, B any]() *Void[A, B]

Creates new void reasoner that always sets a new goal to return results.

func (Void[A, B]) Deduct

func (Void[A, B]) Deduct(thinker.State[A, B]) (thinker.Phase, chatter.Prompt, error)

Deduct new goal for the agent to pursue.

Jump to

Keyboard shortcuts

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