Skip to content

Commit 0a69fe0

Browse files
authored
fix: missing params when init Astra vectorstore (#373)
1 parent de88b32 commit 0a69fe0

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.changeset/forty-pillows-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-llama": patch
3+
---
4+
5+
fix: missing params when init Astra vectorstore

templates/components/vectordbs/typescript/astra/generate.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ async function loadAndIndex() {
1414

1515
// create vector store and a collection
1616
const collectionName = process.env.ASTRA_DB_COLLECTION!;
17-
const vectorStore = new AstraDBVectorStore();
17+
const vectorStore = new AstraDBVectorStore({
18+
params: {
19+
endpoint: process.env.ASTRA_DB_ENDPOINT!,
20+
token: process.env.ASTRA_DB_APPLICATION_TOKEN!,
21+
},
22+
});
1823
await vectorStore.createAndConnect(collectionName, {
1924
vector: {
2025
dimension: parseInt(process.env.EMBEDDING_DIM!),

templates/components/vectordbs/typescript/astra/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import { checkRequiredEnvVars } from "./shared";
55

66
export async function getDataSource(params?: any) {
77
checkRequiredEnvVars();
8-
const store = new AstraDBVectorStore();
8+
const store = new AstraDBVectorStore({
9+
params: {
10+
endpoint: process.env.ASTRA_DB_ENDPOINT!,
11+
token: process.env.ASTRA_DB_APPLICATION_TOKEN!,
12+
},
13+
});
914
await store.connect(process.env.ASTRA_DB_COLLECTION!);
1015
return await VectorStoreIndex.fromVectorStore(store);
1116
}

templates/types/streaming/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dotenv": "^16.3.1",
2222
"duck-duck-scrape": "^2.2.5",
2323
"express": "^4.18.2",
24-
"llamaindex": "0.6.19",
24+
"llamaindex": "0.6.21",
2525
"pdf2json": "3.0.5",
2626
"ajv": "^8.12.0",
2727
"@e2b/code-interpreter": "0.0.9-beta.3",

templates/types/streaming/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"duck-duck-scrape": "^2.2.5",
2828
"formdata-node": "^6.0.3",
2929
"got": "^14.4.1",
30-
"llamaindex": "0.6.19",
30+
"llamaindex": "0.6.21",
3131
"lucide-react": "^0.294.0",
3232
"next": "^14.2.4",
3333
"react": "^18.2.0",

0 commit comments

Comments
 (0)