Add Vertex AI support
This commit is contained in:
@@ -60,7 +60,8 @@ func NewRegistry(entries map[string]config.ProviderEntry, models []config.ModelE
|
||||
}
|
||||
|
||||
func buildProvider(entry config.ProviderEntry) (Provider, error) {
|
||||
if entry.APIKey == "" {
|
||||
// Vertex AI doesn't require APIKey, so check for it separately
|
||||
if entry.Type != "vertexai" && entry.APIKey == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -97,6 +98,14 @@ func buildProvider(entry config.ProviderEntry) (Provider, error) {
|
||||
APIKey: entry.APIKey,
|
||||
Endpoint: entry.Endpoint,
|
||||
}), nil
|
||||
case "vertexai":
|
||||
if entry.Project == "" || entry.Location == "" {
|
||||
return nil, fmt.Errorf("project and location are required for vertexai")
|
||||
}
|
||||
return googleprovider.NewVertexAI(config.VertexAIConfig{
|
||||
Project: entry.Project,
|
||||
Location: entry.Location,
|
||||
}), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown provider type %q", entry.Type)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user