Spaces:
Sleeping
Sleeping
Update app.py
Browse files12234567891011121213141415161617171819192021222324252627282930313233from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,toolimport datetimefrom datetime import datetime,timedeltaimport requestsimport pytzimport yamlfrom tools.final_answer import FinalAnswerToolimport yfinance as yf
from Gradio_UI import GradioUI
# Below is an example of a tool that does nothing. Amaze us with your creativity !@tooldef my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return typedef my_custom_tool(symbol: str)-> str: #it's import to specify the return type #Keep this format for the description / args / args description but feel free to modify the tool """A tool that does nothing yet """A tool returns todays data for symbol Args: arg1: the first argument arg2: the second argument symbol:for which symbol the data is to be fetched """ return "What magic will you build ?" start_date = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d") end_date = datetime.now().strftime("%Y-%m-%d") ticker = yf.Ticker(symbol) df = ticker.history(start=start_date, end=end_date, auto_adjust=True) return f""" Today's Stock data for {symbol}: Open : {df['Open'].iloc[0]} High : {df['High'].iloc[0]} Low : {df['Low'].iloc[0]} Close : {df['Open'].iloc[0]} Volume : {df['Volume'].iloc[0]} """
@tooldef get_current_time_in_timezone(timezone: str) -> str:app.py+17-6