llm_ctrl_drivers

package
v0.3.71 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DriverChatGPT = llm_commons.DriverChatGPT
View Source
const DriverClaude = llm_commons.DriverClaude
View Source
const DriverOllama = llm_commons.DriverOllama

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMDriverHelper

type LLMDriverHelper struct {
	// contains filtered or unexported fields
}
var Factory *LLMDriverHelper

func (*LLMDriverHelper) New

func (instance *LLMDriverHelper) New(driver string, args ...interface{}) (response llm_driver.ILLMDriver, err error)

func (*LLMDriverHelper) Store

func (instance *LLMDriverHelper) Store() (response *LLMDriverStore)

type LLMDriverStore

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

LLMDriverStore manages and stores instances of LLM drivers mapped by their unique identifiers.

func NewDriverStore

func NewDriverStore() (instance *LLMDriverStore)

func (*LLMDriverStore) Contains

func (instance *LLMDriverStore) Contains(uid string) (found bool)

func (*LLMDriverStore) Count

func (instance *LLMDriverStore) Count() (response int)

func (*LLMDriverStore) Drivers

func (instance *LLMDriverStore) Drivers() (response []llm_driver.ILLMDriver)

Drivers returns a slice of all registered driver instances.

func (*LLMDriverStore) EnsureModel

func (instance *LLMDriverStore) EnsureModel(request *llm_commons.LLMRequest) (err error)

EnsureModel validates and updates the provided LLMRequest object to ensure a valid driver and model are set. Returns an error if the driver is not registered or a model is missing for the request.

func (*LLMDriverStore) Get

func (instance *LLMDriverStore) Get(uid string) (response llm_driver.ILLMDriver, err error)

Get retrieves a registered driver instance by its unique identifier (UID) or returns an error if not found.

func (*LLMDriverStore) GetByDriverAndModel

func (instance *LLMDriverStore) GetByDriverAndModel(driver, model string) (response llm_driver.ILLMDriver, err error)

func (*LLMDriverStore) GetOptionsByDriverAndModel

func (instance *LLMDriverStore) GetOptionsByDriverAndModel(driver, model string) (response *llm_commons.LLMDriverOptions)

func (*LLMDriverStore) GetOrCreate

func (instance *LLMDriverStore) GetOrCreate(options *llm_commons.LLMDriverOptions) (response llm_driver.ILLMDriver, err error)

GetOrCreate retrieves an existing driver instance by UID or creates a new one with the specified type and arguments. If the driver does not already exist, it attempts to create and register it, returning the driver or an error.

func (*LLMDriverStore) LoadFromFile

func (instance *LLMDriverStore) LoadFromFile(filename string) (response []llm_driver.ILLMDriver, err error)

func (*LLMDriverStore) Map

func (instance *LLMDriverStore) Map() (m map[string]interface{})

func (*LLMDriverStore) Models added in v0.3.52

func (instance *LLMDriverStore) Models() (response []string)

Models returns a list of unique model names

func (*LLMDriverStore) Names

func (instance *LLMDriverStore) Names() (response []string)

Names returns a slice of strings containing the names of all registered driver instances in the store.

func (*LLMDriverStore) NamesWithModels added in v0.3.52

func (instance *LLMDriverStore) NamesWithModels() (response []string)

func (*LLMDriverStore) New

func (instance *LLMDriverStore) New(options *llm_commons.LLMDriverOptions) (response llm_driver.ILLMDriver, err error)

New initializes and registers a new driver instance with a unique identifier and specific driver type. It returns the created driver instance or an error if the registration fails.

func (*LLMDriverStore) SaveToFile

func (instance *LLMDriverStore) SaveToFile(filename string) (err error)

func (*LLMDriverStore) String

func (instance *LLMDriverStore) String() string

func (*LLMDriverStore) Submit

func (instance *LLMDriverStore) Submit(request *llm_commons.LLMRequest) (response *llm_commons.LLMResponse, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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