From 9c06b16eb30fd4802dff4057b80c2dc2d16c6245 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 25 Jan 2024 16:40:58 -0300 Subject: [PATCH] Fix default value for k parameter and add default value for searx_host parameter --- .../langflow/components/utilities/SearxSearchWrapper.py | 4 ++-- src/backend/langflow/components/utilities/SerpAPIWrapper.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/components/utilities/SearxSearchWrapper.py b/src/backend/langflow/components/utilities/SearxSearchWrapper.py index d89ecacf2..b406f3882 100644 --- a/src/backend/langflow/components/utilities/SearxSearchWrapper.py +++ b/src/backend/langflow/components/utilities/SearxSearchWrapper.py @@ -26,8 +26,8 @@ class SearxSearchWrapperComponent(CustomComponent): def build( self, - k: Optional[int] = 10, + k: int = 10, headers: Optional[Dict[str, str]] = None, - searx_host: Optional[str] = None, + searx_host: str = "https://searx.example.com", ) -> SearxSearchWrapper: return SearxSearchWrapper(headers=headers, k=k, searx_host=searx_host) diff --git a/src/backend/langflow/components/utilities/SerpAPIWrapper.py b/src/backend/langflow/components/utilities/SerpAPIWrapper.py index 1513f4c5e..0fda8188e 100644 --- a/src/backend/langflow/components/utilities/SerpAPIWrapper.py +++ b/src/backend/langflow/components/utilities/SerpAPIWrapper.py @@ -24,4 +24,7 @@ class SerpAPIWrapperComponent(CustomComponent): serpapi_api_key: str, params: dict, ) -> Union[SerpAPIWrapper, Callable]: # Removed quotes around SerpAPIWrapper - return SerpAPIWrapper(serpapi_api_key=serpapi_api_key, params=params) + return SerpAPIWrapper( + serpapi_api_key=serpapi_api_key, + params=params, + )