diff --git a/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx b/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx index 5a9e44fcf..f2108417f 100644 --- a/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx +++ b/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx @@ -60,9 +60,6 @@ export const VectorEmbeddingSourceComponent: FunctionComponent { - // The integrated-embedding capability gate lives at the parent's call site - // (VectorEmbeddingPoliciesComponent). Don't add a gate here — gating before the - // hooks below would violate the Rules of Hooks. const suffix = index + 1; const [sourcePathsRaw, setSourcePathsRaw] = useState(initialEmbeddingSource?.sourcePaths?.join(", ") || ""); @@ -90,10 +87,7 @@ export const VectorEmbeddingSourceComponent: FunctionComponent(() => { if (!hasAnyValue || !isValid) { return undefined; @@ -120,12 +114,6 @@ export const VectorEmbeddingSourceComponent: FunctionComponent { onChange(source, isValid); - // `onChange` is intentionally omitted from the dependency array. The parent recreates - // its inline arrow on every render, and including it here would re-fire this effect - // on every parent render — feeding back into the parent's setState and producing an - // infinite loop. The effect's behavior depends only on `source` / `isValid`, which are - // memoized from local state, so capturing a stale `onChange` reference is safe: the - // underlying state mutation (setVectorEmbeddingPolicyData) is identity-stable. // eslint-disable-next-line react-hooks/exhaustive-deps }, [source, isValid]); diff --git a/src/Explorer/Controls/VectorSearch/VectorSearchUtils.ts b/src/Explorer/Controls/VectorSearch/VectorSearchUtils.ts index 9db70a133..9a4449df8 100644 --- a/src/Explorer/Controls/VectorSearch/VectorSearchUtils.ts +++ b/src/Explorer/Controls/VectorSearch/VectorSearchUtils.ts @@ -19,8 +19,6 @@ export const getQuantizerTypeOptions = (): IDropdownOption[] => [ export const supportsQuantization = (indexType: VectorIndex["type"] | "none" | undefined): boolean => indexType === "quantizedFlat" || indexType === "diskANN"; -// Parses a comma-separated path list, trims whitespace, drops blanks, and -// prefixes a leading "/" on each entry if it isn't there already. export const parseSourcePaths = (raw: string): string[] => { if (!raw) { return []; diff --git a/src/Utils/CapabilityUtils.ts b/src/Utils/CapabilityUtils.ts index 23955e6ac..36ce0f600 100644 --- a/src/Utils/CapabilityUtils.ts +++ b/src/Utils/CapabilityUtils.ts @@ -35,10 +35,8 @@ export const isFullTextSearchPreviewFeaturesEnabled = (targetAccountOverride?: A ); }; -// `enableEmbeddingGenerator` is a top-level boolean on the database account -// (e.g. properties.enableEmbeddingGenerator), not an entry in -// properties.capabilities[]. It's the Foundry integrated embedding generator -// flag that gates the `embeddingSource` block inside a Container Vector Policy. +// Gates the `embeddingSource` block inside a Container Vector Policy. +// Uses the top-level `enableEmbeddingGenerator` boolean (not capabilities[]). export const isIntegratedEmbeddingEnabled = (targetAccountOverride?: AccountOverride): boolean => { const { databaseAccount } = userContext; const enableEmbeddingGenerator = diff --git a/src/Utils/arm/generatedClients/cosmos/types.ts b/src/Utils/arm/generatedClients/cosmos/types.ts index 70d7df0a1..763959841 100644 --- a/src/Utils/arm/generatedClients/cosmos/types.ts +++ b/src/Utils/arm/generatedClients/cosmos/types.ts @@ -1413,25 +1413,15 @@ export interface VectorEmbedding { /* The number of dimensions in the vector. */ dimensions: number; - /* Optional configuration for Cosmos DB integrated embeddings (server-side - embedding generation via Microsoft Foundry). When set, Cosmos DB - auto-populates the vector field from the listed source paths. - TODO: This field was added manually pending an upstream Swagger update; - re-applying `npm run generateARMClients` will overwrite it. */ + /* Added manually pending upstream Swagger update; `npm run generateARMClients` will overwrite. */ embeddingSource?: VectorEmbeddingSource; } -/* Configuration for Cosmos DB integrated embeddings. */ export interface VectorEmbeddingSource { - /* Source field paths used as input for embedding generation. */ sourcePaths: string[]; - /* The Foundry deployment name. */ deploymentName: string; - /* The Foundry model name. */ modelName: string; - /* The Foundry endpoint URL. */ endpoint: string; - /* Authentication type used by Cosmos DB to call Foundry. */ authType: "Entra"; } diff --git a/test/sql/container.spec.ts b/test/sql/container.spec.ts index 129a8d51c..217115222 100644 --- a/test/sql/container.spec.ts +++ b/test/sql/container.spec.ts @@ -57,21 +57,17 @@ test("SQL container with vector embedding policy and embedding source", async ({ const explorer = await DataExplorer.open(page, TestAccount.SQL); - // Open the New Container panel and check if the embedding source capability is available - // before proceeding. We must skip before whilePanelOpen to avoid a timeout on panel close. const newContainerButton = await explorer.globalCommandButton("New Container"); await newContainerButton.click(); const panel = explorer.panel("New Container"); await panel.waitFor(); - // Expand vector policy section and add a vector embedding to check for the embedding source accordion await panel.getByTestId("ContainerVectorPolicy/Section").click(); await panel.getByTestId("VectorEmbedding/AddButton").click(); const embeddingSourceSection = panel.getByTestId("VectorEmbeddingSource/Section/1"); if ((await embeddingSourceSection.count()) === 0) { - // Close the panel before skipping await panel.getByRole("button", { name: "Close New Container" }).click(); await panel.waitFor({ state: "detached" }); test.skip(true, "Test account does not have the integrated embedding capability."); @@ -85,7 +81,7 @@ test("SQL container with vector embedding policy and embedding source", async ({ await panel.getByTestId("VectorEmbedding/Path/1").fill("/embedding"); await panel.getByTestId("VectorEmbedding/Dimensions/1").fill("1536"); - // Expand embedding source section and fill fields + // Expand embedding source and fill fields await embeddingSourceSection.click(); await panel.getByTestId("VectorEmbeddingSource/SourcePaths/1").fill("/description"); @@ -102,7 +98,6 @@ test("SQL container with vector embedding policy and embedding source", async ({ const databaseNode = await explorer.waitForNode(databaseId); const containerNode = await explorer.waitForContainerNode(databaseId, containerId); - // Cleanup await containerNode.openContextMenu(); await containerNode.contextMenuItem("Delete Container").click(); await explorer.whilePanelOpen( diff --git a/test/sql/scaleAndSettings/containerPolicies/vectorPolicy.spec.ts b/test/sql/scaleAndSettings/containerPolicies/vectorPolicy.spec.ts index db2614e8e..4022f052f 100644 --- a/test/sql/scaleAndSettings/containerPolicies/vectorPolicy.spec.ts +++ b/test/sql/scaleAndSettings/containerPolicies/vectorPolicy.spec.ts @@ -203,7 +203,7 @@ test.describe("Vector Policy under Scale & Settings", () => { await explorer.frame.getByTestId("VectorEmbedding/Path/1").fill("/embedding"); await explorer.frame.getByTestId("VectorEmbedding/Dimensions/1").fill("1536"); - // Expand embedding source section and fill fields + // Expand embedding source and fill fields await embeddingSourceSection.click(); await explorer.frame.getByTestId("VectorEmbeddingSource/SourcePaths/1").fill("/description"); @@ -213,7 +213,6 @@ test.describe("Vector Policy under Scale & Settings", () => { .getByTestId("VectorEmbeddingSource/Endpoint/1") .fill("https://e2e-embedding.cognitiveservices.azure.com/"); - // Save changes const saveButton = explorer.commandBarButton(CommandBarButton.Save); await expect(saveButton).toBeEnabled(); await saveButton.click(); @@ -224,7 +223,6 @@ test.describe("Vector Policy under Scale & Settings", () => { }); test("Existing embedding source fields are disabled after save", async () => { - // Ensure a policy with embedding source exists (from previous test or create one) const sourcePathsInput = explorer.frame.getByTestId("VectorEmbeddingSource/SourcePaths/1"); if ((await sourcePathsInput.count()) === 0) { test.skip(true, "No embedding source present; previous test may have been skipped.");