langchain-ai / langserve

LangServe 🦜️🏓
Other
1.75k stars 184 forks source link

How can the client record historical messages without calling the LangChain environment #687

Closed Ricardo-yyz closed 1 week ago

Ricardo-yyz commented 1 week ago

Discussed in https://github.com/langchain-ai/langserve/discussions/686

Originally posted by **Ricardo-yyz** June 18, 2024 When I built an API using Langserve and mimicked the demo in the [example,](https://github.com/langchain-ai/langserve/blob/main/examples/agent_with_history/client.ipynb) the problem was how to record historical information in the input without calling modules such as HumanMessage if my client did not have a langchain environment. I tried to record in JSON format, but I couldn't find a suitable way to convert it to the corresponding format on the server side.