googleapis / googleapis/google-api-ruby-client

Root url seems wrong for Google::Apis::AiplatformV1::AiplatformService

Aperta
#20,520 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Ruby
Stelle
2.9k
Fork
888
Merge medio
6m
PR unite (30g)
218

Descrizione

When I do:
```ruby
scope = 'https://www.googleapis.com/auth/cloud-platform'
Google::Auth.get_application_default([scope])

vertex_ai_service = Google::Apis::AiplatformV1::AiplatformService.new
vertex_ai_service.authorization = authorization

# Project and location details
project_id = "sul-ai-sandbox"
location = "us-central1" # Change as appropriate

# Resource name for the model
model_id = "text-embedding-004"
endpoint = "projects/#{project_id}/locations/#{location}/publishers/google/models/#{model_id}"

response = vertex_ai_service.predict_project_location_publisher_model(
endpoint,
request_body
)
```

This gives this output, and eventually a 503 error:
```
Sending HTTP post https://aiplatform.googleapis.com/v1/projects/sul-ai-sandbox/locations/us-central1/publishers/google/models/text-embedding-004:predict?
```

I noticed the hostname used in the log is not what is listed in https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#generative-ai-get-text-embedding-drest.

So, it seems to work if I do:
```ruby
vertex_ai_service.root_url = "https://us-central1-aiplatform.googleapis.com/"
```

I didn't see this documented anywhere or if this is the supported way of doing this. In any case it's a challenge to find this invocation.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with Google::Apis::AiplatformV1::AiplatformService.new and the predict_project_location_publisher_model invocation shown in the issue. Compare the generated request hostname with the Vertex AI documentation and determine whether the regional root URL should be selected automatically or documented as a supported override. Done means the documented invocation reaches the expected regional endpoint without an unexplained manual setting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ruby
Ambito
api, cloud
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.