Closed peter-boucher closed 1 month ago
Hello, @peter-boucher! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to resolve the issue you're experiencing.
To resolve the TypeError: VectorStore.from_documents() missing 1 required positional argument: 'embedding'
error, ensure that the embedding
argument is correctly provided when calling the Qdrant.from_documents
method. Here’s how you can do it:
Ensure embedding
is Provided: When you call the build
method for the Qdrant component, make sure the embedding
parameter is included. For example:
qdrant_component = QdrantComponent()
vector_store = qdrant_component.build(
embedding=my_embedding, # Ensure this is provided
collection_name="my_collection",
inputs=my_documents, # Ensure this is provided
api_key="my_api_key",
# other parameters as needed
)
Generate the embedding
Parameter: The embedding
parameter should be an instance of the AzureOpenAIEmbeddings
class. Here’s how you can generate it:
from langchain_community.embeddings import AzureOpenAIEmbeddings
azure_embedding = AzureOpenAIEmbeddings(
azure_endpoint="your_azure_endpoint",
azure_deployment="your_azure_deployment",
api_version="your_api_version",
api_key="your_api_key"
)
Pass the embedding
Parameter: Use the generated azure_embedding
when building the Qdrant component:
qdrant_component = QdrantComponent()
vector_store = qdrant_component.build(
embedding=azure_embedding,
collection_name="my_collection",
inputs=my_documents,
api_key="my_api_key",
# other parameters as needed
)
Ensure that my_documents
is a valid list of Record
or Document
objects. This should resolve the error and allow the embedding flow to build successfully [1][2][3].
To continue talking to Dosu, mention @dosu.
Hey @peter-boucher
Please make sure before you run your flow, click on ⚠️ to update the required components, and then try to run your flow.
Please let me know if it works.
Hi @peter-boucher
Do you need any assistance with this case? If not, please let us know if this issue can be closed.
Hi @peter-boucher
Do you need any assistance with this case? If not, please let us know if this issue can be closed.
Thanks @carlosrcoelho I was able to diagnose this was an issue with the embedding model Azure OpenIA Embeddings that caused an exception in the Vector DB module for Qdrand. I have the same issue with other vectorDBs.
Closing this, I'll check my embedding-ada-002 deployment and open a new issue if needed.
Bug Description
Reproduction
Pre requisite: Qdrant container running locally using docker
Expected behavior
Successful build of the embedding flow
Who can help?
No response
Operating System
MacOS Sonoma 14.5 (23F79)
Langflow Version
1.0.7
Python Version