simple

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package simple provides a general LLM-loop strategy: generate, run any tool calls, feed the results back, repeat until the model answers with no more tool calls. It does at most one LLM Generate per transition (checkpointing between rounds), which keeps replay cheap and avoids relying on intra-transition determinism (agentkit is at-least-once, D44).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(r *agentkit.Registry, name agentkit.AgentName, version int, opts ...Option) (agentkit.Agent[Input], error)

Register builds and registers the simple strategy, returning a typed handle (the state type is hidden).

Types

type Input

type Input struct {
	Prompt string `json:"prompt"`
}

Input is the launch input (required; empty prompt is rejected by Init).

type Option

type Option func(*config)

Option configures the strategy.

func WithLimiter

func WithLimiter(f agentkit.Limiter) Option

WithLimiter sets this agent's execution budget, which Strategy.Limit answers with. Default: none, i.e. LimitPass at every check.

This is a different question from WithMaxIterations: that one bounds this strategy's own loop and is counted in checkpointed state, while a limiter sees the kernel's counters — including every terminated child, so on a Process that spawns, it is a budget for the subtree.

func WithMaxIterations

func WithMaxIterations(n int) Option

WithMaxIterations caps the number of LLM rounds. Default: 32. Exceeding it finalizes as Fail(strategy_error).

func WithOnFinish

func WithOnFinish(h agentkit.FinishHandler[Output]) Option

WithOnFinish wires a completion handler for this agent. Delivery is best-effort; see agentkit.WithOnFinish.

func WithRole

func WithRole(r agentkit.ModelRole) Option

WithRole sets the model role. Default: nil (the default model).

func WithSystemPrompt

func WithSystemPrompt(p string) Option

WithSystemPrompt sets the system prompt. Default: "".

type Output

type Output struct {
	Texts []string `json:"texts"`
}

Output is the Done output.

Jump to

Keyboard shortcuts

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