Skip to content

Conversation

bharatkashyap
Copy link
Collaborator

@bharatkashyap bharatkashyap commented Jul 10, 2025

Summary

Refactored the gridDefaultPromptResolver function to use a structured options parameter, consolidating additionalContext and adding a new privateMode option

Context

The other option is to add a privateMode prop at the level of the component itself. However, the reason for not going ahead with that is disabling prompt retention has more to do with the API that is resolving prompts than the DataGrid component itself, so it should be scoped as an option to that level. As an example, the top level prop on the component would have no impact if the URL passed is not MUI's service for prompt resolution. In effect, disabling prompt retention is an option on our backend, so we should set it as a property on the API call to our backend. The component does not have to know if prompt retention is enabled or disabled.

Changes

  • BREAKING: Moved additionalContext parameter into options object
  • Added new privateMode option for privacy control
  • Updated function signature to use PromptResolverOptions parameter
  • Updated JSDoc documentation to reflect the new API structure
  • Modified request body to include the options object

Migration Guide

Before:

gridDefaultPromptResolver(
  url,
  query,
  context,
  conversationId,
  additionalContext  // Direct parameter
);

After:

gridDefaultPromptResolver(
  url,
  query,
  context,
  conversationId,
  {
    additionalContext: 'your context',  // Now in options object
    privateMode: true        // New option
  }
);

@bharatkashyap bharatkashyap added the type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. label Jul 10, 2025
@bharatkashyap bharatkashyap requested a review from arminmeh July 10, 2025 12:02
@mui-bot
Copy link

mui-bot commented Jul 10, 2025

Deploy preview: https://deploy-preview-18759--material-ui-x.netlify.app/

Updated pages:

Bundle size report

Total Size Change: 🔺+41B(0.00%) - Total Gzip Change: 🔺+18B(0.00%)
Files: 122 total (0 added, 0 removed, 1 changed)

Show details for 100 more bundles (22 more not shown)

@mui/x-data-grid-premiumparsed: 🔺+41B(+0.01%) gzip: 🔺+18B(+0.01%)
@mui/x-chartsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-proparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/BarChartProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/ChartContainerProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/ChartDataProviderProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/ChartsToolbarProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/ChartZoomSliderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/FunnelChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/Heatmapparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/LineChartProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/PieChartProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/RadarChartProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts-pro/ScatterChartProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/BarChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartContainerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartDataProviderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsAxisparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsAxisHighlightparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsClipPathparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsGridparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsLabelparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsLegendparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsLocalizationProviderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsOverlayparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsReferenceLineparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsSurfaceparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsTextparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsTooltipparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsXAxisparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ChartsYAxisparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/Gaugeparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/LineChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/PieChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/RadarChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/ScatterChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/SparkLineChartparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-charts/Toolbarparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-data-gridparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-data-grid-premium/DataGridPremiumparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-data-grid-proparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-data-grid-pro/DataGridProparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-data-grid/DataGridparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickersparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-proparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterDateFnsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterDateFnsJalaliparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterDayjsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterLuxonparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterMomentparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterMomentHijriparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/AdapterMomentJalaaliparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DateRangeCalendarparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DateRangePickerDayparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DateRangePickerDay2parsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DateTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DesktopDateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DesktopDateTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/DesktopTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/LocalizationProviderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/MobileDateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/MobileDateTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/MobileTimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/MultiInputDateRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/MultiInputDateTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/MultiInputTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/PickersRangeCalendarHeaderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/SingleInputDateRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/SingleInputDateTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/SingleInputTimeRangeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/StaticDateRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers-pro/TimeRangePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterDateFnsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterDateFnsBaseparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterDateFnsJalaliparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterDayjsparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterLuxonparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterMomentparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterMomentHijriparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/AdapterMomentJalaaliparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DateCalendarparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DateFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DatePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DateTimeFieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DateTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DayCalendarSkeletonparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DesktopDatePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DesktopDateTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DesktopTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/DigitalClockparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/LocalizationProviderparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/MobileDatePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/MobileDateTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/MobileTimePickerparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/MonthCalendarparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/MultiSectionDigitalClockparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/PickerDay2parsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/PickersActionBarparsed: 0B(0.00%) gzip: 0B(0.00%)
@mui/x-date-pickers/PickersCalendarHeaderparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 5d96230

@arminmeh arminmeh added the scope: data grid Changes related to the data grid. label Jul 11, 2025
@bharatkashyap bharatkashyap changed the title [aiAssistant] Add disablePromptRetention to prompt resolver [aiAssistant] Add privateMode to prompt resolver Jul 11, 2025
bharatkashyap and others added 5 commits July 11, 2025 01:16
Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Signed-off-by: Bharat Kashyap <bharatkashyap@outlook.com>
Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Signed-off-by: Bharat Kashyap <bharatkashyap@outlook.com>
…idAiAssistantInterfaces.ts

Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Signed-off-by: Bharat Kashyap <bharatkashyap@outlook.com>
…i.ts

Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Signed-off-by: Bharat Kashyap <bharatkashyap@outlook.com>
@arminmeh arminmeh changed the title [aiAssistant] Add privateMode to prompt resolver [DataGridPremium] Add privateMode to AI assistant prompt resolver Jul 11, 2025
@arminmeh arminmeh added the plan: Premium Impact at least one premium user. label Jul 11, 2025
@bharatkashyap
Copy link
Collaborator Author

@joserodolfofreitas Before merging this, wanted to highlight the breaking change on the promptResolver API so that it's flagged during the release

@joserodolfofreitas
Copy link
Member

@joserodolfofreitas Before merging this, wanted to highlight the breaking change on the promptResolver API so that it's flagged during the release

Isn't it an optional and additional prop? I think we can consider it non-breaking change, right?

@bharatkashyap
Copy link
Collaborator Author

bharatkashyap commented Jul 15, 2025

@joserodolfofreitas Before merging this, wanted to highlight the breaking change on the promptResolver API so that it's flagged during the release

Isn't it an optional and additional prop? I think we can consider it non-breaking change, right?

The new behaviour is that additionalContext moves from top level to inside the options parameter.

Before:

gridDefaultPromptResolver(
  url,
  query,
  context,
  conversationId,
  additionalContext  // Direct parameter
);

After:

gridDefaultPromptResolver(
  url,
  query,
  context,
  conversationId,
  {
    additionalContext: 'your context',  // Now in options object
    privateMode: true        // New option
  }
);

The backend will still support additionalContext as a top-level parameter for older versions, but for versions following this PR, they will have to move additionalContext into options

@bharatkashyap bharatkashyap mentioned this pull request Jul 17, 2025
14 tasks
@joserodolfofreitas
Copy link
Member

In theory, we can do the breaking change, since the feature is marked as unstable. But I'd be more comfortable if we could support both function signatures and effectively not do a breaking change. Is this possible @bharatkashyap?

@bharatkashyap
Copy link
Collaborator Author

In theory, we can do the breaking change, since the feature is marked as unstable. But I'd be more comfortable if we could support both function signatures and effectively not do a breaking change. Is this possible @bharatkashyap?

It is possible, but it has the potential to introduce messy code in the backend where we're testing for the last parameter being either a string or an object, and in the frontend types, allowing both a string or an object as the last parameter.

In general, this change is inevitable: we're going to most likely introduce more options, so we do need to introduce a general options object in this signature. The best time to make this change is the earliest, so I think we should go ahead with it now when it's unstable.

@bharatkashyap bharatkashyap merged commit 660da20 into mui:master Jul 25, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan: Premium Impact at least one premium user. scope: data grid Changes related to the data grid. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants