Spaces:
Runtime error
Runtime error
Update app.py
Browse files12344 unmodified lines9101112131415161718192021222324252627from smolagents import web_search, CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, toolimport datetimeimport requestsimport pytz4 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity!@tooldef faq_bot_tool(query: str) -> str:"""A tool that answers frequently asked questions about virtual assistants by searching the web and giving a snippet or summary of the Information as the answer.Args:query: The question asked by the user."""try:# Perform a web search using the querysearch_results = web_search(query)# Extract relevant information from the search resultsif search_results:12344 unmodified lines910111213141516171819202122232425262728293031from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, toolimport datetimeimport requestsimport pytz4 unmodified lines# Below is an example of a tool that does nothing. Amaze us with your creativity!# Define a custom tool using the @tool decorator@tooldef my_custom_tool(arg1: str, arg2: int) -> str:"""A tool that answers customers' queries on working with and as a Virtual Assistant by searching the web and producing a snippet of the first web result in line with parameter arg2.Args:arg1: Questions about working with and as a Virtual Assistant. (Forexample; Why should I hire a Virtual Assistant?, What courses do I need to complete to become a Virtual Assistant?)arg2: 200 characters."""return f"Processed {arg1} with value {arg2}"# Load an external tool, such as a web search toolweb_search_tool = DuckDuckGoSearchTool(arg1)try:# Perform a web search using the DuckDuckGoSearchTool(arg1)search_results = web_search_tool# Extract relevant information from the search resultsif search_results:
app.py+12-8