-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[DataGridPremium] Add privateMode
to AI assistant prompt resolver
#18759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGridPremium] Add privateMode
to AI assistant prompt resolver
#18759
Conversation
Deploy preview: https://deploy-preview-18759--material-ui-x.netlify.app/ Updated pages: Bundle size reportTotal Size Change: 🔺+41B(0.00%) - Total Gzip Change: 🔺+18B(0.00%) Show details for 100 more bundles (22 more not shown)@mui/x-data-grid-premium parsed: 🔺+41B(+0.01%) gzip: 🔺+18B(+0.01%) |
packages/x-data-grid-premium/src/hooks/features/aiAssistant/api.ts
Outdated
Show resolved
Hide resolved
packages/x-data-grid-premium/src/hooks/features/aiAssistant/gridAiAssistantInterfaces.ts
Outdated
Show resolved
Hide resolved
disablePromptRetention
to prompt resolverprivateMode
to prompt resolver
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>
privateMode
to prompt resolverprivateMode
to AI assistant prompt resolver
@joserodolfofreitas Before merging this, wanted to highlight the breaking change on the |
Isn't it an optional and additional prop? I think we can consider it non-breaking change, right? |
The new behaviour is that 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 |
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. |
Summary
Refactored the
gridDefaultPromptResolver
function to use a structuredoptions
parameter, consolidatingadditionalContext
and adding a newprivateMode
optionContext
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: MovedadditionalContext
parameter intooptions
objectprivateMode
option for privacy controlPromptResolverOptions
parameterMigration Guide
Before:
After: