Skip to content

Commit

Permalink
Disabled Deployment Toggles From User Settings for time being
Browse files Browse the repository at this point in the history
  • Loading branch information
mattahearn committed May 22, 2024
1 parent 5a68f20 commit 71f9ec6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 34 deletions.
1 change: 1 addition & 0 deletions webapi/Extensions/SemanticKernelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static WebApplicationBuilder AddSemanticKernelServices(this WebApplicatio
}
}

deploymentName = null; // For now, keep null until switcher tested fully
var kernel = provider.GetCompletionKernel(deploymentName);

sp.GetRequiredService<RegisterFunctionsWithKernel>()(sp, kernel);
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const App = () => {
if (us.azureAISearch) dispatch(toggleFeatureFlag(FeatureKeys.AzureAISearch)); // Turn on
if (us.exportChatSessions) dispatch(toggleFeatureFlag(FeatureKeys.ExportChatSessions)); // Turn on
if (us.liveChatSessionSharing) dispatch(toggleFeatureFlag(FeatureKeys.LiveChatSessionSharing)); // Turn on
if (us.feedbackFromUser) dispatch(toggleFeatureFlag(FeatureKeys.RLHF)); // Turn on
// if (us.feedbackFromUser) dispatch(toggleFeatureFlag(FeatureKeys.RLHF)); // Turn on
if (us.deploymentGPT35) dispatch(toggleFeatureFlag(FeatureKeys.DeploymentGPT35)); // Turn on
if (us.deploymentGPT4) dispatch(toggleFeatureFlag(FeatureKeys.DeploymentGPT4)); // Turn on
}
Expand Down Expand Up @@ -173,7 +173,7 @@ const App = () => {
if (us.azureAISearch) dispatch(toggleFeatureFlag(FeatureKeys.AzureAISearch)); // Turn on
if (us.exportChatSessions) dispatch(toggleFeatureFlag(FeatureKeys.ExportChatSessions)); // Turn on
if (us.liveChatSessionSharing) dispatch(toggleFeatureFlag(FeatureKeys.LiveChatSessionSharing)); // Turn on
if (us.feedbackFromUser) dispatch(toggleFeatureFlag(FeatureKeys.RLHF)); // Turn on
// if (us.feedbackFromUser) dispatch(toggleFeatureFlag(FeatureKeys.RLHF)); // Turn on
if (us.deploymentGPT35) dispatch(toggleFeatureFlag(FeatureKeys.DeploymentGPT35)); // Turn on
if (us.deploymentGPT4) dispatch(toggleFeatureFlag(FeatureKeys.DeploymentGPT4)); // Turn on
}
Expand Down
51 changes: 28 additions & 23 deletions webapp/src/components/header/settings-dialog/SettingSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,34 @@ export const SettingSection: React.FC<ISettingsSectionProps> = ({ setting, conte
const disableControl = !!feature.inactive;

return (
<div key={key} className={classes.feature}>
<Switch
label={feature.label}
checked={feature.enabled}
disabled={
disableControl || (key === FeatureKeys.MultiUserChat && !AuthHelper.isAuthAAD())
}
onChange={() => {
onFeatureChange(key);
}}
data-testid={feature.label}
/>
<Text
className={classes.featureDescription}
style={{
color: disableControl
? tokens.colorNeutralForegroundDisabled
: tokens.colorNeutralForeground2,
}}
>
{feature.description}
</Text>
</div>
<>
{key !== FeatureKeys.DeploymentGPT35 && key !== FeatureKeys.DeploymentGPT4 && (
<div key={key} className={classes.feature}>
<Switch
label={feature.label}
checked={feature.enabled}
disabled={
disableControl ||
(key === FeatureKeys.MultiUserChat && !AuthHelper.isAuthAAD())
}
onChange={() => {
onFeatureChange(key);
}}
data-testid={feature.label}
/>
<Text
className={classes.featureDescription}
style={{
color: disableControl
? tokens.colorNeutralForegroundDisabled
: tokens.colorNeutralForeground2,
}}
>
{feature.description}
</Text>
</div>
)}
</>
);
})}
</div>
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ export function renderApp() {
store.dispatch(
toggleFeatureState({
feature: FeatureKeys.DeploymentGPT35,
deactivate: lockControl,
deactivate: true, // For now, leave disabled
enable: false,
}),
);

store.dispatch(
toggleFeatureState({
feature: FeatureKeys.DeploymentGPT4,
deactivate: lockControl,
deactivate: true, // For now, leave disabled
enable: false,
}),
);
Expand Down
15 changes: 8 additions & 7 deletions webapp/src/redux/features/app/AppState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,19 @@ export const Settings = [
},
{
title: 'Azure AI',
features: [
FeatureKeys.AzureContentSafety,
FeatureKeys.AzureAISearch,
FeatureKeys.DeploymentGPT35,
FeatureKeys.DeploymentGPT4,
],
features: [FeatureKeys.AzureContentSafety, FeatureKeys.AzureAISearch],
stackVertically: true,
},
{
title: 'Experimental',
description: 'The related icons and menu options are hidden until you turn this on',
features: [FeatureKeys.BotAsDocs, FeatureKeys.MultiUserChat, FeatureKeys.RLHF],
features: [
FeatureKeys.BotAsDocs,
FeatureKeys.MultiUserChat,
FeatureKeys.RLHF,
FeatureKeys.DeploymentGPT35,
FeatureKeys.DeploymentGPT4,
],
},
];

Expand Down

0 comments on commit 71f9ec6

Please sign in to comment.