-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add Chat history endpoints #303
Conversation
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
97fabd9
to
cda483e
Compare
Signed-off-by: Stephanie <[email protected]>
cda483e
to
c147719
Compare
Signed-off-by: Stephanie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good in overall, will have some nitpicks. Are you going to squash commits first please?
Also - would it be possible please to have one PR that changes just transcript format. IIRC I have created the transcript history based on HumanMessage
and AIMessage
sequence, but it was later changed to plaintext. @asamal4 do you recall why?
@tisnik |
When PR merges, github will have a option to squash all commits into one. so I will leave this work to be handled by PR merge.
restricting plain text in the cache comes with significant limitations:
|
Signed-off-by: Stephanie <[email protected]>
@yangcao77 Agree with you regarding plain text issue. I was just saying why we used plain text, requirement was very simple for us earlier. Not saying that we need to continue using plain text. However I do have concern about using langchain message object. There are still some discussion not to use langchain for llm call. If we use something else, then we still have to use langchain only for message object. Having langchain dependency only for storing messages doesn't seem right to me. cc: @tisnik |
Signed-off-by: Stephanie <[email protected]>
1ee7637
to
97ded98
Compare
Re: message type for llm call. with Langchain Object, message content can be easily extract out via service/ols/src/prompts/prompt_generator.py Lines 43 to 49 in 97ded98
service/ols/src/prompts/prompt_generator.py Lines 114 to 115 in 97ded98
|
I am talking about not to use langchain message object while storing. We can use python native dict. Just to avoid any further code related to langchain. Langchains AIMessage, HumanMessage roughly means But I don't want to create any confusion. Currently it is okay to use langchain objects. Because removing langchain will be a big effort. so I guess we can also change how we store the messages at that time or write logic to recreate similar structure. |
Signed-off-by: Stephanie <[email protected]>
@yangcao77 so if @asamal4 is ok with introducing langchain-based message classes, we might merge right? Don't worry about Ruff, that's my problem to fix it later ;) |
Description
Add Chat history endpoints
GET /conversations
List all conversation_id for a login user and also the summary of each conversation.
GET /conversations/:conversation_id
Get chat history in the format of Langchain message for the requested conversation_id
DELETE /conversations/:conversation_id:
Get the conversation in cache for the requested conversation_id
Please check this screen recording for a quick demo: https://drive.google.com/file/d/1UFSq8W6BzRcaELiZuDYbjtUxzNOLxxU0/view?usp=sharing
in addition, update the conversation cache to use langchain message type instead of plain text for future enhance. i.e. image in humanMessage or AIMessage can be added as part of the object.content.
Type of change
Related Tickets & Documents
https://issues.redhat.com/browse/RHDHPAI-175
https://issues.redhat.com/browse/RHDHPAI-193
Checklist before requesting a review
Testing