agent

package
v0.0.0-...-e4882c5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LLM_OPENAI    = "ChatGPT"
	LLM_ANTHROPIC = "Claude"
	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 Tool)

Types

type Agent

type Agent struct {
	History HistoryT

	Meta *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) 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 LLM with the prompt string and streams responses. Use `ai` package to create specific prompts.

func (*Agent) SelectServiceModel

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

func (*Agent) ServiceName

func (agent *Agent) ServiceName() string

func (*Agent) SkillStartTools

func (agent *Agent) SkillStartTools(skill *skills.SkillT) error

func (*Agent) StartServersFromConfig

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

func (*Agent) StartServersFromJson

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

func (*Agent) Term

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

func (*Agent) ToolsAdd

func (agent *Agent) ToolsAdd(t 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 Meta

type Meta struct {
	CmdLine     string
	Pwd         string
	OutputBlock string
	Function    string
}

type Tool

type Tool interface {
	New(*Agent) (Tool, error)
	Enabled() bool
	Toggle()
	Name() string
	Path() string
	Description() string
	Call(context.Context, string) (string, error)
}

Jump to

Keyboard shortcuts

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