Spaces:
Sleeping
Sleeping
Update app.py
Browse files15 unmodified lines16171819202122232425262728293031323332 unmodified lines6667686970717215 unmodified linesArgs:symbol:for which symbol the data is to be fetched"""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:32 unmodified linesagent = CodeAgent(model=model,tools=[final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,15 unmodified lines16171819202122232425262728293031323334353632 unmodified lines6970717273747515 unmodified linesArgs:symbol:for which symbol the data is to be fetched"""try :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]}"""except Exception as e:return f"Error fetching stock data for {symbol}: {str(e)}"@tooldef get_current_time_in_timezone(timezone: str) -> str:32 unmodified linesagent = CodeAgent(model=model,tools=[final_answer, daily_stock_data, get_current_time_in_timezone, image_generation_tool] ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,
app.py+16-13