Skip to content

Commit

Permalink
chore: bump version to 0.70.1-alpha.0 - add playground
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlynn committed Feb 17, 2025
1 parent a169767 commit ab86f2e
Show file tree
Hide file tree
Showing 53 changed files with 4,305 additions and 1,622 deletions.
4 changes: 0 additions & 4 deletions .babel.rc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package-lock.json
.mongodb-rag.json.bak
.mongodb-rag.json
.DS_Store
build-scripts/
# Logs
logs/
*.log
Expand Down
15 changes: 6 additions & 9 deletions bin/commands/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@ export async function init(configPath) {
// Get MongoDB configuration
const mongoConfig = await promptForMongoConfig();

// Get provider configuration - this now returns the complete embedding config
// Get provider configuration
const embeddingConfig = await promptForProviderConfig();

// Build configuration object in the correct format
// Build configuration object
const config = {
mongoUrl: mongoConfig.mongoUrl,
database: mongoConfig.database,
collection: mongoConfig.collection,
...mongoConfig,
embedding: {
provider: embeddingConfig.provider,
apiKey: embeddingConfig.apiKey,
model: embeddingConfig.model,
dimensions: embeddingConfig.dimensions,
batchSize: 100,
...(embeddingConfig.baseUrl && { baseUrl: embeddingConfig.baseUrl })
baseUrl: embeddingConfig.baseUrl,
batchSize: 100
},
search: {
maxResults: 5,
Expand All @@ -51,4 +48,4 @@ export async function init(configPath) {
}

return config;
}
}
9 changes: 9 additions & 0 deletions bin/mongodb-rag.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import chalk from 'chalk';
import { startPlayground } from '../src/cli/playground.js';
import {
createIndex,
showIndexes,
Expand Down Expand Up @@ -202,5 +203,13 @@ program.on('command:*', () => {
process.exit(1);
});

program
.command('playground')
.description('Launch the MongoDB-RAG playground')
.action(() => {
console.log("Starting MongoDB-RAG Playground...");
startPlayground();
});

// Parse command line arguments
program.parse();
5 changes: 5 additions & 0 deletions jest-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
transform: {},
extensionsToTreatAsEsm: ['.js'],
testEnvironment: 'node',
};
29 changes: 0 additions & 29 deletions jest-config.mjs

This file was deleted.

9 changes: 9 additions & 0 deletions jest-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// jest-setup.js
const { TextEncoder, TextDecoder } = require('util');
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;

// Silence console output during tests
console.log = jest.fn();
console.error = jest.fn();
console.warn = jest.fn();
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
},
"description": "RAG (Retrieval Augmented Generation) library for MongoDB Vector Search",
"type": "module",
"jest": {
"transform": {}
},
"main": "src/index.js",
"bin": {
"mongodb-rag": "./bin/mongodb-rag.js"
Expand All @@ -21,10 +24,9 @@
"static"
],
"scripts": {
"test": "NODE_ENV=test node --experimental-vm-modules node_modules/.bin/jest --runInBand --verbose",
"test:watch": "node --experimental-vm-modules node_modules/.bin/jest --watch",
"test:coverage": "node --experimental-vm-modules node_modules/.bin/jest --coverage",
"lint": "eslint src",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"format": "prettier --write \"src/**/*.js\"",
"prepare": "husky install"
},
Expand All @@ -44,19 +46,22 @@
"chalk": "^5.4.1",
"columnify": "^1.6.0",
"commander": "^10.0.0",
"cors": "^2.8.5",
"debug": "^4.3.4",
"dotenv": "^16.0.3",
"dotenv": "^16.4.7",
"enquirer": "^2.4.1",
"execa": "^9.5.2",
"express": "^4.21.2",
"js-yaml": "^4.1.0",
"marked": "^15.0.7",
"mongodb": "^6.13.0",
"multer": "^1.4.5-lts.1",
"natural": "^8.0.1",
"pdf-lib": "^1.17.1"
"open": "^10.1.0",
"pdf-lib": "^1.17.1",
"socket.io": "^4.8.1"
},
"devDependencies": {
"@babel/preset-env": "^7.26.8",
"@jest/globals": "^29.7.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^8.0.3",
Expand Down
Loading

0 comments on commit ab86f2e

Please sign in to comment.