diff --git a/src/Explorer/Controls/VectorSearch/VectorEmbeddingPoliciesComponent.test.tsx b/src/Explorer/Controls/VectorSearch/VectorEmbeddingPoliciesComponent.test.tsx index edfb946bd..c08571cfc 100644 --- a/src/Explorer/Controls/VectorSearch/VectorEmbeddingPoliciesComponent.test.tsx +++ b/src/Explorer/Controls/VectorSearch/VectorEmbeddingPoliciesComponent.test.tsx @@ -108,12 +108,12 @@ describe("VectorEmbeddingPoliciesComponent - embedding source", () => { }); const expandSection = () => { - const header = screen.getByRole("button", { name: /Embedding source/ }); + const header = screen.getByRole("button", { name: /Embedding Configuration/ }); fireEvent.click(header); }; test("renders the embedding source accordion collapsed by default with no errors", () => { - expect(screen.getByText("Embedding source (Preview)")).toBeInTheDocument(); + expect(screen.getByText("Embedding Configuration (Preview)")).toBeInTheDocument(); expect(view.container.querySelector("#vector-policy-embeddingSource-sourcePaths-1")).toBeNull(); const lastCall = onChange.mock.calls[onChange.mock.calls.length - 1]; expect(lastCall[2]).toBe(true); @@ -127,6 +127,18 @@ describe("VectorEmbeddingPoliciesComponent - embedding source", () => { expect(view.container.querySelector("#vector-policy-embeddingSource-modelName-1")).not.toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-endpoint-1")).not.toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-authType-1")).not.toBeNull(); + expect(screen.getByPlaceholderText("/title, /description")).toBeInTheDocument(); + expect(screen.getAllByPlaceholderText("text-embedding-3-small")).toHaveLength(2); + expect(screen.getByPlaceholderText("https://.openai.azure.com/")).toBeInTheDocument(); + expect(screen.getByText("Embedding model name")).toBeInTheDocument(); + expect(screen.getByText("Microsoft Foundry Endpoint")).toBeInTheDocument(); + expect( + screen.getByLabelText( + "The item property paths whose values are used as input for embedding generation. Enter multiple values separated by commas, for example /title, /description.", + ), + ).toBeInTheDocument(); + expect(screen.getByLabelText("Microsoft Foundry model deployment name")).toBeInTheDocument(); + expect(screen.getByLabelText("Microsoft Foundry model name")).toBeInTheDocument(); expect(screen.queryByText("At least one source path is required")).toBeNull(); expect(screen.queryByText("Deployment name is required")).toBeNull(); }); @@ -270,7 +282,7 @@ describe("VectorEmbeddingPoliciesComponent - embedding source gating", () => { onVectorEmbeddingChange={jest.fn()} />, ); - expect(screen.queryByText("Embedding source (Preview)")).toBeNull(); + expect(screen.queryByText("Embedding Configuration (Preview)")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-sourcePaths-1")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-deploymentName-1")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-modelName-1")).toBeNull(); diff --git a/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx b/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx index f2108417f..93c7cfba5 100644 --- a/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx +++ b/src/Explorer/Controls/VectorSearch/VectorEmbeddingSourceComponent.tsx @@ -1,4 +1,4 @@ -import { Dropdown, IDropdownOption, Label, Stack, TextField } from "@fluentui/react"; +import { Dropdown, Icon, IDropdownOption, Label, Stack, TextField, TooltipHost } from "@fluentui/react"; import { CollapsibleSectionComponent } from "Explorer/Controls/CollapsiblePanel/CollapsibleSectionComponent"; import { VectorEmbeddingSource } from "Contracts/DataModels"; import { @@ -21,6 +21,23 @@ export interface IVectorEmbeddingSourceComponentProps { const defaultAuthType: VectorEmbeddingSource["authType"] = "Entra"; +interface EmbeddingSourceLabelProps { + disabled: boolean; + label: string; + tooltip?: string; +} + +const EmbeddingSourceLabel = ({ disabled, label, tooltip }: EmbeddingSourceLabelProps): JSX.Element => ( + +); + const validateSourcePaths = (raw: string): string => { const parsed = parseSourcePaths(raw); if (parsed.length === 0) { @@ -128,9 +145,11 @@ export const VectorEmbeddingSourceComponent: FunctionComponent - + - + setDeploymentName(newValue || "")} @@ -157,13 +179,16 @@ export const VectorEmbeddingSourceComponent: FunctionComponent - + setModelName(newValue || "")} diff --git a/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/Components/VectorSearchComponent.tsx b/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/Components/VectorSearchComponent.tsx index e3021c034..c977613a0 100644 --- a/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/Components/VectorSearchComponent.tsx +++ b/src/Explorer/Panes/AddGlobalSecondaryIndexPanel/Components/VectorSearchComponent.tsx @@ -52,7 +52,7 @@ export const VectorSearchComponent = (props: VectorSearchComponentProps): JSX.El setVectorIndexingPolicy(vectorIndexingPolicy); setVectorPolicyValidated(vectorPolicyValidated); }} - isGlobalSecondaryIndexTarget={isGlobalSecondaryIndexTarget} + isGlobalSecondaryIndex={isGlobalSecondaryIndexTarget} /> diff --git a/src/Localization/en/Resources.json b/src/Localization/en/Resources.json index e978c4a65..63ac8b174 100644 --- a/src/Localization/en/Resources.json +++ b/src/Localization/en/Resources.json @@ -996,14 +996,19 @@ "indexingSearchListSize": "Indexing search list size", "vectorIndexShardKey": "Vector index shard key", "addVectorEmbedding": "Add vector embedding", - "embeddingSourceSection": "Embedding source", + "embeddingSourceSection": "Embedding Configuration", "embeddingSourceTooltip": "Configure Cosmos DB to auto-generate the vector from one or more source paths using a Microsoft Foundry deployment. Leave all fields empty to skip auto-generation.", "sourcePaths": "Source paths", - "sourcePathsPlaceholder": "/description, /title", + "sourcePathsTooltip": "The item property paths whose values are used as input for embedding generation. Enter multiple values separated by commas, for example /title, /description.", + "sourcePathsPlaceholder": "/title, /description", "deploymentName": "Deployment name", - "modelName": "Model name", - "endpoint": "Endpoint", - "endpointPlaceholder": "https://", + "deploymentNameTooltip": "Microsoft Foundry model deployment name", + "deploymentNamePlaceholder": "text-embedding-3-small", + "modelName": "Embedding model name", + "modelNameTooltip": "Microsoft Foundry model name", + "modelNamePlaceholder": "text-embedding-3-small", + "endpoint": "Microsoft Foundry Endpoint", + "endpointPlaceholder": "https://.openai.azure.com/", "authType": "Authentication type", "pathEmptyError": "Path should not be empty", "pathDuplicateError": "Path is already defined",