From d39799aea9805b88c5b7fbe719986edfe05e8d2b Mon Sep 17 00:00:00 2001 From: Developing-Gamer Date: Tue, 14 Jul 2026 11:14:28 -0700 Subject: [PATCH] Revert "Add analytics table filter chat adapter." This reverts commit 42a2cddc0606030aa1dd3c31bf68275d5d73c034. --- .../components/vibe-coding/chat-adapters.ts | 18 ++---------------- .../src/components/vibe-coding/index.ts | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/apps/dashboard/src/components/vibe-coding/chat-adapters.ts b/apps/dashboard/src/components/vibe-coding/chat-adapters.ts index 24e383c91..dc4af39a8 100644 --- a/apps/dashboard/src/components/vibe-coding/chat-adapters.ts +++ b/apps/dashboard/src/components/vibe-coding/chat-adapters.ts @@ -108,35 +108,21 @@ export function createChatAdapter( }); } -/** - * Chat adapter for the analytics table search bar's AI fallback. Uses the - * `filter-analytics-table` system prompt, which constrains the AI to row - * filters of the shape `SELECT * FROM WHERE ...` so the grid's - * columns never change. The table being viewed is injected as a leading - * context exchange, mirroring the source-context pattern in - * `createChatAdapter` above. - */ -export function createAnalyticsTableFilterChatAdapter( +export function createAnalyticsQueryChatAdapter( backendBaseUrl: string, currentUser: CurrentUser | undefined, projectId: string | undefined, - tableName: string, onError?: (error: Error) => void, ): ChatModelAdapter { return createUnifiedAiChatAdapter({ backendBaseUrl, currentUser, - systemPrompt: "filter-analytics-table", + systemPrompt: "build-analytics-query", tools: ["sql-query"], quality: "smart", speed: "fast", projectId, sanitizeContent: sanitizeAiContent, - transformMessages: (messages) => [ - { role: "user", content: `The table I'm viewing is \`${tableName}\`.` }, - { role: "assistant", content: `Got it — I'll only generate row filters of the form SELECT * FROM ${tableName} WHERE ... so the grid's columns stay the same.` }, - ...messages, - ], onError: () => { const wrapped = new Error("Failed to get AI response. Please try again."); onError?.(wrapped); diff --git a/apps/dashboard/src/components/vibe-coding/index.ts b/apps/dashboard/src/components/vibe-coding/index.ts index 48ec3b69c..bf911ccf3 100644 --- a/apps/dashboard/src/components/vibe-coding/index.ts +++ b/apps/dashboard/src/components/vibe-coding/index.ts @@ -1,5 +1,5 @@ export { default as AssistantChat, type AssistantComposerApi } from './assistant-chat'; -export { createAnalyticsTableFilterChatAdapter, createChatAdapter, createDashboardChatAdapter, createHistoryAdapter } from './chat-adapters'; +export { createAnalyticsQueryChatAdapter, createChatAdapter, createDashboardChatAdapter, createHistoryAdapter } from './chat-adapters'; export { default as CodeEditor } from './code-editor'; export { default as VibeCodeLayout, type ViewportMode, type WysiwygDebugInfo } from './vibe-code-layout';