Merge pull request #1657 from eslamkarim/patch-1

Change quota project to the correct project being used for the call
This commit is contained in:
Krish Dholakia 2024-01-30 08:40:09 -08:00 committed by GitHub
commit c53ad878b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -237,8 +237,11 @@ def completion(
GenerationConfig,
)
from google.cloud.aiplatform_v1beta1.types import content as gapic_content_types
import google.auth
vertexai.init(project=vertex_project, location=vertex_location)
## Load credentials with the correct quota project ref: https://github.com/googleapis/python-aiplatform/issues/2557#issuecomment-1709284744
creds, _ = google.auth.default(quota_project_id=vertex_project)
vertexai.init(project=vertex_project, location=vertex_location, credentials=creds)
## Load Config
config = litellm.VertexAIConfig.get_config()