Compare commits

...

3 Commits

Author SHA1 Message Date
Asier Isayas
8ba75c0594 vector search float16 2025-11-05 08:02:13 -08:00
Asier Isayas
c142e4ad8a Merge branch 'master' of https://github.com/Azure/cosmos-explorer 2025-10-17 11:39:32 -07:00
Asier Isayas
fb95b44242 Add multiple languages for Full Text Search Policy 2025-10-17 11:39:25 -07:00
4 changed files with 24 additions and 6 deletions

View File

@@ -389,7 +389,7 @@ export interface VectorEmbeddingPolicy {
}
export interface VectorEmbedding {
dataType: "float32" | "uint8" | "int8";
dataType: "float32" | "float16" | "uint8" | "int8";
dimensions: number;
distanceFunction: "euclidean" | "cosine" | "dotproduct";
path: string;

View File

@@ -22,6 +22,7 @@ export interface FullTextPoliciesComponentProps {
) => void;
discardChanges?: boolean;
onChangesDiscarded?: () => void;
englishOnly?: boolean;
}
export interface FullTextPolicyData {
@@ -66,6 +67,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
onFullTextPathChange,
discardChanges,
onChangesDiscarded,
englishOnly,
}): JSX.Element => {
const getFullTextPathError = (path: string, index?: number): string => {
let error = "";
@@ -87,6 +89,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
if (!fullTextPolicy) {
fullTextPolicy = { defaultLanguage: getFullTextLanguageOptions()[0].key as never, fullTextPaths: [] };
}
return fullTextPolicy.fullTextPaths.map((fullTextPath: FullTextPath) => ({
...fullTextPath,
pathError: getFullTextPathError(fullTextPath.path),
@@ -166,7 +169,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
<Dropdown
required={true}
styles={dropdownStyles}
options={getFullTextLanguageOptions()}
options={getFullTextLanguageOptions(englishOnly)}
selectedKey={defaultLanguage}
onChange={(_event: React.FormEvent<HTMLDivElement>, option: IDropdownOption) =>
setDefaultLanguage(option.key as never)
@@ -211,7 +214,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
<Dropdown
required={true}
styles={dropdownStyles}
options={getFullTextLanguageOptions()}
options={getFullTextLanguageOptions(englishOnly)}
selectedKey={fullTextPolicy.language}
onChange={(_event: React.FormEvent<HTMLDivElement>, option: IDropdownOption) =>
onFullTextPathPolicyChange(index, option)
@@ -229,11 +232,25 @@ export const FullTextPoliciesComponent: React.FunctionComponent<FullTextPolicies
);
};
export const getFullTextLanguageOptions = (): IDropdownOption[] => {
return [
export const getFullTextLanguageOptions = (englishOnly?: boolean): IDropdownOption[] => {
const fullTextLanguageOptions: IDropdownOption[] = [
{
key: "en-US",
text: "English (US)",
},
{
key: "fr-FR",
text: "French",
},
{
key: "de-DE",
text: "German",
},
{
key: "es-ES",
text: "Spanish",
},
];
return englishOnly ? [fullTextLanguageOptions[0]] : fullTextLanguageOptions;
};

View File

@@ -1,6 +1,6 @@
import { IDropdownOption } from "@fluentui/react";
const dataTypes = ["float32", "uint8", "int8"];
const dataTypes = ["float32", "float16", "uint8", "int8"];
const distanceFunctions = ["euclidean", "cosine", "dotproduct"];
const indexTypes = ["none", "flat", "diskANN", "quantizedFlat"];

View File

@@ -893,6 +893,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
) => {
this.setState({ fullTextPolicy, fullTextIndexes, fullTextPolicyValidated });
}}
englishOnly={true}
/>
</Stack>
</Stack>