diff --git a/libs/community/langchain_google_community/vertex_ai_search.py b/libs/community/langchain_google_community/vertex_ai_search.py index 04e0425e..b5321e66 100644 --- a/libs/community/langchain_google_community/vertex_ai_search.py +++ b/libs/community/langchain_google_community/vertex_ai_search.py @@ -252,7 +252,7 @@ class VertexAISearchRetriever(BaseRetriever, _BaseVertexAISearchRetriever): class Config: """Configuration for this pydantic object.""" - extra = Extra.ignore + extra = Extra.forbid arbitrary_types_allowed = True underscore_attrs_are_private = True @@ -267,7 +267,11 @@ def __init__(self, **kwargs: Any) -> None: "`pip install langchain-google-community[vertexaisearch]`" ) from exc - super().__init__(**kwargs) + try: + super().__init__(**kwargs) + except ValueError as e: + print(f"Error initializing GoogleVertexAISearchRetriever: {str(e)}") + raise # For more information, refer to: # https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store