[PR #195] [MERGED] Delegate to orjson on the encoding path #419

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langserve/pull/195
Author: @eyurtsev
Created: 11/9/2023
Status: Merged
Merged: 11/9/2023
Merged by: @eyurtsev

Base: mainHead: eugene/serialization


📝 Commits (8)

📊 Changes

6 files changed (+210 additions, -24 deletions)

View changed files

📝 langserve/serialization.py (+14 -16)
📝 langserve/server.py (+8 -2)
📝 poetry.lock (+62 -2)
📝 pyproject.toml (+1 -0)
📝 tests/unit_tests/test_serialization.py (+65 -1)
📝 tests/unit_tests/test_server_client.py (+60 -3)

📄 Description

Using orjson on the encoding path. This will encode well known types like uuid, datetime, date, time etc.

This PR does not handle the decoding path as decoding can only be done properly once we take into account the jsonschema.

Rolling this out partially seems fine since:

  1. Handling the encoding side is probably more important for well known objects -- users can still roll out decoding code using RunnableLambda and pydantic or we can add run time coercion to runnables.
  2. The encoding format will NOT change once we incorporate more changes (i.e., we're using a standard representation of the well known types)

🔄 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/195 **Author:** [@eyurtsev](https://github.com/eyurtsev) **Created:** 11/9/2023 **Status:** ✅ Merged **Merged:** 11/9/2023 **Merged by:** [@eyurtsev](https://github.com/eyurtsev) **Base:** `main` ← **Head:** `eugene/serialization` --- ### 📝 Commits (8) - [`838c7af`](https://github.com/langchain-ai/langserve/commit/838c7afe1664155e0ced4d10d05e2b3b9e8d1862) x - [`cddd179`](https://github.com/langchain-ai/langserve/commit/cddd17922f40d218fb223c5416070001dccc46ab) x - [`af20551`](https://github.com/langchain-ai/langserve/commit/af205516f9c49837c032560ea68c37f40de3c98b) Merge branch 'main' into eugene/serialization - [`45518a2`](https://github.com/langchain-ai/langserve/commit/45518a2893f22d86415cf622f2698c26206dc336) x - [`dda8efc`](https://github.com/langchain-ai/langserve/commit/dda8efc161c2abce1a89ad33c0b4e7e381b1e313) x - [`e4b814d`](https://github.com/langchain-ai/langserve/commit/e4b814d8ff4e90515657ac16a9fb05ace9276905) x - [`02b1cb2`](https://github.com/langchain-ai/langserve/commit/02b1cb2bf70b32408264acaaf1a542fe018bb579) x - [`353721c`](https://github.com/langchain-ai/langserve/commit/353721c9686efbfba415a2ff00476d654db18eff) Merge branch 'main' into eugene/serialization ### 📊 Changes **6 files changed** (+210 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `langserve/serialization.py` (+14 -16) 📝 `langserve/server.py` (+8 -2) 📝 `poetry.lock` (+62 -2) 📝 `pyproject.toml` (+1 -0) 📝 `tests/unit_tests/test_serialization.py` (+65 -1) 📝 `tests/unit_tests/test_server_client.py` (+60 -3) </details> ### 📄 Description Using orjson on the encoding path. This will encode well known types like uuid, datetime, date, time etc. This PR does not handle the decoding path as decoding can only be done properly once we take into account the jsonschema. Rolling this out partially seems fine since: 1) Handling the encoding side is probably more important for well known objects -- users can still roll out decoding code using RunnableLambda and pydantic or we can add run time coercion to runnables. 2) The encoding format will NOT change once we incorporate more changes (i.e., we're using a standard representation of the well known types) --- <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:28 -05:00
yindo closed this issue 2026-02-16 00:20:28 -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#419