mbarnig commited on
Commit
bbd5849
·
verified ·
1 Parent(s): 89492f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
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
- assistant_id = session_data["assistant_id"]
86
- thread_id = session_data["thread_id"]
87
-
88
- # Add a Message to the Thread
89
- oai_message = await client.beta.threads.messages.create(
90
- thread_id=thread_id,
91
- role="user",
92
- content=user_input
 
 
 
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