-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
29 lines (22 loc) · 920 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Docs2Vector from './lib/Docs2Vector.js';
import dotenv from 'dotenv';
// Load environment variables
dotenv.config();
async function main() {
try {
// Step 1: Define the GitHub repository URL
const githubRepoUrl = 'https://github.com/upstash/docs2vector';
// Print start message
console.log(`Starting processing for the repository: ${githubRepoUrl}`);
// Step 2: Initialize the Docs2Vector SDK
const converter = new Docs2Vector();
// Step 3: Run the processing flow with Docs2Vector's `run` method
await converter.run(githubRepoUrl);
// Print success message
console.log(`Successfully processed repository: ${githubRepoUrl}`);
console.log('Vectors stored in Upstash Vector database.');
} catch (error) {
console.error('An error occurred while processing the repository:', error.message);
}
}
main();