P1 bugs for copilot

This commit is contained in:
Sung-Hyun Kang (from Dev Box) 2023-11-09 20:43:43 -06:00
parent b4d6ad172b
commit 7d557df4e0
3 changed files with 7 additions and 4 deletions

View File

@ -1390,7 +1390,10 @@ export default class Explorer {
} }
const copilotEnabledPromise = getCopilotEnabled(); const copilotEnabledPromise = getCopilotEnabled();
const copilotUserDBEnabledPromise = isCopilotFeatureRegistered(userContext.subscriptionId); const copilotUserDBEnabledPromise = isCopilotFeatureRegistered(userContext.subscriptionId);
const [copilotEnabled, copilotUserDBEnabled] = await Promise.all([copilotEnabledPromise, copilotUserDBEnabledPromise]) const [copilotEnabled, copilotUserDBEnabled] = await Promise.all([
copilotEnabledPromise,
copilotUserDBEnabledPromise,
]);
useQueryCopilot.getState().setCopilotEnabled(copilotEnabled); useQueryCopilot.getState().setCopilotEnabled(copilotEnabled);
useQueryCopilot.getState().setCopilotUserDBEnabled(copilotUserDBEnabled); useQueryCopilot.getState().setCopilotUserDBEnabled(copilotUserDBEnabled);
} }

View File

@ -7,7 +7,7 @@ import {
PrimaryButton, PrimaryButton,
Stack, Stack,
Text, Text,
TextField TextField,
} from "@fluentui/react"; } from "@fluentui/react";
import Explorer from "Explorer/Explorer"; import Explorer from "Explorer/Explorer";
import { useCopilotStore } from "Explorer/QueryCopilot/QueryCopilotContext"; import { useCopilotStore } from "Explorer/QueryCopilot/QueryCopilotContext";

View File

@ -107,7 +107,7 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
setGeneratedQueryComments, setGeneratedQueryComments,
setQueryResults, setQueryResults,
setErrorMessage, setErrorMessage,
errorMessage errorMessage,
} = useCopilotStore(); } = useCopilotStore();
const sampleProps: SamplePromptsProps = { const sampleProps: SamplePromptsProps = {
@ -244,7 +244,7 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
handleError(JSON.stringify(generateSQLQueryResponse), "copilotTooManyRequestError"); handleError(JSON.stringify(generateSQLQueryResponse), "copilotTooManyRequestError");
useTabs.getState().setIsQueryErrorThrown(true); useTabs.getState().setIsQueryErrorThrown(true);
setShowErrorMessageBar(true); setShowErrorMessageBar(true);
setErrorMessage("Ratelimit exceeded 5 per 1 minute. Please try again after sometime") setErrorMessage("Ratelimit exceeded 5 per 1 minute. Please try again after sometime");
TelemetryProcessor.traceFailure(Action.QueryGenerationFromCopilotPrompt, { TelemetryProcessor.traceFailure(Action.QueryGenerationFromCopilotPrompt, {
databaseName: databaseId, databaseName: databaseId,
collectionId: containerId, collectionId: containerId,