mirror of https://github.com/buster-so/buster.git
fix: clean up imports and enhance dashboard file handling
- Removed duplicate import of ModelMessage in create-dashboards-execute.ts for clarity. - Updated createDashboardsReasoningMessage function to conditionally include version_number only if defined, improving the handling of dashboard file properties. All changes aim to streamline the code and enhance maintainability.
This commit is contained in:
parent
c08fdbc30f
commit
1b70c6e2b3
|
@ -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';
|
||||
|
|
|
@ -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 }),
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue