agent

package
v0.0.0-...-3efcfba Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 27 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureTerm

func CaptureTerm(f func() (any, error)) (string, error)

func CollectFsTools

func CollectFsTools() []ai.Tool

func TeeTerm

func TeeTerm(f func() (any, error)) (string, error)

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, fabricAddr string, stack *stacks.Parameters, opts ...Option) (*Agent, error)

func (*Agent) StartWithMessage

func (a *Agent) StartWithMessage(ctx context.Context, msg string) error

func (*Agent) StartWithUserPrompt

func (a *Agent) StartWithUserPrompt(ctx context.Context, userPrompt string) error

type EmptyResponseError

type EmptyResponseError struct{}

func (*EmptyResponseError) Error

func (e *EmptyResponseError) Error() string

type FindFilesParams

type FindFilesParams struct {
	Path    string `json:"path"`
	Pattern string `json:"pattern"`
}

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(genkit *genkit.Genkit, printer Printer, toolManager *ToolManager) *Generator

func (*Generator) HandleMessage

func (g *Generator) HandleMessage(ctx context.Context, prompt string, maxTurns int, message *ai.Message) error

type GenkitGenerator

type GenkitGenerator interface {
	Generate(ctx context.Context, prompt string, tools []ai.ToolRef, messages []*ai.Message, streamingCallback func(context.Context, *ai.ModelResponseChunk) error) (*ai.ModelResponse, error)
}

type GenkitToolManager

type GenkitToolManager interface {
	RegisterTools(tools ...ai.Tool)
	LookupTool(name string) ai.Tool
}

func NewGenkitToolManager

func NewGenkitToolManager(genkit *genkit.Genkit) GenkitToolManager

type ListFilesParams

type ListFilesParams struct {
	Path string `json:"path"`
}

type Option

type Option func(*agentConfig)

Option configures an Agent created by New.

func WithNonInteractive

func WithNonInteractive() Option

WithNonInteractive runs the agent in one-shot mode: it handles the initial message to completion and returns, without a REPL, continue-prompts, or tool elicitations. Suitable for non-interactive environments such as CI.

type Printer

type Printer interface {
	Printf(format string, args ...interface{})
	Println(args ...interface{})
}

type ReadFileParams

type ReadFileParams struct {
	Path string `json:"path"`
}

type ToolManager

type ToolManager struct {
	// contains filtered or unexported fields
}

func NewToolManager

func NewToolManager(genkit *genkit.Genkit, printer Printer) *ToolManager

func (*ToolManager) ClearPrevious

func (t *ToolManager) ClearPrevious()

func (*ToolManager) EqualPrevious

func (t *ToolManager) EqualPrevious(toolRequests []*ai.ToolRequest) bool

func (*ToolManager) HandleToolCalls

func (t *ToolManager) HandleToolCalls(ctx context.Context, requests []*ai.ToolRequest) (*ai.Message, error)

func (*ToolManager) RegisterTools

func (t *ToolManager) RegisterTools(tools ...ai.Tool)

Directories

Path Synopsis
plugins
Package tools: consolidated interfaces for mocking CLI/tool dependencies
Package tools: consolidated interfaces for mocking CLI/tool dependencies

Jump to

Keyboard shortcuts

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