mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-16 09:34:30 -04:00
Remove existing route functionality (opposite to add_routes method) #189
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (May 28, 2024).
Hello. Sorry if this is duplicate issue, but I didn't find anything relevant inside a code / existing issues / documentation.
I would need to replace an existing route and create a new one (using add_routes) with the same name (because of different runnable), but it's not possible and ends up with the following error:
A runnable already exists at path: {path}. If adding multiple runnables make sure they have different paths.https://github.com/langchain-ai/langserve/blob/1b389f075187395e4eb71dc7067bff812dc68269/langserve/server.py#L195
Is there any possibility to delete it first and add again with the same name ? Langserve keeps track of the paths internally , so my attempts to delete it manually from app routes didn't help in this case.
Thanks a lot!
@eyurtsev commented on GitHub (Jun 4, 2024):
This is not possible by design -- what's your use case?
If you need to do something more flexible you can use the underlying
APIhandler