Skip to content

Commit c27aad3

Browse files
TheSonOfThomptsck
andcommitted
Chat bot server to Azure (#2850)
* feat(ui): initialize chatbot UI with React and Vite (#2841) * feat(ui): initialize chatbot UI with React and Vite - Added package.json for UI package with scripts and dependencies. - Created App.css for styling the main application layout. - Implemented App.tsx as the main component integrating the MongoDB Chatbot UI. - Added a React SVG asset for branding. - Created index.css for global styles and theming. - Set up main.tsx as the entry point for the React application. - Added vite-env.d.ts for Vite type definitions. - Configured TypeScript with tsconfig.json and tsconfig.node.json for the UI package. - Created vite.config.ts for Vite configuration with React plugin. * fix: update license to Apache-2.0 and refactor import statements for consistency * feat(ui): initialize chatbot UI with React and Vite - Added package.json for UI package with scripts and dependencies. - Created App.css for styling the main application layout. - Implemented App.tsx as the main component integrating the MongoDB Chatbot UI. - Added a React SVG asset for branding. - Created index.css for global styles and theming. - Set up main.tsx as the entry point for the React application. - Added vite-env.d.ts for Vite type definitions. - Configured TypeScript with tsconfig.json and tsconfig.node.json for the UI package. - Created vite.config.ts for Vite configuration with React plugin. * fix: update license to Apache-2.0 and refactor import statements for consistency * feat(ingest): add initial configuration and data sources for chatbot ingestion * update configs * feat(ingest): implement data sources for LeafyGreen UI and MongoDB Chatbot Framework * chore: update pnpm workspace configuration to include 'apps/*' directory * feat(ingest): add data sources for LeafyGreen UI and MongoDB Chatbot Framework, and refactor Azure OpenAI embedder * feat(ingest): add MongoDB Design website data source and integrate into ingest configuration * Delete package-lock.json * reset ui * feat(crawler): implement createWebSourceConstructor and update ingest configuration * Update ingest.config.ts * feat(crawler): replace createWebSourceConstructor with webSourceConstructor and update data sources * fix(crawler): handle invalid URLs in newURL and recursive crawl logic * mv ui & server * Refactor code structure for improved readability and maintainability * feat(ingest): add UMD configuration and update TypeScript settings * Updates package config * feat(chatbot): integrate Azure OpenAI services and update environment variable loading * feat(chatbot): refactor chatbot initialization and update server configuration * fix: update ingest script path and improve TypeScript configuration * feat(ingest): refactor Azure OpenAI embedder integration and remove unused constructor * fix: update mongodb-chatbot-server and mongodb-rag-core dependencies to latest versions * Squashed commit of the following: commit 3eec08f Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri May 9 10:46:31 2025 -0400 Ingest with recursive crawler (#2849) * feat(ui): initialize chatbot UI with React and Vite (#2841) * feat(ui): initialize chatbot UI with React and Vite - Added package.json for UI package with scripts and dependencies. - Created App.css for styling the main application layout. - Implemented App.tsx as the main component integrating the MongoDB Chatbot UI. - Added a React SVG asset for branding. - Created index.css for global styles and theming. - Set up main.tsx as the entry point for the React application. - Added vite-env.d.ts for Vite type definitions. - Configured TypeScript with tsconfig.json and tsconfig.node.json for the UI package. - Created vite.config.ts for Vite configuration with React plugin. * fix: update license to Apache-2.0 and refactor import statements for consistency * feat(ui): initialize chatbot UI with React and Vite - Added package.json for UI package with scripts and dependencies. - Created App.css for styling the main application layout. - Implemented App.tsx as the main component integrating the MongoDB Chatbot UI. - Added a React SVG asset for branding. - Created index.css for global styles and theming. - Set up main.tsx as the entry point for the React application. - Added vite-env.d.ts for Vite type definitions. - Configured TypeScript with tsconfig.json and tsconfig.node.json for the UI package. - Created vite.config.ts for Vite configuration with React plugin. * fix: update license to Apache-2.0 and refactor import statements for consistency * feat(ingest): add initial configuration and data sources for chatbot ingestion * update configs * feat(ingest): implement data sources for LeafyGreen UI and MongoDB Chatbot Framework * chore: update pnpm workspace configuration to include 'apps/*' directory * feat(ingest): add data sources for LeafyGreen UI and MongoDB Chatbot Framework, and refactor Azure OpenAI embedder * feat(ingest): add MongoDB Design website data source and integrate into ingest configuration * Delete package-lock.json * reset ui * feat(crawler): export LoadedPageContents and ProcessSingleUrl interfaces * feat(crawler): refactor crawling logic to use processLangchainDocument and update allowedDomains format * feat(crawler): update recursive crawl logic to process documents with processLangchainDocument * feat(crawler): update package.json exports and refactor lodash imports * feat(crawler): implement createWebSourceConstructor and update ingest configuration * Update ingest.config.ts * feat(crawler): replace createWebSourceConstructor with webSourceConstructor and update data sources * fix(crawler): handle invalid URLs in newURL and recursive crawl logic * Resolve tsconfig.json --------- Co-authored-by: Terrence Keane <terrence.keane@mongodb.com> * Delete webSourceConstructor.ts * Squashed commit of the following: commit 3eec08f Author: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com> Date: Fri May 9 10:46:31 2025 -0400 Ingest with recursive crawler (#2849) * feat(ui): initialize chatbot UI with React and Vite (#2841) * feat(ui): initialize chatbot UI with React and Vite - Added package.json for UI package with scripts and dependencies. - Created App.css for styling the main application layout. - Implemented App.tsx as the main component integrating the MongoDB Chatbot UI. - Added a React SVG asset for branding. - Created index.css for global styles and theming. - Set up main.tsx as the entry point for the React application. - Added vite-env.d.ts for Vite type definitions. - Configured TypeScript with tsconfig.json and tsconfig.node.json for the UI package. - Created vite.config.ts for Vite configuration with React plugin. * fix: update license to Apache-2.0 and refactor import statements for consistency * feat(ui): initialize chatbot UI with React and Vite - Added package.json for UI package with scripts and dependencies. - Created App.css for styling the main application layout. - Implemented App.tsx as the main component integrating the MongoDB Chatbot UI. - Added a React SVG asset for branding. - Created index.css for global styles and theming. - Set up main.tsx as the entry point for the React application. - Added vite-env.d.ts for Vite type definitions. - Configured TypeScript with tsconfig.json and tsconfig.node.json for the UI package. - Created vite.config.ts for Vite configuration with React plugin. * fix: update license to Apache-2.0 and refactor import statements for consistency * feat(ingest): add initial configuration and data sources for chatbot ingestion * update configs * feat(ingest): implement data sources for LeafyGreen UI and MongoDB Chatbot Framework * chore: update pnpm workspace configuration to include 'apps/*' directory * feat(ingest): add data sources for LeafyGreen UI and MongoDB Chatbot Framework, and refactor Azure OpenAI embedder * feat(ingest): add MongoDB Design website data source and integrate into ingest configuration * Delete package-lock.json * reset ui * feat(crawler): export LoadedPageContents and ProcessSingleUrl interfaces * feat(crawler): refactor crawling logic to use processLangchainDocument and update allowedDomains format * feat(crawler): update recursive crawl logic to process documents with processLangchainDocument * feat(crawler): update package.json exports and refactor lodash imports * feat(crawler): implement createWebSourceConstructor and update ingest configuration * Update ingest.config.ts * feat(crawler): replace createWebSourceConstructor with webSourceConstructor and update data sources * fix(crawler): handle invalid URLs in newURL and recursive crawl logic * Resolve tsconfig.json --------- Co-authored-by: Terrence Keane <terrence.keane@mongodb.com> --------- Co-authored-by: Terrence Keane <terrence.keane@mongodb.com>
1 parent e79e55f commit c27aad3

33 files changed

+328
-358
lines changed

apps/chatbot-server/.env.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
PORT=3030
2+
13
# MongoDB config
24
MONGODB_USER=<YOUR_MONGODB_USER>
35
MONGODB_PASSWORD=<YOUR_MONGODB_PASSWORD>
@@ -13,8 +15,8 @@ OPENAI_EMBEDDING_MODEL="text-embedding-ada-002" # or other model
1315
OPENAI_CHAT_COMPLETION_MODEL="gpt-3.5-turbo" # or other model
1416

1517
# Azure OpenAI config
16-
AZURE_API_KEY1=<YOUR_AZURE_API_KEY1>
17-
AZURE_API_KEY2=<YOUR_AZURE_API_KEY2>
18+
AZURE_OPENAI_API_KEY=<YOUR_AZURE_API_KEY1>
19+
AZURE_OPENAI_API_KEY=<YOUR_AZURE_API_KEY2>
1820
AZURE_OPENAI_ENDPOINT=https://<your-instance>.openai.azure.com/
1921
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
2022
AZURE_OPENAI_CHAT_COMPLETION_MODEL=gpt-3.5-turbo

apps/chatbot-server/ingest/tsconfig.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/chatbot-server/ingest/utils/createAzureEmbedderConstructor.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

apps/chatbot-server/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,27 @@
88
"access": "restricted"
99
},
1010
"scripts": {
11-
"build:ingest": "tsc -p ./ingest",
12-
"ingest": "pnpm build:ingest && ingest all --config ./dist/ingest.config.js",
13-
"dev": "npm run dev --workspace=server & npm run dev --workspace=ui"
11+
"build": "lg build-package",
12+
"tsc": "lg build-ts",
13+
"ingest": "pnpm build && ingest all --config ./dist/esm/ingest.config.js",
14+
"dev": "tsx src/index.ts"
1415
},
1516
"keywords": [],
1617
"author": "",
1718
"license": "Apache-2.0",
1819
"dependencies": {
1920
"@lg-tools/crawler": "workspace:^",
2021
"@emotion/css": "^11.13.5",
22+
"@lg-tools/crawler": "workspace:^",
2123
"dotenv": "^16.5.0",
22-
"jsdom": "^26.1.0"
24+
"express": "^4.18.2",
25+
"jsdom": "^26.1.0",
26+
"mongodb-chatbot-server": "^0.11.0",
27+
"mongodb-rag-core": "^0.7.0"
2328
},
2429
"devDependencies": {
25-
"mongodb-rag-core": "^0.6.3",
2630
"mongodb-rag-ingest": "^0.3.1",
31+
"nodemon": "^3.0.1",
2732
"tsx": "^4.19.4"
2833
}
2934
}

apps/chatbot-server/packages/server/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/chatbot-server/packages/server/package.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/chatbot-server/packages/server/src/index.ts

Lines changed: 0 additions & 164 deletions
This file was deleted.

apps/chatbot-server/packages/server/src/loadEnvVars.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

apps/chatbot-server/packages/server/tsconfig.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

apps/chatbot-server/packages/ui/tsconfig.node.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)