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(cosmosdbnosql): Add Semantic Cache Integration #7033

Merged
merged 36 commits into from
Nov 5, 2024

Conversation

aditishree1
Copy link
Contributor

@aditishree1 aditishree1 commented Oct 21, 2024

This PR adds following changes:

  • adds Azure Cosmos DB NoSQL SemanticCache Integration.
  • adds docs and samples for Semantic Cache

Copy link

vercel bot commented Oct 21, 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 Nov 5, 2024 5:49pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Nov 5, 2024 5:49pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Oct 21, 2024
@aditishree1 aditishree1 changed the title cosmosdbnosql: Add semantic cache Integration cosmosdbnosql: Add Semantic Cache Integration Oct 21, 2024
@jacoblee93 jacoblee93 added the lgtm PRs that are ready to be merged as-is label Oct 29, 2024
@jacoblee93
Copy link
Collaborator

jacoblee93 commented Oct 29, 2024

One more thing you may want to consider - happy to merge but you may want to return undefined in certain cases if the score is not high enough

Copy link

@aayush3011 aayush3011 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @aditishree1 .

@aditishree1
Copy link
Contributor Author

One more thing you may want to consider - happy to merge but you may want to return undefined in certain cases if the score is not high enough

make sense. Any suggestion on what should be the threshold score?

@jacoblee93
Copy link
Collaborator

One more thing you may want to consider - happy to merge but you may want to return undefined in certain cases if the score is not high enough

make sense. Any suggestion on what should be the threshold score?

No good intuition - would try it with some things you'd expect to be cached and allow the user to override it

@aditishree1
Copy link
Contributor Author

Hi @jacoblee93 @sinedied @aayush3011, I have added similarity score threshold in the last commit. I have set the default threshold as 0.6 by trying out some prompts. Also added the tests. Pls review.

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.

Looks good, I put a minor comment regarding the tests to make it work with any embedding model

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 1, 2024
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Nov 1, 2024
@aditishree1
Copy link
Contributor Author

Hi @jacoblee93, I have added changes to set a threshold score. Please have a look.

@jacoblee93
Copy link
Collaborator

Awesome, thanks will merge and ship a new package version once it's in!

@jacoblee93 jacoblee93 removed the question Further information is requested label Nov 5, 2024
@jacoblee93 jacoblee93 merged commit c6440b6 into langchain-ai:main Nov 5, 2024
28 checks passed
cinqisap pushed a commit to cinqisap/langchainjs that referenced this pull request Nov 6, 2024
Co-authored-by: Yohan Lasorsa <noda@free.fr>
Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PRs that are ready to be merged as-is size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants