Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -126,8 +126,8 @@ def chat(message, history):
|
|
126 |
if assistant == None:
|
127 |
assistant = load_assistant(client)
|
128 |
|
129 |
-
|
130 |
-
|
131 |
|
132 |
create_message(client, thread, message)
|
133 |
|
@@ -150,9 +150,6 @@ gr.ChatInterface(
|
|
150 |
textbox=gr.Textbox(placeholder="Ask anything", container=False, scale=7),
|
151 |
title="Python Code Generator",
|
152 |
description="The assistant can generate, explain, fix, optimize, document, test, and generally help with code. It can also execute code.",
|
153 |
-
#clear_btn="Clear",
|
154 |
-
#retry_btn="Retry",
|
155 |
-
#undo_btn="Undo",
|
156 |
examples=[
|
157 |
["Generate: NumPy/Pandas/Matplotlib & yfinance trading app"],
|
158 |
["Explain: r'^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W]).{8,}$'"],
|
|
|
126 |
if assistant == None:
|
127 |
assistant = load_assistant(client)
|
128 |
|
129 |
+
if thread == None:
|
130 |
+
thread = create_thread(client)
|
131 |
|
132 |
create_message(client, thread, message)
|
133 |
|
|
|
150 |
textbox=gr.Textbox(placeholder="Ask anything", container=False, scale=7),
|
151 |
title="Python Code Generator",
|
152 |
description="The assistant can generate, explain, fix, optimize, document, test, and generally help with code. It can also execute code.",
|
|
|
|
|
|
|
153 |
examples=[
|
154 |
["Generate: NumPy/Pandas/Matplotlib & yfinance trading app"],
|
155 |
["Explain: r'^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W]).{8,}$'"],
|