Skip to content

Commit 44fa4c0

Browse files
committed
respect user config for using sample docs on gen ai
1 parent 8f9aaf9 commit 44fa4c0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/compass-collection/src/modules/collection-tab.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,11 @@ export const analyzeCollectionSchema = (): CollectionThunkAction<
566566
export const generateFakerMappings = (
567567
connectionInfo: ConnectionInfo
568568
): CollectionThunkAction<Promise<void>> => {
569-
return async (dispatch, getState, { logger, atlasAiService }) => {
569+
return async (
570+
dispatch,
571+
getState,
572+
{ logger, atlasAiService, preferences }
573+
) => {
570574
const { schemaAnalysis, fakerSchemaGeneration, namespace } = getState();
571575
if (schemaAnalysis.status !== SCHEMA_ANALYSIS_STATE_COMPLETE) {
572576
logger.log.error(
@@ -584,6 +588,10 @@ export const generateFakerMappings = (
584588
return;
585589
}
586590

591+
const includeSampleValues = (
592+
await preferences.getConfigurableUserPreferences()
593+
).enableGenAISampleDocumentPassing;
594+
587595
// todo: dedup/abort requests using requestId (CLOUDP-333850)
588596
const requestId = new UUID().toString();
589597

@@ -602,8 +610,7 @@ export const generateFakerMappings = (
602610
collectionName: collection,
603611
schema: schemaAnalysis.processedSchema,
604612
validationRules: schemaAnalysis.schemaMetadata.validationRules,
605-
// todo: set T/F depending on user setting for "Sending Sample Field Values in DE Gen AI Features"
606-
includeSampleValues: true,
613+
includeSampleValues,
607614
};
608615

609616
const response = await atlasAiService.getMockDataSchema(

0 commit comments

Comments
 (0)