Documentation
¶
Index ¶
- Constants
- func GetCustomizeLogo() string
- func Load() error
- func LoadProvider(name string) error
- func ReadFile(dir embed.FS, name string) (eosc.Untyped[string, string], error)
- func Register(name string, driver IProvider)
- func Remove(name string)
- type Config
- type CustomizeProviderConfig
- type IConfig
- type IModel
- type IParamValidator
- type IProvider
- func GetProvider(name string) (IProvider, bool)
- func NewCustomizeProvider(id string, name string, models []IModel, defaultModel string, config string) (IProvider, error)
- func NewProvider(providerData string, modelContents map[string]eosc.Untyped[string, string]) (IProvider, error)
- func Providers() []IProvider
- type IProviderInfo
- type IProviderURI
- type Manager
- type Model
- type ModelConfig
- type ModelRegistry
- type Param
- type ParamValidator
- type Provider
- func (p *Provider) DefaultModel(modelType string) (IModel, bool)
- func (p *Provider) GetModel(name string) (IModel, bool)
- func (p *Provider) GetModelConfig() ModelConfig
- func (p *Provider) HelpUrl() string
- func (p *Provider) ID() string
- func (p *Provider) Logo() string
- func (p *Provider) MaskConfig(cfg string) string
- func (p *Provider) Models() []IModel
- func (p *Provider) ModelsByType(modelType string) ([]IModel, bool)
- func (p *Provider) Name() string
- func (p *Provider) Recommend() bool
- func (p *Provider) RemoveModel(id string)
- func (p *Provider) SetDefaultModel(modelType string, model IModel)
- func (p *Provider) SetModel(id string, model IModel)
- func (p *Provider) SetURI(uri IProviderURI)
- func (p *Provider) Sort() int
- func (p *Provider) URI() IProviderURI
Constants ¶
View Source
const ( ParameterTypeInt = "int" ParameterTypeStr = "string" ParameterTypeFloat = "float" ParameterTypeBool = "bool" )
View Source
const (
DirAssets = "assets"
)
View Source
const (
ModelTypeLLM = "llm"
)
Variables ¶
This section is empty.
Functions ¶
func GetCustomizeLogo ¶
func GetCustomizeLogo() string
func LoadProvider ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(cfg string, validator IParamValidator) *Config
func (*Config) DefaultConfig ¶
type CustomizeProviderConfig ¶
type IModel ¶
type IModel interface {
ID() string
Name() string
Logo() string
Source() string
ModelType() string
SetLogo(logo string)
AccessConfiguration() string
ModelParameters() string
IConfig
}
func NewCustomizeModel ¶
type IParamValidator ¶
type IProvider ¶
type IProvider interface {
IProviderInfo
GetModelConfig() ModelConfig
SetModel(id string, model IModel)
RemoveModel(id string)
SetDefaultModel(modelType string, model IModel)
GetModel(name string) (IModel, bool)
Models() []IModel
ModelsByType(modelType string) ([]IModel, bool)
IConfig
MaskConfig(cfg string) string
Sort() int
Recommend() bool
}
func GetProvider ¶
func NewCustomizeProvider ¶
func NewProvider ¶
type IProviderInfo ¶
type IProviderInfo interface {
ID() string
Name() string
DefaultModel(modelType string) (IModel, bool)
HelpUrl() string
Logo() string
SetURI(IProviderURI)
URI() IProviderURI
}
type IProviderURI ¶
func GetCustomizeProviderURI ¶
func GetCustomizeProviderURI(config string, emptyURI bool) (IProviderURI, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
type Model ¶
type Model struct {
//defaultConfig string
IConfig
// contains filtered or unexported fields
}
func (*Model) AccessConfiguration ¶
func (*Model) ModelParameters ¶
type ModelConfig ¶
type ModelRegistry ¶
type ModelRegistry struct {
// contains filtered or unexported fields
}
type Param ¶
type Param struct {
Name string `json:"name" yaml:"name"`
Default interface{} `json:"default" yaml:"default"`
Type string `json:"type" yaml:"type"`
Min float64 `json:"min" yaml:"min"`
Max float64 `json:"max" yaml:"max"`
Required bool `json:"required" yaml:"required"`
Secret bool `json:"secret" yaml:"secret"`
}
type ParamValidator ¶
type ParamValidator []Param
func (ParamValidator) GenConfig ¶
func (p ParamValidator) GenConfig(target map[string]interface{}, origin map[string]interface{}) (string, error)
func (ParamValidator) Valid ¶
func (p ParamValidator) Valid(params map[string]interface{}) error
type Provider ¶
type Provider struct {
IConfig
// contains filtered or unexported fields
}
func (*Provider) GetModelConfig ¶
func (p *Provider) GetModelConfig() ModelConfig
func (*Provider) MaskConfig ¶
func (*Provider) RemoveModel ¶
func (*Provider) SetDefaultModel ¶
func (*Provider) SetURI ¶
func (p *Provider) SetURI(uri IProviderURI)
func (*Provider) URI ¶
func (p *Provider) URI() IProviderURI
Click to show internal directories.
Click to hide internal directories.