Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -104,21 +104,20 @@ def create_run(client, assistant, thread):
|
|
104 |
|
105 |
def wait_on_run(client, thread, run):
|
106 |
while run.status == "queued" or run.status == "in_progress":
|
107 |
-
print("### " + run.status)
|
108 |
run = client.beta.threads.runs.retrieve(
|
109 |
thread_id=thread.id,
|
110 |
run_id=run.id,
|
111 |
)
|
112 |
-
|
|
|
|
|
113 |
time.sleep(0.5)
|
114 |
|
115 |
show_json("run", run)
|
116 |
|
117 |
-
if hasattr(run, "
|
118 |
-
|
119 |
-
|
120 |
-
print("###")
|
121 |
-
|
122 |
return run
|
123 |
|
124 |
def get_run_steps(client, thread, run):
|
|
|
104 |
|
105 |
def wait_on_run(client, thread, run):
|
106 |
while run.status == "queued" or run.status == "in_progress":
|
|
|
107 |
run = client.beta.threads.runs.retrieve(
|
108 |
thread_id=thread.id,
|
109 |
run_id=run.id,
|
110 |
)
|
111 |
+
|
112 |
+
print(run.status)
|
113 |
+
|
114 |
time.sleep(0.5)
|
115 |
|
116 |
show_json("run", run)
|
117 |
|
118 |
+
if hasattr(run, "last_error") and run.error:
|
119 |
+
raise gr.Error(run.error)
|
120 |
+
|
|
|
|
|
121 |
return run
|
122 |
|
123 |
def get_run_steps(client, thread, run):
|