diff --git a/packages/ai/src/tools/visualization-tools/create-dashboards-tool/create-dashboards-execute.ts b/packages/ai/src/tools/visualization-tools/create-dashboards-tool/create-dashboards-execute.ts index ce38d17da..d7f53a142 100644 --- a/packages/ai/src/tools/visualization-tools/create-dashboards-tool/create-dashboards-execute.ts +++ b/packages/ai/src/tools/visualization-tools/create-dashboards-tool/create-dashboards-execute.ts @@ -6,9 +6,9 @@ import { metricFiles, metricFilesToDashboardFiles, } from '@buster/database'; +import type { ModelMessage } from 'ai'; import { wrapTraced } from 'braintrust'; import { inArray } from 'drizzle-orm'; -import type { ModelMessage } from 'ai'; import * as yaml from 'yaml'; import { z } from 'zod'; import { trackFileAssociations } from '../file-tracking-helper'; diff --git a/packages/ai/src/tools/visualization-tools/create-dashboards-tool/helpers/create-dashboards-tool-transform-helper.ts b/packages/ai/src/tools/visualization-tools/create-dashboards-tool/helpers/create-dashboards-tool-transform-helper.ts index a4fab8139..16fde7ca9 100644 --- a/packages/ai/src/tools/visualization-tools/create-dashboards-tool/helpers/create-dashboards-tool-transform-helper.ts +++ b/packages/ai/src/tools/visualization-tools/create-dashboards-tool/helpers/create-dashboards-tool-transform-helper.ts @@ -34,11 +34,11 @@ export function createDashboardsReasoningMessage( id: fileId, file_type: 'dashboard', file_name: file.name, - version_number: file.version || undefined, status: file.status || 'loading', file: { text: file.yml_content, }, + ...(file.version !== undefined ? { version_number: file.version } : {}), ...(file.error && { error: file.error }), }; });