mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-03-13 05:15:30 +00:00
Reintroduce feature flags (#1590)
Co-authored-by: Predrag Klepic <v-prklepic@microsoft.com>
This commit is contained in:
parent
55846b98bd
commit
425e375d50
@ -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, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user