bstraehle commited on
Commit
2e01617
·
verified ·
1 Parent(s): 049fb2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -33,13 +33,13 @@ def today_tool() -> str:
33
  There should be no input. 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(ticker, start=start_date, end=end_date)
43
 
44
  tools = {
45
  "today_tool": today_tool,
@@ -224,9 +224,9 @@ def chat(message, history):
224
  global assistant, thread
225
 
226
  if assistant == None:
227
- #assistant = create_assistant(client) # on first run, create assistant and update assistant_id
228
  # see https://platform.openai.com/playground/assistants
229
- assistant = load_assistant(client) # on subsequent runs, load assistant
230
 
231
  if thread == None or len(history) == 0:
232
  thread = create_thread(client)
 
33
  There should be 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 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 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
 
44
  tools = {
45
  "today_tool": today_tool,
 
224
  global assistant, thread
225
 
226
  if assistant == None:
227
+ assistant = create_assistant(client) # on first run, create assistant and update assistant_id
228
  # see https://platform.openai.com/playground/assistants
229
+ #assistant = load_assistant(client) # on subsequent runs, load assistant
230
 
231
  if thread == None or len(history) == 0:
232
  thread = create_thread(client)