Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE]Use Langchain standard message types for storing chat cache #202

Open
yangcao77 opened this issue Dec 10, 2024 · 0 comments
Open

[RFE]Use Langchain standard message types for storing chat cache #202

yangcao77 opened this issue Dec 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@yangcao77
Copy link

Is your feature request related to a problem? Please describe.
Road-core is defining it’s own conversation history class: CacheEntry, instead of using the langchain message types, e.g. AIMessage, HumanMessage, SystemMessage etc.

the self-defined type only contains a simple string value of user query and AI response. It’s missing all other information, and has no flexibility for setting metadata information like timestamp, etc.
Secondly, consumers using the road-core service image container still need to import the CacheEntry from road-core in order to understand the content. RHDH has the worst case, it uses road-core service image and it uses NodeJS. RHDH cannot directly consume the road-core repo as a library, we need some public & standard definition, which is langchain message types.

Describe the solution you'd like
use Langchain AIMessage, HumanMessage as message type, use BaseMessage[] for storing the chat history. ​​https://python.langchain.com/v0.2/docs/tutorials/chatbot/#managing-conversation-history. both Langchain NodeJS and Langchain Python share the same standard definition, it preserves all AI message information, and also provides flexibility to add more info in metadata.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@yangcao77 yangcao77 added the enhancement New feature or request label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant