agent

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] struct {
	Prompts  []prompt.Prompt
	Result   T
	Metadata models.Metadata
	Depth    int
}

func Run

func Run[T any](maxDepth int, parallelism int, g *gen.Generator, prompts ...prompt.Prompt) (*Result[T], error)

Run will prompt until the llm responds with no tool calls, or until maxDepth is reached. Unless Output is already set, it will be set by using schema.From on the expected result struct. Does not work with gemini as of 2025-02-17.

func RunWithToolsOnly added in v0.11.3

func RunWithToolsOnly[T any](maxDepth int, parallelism int, g *gen.Generator, prompts ...prompt.Prompt) (*Result[T], error)

RunWithToolsOnly will prompt until the llm responds with a certain tool call. Prefer to use the Run function above, but gemini does not support the above function (requiring tools and structured output), so use this one instead for those models.

Jump to

Keyboard shortcuts

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