-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Description of the feature request:
The chat loop in the examples/Agents_Function_Calling_Barista_Bot.ipynb
notebook currently lacks error handling for the chat.send_message()
API call.
What problem are you trying to solve with this feature?
If the API call fails (e.g., due to network issues, rate limits, API errors, safety blocks), the script crashes abruptly. This provides a suboptimal user experience for anyone running this interactive example.
Any other information you'd like to share?
Proposed Solution:
Wrap the chat.send_message()
call within a try...except Exception as e:
block. This will allow the script to catch potential errors, print a user-friendly message about the issue, and allow the user to either retry their input or exit the chat gracefully (e.g., by typing 'q').
Benefit:
This change will make the Barista Bot example more robust and user-friendly by preventing unexpected crashes due to common API or network problems.