Skip to content

Commit

Permalink
modified: streamly.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AdieLaine committed Mar 17, 2024
1 parent 2622edc commit 01ac693
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions streamly.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import base64


from openai import OpenAI
from openai import OpenAI, OpenAIError
client = OpenAI()

logging.basicConfig(level=logging.INFO)
Expand Down Expand Up @@ -217,7 +217,7 @@ 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 openai.APIConnectionError as e:
except OpenAIError.APIConnectionError as e:
logging.error(f"Error occurred: {e}")
error_message = f"OpenAI Error: {str(e)}"
st.error(error_message)
Expand Down

0 comments on commit 01ac693

Please sign in to comment.