mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-25 21:47:52 +00:00
Switch to tools federation endpoints for query copilot
This commit is contained in:
parent
879cb08949
commit
5c21e9d5ee
@ -358,6 +358,7 @@ export enum ContainerStatusType {
|
|||||||
|
|
||||||
export enum PoolIdType {
|
export enum PoolIdType {
|
||||||
DefaultPoolId = "default",
|
DefaultPoolId = "default",
|
||||||
|
QueryCopilot = "query-copilot",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EmulatorMasterKey =
|
export const EmulatorMasterKey =
|
||||||
|
@ -395,7 +395,7 @@ export default class Explorer {
|
|||||||
) {
|
) {
|
||||||
const provisionData: IProvisionData = {
|
const provisionData: IProvisionData = {
|
||||||
cosmosEndpoint: userContext?.databaseAccount?.properties?.documentEndpoint,
|
cosmosEndpoint: userContext?.databaseAccount?.properties?.documentEndpoint,
|
||||||
poolId: PoolIdType.DefaultPoolId,
|
poolId: PoolIdType.QueryCopilot,
|
||||||
};
|
};
|
||||||
const connectionStatus: ContainerConnectionInfo = {
|
const connectionStatus: ContainerConnectionInfo = {
|
||||||
status: ConnectionStatusType.Connecting,
|
status: ConnectionStatusType.Connecting,
|
||||||
@ -1335,5 +1335,7 @@ export default class Explorer {
|
|||||||
|
|
||||||
const sampleDataResourceTokenCollection = new ResourceTokenCollection(this, databaseId, collection, true);
|
const sampleDataResourceTokenCollection = new ResourceTokenCollection(this, databaseId, collection, true);
|
||||||
useDatabases.setState({ sampleDataResourceTokenCollection });
|
useDatabases.setState({ sampleDataResourceTokenCollection });
|
||||||
|
|
||||||
|
await this.allocateContainer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import { CommandButtonComponentProps } from "Explorer/Controls/CommandButton/Com
|
|||||||
import { EditorReact } from "Explorer/Controls/Editor/EditorReact";
|
import { EditorReact } from "Explorer/Controls/Editor/EditorReact";
|
||||||
import Explorer from "Explorer/Explorer";
|
import Explorer from "Explorer/Explorer";
|
||||||
import { useCommandBar } from "Explorer/Menus/CommandBar/CommandBarComponentAdapter";
|
import { useCommandBar } from "Explorer/Menus/CommandBar/CommandBarComponentAdapter";
|
||||||
|
import { useNotebook } from "Explorer/Notebook/useNotebook";
|
||||||
import { SaveQueryPane } from "Explorer/Panes/SaveQueryPane/SaveQueryPane";
|
import { SaveQueryPane } from "Explorer/Panes/SaveQueryPane/SaveQueryPane";
|
||||||
import { WelcomeModal } from "Explorer/QueryCopilot/Modal/WelcomeModal";
|
import { WelcomeModal } from "Explorer/QueryCopilot/Modal/WelcomeModal";
|
||||||
import { CopyPopup } from "Explorer/QueryCopilot/Popup/CopyPopup";
|
import { CopyPopup } from "Explorer/QueryCopilot/Popup/CopyPopup";
|
||||||
@ -191,7 +192,8 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({ explorer }: Qu
|
|||||||
};
|
};
|
||||||
setShowDeletePopup(false);
|
setShowDeletePopup(false);
|
||||||
useQueryCopilot.getState().refreshCorrelationId();
|
useQueryCopilot.getState().refreshCorrelationId();
|
||||||
const response = await fetch("https://copilotorchestrater.azurewebsites.net/generateSQLQuery", {
|
const serverInfo = useNotebook.getState().notebookServerInfo;
|
||||||
|
const response = await fetch(`${serverInfo.notebookServerEndpoint}/generateSQLQuery`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
import { useDialog } from "Explorer/Controls/Dialog";
|
import { useDialog } from "Explorer/Controls/Dialog";
|
||||||
import promiseRetry, { AbortError } from "p-retry";
|
|
||||||
import { Action } from "Shared/Telemetry/TelemetryConstants";
|
import { Action } from "Shared/Telemetry/TelemetryConstants";
|
||||||
import { allowedJunoOrigins, validateEndpoint } from "Utils/EndpointValidation";
|
import { allowedJunoOrigins, validateEndpoint } from "Utils/EndpointValidation";
|
||||||
|
import promiseRetry, { AbortError } from "p-retry";
|
||||||
import {
|
import {
|
||||||
Areas,
|
Areas,
|
||||||
ConnectionStatusType,
|
ConnectionStatusType,
|
||||||
ContainerStatusType,
|
ContainerStatusType,
|
||||||
HttpHeaders,
|
HttpHeaders,
|
||||||
HttpStatusCodes,
|
HttpStatusCodes,
|
||||||
|
JunoEndpoints,
|
||||||
Notebook,
|
Notebook,
|
||||||
} from "../Common/Constants";
|
} from "../Common/Constants";
|
||||||
import { getErrorMessage, getErrorStack } from "../Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack } from "../Common/ErrorHandlingUtils";
|
||||||
import * as Logger from "../Common/Logger";
|
import * as Logger from "../Common/Logger";
|
||||||
import { configContext } from "../ConfigContext";
|
|
||||||
import {
|
import {
|
||||||
ContainerConnectionInfo,
|
ContainerConnectionInfo,
|
||||||
ContainerInfo,
|
ContainerInfo,
|
||||||
@ -28,7 +28,6 @@ import {
|
|||||||
} from "../Contracts/DataModels";
|
} from "../Contracts/DataModels";
|
||||||
import { useNotebook } from "../Explorer/Notebook/useNotebook";
|
import { useNotebook } from "../Explorer/Notebook/useNotebook";
|
||||||
import * as TelemetryProcessor from "../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { userContext } from "../UserContext";
|
|
||||||
import { getAuthorizationHeader } from "../Utils/AuthorizationUtils";
|
import { getAuthorizationHeader } from "../Utils/AuthorizationUtils";
|
||||||
|
|
||||||
export class PhoenixClient {
|
export class PhoenixClient {
|
||||||
@ -231,8 +230,8 @@ export class PhoenixClient {
|
|||||||
throw new Error("The Phoenix client was not initialized properly: missing ARM resourcce id");
|
throw new Error("The Phoenix client was not initialized properly: missing ARM resourcce id");
|
||||||
}
|
}
|
||||||
|
|
||||||
const toolsEndpoint =
|
const toolsEndpoint = JunoEndpoints.Test2;
|
||||||
userContext.features.phoenixEndpoint ?? userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT;
|
// userContext.features.phoenixEndpoint ?? userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT;
|
||||||
|
|
||||||
if (!validateEndpoint(toolsEndpoint, allowedJunoOrigins)) {
|
if (!validateEndpoint(toolsEndpoint, allowedJunoOrigins)) {
|
||||||
const error = `${toolsEndpoint} not allowed as tools endpoint`;
|
const error = `${toolsEndpoint} not allowed as tools endpoint`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user