ai_old/interface/llm/gc.go
Star e69b9a3a12 add db、log support
support embedding for llm
support watch run for js
many other updates
2024-09-29 21:20:28 +08:00

34 lines
729 B
Go

package llm
type GCConfig struct {
defaultConfig *GCConfig
Model string
Size string
Ref string
}
func (gcConfig *GCConfig) SetDefault(config *GCConfig) {
gcConfig.defaultConfig = config
}
func (gcConfig *GCConfig) GetModel() string {
if gcConfig.Model == "" && gcConfig.defaultConfig != nil {
return gcConfig.defaultConfig.Model
}
return gcConfig.Model
}
func (gcConfig *GCConfig) GetSize() string {
if gcConfig.Size == "" && gcConfig.defaultConfig != nil {
return gcConfig.defaultConfig.Size
}
return gcConfig.Size
}
func (gcConfig *GCConfig) GetRef() string {
if gcConfig.Ref == "" && gcConfig.defaultConfig != nil {
return gcConfig.defaultConfig.Ref
}
return gcConfig.Ref
}