@@ -12,9 +12,10 @@ import type { AtlasAiService } from '@mongodb-js/compass-generative-ai/provider'
1212import type { experimentationServiceLocator } from '@mongodb-js/compass-telemetry/provider' ;
1313import { type Logger , mongoLogId } from '@mongodb-js/compass-logging/provider' ;
1414import { type PreferencesAccess } from 'compass-preferences-model/provider' ;
15- import {
16- type MockDataSchemaRequest ,
17- type MockDataSchemaResponse ,
15+ import type {
16+ MockDataSchemaRequest ,
17+ MockDataSchemaResponse ,
18+ MockDataSchemaRawField ,
1819} from '@mongodb-js/compass-generative-ai' ;
1920import { isInternalFieldPath } from 'hadron-document' ;
2021import toNS from 'mongodb-ns' ;
@@ -595,27 +596,12 @@ export const generateFakerMappings = (
595596 requestId : requestId ,
596597 } ) ;
597598
598- // Convert FieldInfo objects to MockDataSchemaRawField format
599- const schema : Record <
600- string ,
601- { type : string ; sampleValues ?: unknown [ ] ; probability ?: number }
602- > = { } ;
603- for ( const [ fieldName , fieldInfo ] of Object . entries (
604- schemaAnalysis . processedSchema
605- ) ) {
606- schema [ fieldName ] = {
607- type : fieldInfo . type ,
608- sampleValues : fieldInfo . sample_values ,
609- probability : fieldInfo . probability ,
610- } ;
611- }
612-
613599 const mockDataSchemaRequest : MockDataSchemaRequest = {
614600 databaseName : database ,
615601 collectionName : collection ,
616- schema : schema ,
602+ schema : schemaAnalysis . processedSchema ,
617603 validationRules : schemaAnalysis . schemaMetadata . validationRules ,
618- // todo
604+ // todo: set T/F depending on user setting for "Sending Sample Field Values in DE Gen AI Features"
619605 includeSampleValues : true ,
620606 } ;
621607
0 commit comments