fix: read config upstream type default value
This commit is contained in:
@@ -62,11 +62,11 @@ func readConfig(filepath string) Config {
|
|||||||
log.Fatalf("Can't parse upstream endpoint URL '%s': %s", upstream.Endpoint, err)
|
log.Fatalf("Can't parse upstream endpoint URL '%s': %s", upstream.Endpoint, err)
|
||||||
}
|
}
|
||||||
config.Upstreams[i].URL = endpoint
|
config.Upstreams[i].URL = endpoint
|
||||||
if upstream.Type == "" {
|
if config.Upstreams[i].Type == "" {
|
||||||
upstream.Type = "openai"
|
config.Upstreams[i].Type = "openai"
|
||||||
}
|
}
|
||||||
if (upstream.Type != "openai") && (upstream.Type != "replicate") {
|
if (config.Upstreams[i].Type != "openai") && (config.Upstreams[i].Type != "replicate") {
|
||||||
log.Fatalf("Unsupported upstream type '%s'", upstream.Type)
|
log.Fatalf("Unsupported upstream type '%s'", config.Upstreams[i].Type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user