Skip to content

Commit

Permalink
fix: Add a warning about the luis authoring key 1000/month limit (#7430)
Browse files Browse the repository at this point in the history
* Add a warning about the luis authoring key 1000/month limit unless an endpoint key is set

* add space

Co-authored-by: Chris Whitten <[email protected]>
  • Loading branch information
benbrown and cwhitten authored Apr 27, 2021
1 parent 8796e9b commit 94a1f36
Showing 1 changed file with 28 additions and 0 deletions.
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

0 comments on commit 94a1f36

Please sign in to comment.