mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 13:54:48 +00:00
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 <sardana.bhav@gmail.com>
This commit is contained in:
parent
1c4ce7b42b
commit
d6a7aaa97d
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user