mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 22:20:43 +00:00
big progress checkin. Still quite broken, but now it shows the new direction. Time to start hooking things up again.
This commit is contained in:
parent
20a0cd2f66
commit
f9133b5a61
12 changed files with 228 additions and 364 deletions
|
@ -43,6 +43,18 @@ type Config interface {
|
|||
GetRegistration() ConfigRegistration
|
||||
}
|
||||
|
||||
func (cs ConfigStub) GetRequestDefaults() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cs ConfigStub) GetLocalPaths() ConfigLocalPaths {
|
||||
return cs.LocalPaths
|
||||
}
|
||||
|
||||
func (cs ConfigStub) GetRegistration() ConfigRegistration {
|
||||
return cs.Registration
|
||||
}
|
||||
|
||||
func (sc SpecificConfig[RequestModel]) GetRequestDefaults() interface{} {
|
||||
return sc.RequestDefaults
|
||||
}
|
||||
|
@ -158,6 +170,17 @@ func (cm *ConfigManager) GetConfig(r ConfigRegistration) (Config, bool) {
|
|||
return v, exists
|
||||
}
|
||||
|
||||
// This is a convience function for endpoint functions to use.
|
||||
// The advantage is it avoids errors in the endpoint string
|
||||
// Not a clue what the performance cost of this is.
|
||||
func (cm *ConfigManager) GetConfigForThisEndpoint(m string) (Config, bool) {
|
||||
endpoint := printCurrentFunctionName(2)
|
||||
return cm.GetConfig(ConfigRegistration{
|
||||
Model: m,
|
||||
Endpoint: endpoint,
|
||||
})
|
||||
}
|
||||
|
||||
func (cm *ConfigManager) listConfigs() []ConfigRegistration {
|
||||
var res []ConfigRegistration
|
||||
for k := range cm.configs {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue