[PR #83] [MERGED] Start handling errors on stream/astream/astream_log #334

Closed
opened 2026-02-16 00:20:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langserve/pull/83
Author: @eyurtsev
Created: 10/20/2023
Status: Merged
Merged: 10/20/2023
Merged by: @eyurtsev

Base: mainHead: eugene/handle_errors


📝 Commits (5)

📊 Changes

3 files changed (+259 additions, -40 deletions)

View changed files

📝 langserve/client.py (+62 -5)
📝 langserve/server.py (+73 -29)
📝 tests/unit_tests/test_server_client.py (+124 -6)

📄 Description

This PR introduces error handling for stream/astream/astream_log endpoints.

The error handling is incomplete as client side errors aren't handled yet.

  1. When an exception is encountered while streaming the server sents an error event in the stream with data:
  • status code: int
  • message: str
  1. Client code is updated to handle this

In addition this PR, proposes that the client with log an error instead of
raising when encountering an unsupported event. This will allow us to ship
additional events without breaking older clients. Useful for sending over
callback events.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langserve/pull/83 **Author:** [@eyurtsev](https://github.com/eyurtsev) **Created:** 10/20/2023 **Status:** ✅ Merged **Merged:** 10/20/2023 **Merged by:** [@eyurtsev](https://github.com/eyurtsev) **Base:** `main` ← **Head:** `eugene/handle_errors` --- ### 📝 Commits (5) - [`d538c4c`](https://github.com/langchain-ai/langserve/commit/d538c4cf003743341f2f7e07d727434b26e485af) x - [`1b8f23f`](https://github.com/langchain-ai/langserve/commit/1b8f23f53f726b559077ddc40d6fd743106eb8e7) x - [`e98a861`](https://github.com/langchain-ai/langserve/commit/e98a8613fc17826d9a294a11b642be0ed9d945c2) x - [`17f3da4`](https://github.com/langchain-ai/langserve/commit/17f3da41f5e75c54e45061c9ec61a4e7b01c6726) x - [`6f9bfee`](https://github.com/langchain-ai/langserve/commit/6f9bfee431dcce917706e9767c8cefb9957231f5) x ### 📊 Changes **3 files changed** (+259 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `langserve/client.py` (+62 -5) 📝 `langserve/server.py` (+73 -29) 📝 `tests/unit_tests/test_server_client.py` (+124 -6) </details> ### 📄 Description This PR introduces error handling for stream/astream/astream_log endpoints. The error handling is incomplete as client side errors aren't handled yet. 1) When an exception is encountered while streaming the server sents an error event in the stream with data: - status code: int - message: str 2) Client code is updated to handle this In addition this PR, proposes that the client with log an error instead of raising when encountering an unsupported event. This will allow us to ship additional events without breaking older clients. Useful for sending over callback events. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 00:20:11 -05:00
yindo closed this issue 2026-02-16 00:20:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#334