diff --git a/src/backend/langflow/components/utilities/GoogleSearchAPIWrapper.py b/src/backend/langflow/components/utilities/GoogleSearchAPIWrapper.py index 37c5ec33e..205087076 100644 --- a/src/backend/langflow/components/utilities/GoogleSearchAPIWrapper.py +++ b/src/backend/langflow/components/utilities/GoogleSearchAPIWrapper.py @@ -1,10 +1,6 @@ from langflow import CustomComponent -from typing import Optional, Union, Callable - -# Assuming GoogleSearchAPIWrapper is a valid import based on JSON -# and it exists in some module that should be imported here. -# The import path should be replaced with the correct one once available. +from typing import Union, Callable from langchain_community.utilities.google_search import GoogleSearchAPIWrapper @@ -16,12 +12,11 @@ class GoogleSearchAPIWrapperComponent(CustomComponent): return { "google_api_key": {"display_name": "Google API Key", "password": True}, "google_cse_id": {"display_name": "Google CSE ID","password":True}, - # Fields with "show": False are omitted based on the rules } def build( self, - google_api_key: Optional[str] = None, - google_cse_id: Optional[str] = None, + google_api_key: str, + google_cse_id: str, ) -> Union[GoogleSearchAPIWrapper, Callable]: return GoogleSearchAPIWrapper(google_api_key=google_api_key, google_cse_id=google_cse_id)