Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jcoyne opened this issue Nov 7, 2024 · 0 comments
Open

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

jcoyne opened this issue Nov 7, 2024 · 0 comments
Assignees

Comments

@jcoyne
Copy link

jcoyne commented Nov 7, 2024

When I do:

    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:

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants