microsoft / ai-chat-protocol

A library + API spec for easily streaming generative AI output to your chat applications.
MIT License
89 stars 11 forks source link

Handling mid stream errors. #28

Closed glecaros closed 1 month ago

glecaros commented 1 month ago

This pull request primarily involves changes to enhance error handling and improve code quality in the sdk/js/packages/client and sdk/js/samples/react directories. The key changes include the introduction of a new utility function isErrorResponse for error handling, updates to the AIChatProtocolClient class, and refactoring of the Chat component in the React sample.

Error handling enhancements:

Code quality improvements: