bstraehle commited on
Commit
a1b26e5
1 Parent(s): 0888e64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- There is no input. This function always returns today's date."""
34
  return str(date.today())
35
 
36
- def yf_download_tool(tickers: List[str], start_date: date, end_date: date) -> pd.DataFrame:
37
- """Returns historical stock data for given tickers from a start date to an 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 the tickers as a List of strings, 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,7 +223,7 @@ def chat(message, history):
223
  global assistant, thread
224
 
225
  if assistant == None:
226
- assistant = load_assistant(client)
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)