[PR #47] [MERGED] Temporary workaround for generating unique model names #304

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

📋 Pull Request Information

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

Base: mainHead: eugene/add_unique_names


📝 Commits (10+)

📊 Changes

4 files changed (+149 additions, -29 deletions)

View changed files

📝 langserve/server.py (+51 -25)
📝 poetry.lock (+23 -2)
📝 pyproject.toml (+1 -1)
📝 tests/unit_tests/test_server_client.py (+74 -1)

📄 Description

If two schema different schemas share the same name, fastapi openapi documentation fails.

This is a temporary work-around for openapi spec generation purposes. It will work only for top level model names.

We've bumped into this issue while hosting 2 runnables that start with a PromptTemplate (same name for the schema), but have different template variables (so the schema are different).

We'll need to find a better solution to handle nested models. This should be good for now as it'll allow users to deploy the common case correctly.


🔄 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/47 **Author:** [@eyurtsev](https://github.com/eyurtsev) **Created:** 10/16/2023 **Status:** ✅ Merged **Merged:** 10/17/2023 **Merged by:** [@eyurtsev](https://github.com/eyurtsev) **Base:** `main` ← **Head:** `eugene/add_unique_names` --- ### 📝 Commits (10+) - [`1dbe49e`](https://github.com/langchain-ai/langserve/commit/1dbe49ea1a2869e0fa3dfdcc12ce259e364537da) workaround - [`9568c7c`](https://github.com/langchain-ai/langserve/commit/9568c7c658673826fef0b16b893297b30af3ad17) Update langserve/server.py - [`2992164`](https://github.com/langchain-ai/langserve/commit/2992164bcbbf1b7e688460e875f59183da827e89) x - [`90c70ec`](https://github.com/langchain-ai/langserve/commit/90c70ecc223f4d8e7a7c87253484a17e4af61194) Merge branch 'main' into eugene/add_unique_names - [`adf36b0`](https://github.com/langchain-ai/langserve/commit/adf36b07d36b95b5be8b0399175a8879a75bc2a0) x - [`0f42b2d`](https://github.com/langchain-ai/langserve/commit/0f42b2d738db3a7e8c0da8f055cc0668a37527af) x - [`f733cff`](https://github.com/langchain-ai/langserve/commit/f733cffd8cfe7278efb5d6e076b73dbf6456d545) Merge branch 'main' into eugene/add_unique_names - [`d469ff0`](https://github.com/langchain-ai/langserve/commit/d469ff0320ee7a3f1d5da44c88d4fa82ce429304) x - [`8714950`](https://github.com/langchain-ai/langserve/commit/871495092c865482e552fcb4dec19f343176d4bc) x - [`04a9d36`](https://github.com/langchain-ai/langserve/commit/04a9d36f2c7fcd5073a8b06cb94b7d361e9503a9) relock ### 📊 Changes **4 files changed** (+149 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `langserve/server.py` (+51 -25) 📝 `poetry.lock` (+23 -2) 📝 `pyproject.toml` (+1 -1) 📝 `tests/unit_tests/test_server_client.py` (+74 -1) </details> ### 📄 Description If two schema different schemas share the same name, fastapi openapi documentation fails. This is a temporary work-around for openapi spec generation purposes. It will work only for top level model names. We've bumped into this issue while hosting 2 runnables that start with a PromptTemplate (same name for the schema), but have different template variables (so the schema are different). We'll need to find a better solution to handle nested models. This should be good for now as it'll allow users to deploy the common case correctly. --- <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:06 -05:00
yindo closed this issue 2026-02-16 00:20:06 -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#304