mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 20:28:10 +00:00
Fixes #5889 and fixes the name of the argument in init_vertexai @hwchase17 @agola11 Co-authored-by: Lior Durahly <lior.durahly@superwise.ai>
This commit is contained in:
parent
63fcf41bea
commit
0eb1bc1a02
@ -68,7 +68,7 @@ class _VertexAICommon(BaseModel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _try_init_vertexai(cls, values: Dict) -> None:
|
def _try_init_vertexai(cls, values: Dict) -> None:
|
||||||
allowed_params = ["project", "location", "credentials"]
|
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)
|
init_vertexai(**params)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ def raise_vertex_import_error() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def init_vertexai(
|
def init_vertexai(
|
||||||
project_id: Optional[str] = None,
|
project: Optional[str] = None,
|
||||||
location: Optional[str] = None,
|
location: Optional[str] = None,
|
||||||
credentials: Optional["Credentials"] = None,
|
credentials: Optional["Credentials"] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -40,7 +40,7 @@ def init_vertexai(
|
|||||||
raise_vertex_import_error()
|
raise_vertex_import_error()
|
||||||
|
|
||||||
vertexai.init(
|
vertexai.init(
|
||||||
project=project_id,
|
project=project,
|
||||||
location=location,
|
location=location,
|
||||||
credentials=credentials,
|
credentials=credentials,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user