Skip to content

Commit 052b300

Browse files
authored
bring link back (#312)
1 parent 3f6056b commit 052b300

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

web/src/components/common/Markdown.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,7 @@ function extractLastQueryFromMessages(messages: any[], currentMessageIndex: numb
523523
try {
524524
const args = JSON.parse(toolCall.function.arguments);
525525
if (args.sql) {
526-
// Use the same logic as in the controller to process SQL + CTEs
527-
const ctes: [string, string][] = args._ctes || args.ctes || [];
528-
529-
let lastSQL = processSQLWithCtesOrModels(args.sql, ctes);
530-
const allModels: MetabaseModel[] = toolContext?.dbInfo?.models || []
531-
lastSQL = replaceLLMFriendlyIdentifiersInSqlWithModels(lastSQL, allModels)
532-
return {query: lastSQL, queryType: 'sql'};
526+
return {query: args.sql, queryType: 'sql'};
533527
}
534528
} catch (e) {
535529
// Ignore parsing errors
@@ -579,7 +573,6 @@ export function Markdown({content, messageIndex}: {content: string, messageIndex
579573
let lastQuery = messageIndex !== undefined
580574
? extractLastQueryFromMessages(currentThread?.messages || [], messageIndex, toolContext)
581575
: null;
582-
583576
if (lastQuery) {
584577
// Get current database ID from app state
585578
const databaseId = toolContext?.dbId || null;

0 commit comments

Comments
 (0)