File tree 2 files changed +12
-2
lines changed
templates/components/vectordbs/typescript/astra
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ async function loadAndIndex() {
14
14
15
15
// create vector store and a collection
16
16
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
+ } ) ;
18
23
await vectorStore . createAndConnect ( collectionName , {
19
24
vector : {
20
25
dimension : parseInt ( process . env . EMBEDDING_DIM ! ) ,
Original file line number Diff line number Diff line change @@ -5,7 +5,12 @@ import { checkRequiredEnvVars } from "./shared";
5
5
6
6
export async function getDataSource ( params ?: any ) {
7
7
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
+ } ) ;
9
14
await store . connect ( process . env . ASTRA_DB_COLLECTION ! ) ;
10
15
return await VectorStoreIndex . fromVectorStore ( store ) ;
11
16
}
You can’t perform that action at this time.
0 commit comments