agent

package
v0.0.0-...-66c9f5b Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 27 Imported by: 0

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, clusterAddr string, stack *stacks.Parameters) (*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 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