Add backend provider and cost configuration
This commit is contained in:
@@ -291,6 +291,9 @@ func validateBackendRecord(backend backendConfig, base configkit.Path, validatio
|
||||
if backend.Endpoint == nil || *backend.Endpoint == "" {
|
||||
validation.Error(base.Key("endpoint"), "endpoint is required")
|
||||
}
|
||||
if backend.Provider != nil && !llm.SupportedProvider(*backend.Provider) {
|
||||
validation.Error(base.Key("provider"), "unsupported provider")
|
||||
}
|
||||
if backend.APIKeyEnv != nil && *backend.APIKeyEnv != "" && !envName.MatchString(*backend.APIKeyEnv) {
|
||||
validation.Error(base.Key("api_key_env"), "environment variable name is invalid")
|
||||
}
|
||||
@@ -319,10 +322,8 @@ func validateBackendRecord(backend backendConfig, base configkit.Path, validatio
|
||||
}
|
||||
if authentication := smokeTests.Authentication; authentication != nil {
|
||||
kindPath := smokePath.Key("authentication").Key("kind")
|
||||
if authentication.Kind == nil {
|
||||
validation.Error(kindPath, "authentication kind is required")
|
||||
} else if *authentication.Kind != "none" && *authentication.Kind != "openrouter_key" {
|
||||
validation.Error(kindPath, "authentication kind must be none or openrouter_key")
|
||||
if authentication.Kind != nil && *authentication.Kind != "none" && *authentication.Kind != "openrouter_key" && *authentication.Kind != "vllm_models" {
|
||||
validation.Error(kindPath, "unsupported authentication kind")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user