diff --git a/src/app/components/website/MicrositeEditor.tsx b/src/app/components/website/MicrositeEditor.tsx index 296d220d..d744983f 100644 --- a/src/app/components/website/MicrositeEditor.tsx +++ b/src/app/components/website/MicrositeEditor.tsx @@ -14,7 +14,7 @@ function builderIframeSrc(): string { } function apiBaseUrlForChild(): string { - const base = import.meta.env.VITE_API_URL || "http://localhost:3001/api"; + const base = import.meta.env.VITE_API_URL || "http://localhost:3002/api"; return normalizeBaseUrl(base); } diff --git a/src/app/components/whatsapp-chatbot/WhatsAppChatbotsPage.tsx b/src/app/components/whatsapp-chatbot/WhatsAppChatbotsPage.tsx index b5063b31..cc229a2c 100644 --- a/src/app/components/whatsapp-chatbot/WhatsAppChatbotsPage.tsx +++ b/src/app/components/whatsapp-chatbot/WhatsAppChatbotsPage.tsx @@ -141,7 +141,11 @@ export function WhatsAppChatbotsPage() { greeting: bot.greeting, registration: bot.registration, knowledge: bot.knowledge - ? { includeEventDetails: bot.knowledge.includeEventDetails } + ? { + includeEventDetails: bot.knowledge.includeEventDetails, + includeFoodRecommendations: bot.knowledge.includeFoodRecommendations, + includePlacesRecommendations: bot.knowledge.includePlacesRecommendations, + } : undefined, }); if (res.error) { @@ -211,6 +215,20 @@ export function WhatsAppChatbotsPage() { await loadBot(bot._id); }; + const handleSyncFood = async () => { + if (!bot) return; + await conciergeBotsApi.syncFoodKnowledge(bot._id); + setMsg("Food recommendations sync queued"); + await loadBot(bot._id); + }; + + const handleSyncPlaces = async () => { + if (!bot) return; + await conciergeBotsApi.syncPlacesKnowledge(bot._id); + setMsg("Places recommendations sync queued"); + await loadBot(bot._id); + }; + const handleAddUrl = async () => { if (!bot || !urlInput || !urlName) return; await conciergeBotsApi.createSource(bot._id, { @@ -230,7 +248,7 @@ export function WhatsAppChatbotsPage() { const up = await uploadMediaFile(file, { eventId: eid, module: "concierge", - name: file.name, + //name: file.name, }); const key = up.s3Key; if (!key) { @@ -422,6 +440,33 @@ export function WhatsAppChatbotsPage() { /> Include event programme in knowledge base + + +
+ + diff --git a/src/services/api/client.ts b/src/services/api/client.ts index f7ac6a7e..ee625a3a 100644 --- a/src/services/api/client.ts +++ b/src/services/api/client.ts @@ -16,7 +16,7 @@ import { export type { ApiRequestInit }; -export const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001/api'; +export const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:3002/api'; const BASE_URL = API_BASE_URL; const STORAGE_KEYS = { diff --git a/src/services/api/conciergeBots.ts b/src/services/api/conciergeBots.ts index f510b73d..288fb3be 100644 --- a/src/services/api/conciergeBots.ts +++ b/src/services/api/conciergeBots.ts @@ -14,7 +14,11 @@ export interface ConciergeBotRegistration { export interface ConciergeBotKnowledge { includeEventDetails?: boolean; + includeFoodRecommendations?: boolean; + includePlacesRecommendations?: boolean; lastEventSnapshotAt?: string; + lastFoodSnapshotAt?: string; + lastPlacesSnapshotAt?: string; } export interface ConciergeBotRecord { @@ -45,7 +49,7 @@ export interface KnowledgeSourceCrawlStats { export interface KnowledgeSourceRecord { _id: string; eventId: string; - type: 'url' | 'pdf' | 'event'; + type: 'url' | 'pdf' | 'event' | 'food' | 'places'; sourcePath: string; displayName: string; status: 'PENDING' | 'PROCESSING' | 'READY' | 'FAILED'; @@ -63,6 +67,12 @@ export interface ContextChunkRecord { sourceId: string; } +export interface Event { + _id: string; + name?: string; + [k: string]: any; +} + export const conciergeBotsApi = { list(params?: { organization?: string }) { const sp = new URLSearchParams(); @@ -162,4 +172,12 @@ export const conciergeBotsApi = { syncEventKnowledge(botId: string) { return api.post(`/concierge-bots/${botId}/knowledge/sync-event`, {}); }, + + syncFoodKnowledge(botId: string) { + return api.post(`/concierge-bots/${botId}/knowledge/food-sync`, {}); + }, + + syncPlacesKnowledge(botId: string) { + return api.post(`/concierge-bots/${botId}/knowledge/places-sync`, {}); + }, };