Skip to content

Commit

Permalink
update langchain example (#233)
Browse files Browse the repository at this point in the history
Signed-off-by: nameczz <zizhao.chen@zilliz.com>
  • Loading branch information
nameczz authored Aug 23, 2023
1 parent b08c6d9 commit 698b458
Show file tree
Hide file tree
Showing 3 changed files with 906 additions and 9 deletions.
17 changes: 9 additions & 8 deletions examples/LangChain/LangChain.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Milvus } from 'langchain/vectorstores/milvus';
import { OpenAIEmbeddings } from 'langchain/embeddings/openai';

const address = `localhost:19530`; // or your zilliz cloud endpoint
const username = `username`;
const password = `password`;
const address = `localhot:19530`; // or your zilliz cloud endpoint
const ssl = false; // set it to true if you are using zilliz cloud
const openAIApiKey = `openAiApiKey`;
const token = 'username:passowrd or apikey'; // your zilliz cloud apikey or username:password

const openAIApiKey = ``;
const collectionName = 'books';

// text sample from Godel, Escher, Bach
Expand All @@ -29,10 +29,11 @@ const vectorStore = await Milvus.fromTexts(
{
collectionName,
vectorField: 'vectors',
url: address,
ssl,
username,
password,
clientConfig: {
address,
ssl,
token,
},
}
);

Expand Down
2 changes: 1 addition & 1 deletion examples/LangChain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"type": "module",
"dependencies": {
"@zilliz/milvus2-sdk-node": "^2.2.14",
"langchain": "^0.0.91"
"langchain": "^0.0.132"
}
}
Loading

0 comments on commit 698b458

Please sign in to comment.