Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,16 +28,16 @@ assistant_id = "asst_ypbcWnilAd60bc2DQ8haDL5P"
|
|
| 28 |
|
| 29 |
assistant, thread = None, None
|
| 30 |
|
| 31 |
-
def today_tool() -> str:
|
| 32 |
"""Returns today's date. Use this function for any questions related to knowing today's date.
|
| 33 |
-
|
| 34 |
return str(date.today())
|
| 35 |
|
| 36 |
-
def yf_download_tool(
|
| 37 |
-
"""Returns historical stock data for given
|
| 38 |
using the yfinance library download function.
|
| 39 |
Use this function for any questions related to getting historical stock data.
|
| 40 |
-
The input should be
|
| 41 |
This function always returns a pandas DataFrame."""
|
| 42 |
return yf.download(tickers, start=start_date, end=end_date)
|
| 43 |
|
|
@@ -223,7 +223,7 @@ def chat(message, history):
|
|
| 223 |
global assistant, thread
|
| 224 |
|
| 225 |
if assistant == None:
|
| 226 |
-
assistant =
|
| 227 |
|
| 228 |
if thread == None or len(history) == 0:
|
| 229 |
thread = create_thread(client)
|
|
|
|
| 28 |
|
| 29 |
assistant, thread = None, None
|
| 30 |
|
| 31 |
+
def today_tool(str) -> str:
|
| 32 |
"""Returns today's date. Use this function for any questions related to knowing today's date.
|
| 33 |
+
The input should be an empty string. This function always returns today's date."""
|
| 34 |
return str(date.today())
|
| 35 |
|
| 36 |
+
def yf_download_tool(ticker: str, start_date: date, end_date: date) -> pd.DataFrame:
|
| 37 |
+
"""Returns historical stock data for a given ticker from start date to end date
|
| 38 |
using the yfinance library download function.
|
| 39 |
Use this function for any questions related to getting historical stock data.
|
| 40 |
+
The input should be a ticker string, a start date, and an end date.
|
| 41 |
This function always returns a pandas DataFrame."""
|
| 42 |
return yf.download(tickers, start=start_date, end=end_date)
|
| 43 |
|
|
|
|
| 223 |
global assistant, thread
|
| 224 |
|
| 225 |
if assistant == None:
|
| 226 |
+
assistant = create_assistant(client)
|
| 227 |
|
| 228 |
if thread == None or len(history) == 0:
|
| 229 |
thread = create_thread(client)
|