Skip to content

Commit

Permalink
debug: OpenAI API exception handle
Browse files Browse the repository at this point in the history
  • Loading branch information
liaocyintl committed Mar 8, 2023
1 parent 19ab57a commit 58387d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/slack_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def handle_mention(body, say, logger):
try:
response_message_text, past_messages, result = chatgpt.completion(event_text)
except Exception as err:
response_message_text = f"when call ChatGPT API. {err}"
raise err

role_system_number = len([message for message in past_messages if message["role"] == "system"])
role_assistant_number = len([message for message in past_messages if message["role"] == "assistant"])
Expand Down

0 comments on commit 58387d7

Please sign in to comment.