agent

package
v0.0.0-...-96647dd Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// read from clipboard
	ClipboardInputRedirect = "="

	// write to clipboard
	ClipboardOutputRedirect = "=+"
)

clipboard redirection

View Source
const StdinInputRedirect = "-"

Variables

This section is empty.

Functions

func AgentCommand

func AgentCommand(cfg *llm.Config, role, content string) error

func AgentHelp

func AgentHelp(cfg *llm.Config, role, content string) error

func GetUserInput

func GetUserInput(cfg *llm.Config) (string, error)

func HandleCommand

func HandleCommand(cfg *llm.Config, role, content string) error

func Info

func Info(cfg *llm.Config) error

func LaunchEditor

func LaunchEditor(editor string) (string, error)

func ListAgents

func ListAgents(cfg *llm.Config) error

func ListCommands

func ListCommands(cfg *llm.Config) error

func ProcessBashScript

func ProcessBashScript(cfg *llm.Config, script string) error

func Setup

func Setup(cfg *llm.Config) error

func SlashCommand

func SlashCommand(cfg *llm.Config, role, content string) error

func ValidatePath

func ValidatePath(path string) (string, error)

ValidatePath returns the absolute path of the given path. If the path is empty, it returns an error. If the path is not an absolute path, it converts it to an absolute path. If the path does not exist, it creates the path and returns the absolute path. If the path exists, it returns its absolute path.

Types

type Agent

type Agent interface {
	Send(ctx context.Context, input string) (*ChatMessage, error)
}

func MakeAgent

func MakeAgent(name string, cfg *llm.Config, role, content string) (Agent, error)

type AiderAgent

type AiderAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewAiderAgent

func NewAiderAgent(cfg *llm.Config, role, content string) (*AiderAgent, error)

func (*AiderAgent) Send

func (r *AiderAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type AskAgent

type AskAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewAskAgent

func NewAskAgent(cfg *llm.Config, role, content string) (*AskAgent, error)

func (*AskAgent) GeneratePrompt

func (r *AskAgent) GeneratePrompt(cfg *llm.Config, ctx context.Context, role, prompt, input string) (*AskAgentPrompt, error)

func (*AskAgent) Send

func (r *AskAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type AskAgentPrompt

type AskAgentPrompt struct {
	Service    string `json:"service"`
	RolePrompt string `json:"agent_role_prompt"`
}

type ChatMessage

type ChatMessage struct {
	Agent   string
	Content string
}

type ClipboardProvider

type ClipboardProvider = cb.ClipboardProvider

type Editor

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

func (*Editor) Launch

func (e *Editor) Launch() (string, error)

type EditorProvider

type EditorProvider interface {
	Launch() (string, error)
}

func NewEditor

func NewEditor(editor string) EditorProvider

type EvalAgent

type EvalAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewEvalAgent

func NewEvalAgent(cfg *llm.Config, role, content string) (*EvalAgent, error)

func (*EvalAgent) Send

func (r *EvalAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type GitAgent

type GitAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewGitAgent

func NewGitAgent(cfg *llm.Config, role, content string) (*GitAgent, error)

func (*GitAgent) Send

func (r *GitAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type GptrAgent

type GptrAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewGptrAgent

func NewGptrAgent(cfg *llm.Config, role, content string) (*GptrAgent, error)

func (*GptrAgent) Send

func (r *GptrAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type HelpAgent

type HelpAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

HelpAgent auto selects the best agent to handle the user query

func NewHelpAgent

func NewHelpAgent(cfg *llm.Config, role, content string) (*HelpAgent, error)

func (*HelpAgent) Send

func (r *HelpAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type OhAgent

type OhAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewOhAgent

func NewOhAgent(cfg *llm.Config, role, content string) (*OhAgent, error)

func (*OhAgent) Send

func (r *OhAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type ScriptAgent

type ScriptAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewScriptAgent

func NewScriptAgent(cfg *llm.Config, role, content string) (*ScriptAgent, error)

func (*ScriptAgent) Send

func (r *ScriptAgent) Send(ctx context.Context, command, input string) (*ChatMessage, error)

type SeekAgent

type SeekAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewSeekAgent

func NewSeekAgent(cfg *llm.Config, role, content string) (*SeekAgent, error)

func (*SeekAgent) Send

func (r *SeekAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type SqlAgent

type SqlAgent struct {
	Role    string
	Message string
	// contains filtered or unexported fields
}

func NewSqlAgent

func NewSqlAgent(cfg *llm.Config, role, content string) (*SqlAgent, error)

func (*SqlAgent) Send

func (r *SqlAgent) Send(ctx context.Context, input string) (*ChatMessage, error)

type WorkspaceCheck

type WorkspaceCheck struct {
	WorkspaceBase string `json:"workspace_base"`
	Detected      bool   `json:"detected"`
}

Jump to

Keyboard shortcuts

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