llm

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                            string
	Default                         bool
	Provider                        ProviderType
	Endpoint                        string
	APIKey                          string
	Model, EmbeddingModel, TTSModel string
	Temperature                     float32
}

func (*Config) Validate

func (c *Config) Validate() error

type Factory

type Factory interface {
	component.Component
	config.Watcher
	Get(name string) LLM
}

Factory is a factory for creating LLM instances. If name is empty or not found, it will return the default.

func NewFactory

func NewFactory(
	instance string,
	app *config.App,
	dependencies FactoryDependencies,
	mockOn ...component.MockOption,
) (Factory, error)

type FactoryConfig

type FactoryConfig struct {
	LLMs []Config
	// contains filtered or unexported fields
}

--- Factory code block ---

func (*FactoryConfig) From

func (c *FactoryConfig) From(app *config.App)

func (*FactoryConfig) Validate

func (c *FactoryConfig) Validate() error

type FactoryDependencies

type FactoryDependencies struct {
	KVStorage kv.Storage
}

type LLM

type LLM interface {
	component.Component
	// contains filtered or unexported methods
}

--- Interface code block ---

type ProviderType

type ProviderType string
const (
	ProviderTypeOpenAI      ProviderType = "openai"
	ProviderTypeOpenRouter  ProviderType = "openrouter"
	ProviderTypeDeepSeek    ProviderType = "deepseek"
	ProviderTypeGemini      ProviderType = "gemini"
	ProviderTypeVolc        ProviderType = "volc" // Rename MaaS to ARK. 😄
	ProviderTypeSiliconFlow ProviderType = "siliconflow"
)

type Speaker added in v0.5.0

type Speaker struct {
	Name  string
	Voice string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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