chore: Add type annotation for 'status' and format multiline string in TavilyAISearch tool (#4011)

* Format multiline string in TavilySearchToolComponent description

* Add type annotation for 'status' and import 'Any' in TavilyAISearch tool
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-10-03 14:59:57 -03:00 committed by GitHub
commit e395cb7f4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,5 @@
from typing import Any
import httpx
from langchain.tools import StructuredTool
from pydantic import BaseModel, Field
@ -10,7 +12,8 @@ from langflow.schema import Data
class TavilySearchToolComponent(LCToolComponent):
display_name = "Tavily AI Search"
description = """**Tavily AI** is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results. It can be used independently or as an agent tool.
description = """**Tavily AI** is a search engine optimized for LLMs and RAG, \
aimed at efficient, quick, and persistent search results. It can be used independently or as an agent tool.
Note: Check 'Advanced' for all options.
"""
@ -144,7 +147,7 @@ Note: Check 'Advanced' for all options.
if include_images and search_results.get("images"):
data_results.append(Data(data={"images": search_results["images"]}))
self.status = data_results
self.status: Any = data_results
return data_results
except httpx.HTTPStatusError as e: