-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(azure-cosmosdb): add AzureCosmosDBMongoChatMessageHistory #7305
feat(azure-cosmosdb): add AzureCosmosDBMongoChatMessageHistory #7305
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
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.
Small nit but looks reasonable - @sinedied are you able to have a look as well?
libs/langchain-azure-cosmosdb/src/chat_histories_azure_cosmosdb_mongodb.ts
Outdated
Show resolved
Hide resolved
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.
Thanks for you contribution!
This looks like almost the same implementation as the @langchain/community
mongodb one (which is also compatible with Azure BTW), though for this package we would prefer to have something more in-line with what we have in AzureCosmosDBMongoDBVectorStore
for example, ie provide a dbConfig
object with either:
- mongo Client
- connectionString
- collectionName
and initialise the mongo client directly if it's not provided (see AzureCosmosDBMongoDBVectorStore` implementation).
Do you think you could implement these changes? You can also look at AzureCosmosDBNoSQLChatMessageHistoryInput
for an example implementation.
Thanks
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.
Could you also have a look to add the related documentation?
You can ping me on Teams if needed I can help you with what's missing.
Yep, I'll implement these changes together with Jacob's comments |
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.
Thanks for the update!
I suggest changing the default DB/collection name to align with the other Cosmos Chat history implementation and avoid potential conflicts with vector storage.
Another nit (could be a another PR): test files could be restructured the same way as the implementation, ie:
tests/
- chat_histories/
- mongodb.int.test.ts
- nosql.ts
From our offline chat, docs will be added in another PR.
@jacoblee93 could you help review the PR? I think it's ready to merge :) |
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.
Thank you!
Add
AzureCosmosDBMongoChatMessageHistory
for langchain-azure-cosmosdb.