Skip to content

Commit

Permalink
Update streamly.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AdieLaine authored Jul 24, 2024
1 parent a64ed54 commit aeff73d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions streamly.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ def on_chat_submit(chat_input, api_key, latest_updates, use_langchain=False):
st.session_state.history.append({"role": "user", "content": user_input})
st.session_state.history.append({"role": "assistant", "content": assistant_reply})

except OpenAIError.APIConnectionError as e:
logging.error(f"Error occurred: {e}")
error_message = f"OpenAI Error: {str(e)}"
st.error(error_message)
#st.session_state.history.append({"role": "assistant", "content": error_message})

def main():
"""
Display Streamlit updates and handle the chat interface.
Expand Down

0 comments on commit aeff73d

Please sign in to comment.