Spaces:
Running
Running
import os | |
from tavily import TavilyClient | |
def perform_search(query): | |
try: | |
client = TavilyClient(api_key=os.environ.get("TAVILY_API_KEY")) | |
result = client.search(query, include_answer=True) | |
return result["answer"] | |
except Exception as e: | |
return f"Error: {str(e)}" |