The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community:Fix for Pydantic model validator of GoogleApiYoutubeLoader (#29694)
Bhav Sardana624216aa64cc
diff --git a/libs/community/langchain_community/document_loaders/youtube.py b/libs/community/langchain_community/document_loaders/youtube.pyindex 64871eb3ca..1b99a8d2da 100644--- a/libs/community/langchain_community/document_loaders/youtube.py+++ b/libs/community/langchain_community/document_loaders/youtube.py@@ -392,11 +392,11 @@ class GoogleApiYoutubeLoader(BaseLoader):@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("channel_name") and not values.get("video_ids"):+ if not values.kwargs.get("channel_name") and not values.kwargs.get("video_ids"):raise ValueError("Must specify either channel_name or video_ids")- return values+ return values.kwargsdef _get_transcripe_for_video_id(self, video_id: str) -> str:from youtube_transcript_api import NoTranscriptFound, YouTubeTranscriptApi