diff --git a/.env.example b/.env.example index 6b2b73d..a04e9a0 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,3 @@ +# Moltbot / Clawdbot Service URL +# Defaults to https://clawdbot.svc.plus if not set MOLTBOT_SERVICE_URL=https://clawdbot.svc.plus diff --git a/src/app/components/insight/ai/Assistant.tsx b/src/app/components/insight/ai/Assistant.tsx index 1516394..f85525d 100644 --- a/src/app/components/insight/ai/Assistant.tsx +++ b/src/app/components/insight/ai/Assistant.tsx @@ -55,7 +55,7 @@ export function AIAssistant({ state }: AssistantProps) { // For now, we prepend it to the prompt to ensure the bot knows the current view context const contextAwarePrompt = `Context: [${contextSummary}]\n\nQuestion: ${prompt}` - const response = await fetch('https://clawdbot.svc.plus/chat', { + const response = await fetch('/api/moltbot/chat', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -184,8 +184,8 @@ export function AIAssistant({ state }: AssistantProps) {
diff --git a/src/app/services/moltbot/chats/MoltbotChat.tsx b/src/app/services/moltbot/chats/MoltbotChat.tsx index a1384d3..569bf88 100644 --- a/src/app/services/moltbot/chats/MoltbotChat.tsx +++ b/src/app/services/moltbot/chats/MoltbotChat.tsx @@ -38,17 +38,6 @@ export function MoltbotChat() { setLoading(true) try { - // Optimistic UI update or wait for stream? - // Let's assume simple fetch for now based on user request "打通 https://clawdbot.svc.plus/chat" - // If it's a chat interface, it might be streaming, but let's start with fetch. - // Actually, if it's "https://clawdbot.svc.plus/chat", that might be a *page* URL, not an API URL. - // The user said "打通 https://clawdbot.svc.plus/chat", which implies connecting TO it. - // If it's a browser page, maybe they want an iframe? - // But the previous instructions said "AskAI 按钮简单的UI不变", implying native UI. - // Let's assume there is an API endpoint. If not, I might need to clarify. - // PROXY: request to /api/moltbot/chat which proxies to clawdbot.svc.plus? - // Let's try to fetch directly first, or map to a structured request. - // Use internal proxy to handle CORS and auth const response = await fetch('/api/moltbot/chat', { method: 'POST', @@ -97,7 +86,7 @@ export function MoltbotChat() {
Moltbot AI
+Clawdbot AI
Your personal cloud assistant.
Ask me anything about your infrastructure, logs, or just say hello.