Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj committed Mar 15, 2024
1 parent 653af4c commit 27db0ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
14 changes: 8 additions & 6 deletions helpers/env-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,22 @@ const getVectorDBEnvs = (vectorDb: TemplateVectorDB) => {
name: "MILVUS_ADDRESS",
description:
"The address of the Milvus server. Eg: http://localhost:19530",
value: "http://localhost:19530",
},
{
name: "MILVUS_USER",
name: "MILVUS_COLLECTION",
description:
"The name of the Milvus collection to store the vectors.",
value: "llamacollection",
},
{
name: "MILVUS_USERNAME",
description: "The username to access the Milvus server.",
},
{
name: "MILVUS_PASSWORD",
description: "The password to access the Milvus server.",
},
{
name: "MILVUS_COLLECTION",
description:
"The name of the Milvus collection to store the vectors. Default is 'llamacollection' if not specified.",
},
];
default:
return [];
Expand Down
7 changes: 0 additions & 7 deletions helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,6 @@ export const installTSTemplate = async ({
};
}

if (vectorDb === "milvus") {
packageJson.dependencies = {
...packageJson.dependencies,
"@zilliz/milvus2-sdk-node": "^2.3.5",
};
}

if (observability === "opentelemetry") {
packageJson.dependencies = {
...packageJson.dependencies,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ async function loadAndIndex() {
// Connect to Milvus
const milvusClient = getMilvusClient();
const vectorStore = new MilvusVectorStore({ milvusClient });
await vectorStore.connect();

// now create an index from all the Documents and store them in Milvus
const storageContext = await storageContextFromDefaults({ vectorStore });
Expand Down
1 change: 0 additions & 1 deletion templates/components/vectordbs/typescript/milvus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ async function getDataSource(llm: LLM) {
});
const milvusClient = getMilvusClient();
const store = new MilvusVectorStore({ milvusClient });
await store.connect();

return await VectorStoreIndex.fromVectorStore(store, serviceContext);
}
Expand Down

0 comments on commit 27db0ae

Please sign in to comment.