Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,14 +82,17 @@ async def initialize_thread():
|
|
| 82 |
session_data["thread_id"] = thread.id
|
| 83 |
|
| 84 |
async def generate_response(user_input):
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
| 93 |
)
|
| 94 |
|
| 95 |
# Create and Stream a Run
|
|
|
|
| 82 |
session_data["thread_id"] = thread.id
|
| 83 |
|
| 84 |
async def generate_response(user_input):
|
| 85 |
+
if user_input == "":
|
| 86 |
+
yield "Schreif eng Fro als Input"
|
| 87 |
+
else:
|
| 88 |
+
assistant_id = session_data["assistant_id"]
|
| 89 |
+
thread_id = session_data["thread_id"]
|
| 90 |
+
|
| 91 |
+
# Add a Message to the Thread
|
| 92 |
+
oai_message = await client.beta.threads.messages.create(
|
| 93 |
+
thread_id=thread_id,
|
| 94 |
+
role="user",
|
| 95 |
+
content=user_input
|
| 96 |
)
|
| 97 |
|
| 98 |
# Create and Stream a Run
|