Documentation
¶
Overview ¶
* ChatCLI - Command Line Interface for LLM interaction * Copyright (c) 2024 Edilson Freitas * License: MIT
* ChatCLI - Remote Plugin Implementation * client/remote/remote_plugin.go * Copyright (c) 2024 Edilson Freitas * License: MIT
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) DeleteSession(ctx context.Context, name string) error
- func (c *Client) DownloadPlugin(ctx context.Context, pluginName, targetDir string) (string, error)
- func (c *Client) ExecuteRemotePlugin(ctx context.Context, pluginName string, args []string) (string, error)
- func (c *Client) GetAgentDefinition(ctx context.Context, name string) (*RemoteAgentInfo, error)
- func (c *Client) GetModelName() string
- func (c *Client) GetProvider() string
- func (c *Client) GetServerInfo(ctx context.Context) (*ServerInfo, error)
- func (c *Client) GetSkillContent(ctx context.Context, name string) (*RemoteSkillInfo, error)
- func (c *Client) GetWatcherStatus(ctx context.Context) (*WatcherStatus, error)
- func (c *Client) Health(ctx context.Context) (bool, string, error)
- func (c *Client) ListRemoteAgents(ctx context.Context) ([]RemoteAgentInfo, error)
- func (c *Client) ListRemotePlugins(ctx context.Context) ([]RemotePluginInfo, error)
- func (c *Client) ListRemoteSkills(ctx context.Context) ([]RemoteSkillInfo, error)
- func (c *Client) ListSessions(ctx context.Context) ([]string, error)
- func (c *Client) LoadSession(ctx context.Context, name string) ([]models.Message, error)
- func (c *Client) LoadSessionV2(ctx context.Context, name string) (*models.SessionData, error)
- func (c *Client) SaveSession(ctx context.Context, name string, history []models.Message) error
- func (c *Client) SaveSessionV2(ctx context.Context, name string, sd *models.SessionData) error
- func (c *Client) SendPrompt(ctx context.Context, prompt string, history []models.Message, maxTokens int) (string, error)
- type Config
- type RemoteAgentInfo
- type RemotePlugin
- func (p *RemotePlugin) Description() string
- func (p *RemotePlugin) Execute(ctx context.Context, args []string) (string, error)
- func (p *RemotePlugin) ExecuteWithStream(ctx context.Context, args []string, onOutput func(string)) (string, error)
- func (p *RemotePlugin) IsRemote() bool
- func (p *RemotePlugin) Name() string
- func (p *RemotePlugin) Path() string
- func (p *RemotePlugin) Schema() string
- func (p *RemotePlugin) Usage() string
- func (p *RemotePlugin) Version() string
- type RemotePluginInfo
- type RemoteSkillInfo
- type ServerInfo
- type WatcherStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements llm/client.LLMClient by delegating to a remote ChatCLI gRPC server.
func (*Client) DeleteSession ¶ added in v1.65.0
DeleteSession deletes a session from the remote server.
func (*Client) DownloadPlugin ¶ added in v1.60.0
DownloadPlugin downloads a plugin binary from the server to the specified directory.
func (*Client) ExecuteRemotePlugin ¶ added in v1.60.0
func (c *Client) ExecuteRemotePlugin(ctx context.Context, pluginName string, args []string) (string, error)
ExecuteRemotePlugin executes a plugin on the remote server.
func (*Client) GetAgentDefinition ¶ added in v1.60.0
GetAgentDefinition fetches the full definition of a remote agent.
func (*Client) GetModelName ¶
GetModelName returns the remote server's model name. This satisfies the LLMClient interface.
func (*Client) GetProvider ¶
GetProvider returns the remote server's provider.
func (*Client) GetServerInfo ¶
func (c *Client) GetServerInfo(ctx context.Context) (*ServerInfo, error)
GetServerInfo fetches server metadata including watcher status.
func (*Client) GetSkillContent ¶ added in v1.60.0
GetSkillContent fetches the full content of a remote skill.
func (*Client) GetWatcherStatus ¶
func (c *Client) GetWatcherStatus(ctx context.Context) (*WatcherStatus, error)
GetWatcherStatus fetches the K8s watcher status from the server.
func (*Client) ListRemoteAgents ¶ added in v1.60.0
func (c *Client) ListRemoteAgents(ctx context.Context) ([]RemoteAgentInfo, error)
ListRemoteAgents lists all agents available on the server.
func (*Client) ListRemotePlugins ¶ added in v1.60.0
func (c *Client) ListRemotePlugins(ctx context.Context) ([]RemotePluginInfo, error)
ListRemotePlugins lists all plugins available on the server.
func (*Client) ListRemoteSkills ¶ added in v1.60.0
func (c *Client) ListRemoteSkills(ctx context.Context) ([]RemoteSkillInfo, error)
ListRemoteSkills lists all skills available on the server.
func (*Client) ListSessions ¶
ListSessions lists sessions from the remote server.
func (*Client) LoadSession ¶
LoadSession loads a session from the remote server.
func (*Client) LoadSessionV2 ¶ added in v1.65.2
LoadSessionV2 loads a full v2 session from the remote server. Falls back to v1 (chat history only) if the server doesn't support v2.
func (*Client) SaveSession ¶
SaveSession saves a session to the remote server.
func (*Client) SaveSessionV2 ¶ added in v1.65.2
SaveSessionV2 saves a full v2 session (with scoped histories) to the remote server. It also populates the v1 messages field for backward compatibility with older servers.
type Config ¶
type Config struct {
Address string // server address (host:port)
Token string // auth token for gRPC server authentication
TLS bool // use TLS
CertFile string // CA certificate file for TLS (optional)
ClientAPIKey string // optional: client's own LLM API key/OAuth token (forwarded to server)
Provider string // optional: override server's default provider (e.g., "GOOGLEAI")
Model string // optional: override server's default model (e.g., "gemini-2.0-flash")
ProviderConfig map[string]string // optional: provider-specific config (StackSpot, Ollama, etc.)
}
Config holds remote client configuration.
type RemoteAgentInfo ¶ added in v1.60.0
type RemoteAgentInfo struct {
Name string
Description string
Skills []string
Plugins []string
Model string
Content string
}
RemoteAgentInfo holds agent metadata from the server.
type RemotePlugin ¶ added in v1.60.0
type RemotePlugin struct {
// contains filtered or unexported fields
}
RemotePlugin implements the plugins.Plugin interface by delegating execution to a remote ChatCLI server via gRPC.
func NewRemotePlugin ¶ added in v1.60.0
func NewRemotePlugin(info *pb.PluginInfo, client *Client) *RemotePlugin
NewRemotePlugin creates a RemotePlugin from server-provided metadata.
func NewRemotePluginFromInfo ¶ added in v1.60.0
func NewRemotePluginFromInfo(info RemotePluginInfo, client *Client) *RemotePlugin
NewRemotePluginFromInfo creates a RemotePlugin from a RemotePluginInfo struct.
func (*RemotePlugin) Description ¶ added in v1.60.0
func (p *RemotePlugin) Description() string
func (*RemotePlugin) ExecuteWithStream ¶ added in v1.60.0
func (p *RemotePlugin) ExecuteWithStream(ctx context.Context, args []string, onOutput func(string)) (string, error)
ExecuteWithStream runs the plugin on the remote server with optional output callback.
func (*RemotePlugin) IsRemote ¶ added in v1.60.0
func (p *RemotePlugin) IsRemote() bool
IsRemote returns true to indicate this is a remote plugin.
func (*RemotePlugin) Name ¶ added in v1.60.0
func (p *RemotePlugin) Name() string
func (*RemotePlugin) Path ¶ added in v1.60.0
func (p *RemotePlugin) Path() string
func (*RemotePlugin) Schema ¶ added in v1.60.0
func (p *RemotePlugin) Schema() string
func (*RemotePlugin) Usage ¶ added in v1.60.0
func (p *RemotePlugin) Usage() string
func (*RemotePlugin) Version ¶ added in v1.60.0
func (p *RemotePlugin) Version() string
type RemotePluginInfo ¶ added in v1.60.0
type RemotePluginInfo struct {
Name string
Description string
Usage string
Version string
Schema string
}
RemotePluginInfo holds plugin metadata from the server.
type RemoteSkillInfo ¶ added in v1.60.0
type RemoteSkillInfo struct {
Name string
Description string
Content string
AllowedTools []string
Subskills map[string]string
Scripts map[string]string
}
RemoteSkillInfo holds skill metadata from the server.