-
Notifications
You must be signed in to change notification settings - Fork 16.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
community: update for compatibility with latest Meilisearch version #18970
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hello! I don't want to be a bother, but since it's mentioned in the PR template, I'm tagging @efriis to make sure you don't forget this PR :D |
@@ -67,6 +67,7 @@ class Meilisearch(VectorStore): | |||
embeddings = OpenAIEmbeddings() | |||
vectorstore = Meilisearch( | |||
embedding=embeddings, | |||
embedders=embedders, |
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.
what are embedders? could we show how you'd define embedders in this example?
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.
In Meilisearch versions greater than 1.6, to use vector search, you must first configure the embedders index setting. This setting is a dictionary structure in which each key corresponds to an embedder.
The configuration options within an embedder object vary depending on the value assigned to its source field, which specifies the third-party service used for generating embeddings. In this context, the source is userProvided
.
For userProvided
sources, it's required to include a dimensions field, which outlines the size of the vectors.
An example configuration for embedders could look like this:
embedders = {
"theEmbedderName": {
"source": "userProvided",
"dimensions": "1536"
}
}
The use can define multiple embedders per index to accommodate more demanding use cases. For example, a user can define one embedder to generate text from a document image, and another embedder to translate the original document text fields to let users speaking other languages search products in their native language.
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.
gotcha! should we that snippet in the docstring example?
@@ -125,10 +134,11 @@ def add_texts( | |||
metadata = metadatas[i] | |||
metadata[self._text_key] = text | |||
embedding = embedding_vectors[i] | |||
embedder_name |
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.
stray line?
…rsion (langchain-ai#18970) - **Description:** Updates Meilisearch vectorstore for compatibility with v1.6 and above. Adds embedders settings and embedder_name which are now required. --------- Co-authored-by: Bagatur <[email protected]>
…rsion (#18970) - **Description:** Updates Meilisearch vectorstore for compatibility with v1.6 and above. Adds embedders settings and embedder_name which are now required. --------- Co-authored-by: Bagatur <[email protected]>
Thank you for contributing to LangChain!
PR title: "package: description"
PR message:
Add tests and docs: If you're adding a new integration, please include
docs/docs/integrations
directory.Lint and test: Run
make format
,make lint
andmake test
from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/Additional guidelines:
If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, hwchase17.