mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-25 03:41:19 +00:00
Compare commits
3 Commits
master
...
users/aisa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ba75c0594 | ||
|
|
c142e4ad8a | ||
|
|
fb95b44242 |
@@ -389,7 +389,7 @@ export interface VectorEmbeddingPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface VectorEmbedding {
|
export interface VectorEmbedding {
|
||||||
dataType: "float32" | "uint8" | "int8";
|
dataType: "float32" | "float16" | "uint8" | "int8";
|
||||||
dimensions: number;
|
dimensions: number;
|
||||||
distanceFunction: "euclidean" | "cosine" | "dotproduct";
|
distanceFunction: "euclidean" | "cosine" | "dotproduct";
|
||||||
path: string;
|
path: string;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export interface FullTextPoliciesComponentProps {
|
|||||||
) => void;
|
) => void;
|
||||||
discardChanges?: boolean;
|
discardChanges?: boolean;
|
||||||
onChangesDiscarded?: () => void;
|
onChangesDiscarded?: () => void;
|
||||||
|
englishOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FullTextPolicyData {
|
export interface FullTextPolicyData {
|
||||||
@@ -66,6 +67,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
|
|||||||
onFullTextPathChange,
|
onFullTextPathChange,
|
||||||
discardChanges,
|
discardChanges,
|
||||||
onChangesDiscarded,
|
onChangesDiscarded,
|
||||||
|
englishOnly,
|
||||||
}): JSX.Element => {
|
}): JSX.Element => {
|
||||||
const getFullTextPathError = (path: string, index?: number): string => {
|
const getFullTextPathError = (path: string, index?: number): string => {
|
||||||
let error = "";
|
let error = "";
|
||||||
@@ -87,6 +89,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
|
|||||||
if (!fullTextPolicy) {
|
if (!fullTextPolicy) {
|
||||||
fullTextPolicy = { defaultLanguage: getFullTextLanguageOptions()[0].key as never, fullTextPaths: [] };
|
fullTextPolicy = { defaultLanguage: getFullTextLanguageOptions()[0].key as never, fullTextPaths: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
return fullTextPolicy.fullTextPaths.map((fullTextPath: FullTextPath) => ({
|
return fullTextPolicy.fullTextPaths.map((fullTextPath: FullTextPath) => ({
|
||||||
...fullTextPath,
|
...fullTextPath,
|
||||||
pathError: getFullTextPathError(fullTextPath.path),
|
pathError: getFullTextPathError(fullTextPath.path),
|
||||||
@@ -166,7 +169,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
|
|||||||
<Dropdown
|
<Dropdown
|
||||||
required={true}
|
required={true}
|
||||||
styles={dropdownStyles}
|
styles={dropdownStyles}
|
||||||
options={getFullTextLanguageOptions()}
|
options={getFullTextLanguageOptions(englishOnly)}
|
||||||
selectedKey={defaultLanguage}
|
selectedKey={defaultLanguage}
|
||||||
onChange={(_event: React.FormEvent<HTMLDivElement>, option: IDropdownOption) =>
|
onChange={(_event: React.FormEvent<HTMLDivElement>, option: IDropdownOption) =>
|
||||||
setDefaultLanguage(option.key as never)
|
setDefaultLanguage(option.key as never)
|
||||||
@@ -211,7 +214,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
|
|||||||
<Dropdown
|
<Dropdown
|
||||||
required={true}
|
required={true}
|
||||||
styles={dropdownStyles}
|
styles={dropdownStyles}
|
||||||
options={getFullTextLanguageOptions()}
|
options={getFullTextLanguageOptions(englishOnly)}
|
||||||
selectedKey={fullTextPolicy.language}
|
selectedKey={fullTextPolicy.language}
|
||||||
onChange={(_event: React.FormEvent<HTMLDivElement>, option: IDropdownOption) =>
|
onChange={(_event: React.FormEvent<HTMLDivElement>, option: IDropdownOption) =>
|
||||||
onFullTextPathPolicyChange(index, option)
|
onFullTextPathPolicyChange(index, option)
|
||||||
@@ -229,11 +232,25 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getFullTextLanguageOptions = (): IDropdownOption[] => {
|
export const getFullTextLanguageOptions = (englishOnly?: boolean): IDropdownOption[] => {
|
||||||
return [
|
const fullTextLanguageOptions: IDropdownOption[] = [
|
||||||
{
|
{
|
||||||
key: "en-US",
|
key: "en-US",
|
||||||
text: "English (US)",
|
text: "English (US)",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "fr-FR",
|
||||||
|
text: "French",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "de-DE",
|
||||||
|
text: "German",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "es-ES",
|
||||||
|
text: "Spanish",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
return englishOnly ? [fullTextLanguageOptions[0]] : fullTextLanguageOptions;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IDropdownOption } from "@fluentui/react";
|
import { IDropdownOption } from "@fluentui/react";
|
||||||
|
|
||||||
const dataTypes = ["float32", "uint8", "int8"];
|
const dataTypes = ["float32", "float16", "uint8", "int8"];
|
||||||
const distanceFunctions = ["euclidean", "cosine", "dotproduct"];
|
const distanceFunctions = ["euclidean", "cosine", "dotproduct"];
|
||||||
const indexTypes = ["none", "flat", "diskANN", "quantizedFlat"];
|
const indexTypes = ["none", "flat", "diskANN", "quantizedFlat"];
|
||||||
|
|
||||||
|
|||||||
@@ -893,6 +893,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
) => {
|
) => {
|
||||||
this.setState({ fullTextPolicy, fullTextIndexes, fullTextPolicyValidated });
|
this.setState({ fullTextPolicy, fullTextIndexes, fullTextPolicyValidated });
|
||||||
}}
|
}}
|
||||||
|
englishOnly={true}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
Reference in New Issue
Block a user