Skip to content
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

update langchain example #233

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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