Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,9 +28,9 @@ assistant_id = "asst_CJxGHbFQZADs2uUC2bxuvb7Z"
|
|
28 |
|
29 |
assistant, thread = None, None
|
30 |
|
31 |
-
def today_tool(
|
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(ticker: str, start_date: date, end_date: date) -> pd.DataFrame:
|
@@ -224,8 +224,8 @@ def chat(message, history):
|
|
224 |
global assistant, thread
|
225 |
|
226 |
if assistant == None:
|
227 |
-
|
228 |
-
assistant = load_assistant(client) # on subsequent runs, load assistant
|
229 |
|
230 |
if thread == None or len(history) == 0:
|
231 |
thread = create_thread(client)
|
|
|
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 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:
|
|
|
224 |
global assistant, thread
|
225 |
|
226 |
if assistant == None:
|
227 |
+
assistant = create_assistant(client) # on first run, create assistant and update assistant_id (see https://platform.openai.com/playground/assistants)
|
228 |
+
#assistant = load_assistant(client) # on subsequent runs, load assistant
|
229 |
|
230 |
if thread == None or len(history) == 0:
|
231 |
thread = create_thread(client)
|