Skip to content

Commit

Permalink
Fix the issue where the parameters passed to VertexAI ignored langcha…
Browse files Browse the repository at this point in the history
…in-ai#5889 (langchain-ai#5891)

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

Co-authored-by: Lior Durahly <lior.durahly@superwise.ai>
  • Loading branch information
BigicecreamTaken and Lior Durahly authored Jun 9, 2023
1 parent 63fcf41 commit 0eb1bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion langchain/llms/vertexai.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _llm_type(self) -> str:
@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

Expand Down
4 changes: 2 additions & 2 deletions langchain/utilities/vertexai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -40,7 +40,7 @@ def init_vertexai(
raise_vertex_import_error()

vertexai.init(
project=project_id,
project=project,
location=location,
credentials=credentials,
)

0 comments on commit 0eb1bc1

Please sign in to comment.