diff --git a/src/backend/base/langflow/components/tools/serp_api.py b/src/backend/base/langflow/components/tools/serp_api.py index bc40c41543b..88e15f765bd 100644 --- a/src/backend/base/langflow/components/tools/serp_api.py +++ b/src/backend/base/langflow/components/tools/serp_api.py @@ -1,16 +1,14 @@ from typing import Any -from langchain.tools import StructuredTool from langchain_community.utilities.serpapi import SerpAPIWrapper from langchain_core.tools import ToolException from loguru import logger from pydantic import BaseModel, Field from langflow.custom import Component -from langflow.field_typing import Tool from langflow.inputs import DictInput, IntInput, MultilineInput, SecretStrInput -from langflow.schema import Data from langflow.io import Output +from langflow.schema import Data from langflow.schema.message import Message @@ -64,7 +62,6 @@ def _build_wrapper(self, params: dict[str, Any] | None = None) -> SerpAPIWrapper ) return SerpAPIWrapper(serpapi_api_key=self.serpapi_api_key) - def run_model(self) -> list[Data]: return self.fetch_content() @@ -100,7 +97,7 @@ def search_func( logger.debug(error_message) raise ToolException(error_message) from e return limited_results - + results = search_func( self.input_value, params=self.search_params,