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

core: added FakeVectorStore #9293

Closed
wants to merge 5 commits into from

Conversation

lkuligin
Copy link
Collaborator

@vercel
Copy link

vercel bot commented Aug 16, 2023

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jul 8, 2024 7:41pm

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Aug 16, 2023
@lkuligin
Copy link
Collaborator Author

@eyurtsev @hwchase17 could you take a look, please?

@leo-gan
Copy link
Collaborator

leo-gan commented Sep 21, 2023

@baskaryan Could you, please, review it? It looks like very helpful addition.

@leo-gan leo-gan requested a review from baskaryan September 21, 2023 21:52
@baskaryan
Copy link
Collaborator

out of curiosity how are you imagining using this?

@lkuligin
Copy link
Collaborator Author

lkuligin commented Oct 6, 2023

@baskaryan I find it useful to use together with a FakeLLM (and a callback). It makes it possible to write unit tests to test custom chains.
So essentially you create a few Documents (with some content and metadata) for testing purposes, add them to a fake vectorstore, and then you can unit test the whole chain's logic (that all prompts are formatted correctly, and your final output / evidence also look nice).

Does it make sense?

@efriis
Copy link
Contributor

efriis commented Nov 10, 2023

@lkuligin if you want to write some unit tests for some of the in-library chains and runnables, it might demonstrate the use case a bit better.

Otherwise, I'll probably close this, and you can continue using it in your codebase for unit testing custom chains!

@leo-gan
Copy link
Collaborator

leo-gan commented Nov 10, 2023

We also have plenty Fake classes: LLM, Embeddings. It makes sense to make Fake classes for all modules. So, I like this Fake vector store.

@nejch
Copy link
Contributor

nejch commented Jan 4, 2024

Thanks for this @lkuligin, I was able to use this in combination with a FakeStreamingListLLM to test incorporating chain building into a django app with a chatbot and custom contexts. So just adding another voice/use case here it might make sense since there's similar fake classes already provided with the package 🙇

@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@ccurme ccurme added the langchain Related to the langchain package label Jun 21, 2024
Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

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

Let's move the in memory vectorstore into core! It relies on numpy, but we can make it into an optional dependency?

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 8, 2024
@efriis efriis changed the title added fake vector_store core: added FakeVectorStore Jul 8, 2024
Copy link
Contributor

@efriis efriis left a comment

Choose a reason for hiding this comment

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

moved to core!

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jul 8, 2024
@eyurtsev
Copy link
Collaborator

eyurtsev commented Jul 8, 2024

Here's a PR that should resolve this issue: #23986

@eyurtsev
Copy link
Collaborator

eyurtsev commented Jul 8, 2024

Closing this as we merged the in memory vectorstore

@eyurtsev eyurtsev closed this Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features langchain Related to the langchain package lgtm PR looks good. Use to confirm that a PR is ready for merging. size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants