reasoner

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 2 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 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