mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-16 09:34:30 -04:00
trying to set up a LangServe application with RunnableWithMessageHistory and a chat playground #223
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 @DeeraDigiSpoc on GitHub (Aug 23, 2024).
I'm trying to integrate both
RunnableWithMessageHistoryas chat with persistenceplayground_type='chat'TypeError: issubclass() arg 1 must be a classBut
RunnableWithMessageHistoryis a class right?Is there a option to do this?
@tylerwray commented on GitHub (Aug 24, 2024):
I'm having this same error. Code is very similar —
I suspect something with pydantic versions. I'm using
pydantic = "^2.8.2"in mypyproject.toml.I'm using an app generated with the langchain-cli last week.
@DeeraDigiSpoc commented on GitHub (Aug 26, 2024):
My Configs are:
pydantic-2.8.2
pydantic-core- 2.20.1
@Abd-elr4hman commented on GitHub (Aug 26, 2024):
This issue is in RunnableWithMessageHistory get_output_schema, I was able to work around it by defining my chain as follow:
then passing chain_with_parser to add_routes:
not sure exactly how to solve the issue in RunnableWithMessageHistory tho.
@DeeraDigiSpoc commented on GitHub (Aug 28, 2024):
Yes, It's solved!!
Still, The chat playground is only supported for chains that take one of the following as input:
and which return either an AIMessage or a string.
You can test this chain in the default LangServe playground instead.
To use the default playground, set playground_type="default" when adding the route in your backend.