diff --git a/.changeset/forty-pillows-clean.md b/.changeset/forty-pillows-clean.md new file mode 100644 index 0000000000000000000000000000000000000000..4be3cfde74fb7970be63a757a2f0173dcc605f9c --- /dev/null +++ b/.changeset/forty-pillows-clean.md @@ -0,0 +1,5 @@ +--- +"create-llama": patch +--- + +fix: missing params when init Astra vectorstore diff --git a/templates/components/vectordbs/typescript/astra/generate.ts b/templates/components/vectordbs/typescript/astra/generate.ts index f66657b529091afb5e9329646cac26f918b4b783..b78a3b1d75d2c7b5a443d98c0894dfc13d2b8ccb 100644 --- a/templates/components/vectordbs/typescript/astra/generate.ts +++ b/templates/components/vectordbs/typescript/astra/generate.ts @@ -14,7 +14,12 @@ async function loadAndIndex() { // create vector store and a collection const collectionName = process.env.ASTRA_DB_COLLECTION!; - const vectorStore = new AstraDBVectorStore(); + const vectorStore = new AstraDBVectorStore({ + params: { + endpoint: process.env.ASTRA_DB_ENDPOINT!, + token: process.env.ASTRA_DB_APPLICATION_TOKEN!, + }, + }); await vectorStore.createAndConnect(collectionName, { vector: { dimension: parseInt(process.env.EMBEDDING_DIM!), diff --git a/templates/components/vectordbs/typescript/astra/index.ts b/templates/components/vectordbs/typescript/astra/index.ts index 4ee66ade122d3636dc9a8bb19dfa71aac3ce1e4c..b113523af484630632bc758b8f7833e08b351447 100644 --- a/templates/components/vectordbs/typescript/astra/index.ts +++ b/templates/components/vectordbs/typescript/astra/index.ts @@ -5,7 +5,12 @@ import { checkRequiredEnvVars } from "./shared"; export async function getDataSource(params?: any) { checkRequiredEnvVars(); - const store = new AstraDBVectorStore(); + const store = new AstraDBVectorStore({ + params: { + endpoint: process.env.ASTRA_DB_ENDPOINT!, + token: process.env.ASTRA_DB_APPLICATION_TOKEN!, + }, + }); await store.connect(process.env.ASTRA_DB_COLLECTION!); return await VectorStoreIndex.fromVectorStore(store); } diff --git a/templates/types/streaming/express/package.json b/templates/types/streaming/express/package.json index f7cea6f0afa82c3b78c9f9d25fbd11cc82522cc6..be18e8e687727595d1eb804c1897b707904ba6ef 100644 --- a/templates/types/streaming/express/package.json +++ b/templates/types/streaming/express/package.json @@ -21,7 +21,7 @@ "dotenv": "^16.3.1", "duck-duck-scrape": "^2.2.5", "express": "^4.18.2", - "llamaindex": "0.6.19", + "llamaindex": "0.6.21", "pdf2json": "3.0.5", "ajv": "^8.12.0", "@e2b/code-interpreter": "0.0.9-beta.3", diff --git a/templates/types/streaming/nextjs/package.json b/templates/types/streaming/nextjs/package.json index c8f694edb83071989f567096912e1184f2f3dd20..3f8ad57e8d774bc14160d83179e7d95653cac5cb 100644 --- a/templates/types/streaming/nextjs/package.json +++ b/templates/types/streaming/nextjs/package.json @@ -27,7 +27,7 @@ "duck-duck-scrape": "^2.2.5", "formdata-node": "^6.0.3", "got": "^14.4.1", - "llamaindex": "0.6.19", + "llamaindex": "0.6.21", "lucide-react": "^0.294.0", "next": "^14.2.4", "react": "^18.2.0",