Spaces:
Sleeping
Sleeping
Update app.py
Browse filesconvert df to string
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from Gradio_UI import GradioUI
|
|
| 11 |
|
| 12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 13 |
@tool
|
| 14 |
-
def get_stock_price(ticker_symbol:str)->
|
| 15 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 16 |
"""A tool that searches for the historic price of a stock symbol given the symbol ticker name and a period.
|
| 17 |
Args:
|
|
@@ -21,7 +21,7 @@ def get_stock_price(ticker_symbol:str)-> DataFrame: #it's import to specify the
|
|
| 21 |
try:
|
| 22 |
data = yf.Ticker(ticker_symbol)
|
| 23 |
historic_price = data.history(period=time_period)
|
| 24 |
-
return historic_price
|
| 25 |
except error:
|
| 26 |
return f"Error getting the price for {stock_symbol}"
|
| 27 |
|
|
|
|
| 11 |
|
| 12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 13 |
@tool
|
| 14 |
+
def get_stock_price(ticker_symbol:str)-> str: #it's import to specify the return type
|
| 15 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 16 |
"""A tool that searches for the historic price of a stock symbol given the symbol ticker name and a period.
|
| 17 |
Args:
|
|
|
|
| 21 |
try:
|
| 22 |
data = yf.Ticker(ticker_symbol)
|
| 23 |
historic_price = data.history(period=time_period)
|
| 24 |
+
return historic_price.to_string()
|
| 25 |
except error:
|
| 26 |
return f"Error getting the price for {stock_symbol}"
|
| 27 |
|