Spaces:
Runtime error
Runtime error
Make `run_and_submit_all` asynchronous, update imports, and add telemetry initialization
Browse files
src/gaia_solving_agent/tools.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from tavily import AsyncTavilyClient
|
| 2 |
+
|
| 3 |
+
from gaia_solving_agent import TAVILY_API_KEY
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
async def tavily_search_web(query: str) -> str:
|
| 7 |
+
"""Useful for using the web to answer questions."""
|
| 8 |
+
if TAVILY_API_KEY is None or "x" in TAVILY_API_KEY:
|
| 9 |
+
raise ValueError("Tavily API key not set.")
|
| 10 |
+
client = AsyncTavilyClient(api_key=TAVILY_API_KEY)
|
| 11 |
+
return str(await client.search(query))
|