plugins

package
v0.0.0-...-d9d3ccb Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
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 Names

func Names() []string

Names returns all registered plugin names.

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 ChannelCapabilities struct {
	SupportsDirectMessages bool
	SupportsThreads        bool
}

type ChannelMessage

type ChannelMessage struct {
	ID       string         `json:"id"`
	Channel  string         `json:"channel"`
	Author   string         `json:"author"`
	Content  string         `json:"content"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

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

type ChatStream interface {
	Recv() (*ChatChunk, error)
	Close() error
}

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 ChatToolCall struct {
	ID        string         `json:"id,omitempty"`
	Name      string         `json:"name"`
	Arguments map[string]any `json:"arguments"`
}

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

type DriverFactory func(log hclog.Logger) Driver

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 ExecuteChunk struct {
	CallID  string `json:"call_id,omitempty"`
	Delta   any    `json:"delta,omitempty"`
	Done    bool   `json:"done,omitempty"`
	IsError bool   `json:"is_error,omitempty"`
}

type ExecuteRequest

type ExecuteRequest struct {
	Tool      string         `json:"tool"`
	Arguments map[string]any `json:"arguments"`
	CallID    string         `json:"call_id,omitempty"`
}

type ExecuteResponse

type ExecuteResponse struct {
	Result   any            `json:"result"`
	IsError  bool           `json:"is_error,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

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 ListToolsFilter struct {
	Tags       []string `json:"tags,omitempty"`
	Deprecated bool     `json:"deprecated,omitempty"`
	Prefix     string   `json:"prefix,omitempty"`
}

type ListToolsResponse

type ListToolsResponse struct {
	Tools []ToolDefinition `json:"tools"`
}

type MemoryCapabilities

type MemoryCapabilities struct {
	SupportsVectorSearch bool
	SupportSessions      bool
	MaxContextSize       int
}

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 MemoryResource struct {
	ID       string         `json:"id"`
	Content  string         `json:"content"`
	Score    float64        `json:"score"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

type MemorySession

type MemorySession struct {
	ID           string `json:"id"`
	Author       string `json:"author"`
	Committed    bool   `json:"committed,omitempty"`
	Archived     bool   `json:"archived,omitempty"`
	MessageCount int    `json:"message_count"`
}

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 ModelTemplate struct {
	BaseModel      string         `json:"base_model"`
	PromptTemplate string         `json:"prompt_template,omitempty"`
	System         string         `json:"system,omitempty"`
	Parameters     map[string]any `json:"parameters,omitempty"`
}

type PluginConfig

type PluginConfig struct {
	ConfigMap map[string]any `json:"-"`
}

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 ProviderCapabilities struct {
	SupportsStreaming bool
	SupportsVision    bool
}

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.

func List

func List() []RegistryEntry

List returns all registered plugin entries sorted by name.

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

type SandboxPathRule struct {
	Path     string `json:"path"`
	Writable bool   `json:"writable,omitempty"`
}

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 StoreRequest struct {
	Content   string         `json:"content"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	Namespace string         `json:"namespace,omitempty"`
}

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 ToolProperty struct {
	Type        string   `json:"type"`
	Description string   `json:"description"`
	Enum        []string `json:"enum,omitempty"`
	Format      string   `json:"format,omitempty"`
}

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) Send

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) AddMessage(_ context.Context, _, _, _ string) (bool, error)

func (UnimplementedMemoryPlugin) CommitSession

func (UnimplementedMemoryPlugin) CommitSession(_ context.Context, _ string) (bool, error)

func (UnimplementedMemoryPlugin) CreateSession

func (UnimplementedMemoryPlugin) DeleteSession

func (UnimplementedMemoryPlugin) DeleteSession(_ context.Context, _ string) (bool, error)

func (UnimplementedMemoryPlugin) GetLifecycle

func (UnimplementedMemoryPlugin) GetLifecycle() Lifecycle

func (UnimplementedMemoryPlugin) GetSession

func (UnimplementedMemoryPlugin) ListSessions

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) CreateModel

func (UnimplementedProviderPlugin) DeleteModel

func (UnimplementedProviderPlugin) Embed

func (UnimplementedProviderPlugin) GetLifecycle

func (UnimplementedProviderPlugin) GetLifecycle() Lifecycle

func (UnimplementedProviderPlugin) GetModel

func (UnimplementedProviderPlugin) ListModels

type UnimplementedSandboxPlugin

type UnimplementedSandboxPlugin struct{}

UnimplementedSandboxPlugin can be embedded to satisfy SandboxPlugin with stub error returns, allowing partial implementations.

func (UnimplementedSandboxPlugin) CopyIn

func (UnimplementedSandboxPlugin) CopyOut

func (UnimplementedSandboxPlugin) CreateSandbox

func (UnimplementedSandboxPlugin) DestroySandbox

func (UnimplementedSandboxPlugin) DestroySandbox(_ context.Context, _ string) error

func (UnimplementedSandboxPlugin) Execute

func (UnimplementedSandboxPlugin) GetLifecycle

func (UnimplementedSandboxPlugin) GetLifecycle() Lifecycle

func (UnimplementedSandboxPlugin) ReadFile

func (UnimplementedSandboxPlugin) ReadFile(_ context.Context, _, _ string) ([]byte, error)

func (UnimplementedSandboxPlugin) Stat

type UnimplementedToolsPlugin

type UnimplementedToolsPlugin struct{}

UnimplementedToolsPlugin can be embedded to satisfy ToolsPlugin with default implementations that return errors.ErrPluginCapabilityNotSupported.

func (UnimplementedToolsPlugin) Cancel

func (UnimplementedToolsPlugin) Execute

func (UnimplementedToolsPlugin) ExecuteStream

func (UnimplementedToolsPlugin) GetLifecycle

func (UnimplementedToolsPlugin) GetLifecycle() Lifecycle

func (UnimplementedToolsPlugin) GetTool

func (UnimplementedToolsPlugin) ListTools

func (UnimplementedToolsPlugin) Validate

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.

Jump to

Keyboard shortcuts

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