You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use the CrateDBVectorSearch interface to add documents with 1536 dimensions to this embedding table
fromlangchain.schemaimportDocumentfromlangchain.vectorstores.cratedbimportCrateDBVectorSearchfromlangchain.embeddings.openaiimportOpenAIEmbeddingsdoc=Document(page_content="this is such a nice text")
doc1=Document(page_content="this is such a nice text")
vector_store=CrateDBVectorSearch.from_documents(
[doc, doc1],
OpenAIEmbeddings(api_key="<your-api-key>"),
collection_name="wow_such_nice",
connection_string="crate://localhost:4200?schema=repro",
)
No exception is thrown, even though the OpenAI embeddings have 1536 dimensions and therefore can't be inserted. It looks as if everyting worked as expected.
IMPORTANT: You need to have at least 2 documents to add (see the list of doc and doc1 above). With only one document, the exception is thrown as expected.
(Note: I'd not expect anyone to insert different dimension sizes on purpose. However this could happen on accident, so it might be good to notify the user, instead of swallowing the exception)
Expected behavior
An error should be provided, if the embeddings can't be inserted. Additionally the interface should behave the same for 1 or many documents.
The text was updated successfully, but these errors were encountered:
System Info
latest cratedb branch, langchain 0.0.339rc1
Who can help?
@Amot
Information
Related Components
Reproduction
No exception is thrown, even though the OpenAI embeddings have 1536 dimensions and therefore can't be inserted. It looks as if everyting worked as expected.
(Note: I'd not expect anyone to insert different dimension sizes on purpose. However this could happen on accident, so it might be good to notify the user, instead of swallowing the exception)
Expected behavior
An error should be provided, if the embeddings can't be inserted. Additionally the interface should behave the same for 1 or many documents.
The text was updated successfully, but these errors were encountered: