Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
# TODO:
|
2 |
#
|
3 |
# 1. Multi-user thread
|
4 |
-
# 2. Tools:
|
5 |
-
# 3. Tools: Function calling - https://platform.openai.com/docs/assistants/tools/function-calling
|
6 |
|
7 |
# Reference:
|
8 |
#
|
@@ -152,7 +151,7 @@ def chat(message, history):
|
|
152 |
|
153 |
run_steps = get_run_steps(client, thread, run)
|
154 |
|
155 |
-
|
156 |
|
157 |
messages = get_messages(client, thread)
|
158 |
|
@@ -160,13 +159,8 @@ def chat(message, history):
|
|
160 |
|
161 |
download_link = ""
|
162 |
|
163 |
-
print("###")
|
164 |
-
print(text_values[0])
|
165 |
-
print("###")
|
166 |
if len(image_values) > 0:
|
167 |
-
|
168 |
-
download_link = f"https://platform.openai.com/storage/files/{image_values[0]}"
|
169 |
-
print("###")
|
170 |
|
171 |
return f"{text_values[0]}{download_link}"
|
172 |
|
@@ -184,8 +178,8 @@ gr.ChatInterface(
|
|
184 |
["Explain: r\"^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W]).{8,}$\""],
|
185 |
["Fix: x = [5, 2, 1, 3, 4]; print(x.sort())"],
|
186 |
["Optimize: x = []; for i in range(0, 10000): x.append(i)"],
|
187 |
-
["
|
188 |
-
["
|
189 |
],
|
190 |
cache_examples=False,
|
191 |
).launch()
|
|
|
1 |
# TODO:
|
2 |
#
|
3 |
# 1. Multi-user thread
|
4 |
+
# 2. Tools: Function calling - https://platform.openai.com/docs/assistants/tools/function-calling
|
|
|
5 |
|
6 |
# Reference:
|
7 |
#
|
|
|
151 |
|
152 |
run_steps = get_run_steps(client, thread, run)
|
153 |
|
154 |
+
get_run_step_details(run_steps)
|
155 |
|
156 |
messages = get_messages(client, thread)
|
157 |
|
|
|
159 |
|
160 |
download_link = ""
|
161 |
|
|
|
|
|
|
|
162 |
if len(image_values) > 0:
|
163 |
+
download_link = f"<br /><br />https://platform.openai.com/storage/files/{image_values[0]}"
|
|
|
|
|
164 |
|
165 |
return f"{text_values[0]}{download_link}"
|
166 |
|
|
|
178 |
["Explain: r\"^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W]).{8,}$\""],
|
179 |
["Fix: x = [5, 2, 1, 3, 4]; print(x.sort())"],
|
180 |
["Optimize: x = []; for i in range(0, 10000): x.append(i)"],
|
181 |
+
["Generate and execute: First 25 Fibbonaci numbers"],
|
182 |
+
["Generate and execute: Chart showing stock gain YTD for NVDA, MSFT, AAPL, and GOOG, x-axis is 'Day' and y-axis is 'YTD Gain %'. Use mock data."]
|
183 |
],
|
184 |
cache_examples=False,
|
185 |
).launch()
|