agent

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxToolRounds    = 5
	MaxToolRequestsPerRound = 3
	MaxTotalToolExecutions  = 8
	MaxToolResultChars      = 16000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Completer

type Completer interface {
	Complete(ctx context.Context, prompt string, maxTokens int) (string, error)
}

type Loop

type Loop struct {
	Complete  Completer
	Tools     ToolRunner
	MaxRounds int
}

func NewLoop

func NewLoop(client *ai.Client, tools ToolRunner, maxRounds int) *Loop

func (*Loop) Run

func (l *Loop) Run(ctx context.Context, prompt string, maxTokens int) (string, error)

type Request

type Request struct {
	Name string
	Args map[string]string
}

func ParseToolRequests

func ParseToolRequests(response string) []Request

type ToolRunner

type ToolRunner interface {
	Execute(ctx context.Context, tool string, args map[string]string) (string, error)
}

Jump to

Keyboard shortcuts

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