Full-stack GraphRAG chatbot for HP marketing materials with: - Python/Flask backend with custom ReAct agent (LlamaIndex) - Neo4j knowledge graph + vector search hybrid retrieval - LlamaParse multimodal document processing (text + images) - React/Vite frontend with conversation management - MongoDB conversation persistence - MSAL authentication support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
124 lines
3.9 KiB
JavaScript
124 lines
3.9 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const baseUrl = mode === 'production' ? '/hp_chatbot/' : '/';
|
|
|
|
// Create a replace plugin to ensure all '/hp_back' gets replaced with the full URL
|
|
const replaceBackendUrl = {
|
|
name: 'replace-backend-url',
|
|
transform(src, id) {
|
|
if (id.endsWith('.js') || id.endsWith('.jsx')) {
|
|
return {
|
|
code: src.replace(/['"]\/hp_back['"]/g, '"https://ai-sandbox.oliver.solutions/hp_back_v2"'),
|
|
map: null
|
|
};
|
|
}
|
|
}
|
|
};
|
|
|
|
return {
|
|
plugins: [react(), replaceBackendUrl],
|
|
base: baseUrl,
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
// New MongoDB conversation endpoints
|
|
'/conversations': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/conversations/new': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
|
|
// Original endpoints
|
|
'/chat': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/status': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/initialize': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/reset': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/download-brief': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/init-chunked-upload': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/upload-chunk': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/finalize-upload': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/upload-small-file': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/initialize-from-uploads': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/images': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/list-images': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
},
|
|
'/capture-screenshot': {
|
|
target: 'https://ai-sandbox.oliver.solutions/hp_back_v2',
|
|
changeOrigin: true,
|
|
secure: true,
|
|
timeout: 300000 // 5 minutes timeout
|
|
}
|
|
}
|
|
}
|
|
};
|
|
})
|
|
|