agent

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

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

Go to latest
Published: Jul 12, 2026 License: GPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LLM_OPENAI    = "OpenAI"
	LLM_ANTHROPIC = "Anthropic"
	LLM_OLLAMA    = "Ollama"
)

Variables

This section is empty.

Functions

func Close

func Close(tileId string)

func New

func New(renderer types.Renderer, tile types.Tile)

func ToolsAdd

func ToolsAdd(t aitypes.Tool)

Types

type Agent

type Agent struct {
	History HistoryT

	Meta *aitypes.Meta
	// contains filtered or unexported fields
}

func Get

func Get(tileId string) *Agent

func (*Agent) AddHistory

func (agent *Agent) AddHistory(title string, response string)

func (*Agent) ChooseTools

func (agent *Agent) ChooseTools(cancel types.MenuCallbackT)

func (*Agent) CurrentModelLabel

func (agent *Agent) CurrentModelLabel() string

func (*Agent) GetMeta

func (agent *Agent) GetMeta() *aitypes.Meta

func (*Agent) ListModels

func (agent *Agent) ListModels() ([]ServiceModelIndexT, []string)

func (*Agent) ListModelsInputVariable

func (agent *Agent) ListModelsInputVariable() types.InputBoxWTVariables

ListModelsInputVariable returns a pre-configured InputBox variable definition that can be used directly in InputBoxWT options.

func (*Agent) MaxIterations

func (agent *Agent) MaxIterations() int

func (*Agent) McpMenu

func (agent *Agent) McpMenu(cancel types.MenuCallbackT)

func (*Agent) McpServerAdd

func (agent *Agent) McpServerAdd(server string, client client)

func (*Agent) McpServerExists

func (agent *Agent) McpServerExists(server string) bool

func (*Agent) ModelName

func (agent *Agent) ModelName() string

func (*Agent) Reload

func (agent *Agent) Reload()

func (*Agent) Renderer

func (agent *Agent) Renderer() types.Renderer

func (*Agent) RunLLMWithStream

func (agent *Agent) RunLLMWithStream(ctx context.Context, prompt string, streamCallback func(string)) (result string, err error)

RunLLMWithStream calls the configured runtime and streams text chunks. Use ai package helpers to construct provider-appropriate prompts.

func (*Agent) SelectServiceModel

func (agent *Agent) SelectServiceModel(returnFn func())

func (*Agent) ServiceName

func (agent *Agent) ServiceName() string

func (*Agent) SetServiceModelFromSelection

func (agent *Agent) SetServiceModelFromSelection(selection string) error

SetServiceModelFromSelection sets the active service/model from a list label formatted as "<Service>: <Model>".

func (*Agent) StartServersFromConfig

func (agent *Agent) StartServersFromConfig(config *mcp_config.ConfigT) error

func (*Agent) StartServersFromJson

func (agent *Agent) StartServersFromJson(filename string) error

func (*Agent) StartTools

func (agent *Agent) StartTools(tools []*skills.ToolsT) error

func (*Agent) SwitchServiceModel

func (agent *Agent) SwitchServiceModel(modelXRef []ServiceModelIndexT, i int)

func (*Agent) Term

func (agent *Agent) Term() types.Term

func (*Agent) ToolsAdd

func (agent *Agent) ToolsAdd(t aitypes.Tool) error

type HistoryItemT

type HistoryItemT struct {
	Title       string
	CmdLine     string
	OutputBlock string
	Response    string
}

type HistoryT

type HistoryT []HistoryItemT

func (HistoryT) String

func (h HistoryT) String() string

type ServiceModelIndexT

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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