From d6a7aaa97de1df3858ff6e2f1a47f002d8c56d69 Mon Sep 17 00:00:00 2001 From: Bhav Sardana <40908961+sardanabhav@users.noreply.github.com> Date: Wed, 22 Jan 2025 01:47:43 +0530 Subject: [PATCH] community: Fix for Pydantic model validator of GoogleApiClient (#29346) - [ *] **PR message**: ***Delete this entire checklist*** and replace with - **Description:** Fix for pedantic model validator for GoogleApiHandler - **Issue:** the issue #29165 - [ *] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. --------- Signed-off-by: Bhav Sardana --- .../langchain_community/document_loaders/youtube.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/community/langchain_community/document_loaders/youtube.py b/libs/community/langchain_community/document_loaders/youtube.py index 67c1569adf8..64871eb3caf 100644 --- a/libs/community/langchain_community/document_loaders/youtube.py +++ b/libs/community/langchain_community/document_loaders/youtube.py @@ -52,14 +52,14 @@ class GoogleApiClient: @model_validator(mode="before") @classmethod - def validate_channel_or_videoIds_is_set(cls, values: Dict[str, Any]) -> Any: + def validate_channel_or_videoIds_is_set(cls, values: Any) -> Any: """Validate that either folder_id or document_ids is set, but not both.""" - if not values.get("credentials_path") and not values.get( + if not values.kwargs.get("credentials_path") and not values.kwargs.get( "service_account_path" ): raise ValueError("Must specify either channel_name or video_ids") - return values + return values.kwargs def _load_credentials(self) -> Any: """Load credentials."""