Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
# TODO: Gradio session / multi-user thread
|
2 |
-
|
3 |
# Reference:
|
4 |
#
|
5 |
# https://vimeo.com/990334325/56b552bc7a
|
@@ -40,7 +38,8 @@ def chat(message, history):
|
|
40 |
#assistant = create_assistant(openai_client) # on first run, create assistant and update assistant_id
|
41 |
# see https://platform.openai.com/playground/assistants
|
42 |
assistant = load_assistant(openai_client) # on subsequent runs, load assistant
|
43 |
-
|
|
|
44 |
if thread == None or len(history) == 0:
|
45 |
thread = create_thread(openai_client)
|
46 |
|
@@ -110,7 +109,8 @@ def chat(message, history):
|
|
110 |
text_values, image_values = extract_content_values(messages)
|
111 |
|
112 |
download_link = ""
|
113 |
-
|
|
|
114 |
if len(image_values) > 0:
|
115 |
download_link = f"<p>Download: https://platform.openai.com/storage/files/{image_values[0]}</p>"
|
116 |
|
|
|
|
|
|
|
1 |
# Reference:
|
2 |
#
|
3 |
# https://vimeo.com/990334325/56b552bc7a
|
|
|
38 |
#assistant = create_assistant(openai_client) # on first run, create assistant and update assistant_id
|
39 |
# see https://platform.openai.com/playground/assistants
|
40 |
assistant = load_assistant(openai_client) # on subsequent runs, load assistant
|
41 |
+
|
42 |
+
# TODO: Gradio session / multi-user thread
|
43 |
if thread == None or len(history) == 0:
|
44 |
thread = create_thread(openai_client)
|
45 |
|
|
|
109 |
text_values, image_values = extract_content_values(messages)
|
110 |
|
111 |
download_link = ""
|
112 |
+
|
113 |
+
# TODO: Handle multiple images and other file types
|
114 |
if len(image_values) > 0:
|
115 |
download_link = f"<p>Download: https://platform.openai.com/storage/files/{image_values[0]}</p>"
|
116 |
|