Documentation
¶
Index ¶
- Constants
- func MatchesToolsFilter(def ToolDefinition, f ListToolsFilter) bool
- func Names() []string
- func Register(name, description string, factory DriverFactory)
- type BasePlugin
- type ChannelCapabilities
- type ChannelMessage
- type ChannelPlugin
- type ChatChunk
- type ChatMessage
- type ChatMessageToolCalls
- type ChatResult
- type ChatStream
- type ChatToolCall
- type Driver
- type DriverCapabilities
- type DriverFactory
- type ExecuteChunk
- type ExecuteRequest
- type ExecuteResponse
- type Lifecycle
- type ListToolsFilter
- type ListToolsResponse
- type MemoryCapabilities
- type MemoryPlugin
- type MemoryResource
- type MemorySession
- type Model
- type ModelTemplate
- type PluginConfig
- type PluginInfo
- type ProviderCapabilities
- type ProviderPlugin
- type RegistryEntry
- type SandboxCapabilities
- type SandboxExecChunk
- type SandboxExecRequest
- type SandboxHandle
- type SandboxPathRule
- type SandboxPlugin
- type SandboxSpec
- type SandboxStatResult
- type StoreRequest
- type TokenUsage
- type ToolAnnotations
- type ToolCall
- type ToolCostHint
- type ToolDefinition
- type ToolIdempotentProbability
- type ToolParameters
- type ToolProperty
- type ToolsCapabilities
- type ToolsPlugin
- type UnimplementedChannelPlugin
- type UnimplementedDriver
- func (u *UnimplementedDriver) CloseDriver(ctx context.Context) error
- func (u *UnimplementedDriver) ConfigDriver(ctx context.Context, config PluginConfig) error
- func (u *UnimplementedDriver) GetCapabilities(ctx context.Context) (*DriverCapabilities, error)
- func (u *UnimplementedDriver) GetChannelPlugin(ctx context.Context) (ChannelPlugin, error)
- func (u *UnimplementedDriver) GetMemoryPlugin(ctx context.Context) (MemoryPlugin, error)
- func (u *UnimplementedDriver) GetPluginInfo() PluginInfo
- func (u *UnimplementedDriver) GetProviderPlugin(ctx context.Context) (ProviderPlugin, error)
- func (u *UnimplementedDriver) GetSandboxPlugin(ctx context.Context) (SandboxPlugin, error)
- func (u *UnimplementedDriver) GetToolsPlugin(ctx context.Context) (ToolsPlugin, error)
- func (u *UnimplementedDriver) OpenDriver(ctx context.Context) error
- func (u *UnimplementedDriver) ProbePlugin(ctx context.Context) (bool, error)
- type UnimplementedMemoryPlugin
- func (UnimplementedMemoryPlugin) AddMessage(_ context.Context, _, _, _ string) (bool, error)
- func (UnimplementedMemoryPlugin) CommitSession(_ context.Context, _ string) (bool, error)
- func (UnimplementedMemoryPlugin) CreateSession(_ context.Context) (*MemorySession, error)
- func (UnimplementedMemoryPlugin) DeleteSession(_ context.Context, _ string) (bool, error)
- func (UnimplementedMemoryPlugin) GetLifecycle() Lifecycle
- func (UnimplementedMemoryPlugin) GetSession(_ context.Context, _ string) (*MemorySession, error)
- func (UnimplementedMemoryPlugin) ListSessions(_ context.Context) ([]*MemorySession, error)
- func (UnimplementedMemoryPlugin) RetrieveResource(_ context.Context, _, _ string, _ int, _ map[string]any) ([]*MemoryResource, error)
- func (UnimplementedMemoryPlugin) StoreResource(_ context.Context, _, _ string, _ map[string]any) (*MemoryResource, error)
- type UnimplementedProviderPlugin
- func (UnimplementedProviderPlugin) Chat(_ context.Context, _ []ChatMessage, _ []ToolCall, _ *Model) (ChatStream, error)
- func (UnimplementedProviderPlugin) CreateModel(_ context.Context, _ string, _ *ModelTemplate) (*Model, error)
- func (UnimplementedProviderPlugin) DeleteModel(_ context.Context, _ string) (bool, error)
- func (UnimplementedProviderPlugin) Embed(_ context.Context, _ string, _ *Model) ([][]float32, error)
- func (UnimplementedProviderPlugin) GetLifecycle() Lifecycle
- func (UnimplementedProviderPlugin) GetModel(_ context.Context, _ string) (*Model, error)
- func (UnimplementedProviderPlugin) ListModels(_ context.Context) ([]*Model, error)
- type UnimplementedSandboxPlugin
- func (UnimplementedSandboxPlugin) CopyIn(_ context.Context, _, _, _ string) error
- func (UnimplementedSandboxPlugin) CopyOut(_ context.Context, _, _, _ string) error
- func (UnimplementedSandboxPlugin) CreateSandbox(_ context.Context, _ SandboxSpec) (*SandboxHandle, error)
- func (UnimplementedSandboxPlugin) DestroySandbox(_ context.Context, _ string) error
- func (UnimplementedSandboxPlugin) Execute(_ context.Context, _ SandboxExecRequest) (<-chan SandboxExecChunk, error)
- func (UnimplementedSandboxPlugin) GetLifecycle() Lifecycle
- func (UnimplementedSandboxPlugin) ReadFile(_ context.Context, _, _ string) ([]byte, error)
- func (UnimplementedSandboxPlugin) Stat(_ context.Context, _, _ string) (*SandboxStatResult, error)
- type UnimplementedToolsPlugin
- func (UnimplementedToolsPlugin) Cancel(_ context.Context, _ string) error
- func (UnimplementedToolsPlugin) Execute(_ context.Context, _ ExecuteRequest) (*ExecuteResponse, error)
- func (UnimplementedToolsPlugin) ExecuteStream(_ context.Context, _ ExecuteRequest) (<-chan ExecuteChunk, error)
- func (UnimplementedToolsPlugin) GetLifecycle() Lifecycle
- func (UnimplementedToolsPlugin) GetTool(_ context.Context, _ string) (*ToolDefinition, error)
- func (UnimplementedToolsPlugin) ListTools(_ context.Context, _ ListToolsFilter) (*ListToolsResponse, error)
- func (UnimplementedToolsPlugin) Validate(_ context.Context, _ ExecuteRequest) (*ValidateResponse, error)
- type ValidateResponse
Constants ¶
const ( // A provider plugin acts as LLM provider to "provide" access to endpoints like Ollama, Anthropic, etc. PluginTypeProvider string = "provider" // A memory plugin acts as memory management for endpoints like OpenViking. PluginTypeMemory string = "memory" // A channel plugin acts as communication gateway for endpoints like Discord. PluginTypeChannel string = "channel" // A tools plugin acts as bridge (or summary of embedded tools) for tool calling. PluginTypeTools string = "tools" // A sandbox plugin provides an isolated execution environment for running scripts and tools. PluginTypeSandbox string = "sandbox" )
Variables ¶
This section is empty.
Functions ¶
func MatchesToolsFilter ¶
func MatchesToolsFilter(def ToolDefinition, f ListToolsFilter) bool
func Register ¶
func Register(name, description string, factory DriverFactory)
Register adds a plugin factory to the registry. This should be called in init() functions of plugin packages.
Types ¶
type BasePlugin ¶
type BasePlugin interface {
GetLifecycle() Lifecycle
}
BasePlugin is the common interface all sub-plugins share. Sub-plugins reference their parent driver via GetLifecycle.
type ChannelCapabilities ¶
type ChannelMessage ¶
type ChannelPlugin ¶
type ChannelPlugin interface {
BasePlugin
// Additional channel methods will be added here
Send(ctx context.Context, channel, content string, metadata map[string]any) (string, error)
Receive(ctx context.Context) (<-chan ChannelMessage, error)
}
ChannelPlugin acts as communication gateway for endpoints like Discord.
type ChatChunk ¶
type ChatChunk struct {
ID string `json:"id,omitempty"`
Role string `json:"role,omitempty"`
Delta string `json:"delta"`
Thinking string `json:"thinking,omitempty"`
Done bool `json:"done"`
ToolCalls []ChatToolCall `json:"tool_calls,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Usage *TokenUsage `json:"usage,omitempty"`
}
ChatChunk is a single streamed piece of a response. Delta carries incremental content text. Thinking carries reasoning/scratchpad text when the model supports extended thinking — it is never mixed into Delta. ToolCalls, Done, and Usage are only set on the final chunk.
type ChatMessage ¶
type ChatMessage struct {
Role string `json:"role"`
Content string `json:"content"`
ToolCalls *ChatMessageToolCalls `json:"tool_calls,omitempty"`
}
type ChatMessageToolCalls ¶
type ChatMessageToolCalls struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ToolCalls []ChatToolCall `json:"tool_calls,omitempty"`
}
type ChatResult ¶
type ChatResult struct {
ID string `json:"id"`
Role string `json:"role"`
Content string `json:"content"`
Thinking string `json:"thinking,omitempty"`
ToolCalls []ChatToolCall `json:"tool_calls,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Usage *TokenUsage `json:"usage,omitempty"`
}
ChatResult is the fully-assembled response after draining a ChatStream.
func CollectStream ¶
func CollectStream(stream ChatStream) (*ChatResult, error)
CollectStream drains a ChatStream into a single ChatResult.
type ChatStream ¶
ChatStream is returned by Chat for consuming a streaming response. Recv returns the next chunk; io.EOF signals the stream is complete. Close must always be called to release resources.
type ChatToolCall ¶
type Driver ¶
type Driver interface {
Lifecycle
// Lifecycle management
OpenDriver(ctx context.Context) error
CloseDriver(ctx context.Context) error
// Configuration
ConfigDriver(ctx context.Context, config PluginConfig) error
// Plugin type accessors - return implementations only if supported
GetProviderPlugin(ctx context.Context) (ProviderPlugin, error)
GetMemoryPlugin(ctx context.Context) (MemoryPlugin, error)
GetChannelPlugin(ctx context.Context) (ChannelPlugin, error)
GetToolsPlugin(ctx context.Context) (ToolsPlugin, error)
GetSandboxPlugin(ctx context.Context) (SandboxPlugin, error)
}
Driver is the main interface that plugins implement. A single driver can support multiple plugin types simultaneously.
type DriverCapabilities ¶
type DriverCapabilities struct {
Types []string
Provider *ProviderCapabilities
Memory *MemoryCapabilities
Channel *ChannelCapabilities
Tools *ToolsCapabilities
Sandbox *SandboxCapabilities
}
DriverCapabilities describes what a driver supports.
type DriverFactory ¶
DriverFactory creates a Driver implementation with a logger.
func Get ¶
func Get(name string) DriverFactory
Get returns a plugin factory by name, or nil if not found.
type ExecuteChunk ¶
type ExecuteRequest ¶
type ExecuteResponse ¶
type Lifecycle ¶
type Lifecycle interface {
GetPluginInfo() PluginInfo
ProbePlugin(ctx context.Context) (bool, error)
GetCapabilities(ctx context.Context) (*DriverCapabilities, error)
}
Lifecycle provides access to driver-level lifecycle checks. Plugins use this to reference back to their parent driver.
type ListToolsFilter ¶
type ListToolsResponse ¶
type ListToolsResponse struct {
Tools []ToolDefinition `json:"tools"`
}
type MemoryCapabilities ¶
type MemoryPlugin ¶
type MemoryPlugin interface {
BasePlugin
StoreResource(ctx context.Context, sessionID, content string, metadata map[string]any) (*MemoryResource, error)
RetrieveResource(ctx context.Context, sessionID, query string, limit int, filter map[string]any) ([]*MemoryResource, error)
CreateSession(ctx context.Context) (*MemorySession, error)
GetSession(ctx context.Context, sessionID string) (*MemorySession, error)
ListSessions(ctx context.Context) ([]*MemorySession, error)
DeleteSession(ctx context.Context, sessionID string) (bool, error)
CommitSession(ctx context.Context, sessionID string) (bool, error)
AddMessage(ctx context.Context, sessionID, role, content string) (bool, error)
}
MemoryPlugin acts as memory management for endpoints like OpenViking.
type MemoryResource ¶
type MemorySession ¶
type Model ¶
type Model struct {
ModelName string `json:"model_name,omitempty"`
Dimension int `json:"dimension,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
Template *ModelTemplate `json:"template,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
CostPerInputToken float64 `json:"cost_per_input_token,omitempty"`
CostPerOutputToken float64 `json:"cost_per_output_token,omitempty"`
}
type ModelTemplate ¶
type PluginConfig ¶
PluginConfig holds driver configuration as a generic map.
type PluginInfo ¶
type PluginInfo struct {
Name string `json:"name"`
Author string `json:"author"`
Version string `json:"version"`
Description string `json:"description"`
}
PluginInfo describes plugin metadata at the driver level.
type ProviderCapabilities ¶
type ProviderPlugin ¶
type ProviderPlugin interface {
BasePlugin
// Chat sends messages and returns a stream of response chunks.
Chat(ctx context.Context, messages []ChatMessage, tools []ToolCall, model *Model) (ChatStream, error)
Embed(ctx context.Context, content string, model *Model) ([][]float32, error)
ListModels(ctx context.Context) ([]*Model, error)
CreateModel(ctx context.Context, modelName string, template *ModelTemplate) (*Model, error)
GetModel(ctx context.Context, name string) (*Model, error)
DeleteModel(ctx context.Context, name string) (bool, error)
}
ProviderPlugin acts as LLM provider to "provide" access to endpoints like Ollama, Anthropic, etc.
type RegistryEntry ¶
type RegistryEntry struct {
Name string
Description string
Factory DriverFactory
}
RegistryEntry holds a plugin factory and its metadata.
type SandboxCapabilities ¶
type SandboxCapabilities struct {
// IsolationMode describes the mechanism: "landlock", "container", "vm", "remote".
IsolationMode string `json:"isolation_mode"`
// SupportsStreaming indicates whether Execute returns real-time output chunks.
SupportsStreaming bool `json:"supports_streaming"`
// SupportsFilesystem indicates whether CopyIn/CopyOut/ReadFile are supported.
SupportsFilesystem bool `json:"supports_filesystem"`
}
SandboxCapabilities describes what a sandbox plugin supports.
type SandboxExecChunk ¶
type SandboxExecChunk struct {
// Stream is "stdout" or "stderr".
Stream string `json:"stream,omitempty"`
// Data is a UTF-8 chunk of output.
Data string `json:"data,omitempty"`
// ExitCode is set only on the final chunk (Done == true).
ExitCode int `json:"exit_code,omitempty"`
// Done marks the final chunk.
Done bool `json:"done,omitempty"`
// IsError is true when the chunk represents a framework-level error
// (e.g. the process could not be started), not a stderr write.
IsError bool `json:"is_error,omitempty"`
}
SandboxExecChunk is a single streamed unit of execution output.
type SandboxExecRequest ¶
type SandboxExecRequest struct {
// SandboxID is the handle ID returned by CreateSandbox.
SandboxID string `json:"sandbox_id"`
// Command is the executable to run.
Command string `json:"command"`
// Args are the command-line arguments.
Args []string `json:"args,omitempty"`
// Env overrides or extends the sandbox's base environment for this execution.
Env map[string]string `json:"env,omitempty"`
// TimeoutSeconds limits execution duration. 0 means use the driver default.
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
}
SandboxExecRequest describes a command to run inside a sandbox.
type SandboxHandle ¶
type SandboxHandle struct {
// ID is the opaque sandbox identifier assigned by the plugin.
ID string `json:"id"`
// Driver is the name of the plugin that owns this handle.
Driver string `json:"driver"`
}
SandboxHandle is returned by CreateSandbox and used to reference an active sandbox.
type SandboxPathRule ¶
SandboxPathRule describes a host path the sandbox may access and how.
type SandboxPlugin ¶
type SandboxPlugin interface {
BasePlugin
// CreateSandbox creates a new isolated environment from the given spec.
// Returns a handle whose ID callers use for all subsequent operations.
CreateSandbox(ctx context.Context, spec SandboxSpec) (*SandboxHandle, error)
// DestroySandbox tears down a sandbox and releases all its resources.
DestroySandbox(ctx context.Context, id string) error
// CopyIn copies a file or directory from the host into the sandbox.
CopyIn(ctx context.Context, id, hostSrc, sandboxDst string) error
// CopyOut copies a file or directory from the sandbox to the host.
CopyOut(ctx context.Context, id, sandboxSrc, hostDst string) error
// Execute runs a command inside the sandbox and streams output chunks.
Execute(ctx context.Context, req SandboxExecRequest) (<-chan SandboxExecChunk, error)
// Stat checks whether a path exists inside the sandbox and returns basic info.
Stat(ctx context.Context, id, path string) (*SandboxStatResult, error)
// ReadFile reads the full content of a file from inside the sandbox.
ReadFile(ctx context.Context, id, path string) ([]byte, error)
}
SandboxPlugin is the isolation-layer interface. Implementations include: builtin (go-landlock), Docker, Podman, remote SSH, etc.
type SandboxSpec ¶
type SandboxSpec struct {
// Name is a human-readable label used in log messages.
Name string `json:"name"`
// AllowedHostPaths lists host paths the sandbox process may access.
// Only used by filesystem-isolation backends (e.g. landlock).
AllowedHostPaths []SandboxPathRule `json:"allowed_host_paths,omitempty"`
// WorkDir is the working directory for command execution inside the sandbox.
WorkDir string `json:"work_dir,omitempty"`
// Env is the base environment variables for command execution.
Env map[string]string `json:"env,omitempty"`
// Metadata holds driver-specific extra configuration.
Metadata map[string]any `json:"metadata,omitempty"`
}
SandboxSpec describes the desired configuration for a new sandbox.
type SandboxStatResult ¶
type SandboxStatResult struct {
Path string `json:"path"`
Exists bool `json:"exists"`
IsDir bool `json:"is_dir,omitempty"`
Size int64 `json:"size,omitempty"`
Mode string `json:"mode,omitempty"`
ModTime string `json:"mod_time,omitempty"`
}
SandboxStatResult is the result of a Stat call.
type StoreRequest ¶
type TokenUsage ¶
type TokenUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
TotalTokens int `json:"total_tokens"`
InputCost float64 `json:"input_cost,omitempty"`
OutputCost float64 `json:"output_cost,omitempty"`
TotalCost float64 `json:"total_cost,omitempty"`
}
TokenUsage tracks token consumption and optional cost for a single inference call.
func (*TokenUsage) Add ¶
func (u *TokenUsage) Add(other *TokenUsage)
Add combines another TokenUsage into this one (used to accumulate session totals).
type ToolAnnotations ¶
type ToolAnnotations struct {
ReadOnly bool `json:"read_only,omitempty"`
Destructive bool `json:"destructive,omitempty"`
Idempotent bool `json:"idempotent,omitempty"`
IdempotentProbability ToolIdempotentProbability `json:"idempotent_probability,omitempty"`
RequiresConfirmation bool `json:"requires_confirmation,omitempty"`
CostHint ToolCostHint `json:"cost_hint,omitempty"`
}
type ToolCall ¶
type ToolCall struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters ToolParameters `json:"parameters"`
}
type ToolCostHint ¶
type ToolCostHint string
var ( ToolCostFree ToolCostHint = "free" ToolCostCheap ToolCostHint = "cheap" ToolCostModerate ToolCostHint = "moderate" ToolCostExpensive ToolCostHint = "expensive" )
type ToolDefinition ¶
type ToolDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Tags []string `json:"tags,omitempty"`
Annotations ToolAnnotations `json:"annotations"`
Parameters ToolParameters `json:"parameters"`
Version string `json:"version,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
DeprecationMessage string `json:"deprecation_message,omitempty"`
}
type ToolIdempotentProbability ¶
type ToolIdempotentProbability string
var ( ToolIdempotentGuaranteed ToolIdempotentProbability = "guaranteed" ToolIdempotentUnlikely ToolIdempotentProbability = "unlikely" ToolIdempotentFrequent ToolIdempotentProbability = "frequent" )
type ToolParameters ¶
type ToolParameters struct {
Type string `json:"type"`
Properties map[string]ToolProperty `json:"properties"`
Required []string `json:"required,omitempty"`
}
type ToolProperty ¶
type ToolsCapabilities ¶
type ToolsCapabilities struct {
SupportsAsyncExecution bool
}
type ToolsPlugin ¶
type ToolsPlugin interface {
BasePlugin
ListTools(ctx context.Context, filter ListToolsFilter) (*ListToolsResponse, error)
GetTool(ctx context.Context, name string) (*ToolDefinition, error)
Execute(ctx context.Context, req ExecuteRequest) (*ExecuteResponse, error)
ExecuteStream(ctx context.Context, req ExecuteRequest) (<-chan ExecuteChunk, error)
Cancel(ctx context.Context, callID string) error
Validate(ctx context.Context, req ExecuteRequest) (*ValidateResponse, error)
}
ToolsPlugin acts as bridge (or summary of embedded tools) for tool calling.
type UnimplementedChannelPlugin ¶
type UnimplementedChannelPlugin struct{}
UnimplementedChannelPlugin can be embedded to satisfy ChannelPlugin with default implementations that return errors.ErrPluginCapabilityNotSupported.
func (UnimplementedChannelPlugin) GetLifecycle ¶
func (UnimplementedChannelPlugin) GetLifecycle() Lifecycle
func (UnimplementedChannelPlugin) Receive ¶
func (UnimplementedChannelPlugin) Receive(_ context.Context) (<-chan ChannelMessage, error)
type UnimplementedDriver ¶
type UnimplementedDriver struct{}
func (*UnimplementedDriver) CloseDriver ¶
func (u *UnimplementedDriver) CloseDriver(ctx context.Context) error
CloseDriver implements Driver.
func (*UnimplementedDriver) ConfigDriver ¶
func (u *UnimplementedDriver) ConfigDriver(ctx context.Context, config PluginConfig) error
ConfigDriver implements Driver.
func (*UnimplementedDriver) GetCapabilities ¶
func (u *UnimplementedDriver) GetCapabilities(ctx context.Context) (*DriverCapabilities, error)
GetCapabilities implements Driver.
func (*UnimplementedDriver) GetChannelPlugin ¶
func (u *UnimplementedDriver) GetChannelPlugin(ctx context.Context) (ChannelPlugin, error)
GetChannelPlugin implements Driver.
func (*UnimplementedDriver) GetMemoryPlugin ¶
func (u *UnimplementedDriver) GetMemoryPlugin(ctx context.Context) (MemoryPlugin, error)
GetMemoryPlugin implements Driver.
func (*UnimplementedDriver) GetPluginInfo ¶
func (u *UnimplementedDriver) GetPluginInfo() PluginInfo
GetPluginInfo implements Driver.
func (*UnimplementedDriver) GetProviderPlugin ¶
func (u *UnimplementedDriver) GetProviderPlugin(ctx context.Context) (ProviderPlugin, error)
GetProviderPlugin implements Driver.
func (*UnimplementedDriver) GetSandboxPlugin ¶
func (u *UnimplementedDriver) GetSandboxPlugin(ctx context.Context) (SandboxPlugin, error)
GetSandboxPlugin implements Driver.
func (*UnimplementedDriver) GetToolsPlugin ¶
func (u *UnimplementedDriver) GetToolsPlugin(ctx context.Context) (ToolsPlugin, error)
GetToolsPlugin implements Driver.
func (*UnimplementedDriver) OpenDriver ¶
func (u *UnimplementedDriver) OpenDriver(ctx context.Context) error
OpenDriver implements Driver.
func (*UnimplementedDriver) ProbePlugin ¶
func (u *UnimplementedDriver) ProbePlugin(ctx context.Context) (bool, error)
ProbePlugin implements Driver.
type UnimplementedMemoryPlugin ¶
type UnimplementedMemoryPlugin struct{}
UnimplementedMemoryPlugin can be embedded to satisfy MemoryPlugin with default implementations that return errors.ErrPluginCapabilityNotSupported.
func (UnimplementedMemoryPlugin) AddMessage ¶
func (UnimplementedMemoryPlugin) CommitSession ¶
func (UnimplementedMemoryPlugin) CreateSession ¶
func (UnimplementedMemoryPlugin) CreateSession(_ context.Context) (*MemorySession, error)
func (UnimplementedMemoryPlugin) DeleteSession ¶
func (UnimplementedMemoryPlugin) GetLifecycle ¶
func (UnimplementedMemoryPlugin) GetLifecycle() Lifecycle
func (UnimplementedMemoryPlugin) GetSession ¶
func (UnimplementedMemoryPlugin) GetSession(_ context.Context, _ string) (*MemorySession, error)
func (UnimplementedMemoryPlugin) ListSessions ¶
func (UnimplementedMemoryPlugin) ListSessions(_ context.Context) ([]*MemorySession, error)
func (UnimplementedMemoryPlugin) RetrieveResource ¶
func (UnimplementedMemoryPlugin) RetrieveResource(_ context.Context, _, _ string, _ int, _ map[string]any) ([]*MemoryResource, error)
func (UnimplementedMemoryPlugin) StoreResource ¶
func (UnimplementedMemoryPlugin) StoreResource(_ context.Context, _, _ string, _ map[string]any) (*MemoryResource, error)
type UnimplementedProviderPlugin ¶
type UnimplementedProviderPlugin struct{}
UnimplementedProviderPlugin can be embedded to satisfy ProviderPlugin with default implementations that return errors.ErrPluginCapabilityNotSupported.
func (UnimplementedProviderPlugin) Chat ¶
func (UnimplementedProviderPlugin) Chat(_ context.Context, _ []ChatMessage, _ []ToolCall, _ *Model) (ChatStream, error)
func (UnimplementedProviderPlugin) CreateModel ¶
func (UnimplementedProviderPlugin) CreateModel(_ context.Context, _ string, _ *ModelTemplate) (*Model, error)
func (UnimplementedProviderPlugin) DeleteModel ¶
func (UnimplementedProviderPlugin) GetLifecycle ¶
func (UnimplementedProviderPlugin) GetLifecycle() Lifecycle
func (UnimplementedProviderPlugin) ListModels ¶
func (UnimplementedProviderPlugin) ListModels(_ context.Context) ([]*Model, error)
type UnimplementedSandboxPlugin ¶
type UnimplementedSandboxPlugin struct{}
UnimplementedSandboxPlugin can be embedded to satisfy SandboxPlugin with stub error returns, allowing partial implementations.
func (UnimplementedSandboxPlugin) CopyIn ¶
func (UnimplementedSandboxPlugin) CopyIn(_ context.Context, _, _, _ string) error
func (UnimplementedSandboxPlugin) CopyOut ¶
func (UnimplementedSandboxPlugin) CopyOut(_ context.Context, _, _, _ string) error
func (UnimplementedSandboxPlugin) CreateSandbox ¶
func (UnimplementedSandboxPlugin) CreateSandbox(_ context.Context, _ SandboxSpec) (*SandboxHandle, error)
func (UnimplementedSandboxPlugin) DestroySandbox ¶
func (UnimplementedSandboxPlugin) DestroySandbox(_ context.Context, _ string) error
func (UnimplementedSandboxPlugin) Execute ¶
func (UnimplementedSandboxPlugin) Execute(_ context.Context, _ SandboxExecRequest) (<-chan SandboxExecChunk, error)
func (UnimplementedSandboxPlugin) GetLifecycle ¶
func (UnimplementedSandboxPlugin) GetLifecycle() Lifecycle
func (UnimplementedSandboxPlugin) Stat ¶
func (UnimplementedSandboxPlugin) Stat(_ context.Context, _, _ string) (*SandboxStatResult, error)
type UnimplementedToolsPlugin ¶
type UnimplementedToolsPlugin struct{}
UnimplementedToolsPlugin can be embedded to satisfy ToolsPlugin with default implementations that return errors.ErrPluginCapabilityNotSupported.
func (UnimplementedToolsPlugin) Cancel ¶
func (UnimplementedToolsPlugin) Cancel(_ context.Context, _ string) error
func (UnimplementedToolsPlugin) Execute ¶
func (UnimplementedToolsPlugin) Execute(_ context.Context, _ ExecuteRequest) (*ExecuteResponse, error)
func (UnimplementedToolsPlugin) ExecuteStream ¶
func (UnimplementedToolsPlugin) ExecuteStream(_ context.Context, _ ExecuteRequest) (<-chan ExecuteChunk, error)
func (UnimplementedToolsPlugin) GetLifecycle ¶
func (UnimplementedToolsPlugin) GetLifecycle() Lifecycle
func (UnimplementedToolsPlugin) GetTool ¶
func (UnimplementedToolsPlugin) GetTool(_ context.Context, _ string) (*ToolDefinition, error)
func (UnimplementedToolsPlugin) ListTools ¶
func (UnimplementedToolsPlugin) ListTools(_ context.Context, _ ListToolsFilter) (*ListToolsResponse, error)
func (UnimplementedToolsPlugin) Validate ¶
func (UnimplementedToolsPlugin) Validate(_ context.Context, _ ExecuteRequest) (*ValidateResponse, error)
type ValidateResponse ¶
type ValidateResponse struct {
Valid bool `json:"valid"`
Errors []string `json:"errors,omitempty"`
}
func ValidateAgainstDefinition ¶
func ValidateAgainstDefinition(def ToolDefinition, req ExecuteRequest) *ValidateResponse
ValidateAgainstDefinition checks that all required fields declared in def.Parameters.Required are present and non-empty in req.Arguments.