Skip to content

Commit

Permalink
fix: correct collection name for Milvus store to use underscores (lan…
Browse files Browse the repository at this point in the history
…gchain-ai#793)

* fix: correct collection name for Milvus store

Current name produces an error when using Milvus 2.3.0

"Invalid collection name: goldel-escher-bach.  collection name can only contain numbers, letters and underscores"

* Update milvus.md
  • Loading branch information
dkarlovi authored and RohitMidha23 committed Apr 18, 2023
1 parent 9697956 commit 0e52a00
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ const vectorStore = await Milvus.fromTexts(
[{ id: 2 }, { id: 1 }, { id: 3 }, { id: 4 }, { id: 5 }],
new OpenAIEmbeddings(),
{
collectionName: "goldel-escher-bach",
collectionName: "goldel_escher_bach",
}
);

// or alternatively from docs
const vectorStore = await Milvus.fromDocuments(docs, new OpenAIEmbeddings(), {
collectionName: "goldel-escher-bach",
collectionName: "goldel_escher_bach",
});

const response = await vectorStore.similaritySearch("scared", 2);
Expand All @@ -70,7 +70,7 @@ import { OpenAIEmbeddings } from "langchain/embeddings/openai";
const vectorStore = await Milvus.fromExistingCollection(
new OpenAIEmbeddings(),
{
collectionName: "goldel-escher-bach",
collectionName: "goldel_escher_bach",
}
);

Expand Down

0 comments on commit 0e52a00

Please sign in to comment.