mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 17:12:47 +01:00
Changed embedding configuration field texts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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://<foundry-resource-name>.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();
|
||||
|
||||
@@ -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 => (
|
||||
<Label disabled={disabled} styles={labelStyles}>
|
||||
{label}
|
||||
{tooltip && (
|
||||
<TooltipHost content={tooltip} styles={{ root: { display: "inline-block", marginLeft: 4 } }}>
|
||||
<Icon iconName="Info" ariaLabel={tooltip} tabIndex={0} />
|
||||
</TooltipHost>
|
||||
)}
|
||||
</Label>
|
||||
);
|
||||
|
||||
const validateSourcePaths = (raw: string): string => {
|
||||
const parsed = parseSourcePaths(raw);
|
||||
if (parsed.length === 0) {
|
||||
@@ -128,9 +145,11 @@ export const VectorEmbeddingSourceComponent: FunctionComponent<IVectorEmbeddingS
|
||||
>
|
||||
<Stack style={{ marginLeft: "10px", marginTop: 4 }} tokens={{ childrenGap: 4 }}>
|
||||
<Stack>
|
||||
<Label disabled={disabled} styles={labelStyles}>
|
||||
{t(Keys.controls.vectorEmbeddingPolicies.sourcePaths)}
|
||||
</Label>
|
||||
<EmbeddingSourceLabel
|
||||
disabled={disabled}
|
||||
label={t(Keys.controls.vectorEmbeddingPolicies.sourcePaths)}
|
||||
tooltip={t(Keys.controls.vectorEmbeddingPolicies.sourcePathsTooltip)}
|
||||
/>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
id={`vector-policy-embeddingSource-sourcePaths-${suffix}`}
|
||||
@@ -143,13 +162,16 @@ export const VectorEmbeddingSourceComponent: FunctionComponent<IVectorEmbeddingS
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Label disabled={disabled} styles={labelStyles}>
|
||||
{t(Keys.controls.vectorEmbeddingPolicies.deploymentName)}
|
||||
</Label>
|
||||
<EmbeddingSourceLabel
|
||||
disabled={disabled}
|
||||
label={t(Keys.controls.vectorEmbeddingPolicies.deploymentName)}
|
||||
tooltip={t(Keys.controls.vectorEmbeddingPolicies.deploymentNameTooltip)}
|
||||
/>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
id={`vector-policy-embeddingSource-deploymentName-${suffix}`}
|
||||
data-test={`VectorEmbeddingSource/DeploymentName/${suffix}`}
|
||||
placeholder={t(Keys.controls.vectorEmbeddingPolicies.deploymentNamePlaceholder)}
|
||||
styles={textFieldStyles}
|
||||
value={deploymentName}
|
||||
onChange={(_event, newValue) => setDeploymentName(newValue || "")}
|
||||
@@ -157,13 +179,16 @@ export const VectorEmbeddingSourceComponent: FunctionComponent<IVectorEmbeddingS
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Label disabled={disabled} styles={labelStyles}>
|
||||
{t(Keys.controls.vectorEmbeddingPolicies.modelName)}
|
||||
</Label>
|
||||
<EmbeddingSourceLabel
|
||||
disabled={disabled}
|
||||
label={t(Keys.controls.vectorEmbeddingPolicies.modelName)}
|
||||
tooltip={t(Keys.controls.vectorEmbeddingPolicies.modelNameTooltip)}
|
||||
/>
|
||||
<TextField
|
||||
disabled={disabled}
|
||||
id={`vector-policy-embeddingSource-modelName-${suffix}`}
|
||||
data-test={`VectorEmbeddingSource/ModelName/${suffix}`}
|
||||
placeholder={t(Keys.controls.vectorEmbeddingPolicies.modelNamePlaceholder)}
|
||||
styles={textFieldStyles}
|
||||
value={modelName}
|
||||
onChange={(_event, newValue) => setModelName(newValue || "")}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ export const VectorSearchComponent = (props: VectorSearchComponentProps): JSX.El
|
||||
setVectorIndexingPolicy(vectorIndexingPolicy);
|
||||
setVectorPolicyValidated(vectorPolicyValidated);
|
||||
}}
|
||||
isGlobalSecondaryIndexTarget={isGlobalSecondaryIndexTarget}
|
||||
isGlobalSecondaryIndex={isGlobalSecondaryIndexTarget}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
@@ -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://<your-foundry-endpoint>",
|
||||
"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://<foundry-resource-name>.openai.azure.com/",
|
||||
"authType": "Authentication type",
|
||||
"pathEmptyError": "Path should not be empty",
|
||||
"pathDuplicateError": "Path is already defined",
|
||||
|
||||
Reference in New Issue
Block a user