Skip to content
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

Merged
merged 6 commits into from
Dec 16, 2024

Conversation

fatmelon
Copy link
Contributor

@fatmelon fatmelon commented Dec 3, 2024

Add AzureCosmosDBMongoChatMessageHistory for langchain-azure-cosmosdb.

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Dec 16, 2024 6:52am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Dec 16, 2024 6:52am

@fatmelon fatmelon marked this pull request as ready for review December 3, 2024 08:08
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases labels Dec 3, 2024
@jacoblee93 jacoblee93 changed the title community[minor] add AzureCosmosDBMongoChatMessageHistory feat(azure-cosmosdb): add AzureCosmosDBMongoChatMessageHistory Dec 10, 2024
Copy link
Collaborator

@jacoblee93 jacoblee93 left a 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?

@jacoblee93 jacoblee93 added hold On hold close PRs that need one or two touch-ups to be ready labels Dec 10, 2024
Copy link
Contributor

@sinedied sinedied left a 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

Copy link
Contributor

@sinedied sinedied left a 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.

@fatmelon
Copy link
Contributor Author

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

Yep, I'll implement these changes together with Jacob's comments

Copy link
Contributor

@sinedied sinedied left a 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.

@fatmelon
Copy link
Contributor Author

@jacoblee93 could you help review the PR? I think it's ready to merge :)

Copy link
Collaborator

@jacoblee93 jacoblee93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Dec 16, 2024
@jacoblee93 jacoblee93 merged commit ec9b6a5 into langchain-ai:main Dec 16, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases close PRs that need one or two touch-ups to be ready hold On hold lgtm PRs that are ready to be merged as-is size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants