plugins

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbedderPlugin

type EmbedderPlugin interface {
	Plugin
	Embedder() embedding.Provider
}

EmbedderPlugin defines the interface for embedding provider plugins

type LLMPlugin

type LLMPlugin interface {
	Plugin
	LLM() llm.Client
}

LLMPlugin defines the interface for LLM client plugins

type ParserPlugin

type ParserPlugin interface {
	Plugin
	Parser() parser.Parser
}

ParserPlugin defines the interface for parser plugins

type Plugin

type Plugin interface {
	Name() string
	Type() PluginType
	Init(config map[string]interface{}) error
}

Plugin defines the interface for all plugins

type PluginType

type PluginType string

PluginType defines the type of plugin

const (
	// PluginTypeParser represents a document parser plugin
	PluginTypeParser PluginType = "parser"
	// PluginTypeVectorStore represents a vector store plugin
	PluginTypeVectorStore PluginType = "vectorstore"
	// PluginTypeEmbedder represents an embedding provider plugin
	PluginTypeEmbedder PluginType = "embedder"
	// PluginTypeLLM represents an LLM client plugin
	PluginTypeLLM PluginType = "llm"
)

type Registry

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

Registry manages plugins

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new plugin registry

func (*Registry) Get

func (r *Registry) Get(name string) Plugin

Get returns a plugin by name

func (*Registry) GetByType

func (r *Registry) GetByType(pluginType PluginType) []Plugin

GetByType returns all plugins of a specific type

func (*Registry) List

func (r *Registry) List() []Plugin

List returns all registered plugins

func (*Registry) Load

func (r *Registry) Load(path string) error

Load loads a plugin from a shared library

func (*Registry) Register

func (r *Registry) Register(plugin Plugin) error

Register registers a plugin

type VectorStorePlugin

type VectorStorePlugin interface {
	Plugin
	VectorStore(ctx context.Context) (vectorstore.Store, error)
}

VectorStorePlugin defines the interface for vector store plugins

Jump to

Keyboard shortcuts

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