Documentation ¶
Index ¶
- Constants
- 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)
- type Config
- type IConfig
- type IModel
- type IParamValidator
- type IProvider
- type IProviderInfo
- type IProviderURI
- type Manager
- type Model
- 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) 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) SetDefaultModel(modelType string, model IModel)
- func (p *Provider) SetModel(id string, model IModel)
- func (p *Provider) SetModelsByType(modelType string, models []IModel)
- 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 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 IParamValidator ¶
type IProvider ¶
type IProvider interface { IProviderInfo GetModel(name string) (IModel, bool) Models() []IModel ModelsByType(modelType string) ([]IModel, bool) IConfig MaskConfig(cfg string) string Sort() int Recommend() bool }
func GetProvider ¶
func NewProvider ¶
type IProviderInfo ¶
type IProviderURI ¶
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 }
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) MaskConfig ¶
func (*Provider) SetDefaultModel ¶
func (*Provider) SetModelsByType ¶
func (*Provider) URI ¶
func (p *Provider) URI() IProviderURI
Click to show internal directories.
Click to hide internal directories.