arthurcarvalho commited on
Commit
ec3f884
·
verified ·
1 Parent(s): 4435384

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -41,9 +41,9 @@ if prompt := st.chat_input("How can I help you today?"):
41
  stream=True,
42
  )
43
 
44
- for chunk in response:
45
- if chunk.choices[0].delta.content is not None:
46
- full_response += chunk.choices[0].delta.content.replace('\\$','$').replace('$','\\$')
47
  message_placeholder.markdown(full_response + "▌")
48
 
49
  message_placeholder.markdown(full_response)
 
41
  stream=True,
42
  )
43
 
44
+ for event in response:
45
+ if event.type == 'response.output_text.delta':
46
+ full_response += event.delta.content.replace('\\$','$').replace('$','\\$')
47
  message_placeholder.markdown(full_response + "▌")
48
 
49
  message_placeholder.markdown(full_response)