Reintroduce feature flags (#1590)

Co-authored-by: Predrag Klepic <v-prklepic@microsoft.com>
This commit is contained in:
Predrag Klepic 2023-08-28 16:56:13 +02:00 committed by GitHub
parent 55846b98bd
commit 425e375d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,16 +27,22 @@ export const SendQueryRequest = async ({
.getState() .getState()
.setChatMessages([...useQueryCopilot.getState().chatMessages, { source: 0, message: userPrompt }]); .setChatMessages([...useQueryCopilot.getState().chatMessages, { source: 0, message: userPrompt }]);
try { try {
if (useQueryCopilot.getState().shouldAllocateContainer) { if (useQueryCopilot.getState().shouldAllocateContainer && userContext.features.enableCopilotPhoenixGateaway) {
await explorer.allocateContainer(PoolIdType.DefaultPoolId); await explorer.allocateContainer(PoolIdType.DefaultPoolId);
useQueryCopilot.getState().setShouldAllocateContainer(false); useQueryCopilot.getState().setShouldAllocateContainer(false);
} }
useQueryCopilot.getState().refreshCorrelationId(); useQueryCopilot.getState().refreshCorrelationId();
const serverInfo = useNotebook.getState().notebookServerInfo; const serverInfo = useNotebook.getState().notebookServerInfo;
const queryUri = createUri(serverInfo.notebookServerEndpoint, "generateSQLQuery");
const queryUri = userContext.features.enableCopilotPhoenixGateaway
? createUri(serverInfo.notebookServerEndpoint, "generateSQLQuery")
: createUri("https://copilotorchestrater.azurewebsites.net/", "generateSQLQuery");
const payload = { const payload = {
containerSchema: ShortenedQueryCopilotSampleContainerSchema, containerSchema: userContext.features.enableCopilotFullSchema
? QueryCopilotSampleContainerSchema
: ShortenedQueryCopilotSampleContainerSchema,
userPrompt: userPrompt, userPrompt: userPrompt,
}; };
const response = await fetch(queryUri, { const response = await fetch(queryUri, {