-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark generated for subsequential agent (5 markets)
- Loading branch information
1 parent
0aeb3c2
commit f1cfadc
Showing
7 changed files
with
696 additions
and
74 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
import os | ||
from typing import Type, Any | ||
from typing import Any, Type | ||
|
||
from crewai_tools.tools.base_tool import BaseTool | ||
from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper | ||
from pydantic.v1 import BaseModel, Field | ||
from pydantic.v1.types import SecretStr | ||
|
||
|
||
class TavilyDevToolSchema(BaseModel): | ||
"""Input for TXTSearchTool.""" | ||
search_query: str = Field(..., description="Mandatory search query you want to use to search the internet") | ||
"""Input for TXTSearchTool.""" | ||
|
||
search_query: str = Field( | ||
..., description="Mandatory search query you want to use to search the internet" | ||
) | ||
|
||
|
||
class TavilyDevTool(BaseTool): | ||
name: str = "Search the internet" | ||
# From Langchain's Tavily integration | ||
description: str = """"A search engine optimized for comprehensive, accurate, \ | ||
name: str = "Search the internet" | ||
# From Langchain's Tavily integration | ||
description: str = """"A search engine optimized for comprehensive, accurate, \ | ||
and trusted results. Useful for when you need to answer questions \ | ||
about current events or about recent information. \ | ||
Input should be a search query. \ | ||
If the user is asking about something that you don't know about, \ | ||
you should probably use this tool to see if that can provide any information.""" | ||
args_schema: Type[BaseModel] = TavilyDevToolSchema | ||
|
||
def _run( | ||
self, | ||
search_query: str, | ||
**kwargs: Any, | ||
) -> Any: | ||
args_schema: Type[BaseModel] = TavilyDevToolSchema | ||
|
||
return TavilySearchAPIWrapper(tavily_api_key = os.environ['TAVILY_API_KEY']).results(query=search_query) | ||
def _run( | ||
self, | ||
search_query: str, | ||
**kwargs: Any, | ||
) -> Any: | ||
return TavilySearchAPIWrapper( | ||
tavily_api_key=SecretStr(os.environ["TAVILY_API_KEY"]) | ||
).results(query=search_query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters