Fix the issue where the parameters passed to VertexAI ignored #5889 (#5891)

Fixes #5889 and fixes the name of the argument in init_vertexai
@hwchase17
@agola11

Co-authored-by: Lior Durahly <lior.durahly@superwise.ai>
pull/5708/head
Lior 1 year ago committed by GitHub
parent 63fcf41bea
commit 0eb1bc1a02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,7 +68,7 @@ class _VertexAICommon(BaseModel):
@classmethod
def _try_init_vertexai(cls, values: Dict) -> None:
allowed_params = ["project", "location", "credentials"]
params = {k: v for k, v in values.items() if v in allowed_params}
params = {k: v for k, v in values.items() if k in allowed_params}
init_vertexai(**params)
return None

@ -18,7 +18,7 @@ def raise_vertex_import_error() -> None:
def init_vertexai(
project_id: Optional[str] = None,
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional["Credentials"] = None,
) -> None:
@ -40,7 +40,7 @@ def init_vertexai(
raise_vertex_import_error()
vertexai.init(
project=project_id,
project=project,
location=location,
credentials=credentials,
)

Loading…
Cancel
Save