agent

package
v0.0.0-...-8dc656b Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: GPL-2.0 Imports: 19 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 Init

func Init(renderer types.Renderer)

func ToolsAdd

func ToolsAdd(t Tool)

Types

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 {
	History HistoryT

	Term     types.Term
	Renderer types.Renderer

	CmdLine          string
	Pwd              string
	OutputBlock      string
	InsertAfterRowId uint64
	// contains filtered or unexported fields
}

func Get

func Get(tileId string) *Meta

func NewAgentMeta

func NewAgentMeta() *Meta

func (*Meta) AddHistory

func (meta *Meta) AddHistory(title string, response string)

func (*Meta) ChooseTools

func (meta *Meta) ChooseTools(cancel types.MenuCallbackT)

func (*Meta) McpServerAdd

func (meta *Meta) McpServerAdd(server string, client client)

func (*Meta) McpServerExists

func (meta *Meta) McpServerExists(server string) bool

func (*Meta) ModelName

func (meta *Meta) ModelName() string

func (*Meta) ModelNext

func (meta *Meta) ModelNext()

func (*Meta) Reload

func (meta *Meta) Reload()

func (*Meta) RunLLM

func (meta *Meta) RunLLM(prompt string, sticky types.Notification) (result string, err error)

RunLLM calls the LLM with the prompt string. Use `ai` package to create specific prompts.

func (*Meta) ServiceName

func (meta *Meta) ServiceName() string

func (*Meta) ServiceNext

func (meta *Meta) ServiceNext()

func (*Meta) ToolsAdd

func (meta *Meta) ToolsAdd(t Tool) error

type Tool

type Tool interface {
	New(*Meta) (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