-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Chat Message History. #8
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
Conversation
from langchain_core.chat_history import BaseChatMessageHistory | ||
from langchain_core.messages import BaseMessage, messages_from_dict | ||
|
||
USER_AGENT = "langchain-google-datastore-python" |
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.
nit: We will need to include the version here
@averikitsch will share a doc shortly on recommendations
""" | ||
if client: | ||
self.client = client | ||
self.client._client_info.user_agent = USER_AGENT |
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.
this is overriding the agent entirely. Can we preserve the original as well?
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.
I'm not very familiar with the USER_AGENT_HEADER .
Should we add an space and the agent followed by the version?
I'm looking at some examples like
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36
I'm not certain about this. I can append it to the string if it's better
self.client.delete(self.key) | ||
|
||
|
||
class MessageConverter: |
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.
nit: is there any reason to put this in a class as opposed to just functions in the file?
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.
Not really, I was using the utility class pattern - (more like java)
I don't know if the best practice is to have this as functions of the file.
Should I change it?
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Add Chat Message History for Firestore in Datastore Mode.