Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,9 +30,12 @@ def ask_openai(question):
|
|
30 |
messages = client.beta.threads.messages.list(
|
31 |
thread_id=thread.id,
|
32 |
)
|
33 |
-
|
34 |
-
|
|
|
35 |
|
|
|
|
|
36 |
examples = [
|
37 |
["My Eucalyptus tree is struggling outside in the cold weather in europe"],
|
38 |
["My callatea house plant is yellowing."],
|
|
|
30 |
messages = client.beta.threads.messages.list(
|
31 |
thread_id=thread.id,
|
32 |
)
|
33 |
+
for msg in messages:
|
34 |
+
if msg.role == 'assistant':
|
35 |
+
return msg.content[0]['text']['value']
|
36 |
|
37 |
+
return "No response."
|
38 |
+
|
39 |
examples = [
|
40 |
["My Eucalyptus tree is struggling outside in the cold weather in europe"],
|
41 |
["My callatea house plant is yellowing."],
|