Skip to content

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

Merged
merged 9 commits into from
Feb 16, 2024
Merged

feat: Chat Message History. #8

merged 9 commits into from
Feb 16, 2024

Conversation

JU-2094
Copy link
Member

@JU-2094 JU-2094 commented Feb 15, 2024

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:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Add Chat Message History for Firestore in Datastore Mode.

@JU-2094 JU-2094 requested a review from a team as a code owner February 15, 2024 02:49
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/langchain-google-datastore-python API. label Feb 15, 2024
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import BaseMessage, messages_from_dict

USER_AGENT = "langchain-google-datastore-python"
Copy link
Collaborator

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
Copy link
Collaborator

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?

@averikitsch

Copy link
Member Author

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:
Copy link
Collaborator

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?

Copy link
Member Author

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?

@JU-2094 JU-2094 merged commit e8663dd into main Feb 16, 2024
@JU-2094 JU-2094 deleted the jfurbina-memory branch February 16, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/langchain-google-datastore-python API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants