-
Notifications
You must be signed in to change notification settings - Fork 872
Chat ID inclusion to conversation history #249
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
base: main
Are you sure you want to change the base?
Conversation
hey @pietrozullo / @NandhuKishore24 , can you please review the changes for this request. |
Hey @THARUN-S-R actually the chat id has no function on the local agent but only on the remote execution. I am not sure what are you trying to do here, could you explain ? |
Hi @pietrozullo , I am using the Chat Id to pass a unique hash value to identify each agent run or Chat. This will be then added to the conversation history. I need to find each Chat to add a feedback to the response. This way i can identify the chat and improve prompting based on user feedback. For this langchain BaseMessage has optional id field which we can use to identify each chat. |
Hey @THARUN-S-R I am still not sure I follow, have you see what the chat_id is used for inside the agent ? The chatID is a reference to the cloud hosted agent in the library context, it will not have anything to do with chat persistence locally, even after your changes. Also I see you are passing it in the langchain messages, which is fine, but that id is supposed to be unique for every message not a common one for a chat. If you want to persiste the messages in a chat you can create a Chat class where you persist them and you can have the Chat take an ID. Maybe I am not seeing something here but this PR does not seem to solve the problem you want to address, imo |
Hi @pietrozullo , yes the chat id initially is used only for remote agent, but in my use case I want to mark each chat with a unique id to reference it back later. Hence, this field was already there which i can use to pass the unique id into the Messages. This way i dont need a new parameter to achieve this and can be assigned in Chat_id. About the uniqueness of the id, before triggering the run(query) func, I will assign the agent a new chat id as : This way I can easily identify the chats I want to refer back to. The user can have a feedback to the chat generated which we can use to adjust our prompt accordingly. This is just one of the use case of the Chat ID. |
Chat ID inclusion to the conversation history
Changes
We are passing the Chat Id variable into the conversation history to better identify the chats within the same session.
Implementation Details
The BaseMessage of langchain has capabilities to accept the ID which we can use to identify the exact chat incase we need to use it for training or feedback purposes
This change will not be affected if chat id is not sent.