Skip to content
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

fix: Add a warning about the luis authoring key 1000/month limit #7430

Merged
merged 5 commits into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { FontSizes } from 'office-ui-fabric-react/lib/Styling';
import { NeutralColors, SharedColors } from '@uifabric/fluent-theme';
import { PrimaryButton } from 'office-ui-fabric-react/lib/Button';
import { Link } from 'office-ui-fabric-react/lib/Link';
import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBar';

import {
dispatcherState,
Expand Down Expand Up @@ -151,6 +152,9 @@ export const RootBotExternalService: React.FC<RootBotExternalServiceProps> = (pr

const groupLUISAuthoringKey = get(sensitiveGroupManageProperty, 'luis.authoringKey', {});
const rootLuisKey = groupLUISAuthoringKey.root;
const groupLUISEndpointKey = get(sensitiveGroupManageProperty, 'luis.endpointKey', {});
const rootLuisEndpointKey = groupLUISEndpointKey.root;

const groupLUISRegion = get(sensitiveGroupManageProperty, 'luis.authoringRegion', {});
const rootLuisRegion = groupLUISRegion.root;
const groupQnAKey = get(sensitiveGroupManageProperty, 'qna.subscriptionKey', {});
Expand Down Expand Up @@ -179,6 +183,7 @@ export const RootBotExternalService: React.FC<RootBotExternalServiceProps> = (pr
const luisKeyFieldRef = useRef<HTMLDivElement>(null);
const luisRegionFieldRef = useRef<HTMLDivElement>(null);
const qnaKeyFieldRef = useRef<HTMLDivElement>(null);
const linkToPublishProfile = `/bot/${rootBotProjectId}/publish/all#addNewPublishProfile`;

const handleRootLUISKeyOnChange = (e, value) => {
if (value) {
Expand Down Expand Up @@ -412,6 +417,29 @@ export const RootBotExternalService: React.FC<RootBotExternalServiceProps> = (pr
setDisplayManageLuis(true);
}}
/>
{localRootLuisKey && !rootLuisEndpointKey && (
<MessageBar messageBarType={MessageBarType.info} styles={{ root: { width: '75%', marginTop: 20 } }}>
{formatMessage.rich(
'Your bot is configured with only a LUIS authoring key, which has a limit of 1,000 calls per month. If your bot hits this limit, publish it to Azure using a <a>publishing profile</a> to continue testing.<a2>Learn more</a2>',
{
a: ({ children }) => (
<Link key="luis-endpoint-key-info" href={linkToPublishProfile}>
{children}
</Link>
),
a2: ({ children }) => (
<Link
key="luis-endpoint-key-info"
href={'https://aka.ms/composer-settings-luislimits'}
target="_blank"
>
{children}
</Link>
),
}
)}
</MessageBar>
)}
<div css={title}>{formatMessage('QnA Maker')}</div>
<div css={subtext}>
{formatMessage.rich(
Expand Down