reasoner

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 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[B any](f func(thinker.State[B]) (thinker.Phase, chatter.Prompt, error)) thinker.Reasoner[B]

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

Types

type Cmd added in v0.0.2

type Cmd 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() *Cmd

Creates new command reasoner.

func (*Cmd) Deduct added in v0.0.2

func (task *Cmd) Deduct(state StateCmd) (thinker.Phase, chatter.Prompt, error)

type CmdSeq added in v0.0.2

type CmdSeq 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() *CmdSeq

func (*CmdSeq) Deduct added in v0.0.2

func (task *CmdSeq) Deduct(state StateCmd) (thinker.Phase, chatter.Prompt, error)

type Epoch

type Epoch[B any] struct {
	thinker.Reasoner[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[B any](max int, reasoner thinker.Reasoner[B]) Epoch[B]

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

func (Epoch[B]) Deduct

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

Deduct new goal for the agent to pursue.

type StateCmd added in v0.0.6

type StateCmd = thinker.State[thinker.CmdOut]

State of Command reasoner

type Void

type Void[B any] struct{}

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

func NewVoid

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

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

func (Void[B]) Deduct

func (Void[B]) Deduct(thinker.State[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