Spaces:
Sleeping
Sleeping
Update app.py
Browse files15 unmodified lines16171819192021222324252627282930202122232425262728293031323334353632 unmodified lines697071697273747515 unmodified lines Args: 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]} """ 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 lines agent = CodeAgent( model=model, tools=[final_answer], ## add your tools here (don't remove final answer) 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