From b601c4346e5859d7b6b55334050f319a89ba08ab Mon Sep 17 00:00:00 2001 From: Daniel Getu Date: Thu, 6 Jun 2024 20:30:35 +0000 Subject: [PATCH] Regenerate with 2024-07-01 spec --- common/config/rush/pnpm-lock.yaml | 37 +- sdk/search/search-documents/CHANGELOG.md | 15 + sdk/search/search-documents/package.json | 3 +- .../review/search-documents.api.md | 268 +++++++- .../search-documents/samples-dev/setup.ts | 12 + .../samples-dev/vectorSearch.ts | 8 + .../samples/v12/javascript/setup.js | 12 + .../samples/v12/javascript/vectorSearch.js | 8 + .../samples/v12/typescript/src/setup.ts | 12 + .../v12/typescript/src/vectorSearch.ts | 8 + .../search-documents/src/errorModels.ts | 28 +- .../src/generated/data/models/index.ts | 94 ++- .../src/generated/data/models/mappers.ts | 106 ++- .../src/generated/data/models/parameters.ts | 10 + .../generated/data/operations/documents.ts | 19 +- .../src/generated/data/searchClient.ts | 6 +- .../src/generated/service/models/index.ts | 505 ++++++++++++-- .../src/generated/service/models/mappers.ts | 628 +++++++++++++++++- .../service/operations/dataSources.ts | 10 +- .../generated/service/operations/indexers.ts | 16 +- .../generated/service/operations/indexes.ts | 14 +- .../generated/service/operations/skillsets.ts | 10 +- .../service/operations/synonymMaps.ts | 10 +- .../generated/service/searchServiceClient.ts | 8 +- sdk/search/search-documents/src/index.ts | 38 ++ .../search-documents/src/indexModels.ts | 36 +- .../search-documents/src/searchClient.ts | 8 +- .../search-documents/src/searchIndexClient.ts | 8 +- .../src/searchIndexerClient.ts | 8 +- .../search-documents/src/serviceModels.ts | 132 +++- .../search-documents/src/serviceUtils.ts | 70 +- sdk/search/search-documents/swagger/Data.md | 2 +- .../search-documents/swagger/Service.md | 109 ++- .../test/public/node/searchClient.spec.ts | 42 +- .../public/node/searchIndexClient.spec.ts | 46 +- .../test/public/typeDefinitions.ts | 22 +- .../test/public/utils/setup.ts | 74 ++- 37 files changed, 2115 insertions(+), 327 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 78496c5f2f50..bf9bb5a11e4e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10068,6 +10068,14 @@ packages: streamx: 2.18.0 dev: false + /tersify@3.12.1: + resolution: {integrity: sha512-VwzXGHZSOB4T27s4uvh9v8FYrNXyfVz0nBQi28TDwrZoQwT8ZJUp1W2Ff73ekN07stJSb0D+pr6iXeNeFqTI6Q==} + dependencies: + acorn: 8.12.1 + is-buffer: 2.0.5 + unpartial: 1.0.5 + dev: false + /test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -10442,6 +10450,13 @@ packages: mime-types: 2.1.35 dev: false + /type-plus@7.6.2: + resolution: {integrity: sha512-qUlXv9Y0/W56pg38m275IMD3WA03QbVoqNY16S3kmwtuA4gOT2iheyUdOp8NWrmXWpf7om98hzr7AZD/eW2jLA==} + dependencies: + tersify: 3.12.1 + unpartial: 1.0.5 + dev: false + /typed-array-buffer@1.0.2: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} @@ -10541,6 +10556,12 @@ packages: hasBin: true dev: false + /typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + engines: {node: '>=14.17'} + hasBin: true + dev: false + /ua-parser-js@0.7.38: resolution: {integrity: sha512-fYmIy7fKTSFAhG3fuPlubeGaMoAd6r0rSnfEsO5nEY55i26KSLt9EH7PLQiiqPUhNqYIJvSkTy1oArIcXAbPbA==} dev: false @@ -10616,6 +10637,11 @@ packages: engines: {node: '>= 10.0.0'} dev: false + /unpartial@1.0.5: + resolution: {integrity: sha512-yAqaXcachjgZUnM2yIkf+4KJhmyuoj7stBvlnlZpB15OYVbKnLhgJfmLW7qkpzLHCdsm1bEFvhyN9hCmlZ3uuw==} + engines: {node: '>=6'} + dev: false + /unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -11500,7 +11526,7 @@ packages: dev: false file:projects/ai-inference.tgz: - resolution: {integrity: sha512-BvQNtblG5Ekhs4ZmiHUKiLU49L8op9tVOwJSCaZP52jhMBqNAmZFWQ4QTz6uAdbd8nqlTdtL932Xer59Dap9PA==, tarball: file:projects/ai-inference.tgz} + resolution: {integrity: sha512-RZajZdzu6j7X9C4dVf2rYkuHno03Yvc/IQ/LP5vklugnFc74kluhXdEY6F2aoWK+b0Vh4K9YP0E9IG/yryJMOw==, tarball: file:projects/ai-inference.tgz} name: '@rush-temp/ai-inference' version: 0.0.0 dependencies: @@ -11712,7 +11738,7 @@ packages: dev: false file:projects/ai-text-analytics.tgz: - resolution: {integrity: sha512-lE4wXAnj0Mor6PbzOzScLSTW5+5SDmHqwKt0JS9rHHZhPe8d51icfxYeWVu+lZ/MlnkeML+JpKbFAOkEZ0guvw==, tarball: file:projects/ai-text-analytics.tgz} + resolution: {integrity: sha512-KhEaRw6EXf2LMmw6rbuaep9/G4kKWATXsA5czScbTOkJ3bQKOACslWN3zynn+puHpuyIeANMVovQaNH8oRd1xg==, tarball: file:projects/ai-text-analytics.tgz} name: '@rush-temp/ai-text-analytics' version: 0.0.0 dependencies: @@ -20474,7 +20500,7 @@ packages: name: '@rush-temp/dev-tool' version: 0.0.0 dependencies: - '@_ts/max': /typescript@5.5.3 + '@_ts/max': /typescript@5.5.4 '@_ts/min': /typescript@4.2.4 '@azure/identity': 4.4.0 '@microsoft/api-extractor': 7.47.1(@types/node@18.19.40) @@ -22114,7 +22140,7 @@ packages: '@azure/functions': 4.5.0 '@azure/functions-old': /@azure/functions@3.5.1 '@azure/functions3': /@azure/functions@3.2.0 - '@microsoft/api-extractor': 7.47.0(@types/node@18.19.39) + '@microsoft/api-extractor': 7.47.1(@types/node@18.19.40) '@microsoft/applicationinsights-web-snippet': 1.2.1 '@opentelemetry/api': 1.9.0 '@opentelemetry/api-logs': 0.52.1 @@ -23310,7 +23336,7 @@ packages: dev: false file:projects/search-documents.tgz: - resolution: {integrity: sha512-QwCqI/QWOkgjhu7u6gjKdT5bzrmcjYRvPbXwCJKSf9X+ixHviiE6SU2TevqsXRgr15OcmgRuCRq92eJA/A2VnQ==, tarball: file:projects/search-documents.tgz} + resolution: {integrity: sha512-7YkpVK3YHsZb4KJfViyS4sbqdpWQPpebcwUp1kOIHANn8Q97ipVuDAcZGxgVgADNhgWpBrFIf/E5BZ0ORfbsMQ==, tarball: file:projects/search-documents.tgz} name: '@rush-temp/search-documents' version: 0.0.0 dependencies: @@ -23344,6 +23370,7 @@ packages: sinon: 17.0.1 ts-node: 10.9.2(@types/node@18.19.40)(typescript@5.3.3) tslib: 2.6.3 + type-plus: 7.6.2 typescript: 5.3.3 util: 0.12.5 transitivePeerDependencies: diff --git a/sdk/search/search-documents/CHANGELOG.md b/sdk/search/search-documents/CHANGELOG.md index 5498ff119a9b..bf8717f7919b 100644 --- a/sdk/search/search-documents/CHANGELOG.md +++ b/sdk/search/search-documents/CHANGELOG.md @@ -2,6 +2,21 @@ ## 12.1.0 (2024-07-24) +### Features Added + +- Added support for text queries against vector fields [#30494](https://github.com/Azure/azure-sdk-for-js/pull/29597) + - Create text queries against vector fields with the `VectorizedTextQuery` variant of `VectorQuery`. Such queries are supported by configuring the corresponding index field with a `VectorSearchVectorizer`. This configuration describes a delegate, which the service uses to generate vector embeddings for the query text. +- Added `AzureOpenAIEmbeddingSkill` to allow for `SearchIndexer`s to populate embedding fields at index-time. +- Added index configuration for vector quantization through `VectorSearchCompression` + +### Bugs Fixed + +- Improved serialization performance on large payloads [#29597](https://github.com/Azure/azure-sdk-for-js/pull/29597) + +### Note + +- This GA release introduces bug fixes, convenience improvements, and select features from prior beta releases. Except for the features listed in these release notes, no preview features are being pulled into this release. + ## 12.1.0-beta.2 (2024-05-20) ### Breaking Changes diff --git a/sdk/search/search-documents/package.json b/sdk/search/search-documents/package.json index 1a2b660716f6..b824e29efa84 100644 --- a/sdk/search/search-documents/package.json +++ b/sdk/search/search-documents/package.json @@ -130,7 +130,8 @@ "sinon": "^17.0.0", "ts-node": "^10.0.0", "typescript": "~5.3.3", - "util": "^0.12.1" + "util": "^0.12.1", + "type-plus": "^7.6.2" }, "//sampleConfiguration": { "productName": "Azure Search Documents", diff --git a/sdk/search/search-documents/review/search-documents.api.md b/sdk/search/search-documents/review/search-documents.api.md index 3781b571fb71..770cac41d8ce 100644 --- a/sdk/search/search-documents/review/search-documents.api.md +++ b/sdk/search/search-documents/review/search-documents.api.md @@ -11,7 +11,6 @@ import { ExtendedCommonClientOptions } from '@azure/core-http-compat'; import { KeyCredential } from '@azure/core-auth'; import { OperationOptions } from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { Pipeline } from '@azure/core-rest-pipeline'; import { RestError } from '@azure/core-rest-pipeline'; import { TokenCredential } from '@azure/core-auth'; @@ -84,6 +83,30 @@ export interface AzureActiveDirectoryApplicationCredentials { export { AzureKeyCredential } +// @public +export interface AzureOpenAIEmbeddingSkill extends BaseSearchIndexerSkill, AzureOpenAIParameters { + dimensions?: number; + odatatype: "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; +} + +// @public +export type AzureOpenAIModelName = string; + +// @public +export interface AzureOpenAIParameters { + apiKey?: string; + authIdentity?: SearchIndexerDataIdentity; + deploymentId?: string; + modelName?: AzureOpenAIModelName; + resourceUrl?: string; +} + +// @public +export interface AzureOpenAIVectorizer extends BaseVectorSearchVectorizer { + kind: "azureOpenAI"; + parameters?: AzureOpenAIParameters; +} + // @public export interface BaseCharFilter { name: string; @@ -126,13 +149,18 @@ export interface BaseScoringFunction { type: "distance" | "freshness" | "magnitude" | "tag"; } +// @public +export interface BaseSearchIndexerDataIdentity { + odatatype: "#Microsoft.Azure.Search.DataNoneIdentity" | "#Microsoft.Azure.Search.DataUserAssignedIdentity"; +} + // @public export interface BaseSearchIndexerSkill { context?: string; description?: string; inputs: InputFieldMappingEntry[]; name?: string; - odatatype: "#Microsoft.Skills.Util.ConditionalSkill" | "#Microsoft.Skills.Text.KeyPhraseExtractionSkill" | "#Microsoft.Skills.Vision.OcrSkill" | "#Microsoft.Skills.Vision.ImageAnalysisSkill" | "#Microsoft.Skills.Text.LanguageDetectionSkill" | "#Microsoft.Skills.Util.ShaperSkill" | "#Microsoft.Skills.Text.MergeSkill" | "#Microsoft.Skills.Text.EntityRecognitionSkill" | "#Microsoft.Skills.Text.SentimentSkill" | "#Microsoft.Skills.Text.V3.SentimentSkill" | "#Microsoft.Skills.Text.V3.EntityLinkingSkill" | "#Microsoft.Skills.Text.V3.EntityRecognitionSkill" | "#Microsoft.Skills.Text.PIIDetectionSkill" | "#Microsoft.Skills.Text.SplitSkill" | "#Microsoft.Skills.Text.CustomEntityLookupSkill" | "#Microsoft.Skills.Text.TranslationSkill" | "#Microsoft.Skills.Util.DocumentExtractionSkill" | "#Microsoft.Skills.Custom.WebApiSkill"; + odatatype: "#Microsoft.Skills.Util.ConditionalSkill" | "#Microsoft.Skills.Text.KeyPhraseExtractionSkill" | "#Microsoft.Skills.Vision.OcrSkill" | "#Microsoft.Skills.Vision.ImageAnalysisSkill" | "#Microsoft.Skills.Text.LanguageDetectionSkill" | "#Microsoft.Skills.Util.ShaperSkill" | "#Microsoft.Skills.Text.MergeSkill" | "#Microsoft.Skills.Text.EntityRecognitionSkill" | "#Microsoft.Skills.Text.SentimentSkill" | "#Microsoft.Skills.Text.V3.SentimentSkill" | "#Microsoft.Skills.Text.V3.EntityLinkingSkill" | "#Microsoft.Skills.Text.V3.EntityRecognitionSkill" | "#Microsoft.Skills.Text.PIIDetectionSkill" | "#Microsoft.Skills.Text.SplitSkill" | "#Microsoft.Skills.Text.CustomEntityLookupSkill" | "#Microsoft.Skills.Text.TranslationSkill" | "#Microsoft.Skills.Util.DocumentExtractionSkill" | "#Microsoft.Skills.Custom.WebApiSkill" | "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; outputs: OutputFieldMappingEntry[]; } @@ -171,6 +199,8 @@ export interface BaseVectorQuery { fields?: SearchFieldArray; kind: VectorQueryKind; kNearestNeighborsCount?: number; + oversampling?: number; + weight?: number; } // @public @@ -179,6 +209,25 @@ export interface BaseVectorSearchAlgorithmConfiguration { name: string; } +// @public +export interface BaseVectorSearchCompression { + compressionName: string; + defaultOversampling?: number; + kind: "scalarQuantization" | "binaryQuantization"; + rerankWithOriginalVectors?: boolean; +} + +// @public +export interface BaseVectorSearchVectorizer { + kind: VectorSearchVectorizerKind; + vectorizerName: string; +} + +// @public +export interface BinaryQuantizationCompression extends BaseVectorSearchCompression { + kind: "binaryQuantization"; +} + // @public (undocumented) export type BlobIndexerDataToExtract = `${KnownBlobIndexerDataToExtract}`; @@ -247,7 +296,7 @@ export type ComplexDataType = "Edm.ComplexType" | "Collection(Edm.ComplexType)"; // @public export interface ComplexField { - fields: SearchField[]; + fields?: SearchField[]; name: string; type: ComplexDataType; } @@ -678,8 +727,6 @@ export interface IndexDocumentsResult { readonly results: IndexingResult[]; } -// Warning: (ae-forgotten-export) The symbol "KnownIndexerExecutionEnvironment" needs to be exported by the entry point index.d.ts -// // @public (undocumented) export type IndexerExecutionEnvironment = `${KnownIndexerExecutionEnvironment}`; @@ -752,6 +799,9 @@ export type IndexIterator = PagedAsyncIterableIterator; +// @public +export type IndexProjectionMode = string; + // @public export interface InputFieldMappingEntry { inputs?: InputFieldMappingEntry[]; @@ -889,6 +939,13 @@ export enum KnownAnalyzerNames { ZhHantMicrosoft = "zh-Hant.microsoft" } +// @public +export enum KnownAzureOpenAIModelName { + TextEmbedding3Large = "text-embedding-3-large", + TextEmbedding3Small = "text-embedding-3-small", + TextEmbeddingAda002 = "text-embedding-ada-002" +} + // @public export enum KnownBlobIndexerDataToExtract { AllMetadata = "allMetadata", @@ -1037,6 +1094,18 @@ export enum KnownImageDetail { Landmarks = "landmarks" } +// @public +export enum KnownIndexerExecutionEnvironment { + Private = "private", + Standard = "standard" +} + +// @public +export enum KnownIndexProjectionMode { + IncludeIndexingParentDocuments = "includeIndexingParentDocuments", + SkipIndexingParentDocuments = "skipIndexingParentDocuments" +} + // @public export enum KnownKeyPhraseExtractionSkillLanguage { Da = "da", @@ -1057,6 +1126,14 @@ export enum KnownKeyPhraseExtractionSkillLanguage { Sv = "sv" } +// @public +export enum KnownOcrLineEnding { + CarriageReturn = "carriageReturn", + CarriageReturnLineFeed = "carriageReturnLineFeed", + LineFeed = "lineFeed", + Space = "space" +} + // @public export enum KnownOcrSkillLanguage { Af = "af", @@ -1231,6 +1308,12 @@ export enum KnownOcrSkillLanguage { Zu = "zu" } +// @public +export enum KnownPIIDetectionSkillMaskingMode { + None = "none", + Replace = "replace" +} + // @public export enum KnownRegexFlags { CanonEq = "CANON_EQ", @@ -1250,6 +1333,23 @@ export enum KnownSearchAudience { AzurePublicCloud = "https://search.azure.com" } +// @public +export enum KnownSearchFieldDataType { + Boolean = "Edm.Boolean", + Byte = "Edm.Byte", + Complex = "Edm.ComplexType", + DateTimeOffset = "Edm.DateTimeOffset", + Double = "Edm.Double", + GeographyPoint = "Edm.GeographyPoint", + Half = "Edm.Half", + Int16 = "Edm.Int16", + Int32 = "Edm.Int32", + Int64 = "Edm.Int64", + SByte = "Edm.SByte", + Single = "Edm.Single", + String = "Edm.String" +} + // @public export enum KnownSearchIndexerDataSourceType { AdlsGen2 = "adlsgen2", @@ -1362,6 +1462,7 @@ export enum KnownTextTranslationSkillLanguage { Fil = "fil", Fj = "fj", Fr = "fr", + Ga = "ga", He = "he", Hi = "hi", Hr = "hr", @@ -1371,18 +1472,24 @@ export enum KnownTextTranslationSkillLanguage { Is = "is", It = "it", Ja = "ja", + Kn = "kn", Ko = "ko", Lt = "lt", Lv = "lv", Mg = "mg", + Mi = "mi", + Ml = "ml", Ms = "ms", Mt = "mt", Mww = "mww", Nb = "nb", Nl = "nl", Otq = "otq", + Pa = "pa", Pl = "pl", Pt = "pt", + PtBr = "pt-br", + PtPT = "pt-PT", Ro = "ro", Ru = "ru", Sk = "sk", @@ -1396,6 +1503,8 @@ export enum KnownTextTranslationSkillLanguage { Te = "te", Th = "th", Tlh = "tlh", + TlhLatn = "tlh-Latn", + TlhPiqd = "tlh-Piqd", To = "to", Tr = "tr", Ty = "ty", @@ -1463,6 +1572,11 @@ export enum KnownTokenizerNames { Whitespace = "whitespace" } +// @public +export enum KnownVectorEncodingFormat { + PackedBit = "packedBit" +} + // @public export enum KnownVectorFilterMode { PostFilter = "postFilter", @@ -1471,6 +1585,7 @@ export enum KnownVectorFilterMode { // @public export enum KnownVectorQueryKind { + Text = "text", Vector = "vector" } @@ -1484,7 +1599,25 @@ export enum KnownVectorSearchAlgorithmKind { export enum KnownVectorSearchAlgorithmMetric { Cosine = "cosine", DotProduct = "dotProduct", - Euclidean = "euclidean" + Euclidean = "euclidean", + Hamming = "hamming" +} + +// @public +export enum KnownVectorSearchCompressionKind { + BinaryQuantization = "binaryQuantization", + ScalarQuantization = "scalarQuantization" +} + +// @public +export enum KnownVectorSearchCompressionTarget { + Int8 = "int8" +} + +// @public +export enum KnownVectorSearchVectorizerKind { + AzureOpenAI = "azureOpenAI", + CustomWebApi = "customWebApi" } // @public @@ -1638,6 +1771,9 @@ export interface NGramTokenizer extends BaseLexicalTokenizer { tokenChars?: TokenCharacterKind[]; } +// @public +export type OcrLineEnding = string; + // @public export interface OcrSkill extends BaseSearchIndexerSkill { defaultLanguageCode?: OcrSkillLanguage; @@ -1729,8 +1865,6 @@ export interface PIIDetectionSkill extends BaseSearchIndexerSkill { odatatype: "#Microsoft.Skills.Text.PIIDetectionSkill"; } -// Warning: (ae-forgotten-export) The symbol "KnownPIIDetectionSkillMaskingMode" needs to be exported by the entry point index.d.ts -// // @public (undocumented) export type PIIDetectionSkillMaskingMode = `${KnownPIIDetectionSkillMaskingMode}`; @@ -1774,6 +1908,17 @@ export interface ResourceCounter { // @public export type RunIndexerOptions = OperationOptions; +// @public +export interface ScalarQuantizationCompression extends BaseVectorSearchCompression { + kind: "scalarQuantization"; + parameters?: ScalarQuantizationParameters; +} + +// @public +export interface ScalarQuantizationParameters { + quantizedDataType?: VectorSearchCompressionTarget; +} + // @public export type ScoringFunction = DistanceScoringFunction | FreshnessScoringFunction | MagnitudeScoringFunction | TagScoringFunction; @@ -1809,7 +1954,6 @@ export class SearchClient implements IndexDocumentsClient readonly indexName: string; mergeDocuments(documents: TModel[], options?: MergeDocumentsOptions): Promise; mergeOrUploadDocuments(documents: TModel[], options?: MergeOrUploadDocumentsOptions): Promise; - readonly pipeline: Pipeline; search>(searchText?: string, options?: SearchOptions): Promise>; readonly serviceVersion: string; suggest = never>(searchText: string, suggesterName: string, options?: SuggestOptions): Promise>; @@ -1853,8 +1997,6 @@ export type SearchField = SimpleField | ComplexField; // @public export type SearchFieldArray = (() => T extends TModel ? true : false) extends () => T extends object ? true : false ? readonly string[] : readonly SelectFields[]; -// Warning: (ae-forgotten-export) The symbol "KnownSearchFieldDataType" needs to be exported by the entry point index.d.ts -// // @public export type SearchFieldDataType = Exclude<`${KnownSearchFieldDataType}` | `Collection(${KnownSearchFieldDataType})`, "Edm.ComplexType" | "Edm.Byte" | "Edm.Half" | "Edm.Int16" | "Edm.SByte" | "Edm.Single">; @@ -1899,7 +2041,6 @@ export class SearchIndexClient { listIndexesNames(options?: ListIndexesOptions): IndexNameIterator; listSynonymMaps(options?: ListSynonymMapsOptions): Promise>; listSynonymMapsNames(options?: ListSynonymMapsOptions): Promise>; - readonly pipeline: Pipeline; readonly serviceVersion: string; } @@ -1952,7 +2093,6 @@ export class SearchIndexerClient { listIndexersNames(options?: ListIndexersOptions): Promise>; listSkillsets(options?: ListSkillsetsOptions): Promise>; listSkillsetsNames(options?: ListSkillsetsOptions): Promise>; - readonly pipeline: Pipeline; resetIndexer(indexerName: string, options?: ResetIndexerOptions): Promise; runIndexer(indexerName: string, options?: RunIndexerOptions): Promise; readonly serviceVersion: string; @@ -1972,6 +2112,14 @@ export interface SearchIndexerDataContainer { query?: string; } +// @public +export type SearchIndexerDataIdentity = SearchIndexerDataNoneIdentity | SearchIndexerDataUserAssignedIdentity; + +// @public +export interface SearchIndexerDataNoneIdentity extends BaseSearchIndexerDataIdentity { + odatatype: "#Microsoft.Azure.Search.DataNoneIdentity"; +} + // @public export interface SearchIndexerDataSourceConnection { connectionString?: string; @@ -1981,6 +2129,7 @@ export interface SearchIndexerDataSourceConnection { description?: string; encryptionKey?: SearchResourceEncryptionKey; etag?: string; + identity?: SearchIndexerDataIdentity; name: string; type: SearchIndexerDataSourceType; } @@ -1988,6 +2137,12 @@ export interface SearchIndexerDataSourceConnection { // @public (undocumented) export type SearchIndexerDataSourceType = `${KnownSearchIndexerDataSourceType}`; +// @public +export interface SearchIndexerDataUserAssignedIdentity extends BaseSearchIndexerDataIdentity { + odatatype: "#Microsoft.Azure.Search.DataUserAssignedIdentity"; + resourceId: string; +} + // @public export interface SearchIndexerError { readonly details?: string; @@ -1998,8 +2153,29 @@ export interface SearchIndexerError { readonly statusCode: number; } +// @public +export interface SearchIndexerIndexProjection { + parameters?: SearchIndexerIndexProjectionParameters; + selectors: SearchIndexerIndexProjectionSelector[]; +} + +// @public +export interface SearchIndexerIndexProjectionParameters { + [property: string]: unknown; + projectionMode?: IndexProjectionMode; +} + +// @public +export interface SearchIndexerIndexProjectionSelector { + mappings: InputFieldMappingEntry[]; + parentKeyFieldName: string; + sourceContext: string; + targetIndexName: string; +} + // @public export interface SearchIndexerKnowledgeStore { + identity?: SearchIndexerDataIdentity; projections: SearchIndexerKnowledgeStoreProjection[]; storageConnectionString: string; } @@ -2017,6 +2193,12 @@ export interface SearchIndexerKnowledgeStoreFileProjectionSelector extends Searc export interface SearchIndexerKnowledgeStoreObjectProjectionSelector extends SearchIndexerKnowledgeStoreBlobProjectionSelector { } +// @public +export interface SearchIndexerKnowledgeStoreParameters { + [property: string]: unknown; + synthesizeGeneratedKeyName?: boolean; +} + // @public export interface SearchIndexerKnowledgeStoreProjection { files?: SearchIndexerKnowledgeStoreFileProjectionSelector[]; @@ -2046,7 +2228,7 @@ export interface SearchIndexerLimits { } // @public -export type SearchIndexerSkill = ConditionalSkill | CustomEntityLookupSkill | DocumentExtractionSkill | EntityLinkingSkill | EntityRecognitionSkill | EntityRecognitionSkillV3 | ImageAnalysisSkill | KeyPhraseExtractionSkill | LanguageDetectionSkill | MergeSkill | OcrSkill | PIIDetectionSkill | SentimentSkill | SentimentSkillV3 | ShaperSkill | SplitSkill | TextTranslationSkill | WebApiSkill; +export type SearchIndexerSkill = AzureOpenAIEmbeddingSkill | ConditionalSkill | CustomEntityLookupSkill | DocumentExtractionSkill | EntityLinkingSkill | EntityRecognitionSkill | EntityRecognitionSkillV3 | ImageAnalysisSkill | KeyPhraseExtractionSkill | LanguageDetectionSkill | MergeSkill | OcrSkill | PIIDetectionSkill | SentimentSkill | SentimentSkillV3 | ShaperSkill | SplitSkill | TextTranslationSkill | WebApiSkill; // @public export interface SearchIndexerSkillset { @@ -2054,6 +2236,7 @@ export interface SearchIndexerSkillset { description?: string; encryptionKey?: SearchResourceEncryptionKey; etag?: string; + indexProjection?: SearchIndexerIndexProjection; knowledgeStore?: SearchIndexerKnowledgeStore; name: string; skills: SearchIndexerSkill[]; @@ -2165,6 +2348,7 @@ export type SearchRequestQueryTypeOptions = { export interface SearchResourceEncryptionKey { applicationId?: string; applicationSecret?: string; + identity?: SearchIndexerDataIdentity; keyName: string; keyVersion: string; vaultUrl: string; @@ -2240,6 +2424,7 @@ export interface SemanticSearchOptions { configurationName?: string; errorMode?: SemanticErrorMode; maxWaitInMilliseconds?: number; + semanticQuery?: string; } // @public (undocumented) @@ -2268,7 +2453,7 @@ export interface ServiceCounters { documentCounter: ResourceCounter; indexCounter: ResourceCounter; indexerCounter: ResourceCounter; - skillsetCounter?: ResourceCounter; + skillsetCounter: ResourceCounter; storageSizeCounter: ResourceCounter; synonymMapCounter: ResourceCounter; vectorIndexSizeCounter: ResourceCounter; @@ -2280,6 +2465,7 @@ export interface ServiceLimits { maxComplexObjectsInCollectionsPerDocument?: number; maxFieldNestingDepthPerIndex?: number; maxFieldsPerIndex?: number; + maxStoragePerIndexInBytes?: number; } // @public @@ -2318,8 +2504,10 @@ export interface SimpleField { searchable?: boolean; searchAnalyzerName?: LexicalAnalyzerName; sortable?: boolean; + stored?: boolean; synonymMapNames?: string[]; type: SearchFieldDataType; + vectorEncodingFormat?: VectorEncodingFormat; vectorSearchDimensions?: number; vectorSearchProfileName?: string; } @@ -2501,9 +2689,18 @@ export interface UniqueTokenFilter extends BaseTokenFilter { // @public export type UploadDocumentsOptions = IndexDocumentsOptions; +// @public +export type VectorEncodingFormat = string; + // @public (undocumented) export type VectorFilterMode = `${KnownVectorFilterMode}`; +// @public +export interface VectorizableTextQuery extends BaseVectorQuery { + kind: "text"; + text: string; +} + // @public export interface VectorizedQuery extends BaseVectorQuery { kind: "vector"; @@ -2511,7 +2708,7 @@ export interface VectorizedQuery extends BaseVectorQuery< } // @public -export type VectorQuery = VectorizedQuery; +export type VectorQuery = VectorizedQuery | VectorizableTextQuery; // @public (undocumented) export type VectorQueryKind = `${KnownVectorQueryKind}`; @@ -2519,7 +2716,9 @@ export type VectorQueryKind = `${KnownVectorQueryKind}`; // @public export interface VectorSearch { algorithms?: VectorSearchAlgorithmConfiguration[]; + compressions?: VectorSearchCompression[]; profiles?: VectorSearchProfile[]; + vectorizers?: VectorSearchVectorizer[]; } // @public @@ -2531,6 +2730,15 @@ export type VectorSearchAlgorithmKind = `${KnownVectorSearchAlgorithmKind}`; // @public (undocumented) export type VectorSearchAlgorithmMetric = `${KnownVectorSearchAlgorithmMetric}`; +// @public +export type VectorSearchCompression = BinaryQuantizationCompression | ScalarQuantizationCompression; + +// @public +export type VectorSearchCompressionKind = string; + +// @public +export type VectorSearchCompressionTarget = string; + // @public export interface VectorSearchOptions { filterMode?: VectorFilterMode; @@ -2540,14 +2748,36 @@ export interface VectorSearchOptions { // @public export interface VectorSearchProfile { algorithmConfigurationName: string; + compressionName?: string; name: string; + vectorizerName?: string; } +// @public +export type VectorSearchVectorizer = AzureOpenAIVectorizer | WebApiVectorizer; + +// @public +export type VectorSearchVectorizerKind = string; + // @public (undocumented) export type VisualFeature = `${KnownVisualFeature}`; +// @public +export interface WebApiParameters { + authIdentity?: SearchIndexerDataIdentity; + authResourceId?: string; + httpHeaders?: { + [propertyName: string]: string; + }; + httpMethod?: string; + timeout?: string; + uri?: string; +} + // @public export interface WebApiSkill extends BaseSearchIndexerSkill { + authIdentity?: SearchIndexerDataIdentity; + authResourceId?: string; batchSize?: number; degreeOfParallelism?: number; httpHeaders?: { @@ -2559,6 +2789,12 @@ export interface WebApiSkill extends BaseSearchIndexerSkill { uri: string; } +// @public +export interface WebApiVectorizer extends BaseVectorSearchVectorizer { + kind: "customWebApi"; + parameters?: WebApiParameters; +} + // @public export interface WordDelimiterTokenFilter extends BaseTokenFilter { catenateAll?: boolean; diff --git a/sdk/search/search-documents/samples-dev/setup.ts b/sdk/search/search-documents/samples-dev/setup.ts index 8316293413e6..58be90ef0ffe 100644 --- a/sdk/search/search-documents/samples-dev/setup.ts +++ b/sdk/search/search-documents/samples-dev/setup.ts @@ -7,6 +7,7 @@ */ import { KnownAnalyzerNames, SearchIndex, SearchIndexClient } from "@azure/search-documents"; +import { env } from "process"; import { Hotel } from "./interfaces"; export const WAIT_TIME = 4000; @@ -249,10 +250,21 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom }, vectorSearch: { algorithms: [{ name: "vector-search-algorithm", kind: "hnsw" }], + vectorizers: [ + { + vectorizerName: "vector-search-vectorizer", + kind: "azureOpenAI", + parameters: { + resourceUrl: env.AZURE_OPENAI_ENDPOINT, + deploymentId: env.AZURE_OPENAI_DEPLOYMENT_NAME, + }, + }, + ], profiles: [ { name: "vector-search-profile", algorithmConfigurationName: "vector-search-algorithm", + vectorizerName: "vector-search-vectorizer", }, ], }, diff --git a/sdk/search/search-documents/samples-dev/vectorSearch.ts b/sdk/search/search-documents/samples-dev/vectorSearch.ts index 6733e7682a94..31ece408b87a 100644 --- a/sdk/search/search-documents/samples-dev/vectorSearch.ts +++ b/sdk/search/search-documents/samples-dev/vectorSearch.ts @@ -92,6 +92,14 @@ async function main(): Promise { kNearestNeighborsCount: 3, vector: luxuryQueryVector, }, + // The index can be configured with a vectorizer to generate text embeddings + // from a text query + { + kind: "text", + fields: ["descriptionVectorFr"], + kNearestNeighborsCount: 3, + text: "What are the most luxurious hotels?", + }, ], }, }); diff --git a/sdk/search/search-documents/samples/v12/javascript/setup.js b/sdk/search/search-documents/samples/v12/javascript/setup.js index ebd195953bde..1d09c70a93c0 100644 --- a/sdk/search/search-documents/samples/v12/javascript/setup.js +++ b/sdk/search/search-documents/samples/v12/javascript/setup.js @@ -6,6 +6,7 @@ */ const { KnownAnalyzerNames } = require("@azure/search-documents"); +const { env } = require("process"); const WAIT_TIME = 4000; @@ -247,10 +248,21 @@ async function createIndex(client, name) { }, vectorSearch: { algorithms: [{ name: "vector-search-algorithm", kind: "hnsw" }], + vectorizers: [ + { + vectorizerName: "vector-search-vectorizer", + kind: "azureOpenAI", + parameters: { + resourceUrl: env.AZURE_OPENAI_ENDPOINT, + deploymentId: env.AZURE_OPENAI_DEPLOYMENT_NAME, + }, + }, + ], profiles: [ { name: "vector-search-profile", algorithmConfigurationName: "vector-search-algorithm", + vectorizerName: "vector-search-vectorizer", }, ], }, diff --git a/sdk/search/search-documents/samples/v12/javascript/vectorSearch.js b/sdk/search/search-documents/samples/v12/javascript/vectorSearch.js index 9328989abed5..e50d8e3924ed 100644 --- a/sdk/search/search-documents/samples/v12/javascript/vectorSearch.js +++ b/sdk/search/search-documents/samples/v12/javascript/vectorSearch.js @@ -87,6 +87,14 @@ async function main() { kNearestNeighborsCount: 3, vector: luxuryQueryVector, }, + // The index can be configured with a vectorizer to generate text embeddings + // from a text query + { + kind: "text", + fields: ["descriptionVectorFr"], + kNearestNeighborsCount: 3, + text: "What are the most luxurious hotels?", + }, ], }, }); diff --git a/sdk/search/search-documents/samples/v12/typescript/src/setup.ts b/sdk/search/search-documents/samples/v12/typescript/src/setup.ts index 1e5488ea8b72..5a32d402ef79 100644 --- a/sdk/search/search-documents/samples/v12/typescript/src/setup.ts +++ b/sdk/search/search-documents/samples/v12/typescript/src/setup.ts @@ -6,6 +6,7 @@ */ import { KnownAnalyzerNames, SearchIndex, SearchIndexClient } from "@azure/search-documents"; +import { env } from "process"; import { Hotel } from "./interfaces"; export const WAIT_TIME = 4000; @@ -248,10 +249,21 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom }, vectorSearch: { algorithms: [{ name: "vector-search-algorithm", kind: "hnsw" }], + vectorizers: [ + { + vectorizerName: "vector-search-vectorizer", + kind: "azureOpenAI", + parameters: { + resourceUrl: env.AZURE_OPENAI_ENDPOINT, + deploymentId: env.AZURE_OPENAI_DEPLOYMENT_NAME, + }, + }, + ], profiles: [ { name: "vector-search-profile", algorithmConfigurationName: "vector-search-algorithm", + vectorizerName: "vector-search-vectorizer", }, ], }, diff --git a/sdk/search/search-documents/samples/v12/typescript/src/vectorSearch.ts b/sdk/search/search-documents/samples/v12/typescript/src/vectorSearch.ts index 6733e7682a94..31ece408b87a 100644 --- a/sdk/search/search-documents/samples/v12/typescript/src/vectorSearch.ts +++ b/sdk/search/search-documents/samples/v12/typescript/src/vectorSearch.ts @@ -92,6 +92,14 @@ async function main(): Promise { kNearestNeighborsCount: 3, vector: luxuryQueryVector, }, + // The index can be configured with a vectorizer to generate text embeddings + // from a text query + { + kind: "text", + fields: ["descriptionVectorFr"], + kNearestNeighborsCount: 3, + text: "What are the most luxurious hotels?", + }, ], }, }); diff --git a/sdk/search/search-documents/src/errorModels.ts b/sdk/search/search-documents/src/errorModels.ts index fa0dc909d9da..34723c353ef1 100644 --- a/sdk/search/search-documents/src/errorModels.ts +++ b/sdk/search/search-documents/src/errorModels.ts @@ -13,28 +13,28 @@ export interface ErrorResponse { /** The error detail. */ export interface ErrorDetail { /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The error code. NOTE: This property will not be serialized. It can only be populated by the + * server. */ readonly code?: string; /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The error message. NOTE: This property will not be serialized. It can only be populated by the + * server. */ readonly message?: string; /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The error target. NOTE: This property will not be serialized. It can only be populated by the + * server. */ readonly target?: string; /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The error details. NOTE: This property will not be serialized. It can only be populated by the + * server. */ readonly details?: ErrorDetail[]; /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The error additional info. NOTE: This property will not be serialized. It can only be populated + * by the server. */ readonly additionalInfo?: ErrorAdditionalInfo[]; } @@ -42,13 +42,13 @@ export interface ErrorDetail { /** The resource management error additional info. */ export interface ErrorAdditionalInfo { /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The additional info type. NOTE: This property will not be serialized. It can only be populated + * by the server. */ readonly type?: string; /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The additional info. NOTE: This property will not be serialized. It can only be populated by + * the server. */ readonly info?: Record; } diff --git a/sdk/search/search-documents/src/generated/data/models/index.ts b/sdk/search/search-documents/src/generated/data/models/index.ts index d7f804870723..e7aebcf7b22d 100644 --- a/sdk/search/search-documents/src/generated/data/models/index.ts +++ b/sdk/search/search-documents/src/generated/data/models/index.ts @@ -9,25 +9,58 @@ import * as coreClient from "@azure/core-client"; import * as coreHttpCompat from "@azure/core-http-compat"; -export type VectorQueryUnion = VectorQuery | VectorizedQuery; +export type VectorQueryUnion = + | VectorQuery + | VectorizedQuery + | VectorizableTextQuery; -/** Describes an error condition for the API. */ -export interface SearchError { +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { /** - * One of a server-defined set of error codes. + * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly code?: string; /** - * A human-readable representation of the error. + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message: string; + readonly type?: string; /** - * An array of details about specific errors that led to this reported error. + * The additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: SearchError[]; + readonly info?: Record; } /** Response containing search results from an index. */ @@ -162,6 +195,8 @@ export interface SearchRequest { semanticErrorHandling?: SemanticErrorMode; /** Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails. */ semanticMaxWaitInMilliseconds?: number; + /** Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase. */ + semanticQuery?: string; /** A value that specifies whether answers should be returned as part of the search response. */ answers?: QueryAnswerType; /** A value that specifies whether captions should be returned as part of the search response. */ @@ -175,13 +210,17 @@ export interface SearchRequest { /** The query parameters for vector and hybrid search queries. */ export interface VectorQuery { /** Polymorphic discriminator, which specifies the different types this object can be */ - kind: "vector"; + kind: "vector" | "text"; /** Number of nearest neighbors to return as top hits. */ kNearestNeighborsCount?: number; /** Vector Fields of type Collection(Edm.Single) to be included in the vector searched. */ fields?: string; /** When true, triggers an exhaustive k-nearest neighbor search across all vectors within the vector index. Useful for scenarios where exact matches are critical, such as determining ground truth values. */ exhaustive?: boolean; + /** Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is true. This parameter is only permitted when a compression method is used on the underlying vector field. */ + oversampling?: number; + /** Relative weight of the vector query when compared to other vector query and/or the text query within the same search request. This value is used when combining the results of multiple ranking lists produced by the different vector queries and/or the results retrieved through the text query. The higher the weight, the higher the documents that matched that query will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero. */ + weight?: number; } /** Contains a document found by a search query, plus associated metadata. */ @@ -194,7 +233,7 @@ export interface SearchResult { */ readonly _score: number; /** - * The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type `semantic`. + * The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly _rerankerScore?: number; @@ -204,7 +243,7 @@ export interface SearchResult { */ readonly _highlights?: { [propertyName: string]: string[] }; /** - * Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type `semantic`. + * Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly _captions?: QueryCaptionResult[]; @@ -384,6 +423,14 @@ export interface VectorizedQuery extends VectorQuery { vector: number[]; } +/** The query parameters to use for vector search when a text value that needs to be vectorized is provided. */ +export interface VectorizableTextQuery extends VectorQuery { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "text"; + /** The text to be vectorized to perform a vector search query. */ + text: string; +} + /** Parameter group */ export interface SearchOptions { /** A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. */ @@ -424,7 +471,7 @@ export interface SearchOptions { top?: number; /** The name of the semantic configuration that lists which fields should be used for semantic ranking, captions, highlights, and answers */ semanticConfiguration?: string; - /** Allows the user to choose whether a semantic call should fail completely, or to return partial results. */ + /** Allows the user to choose whether a semantic call should fail completely, or to return partial results (default). */ semanticErrorHandling?: SemanticErrorMode; /** Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails. */ semanticMaxWaitInMilliseconds?: number; @@ -432,6 +479,8 @@ export interface SearchOptions { answers?: QueryAnswerType; /** This parameter is only valid if the query type is `semantic`. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to `extractive`, highlighting is enabled by default, and can be configured by appending the pipe character `|` followed by the `highlight-` option, such as `extractive|highlight-true`. Defaults to `None`. */ captions?: QueryCaptionType; + /** Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase. */ + semanticQuery?: string; } /** Parameter group */ @@ -476,20 +525,20 @@ export interface AutocompleteOptions { top?: number; } -/** Known values of {@link ApiVersion20231101} that the service accepts. */ -export enum KnownApiVersion20231101 { - /** Api Version '2023-11-01' */ - TwoThousandTwentyThree1101 = "2023-11-01", +/** Known values of {@link ApiVersion20240701} that the service accepts. */ +export enum KnownApiVersion20240701 { + /** Api Version '2024-07-01' */ + TwoThousandTwentyFour0701 = "2024-07-01", } /** - * Defines values for ApiVersion20231101. \ - * {@link KnownApiVersion20231101} can be used interchangeably with ApiVersion20231101, + * Defines values for ApiVersion20240701. \ + * {@link KnownApiVersion20240701} can be used interchangeably with ApiVersion20240701, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **2023-11-01**: Api Version '2023-11-01' + * **2024-07-01**: Api Version '2024-07-01' */ -export type ApiVersion20231101 = string; +export type ApiVersion20240701 = string; /** Known values of {@link SemanticErrorMode} that the service accepts. */ export enum KnownSemanticErrorMode { @@ -549,6 +598,8 @@ export type QueryCaptionType = string; export enum KnownVectorQueryKind { /** Vector query where a raw vector value is provided. */ Vector = "vector", + /** Vector query where a text value that needs to be vectorized is provided. */ + Text = "text", } /** @@ -556,7 +607,8 @@ export enum KnownVectorQueryKind { * {@link KnownVectorQueryKind} can be used interchangeably with VectorQueryKind, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **vector**: Vector query where a raw vector value is provided. + * **vector**: Vector query where a raw vector value is provided. \ + * **text**: Vector query where a text value that needs to be vectorized is provided. */ export type VectorQueryKind = string; diff --git a/sdk/search/search-documents/src/generated/data/models/mappers.ts b/sdk/search/search-documents/src/generated/data/models/mappers.ts index 91de53942dd1..acaddb9abfba 100644 --- a/sdk/search/search-documents/src/generated/data/models/mappers.ts +++ b/sdk/search/search-documents/src/generated/data/models/mappers.ts @@ -8,10 +8,26 @@ import * as coreClient from "@azure/core-client"; -export const SearchError: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SearchError", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", modelProperties: { code: { serializedName: "code", @@ -22,7 +38,13 @@ export const SearchError: coreClient.CompositeMapper = { }, message: { serializedName: "message", - required: true, + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", readOnly: true, type: { name: "String", @@ -36,7 +58,20 @@ export const SearchError: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SearchError", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", }, }, }, @@ -45,6 +80,30 @@ export const SearchError: coreClient.CompositeMapper = { }, }; +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + }, + }, +}; + export const SearchDocumentsResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -352,6 +411,12 @@ export const SearchRequest: coreClient.CompositeMapper = { name: "Number", }, }, + semanticQuery: { + serializedName: "semanticQuery", + type: { + name: "String", + }, + }, answers: { serializedName: "answers", type: { @@ -421,6 +486,18 @@ export const VectorQuery: coreClient.CompositeMapper = { name: "Boolean", }, }, + oversampling: { + serializedName: "oversampling", + type: { + name: "Number", + }, + }, + weight: { + serializedName: "weight", + type: { + name: "Number", + }, + }, }, }, }; @@ -880,7 +957,28 @@ export const VectorizedQuery: coreClient.CompositeMapper = { }, }; +export const VectorizableTextQuery: coreClient.CompositeMapper = { + serializedName: "text", + type: { + name: "Composite", + className: "VectorizableTextQuery", + uberParent: "VectorQuery", + polymorphicDiscriminator: VectorQuery.type.polymorphicDiscriminator, + modelProperties: { + ...VectorQuery.type.modelProperties, + text: { + serializedName: "text", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + export let discriminators = { VectorQuery: VectorQuery, "VectorQuery.vector": VectorizedQuery, + "VectorQuery.text": VectorizableTextQuery, }; diff --git a/sdk/search/search-documents/src/generated/data/models/parameters.ts b/sdk/search/search-documents/src/generated/data/models/parameters.ts index 4bc54262837e..a4822b2e3931 100644 --- a/sdk/search/search-documents/src/generated/data/models/parameters.ts +++ b/sdk/search/search-documents/src/generated/data/models/parameters.ts @@ -346,6 +346,16 @@ export const captions: OperationQueryParameter = { }, }; +export const semanticQuery: OperationQueryParameter = { + parameterPath: ["options", "searchOptions", "semanticQuery"], + mapper: { + serializedName: "semanticQuery", + type: { + name: "String", + }, + }, +}; + export const contentType: OperationParameter = { parameterPath: ["options", "contentType"], mapper: { diff --git a/sdk/search/search-documents/src/generated/data/operations/documents.ts b/sdk/search/search-documents/src/generated/data/operations/documents.ts index 8c8fb4292c7a..301b5da08027 100644 --- a/sdk/search/search-documents/src/generated/data/operations/documents.ts +++ b/sdk/search/search-documents/src/generated/data/operations/documents.ts @@ -191,7 +191,7 @@ const countOperationSpec: coreClient.OperationSpec = { bodyMapper: { type: { name: "Number" } }, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -207,7 +207,7 @@ const searchGetOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchDocumentsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [ @@ -236,6 +236,7 @@ const searchGetOperationSpec: coreClient.OperationSpec = { Parameters.semanticMaxWaitInMilliseconds, Parameters.answers, Parameters.captions, + Parameters.semanticQuery, ], urlParameters: [Parameters.endpoint, Parameters.indexName], headerParameters: [Parameters.accept], @@ -249,7 +250,7 @@ const searchPostOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchDocumentsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.searchRequest, @@ -269,7 +270,7 @@ const getOperationSpec: coreClient.OperationSpec = { }, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.selectedFields], @@ -285,7 +286,7 @@ const suggestGetOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SuggestDocumentsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [ @@ -314,7 +315,7 @@ const suggestPostOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SuggestDocumentsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.suggestRequest, @@ -335,7 +336,7 @@ const indexOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.IndexDocumentsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.batch, @@ -353,7 +354,7 @@ const autocompleteGetOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutocompleteResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [ @@ -381,7 +382,7 @@ const autocompletePostOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AutocompleteResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.autocompleteRequest, diff --git a/sdk/search/search-documents/src/generated/data/searchClient.ts b/sdk/search/search-documents/src/generated/data/searchClient.ts index 0c544629959e..7773e7490bac 100644 --- a/sdk/search/search-documents/src/generated/data/searchClient.ts +++ b/sdk/search/search-documents/src/generated/data/searchClient.ts @@ -14,13 +14,13 @@ import { } from "@azure/core-rest-pipeline"; import { DocumentsImpl } from "./operations"; import { Documents } from "./operationsInterfaces"; -import { ApiVersion20231101, SearchClientOptionalParams } from "./models"; +import { ApiVersion20240701, SearchClientOptionalParams } from "./models"; /** @internal */ export class SearchClient extends coreHttpCompat.ExtendedServiceClient { endpoint: string; indexName: string; - apiVersion: ApiVersion20231101; + apiVersion: ApiVersion20240701; /** * Initializes a new instance of the SearchClient class. @@ -32,7 +32,7 @@ export class SearchClient extends coreHttpCompat.ExtendedServiceClient { constructor( endpoint: string, indexName: string, - apiVersion: ApiVersion20231101, + apiVersion: ApiVersion20240701, options?: SearchClientOptionalParams, ) { if (endpoint === undefined) { diff --git a/sdk/search/search-documents/src/generated/service/models/index.ts b/sdk/search/search-documents/src/generated/service/models/index.ts index 091acdc6e403..936104ccf8a7 100644 --- a/sdk/search/search-documents/src/generated/service/models/index.ts +++ b/sdk/search/search-documents/src/generated/service/models/index.ts @@ -35,7 +35,8 @@ export type SearchIndexerSkillUnion = | CustomEntityLookupSkill | TextTranslationSkill | DocumentExtractionSkill - | WebApiSkill; + | WebApiSkill + | AzureOpenAIEmbeddingSkill; export type CognitiveServicesAccountUnion = | CognitiveServicesAccount | DefaultCognitiveServicesAccount @@ -102,6 +103,18 @@ export type VectorSearchAlgorithmConfigurationUnion = | VectorSearchAlgorithmConfiguration | HnswAlgorithmConfiguration | ExhaustiveKnnAlgorithmConfiguration; +export type VectorSearchVectorizerUnion = + | VectorSearchVectorizer + | AzureOpenAIVectorizer + | WebApiVectorizer; +export type VectorSearchCompressionUnion = + | VectorSearchCompression + | ScalarQuantizationCompression + | BinaryQuantizationCompression; +export type SearchIndexerDataIdentityUnion = + | SearchIndexerDataIdentity + | SearchIndexerDataNoneIdentity + | SearchIndexerDataUserAssignedIdentity; /** Represents a datasource definition, which can be used to configure an indexer. */ export interface SearchIndexerDataSource { @@ -153,7 +166,7 @@ export interface DataDeletionDetectionPolicy { odatatype: "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"; } -/** A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest on your search service, such as indexes and synonym maps. */ +/** A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest, such as indexes and synonym maps. */ export interface SearchResourceEncryptionKey { /** The name of your Azure Key Vault key to be used to encrypt your data at rest. */ keyName: string; @@ -173,23 +186,53 @@ export interface AzureActiveDirectoryApplicationCredentials { applicationSecret?: string; } -/** Describes an error condition for the API. */ -export interface SearchError { +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { /** - * One of a server-defined set of error codes. + * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly code?: string; /** - * A human-readable representation of the error. + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message: string; + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; /** - * An array of details about specific errors that led to this reported error. + * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: SearchError[]; + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; } /** Response from a List Datasources request. If successful, it includes the full definitions of all datasources. */ @@ -263,7 +306,7 @@ export interface IndexingParametersConfiguration { failOnUnsupportedContentType?: boolean; /** For Azure blobs, set to false if you want to continue indexing if a document fails indexing. */ failOnUnprocessableDocument?: boolean; - /** For Azure blobs, set this property to true to still index storage metadata for blob content that is too large to process. Oversized blobs are treated as errors by default. For limits on blob size, see https://docs.microsoft.com/azure/search/search-limits-quotas-capacity. */ + /** For Azure blobs, set this property to true to still index storage metadata for blob content that is too large to process. Oversized blobs are treated as errors by default. For limits on blob size, see https://learn.microsoft.com/azure/search/search-limits-quotas-capacity. */ indexStorageMetadataOnlyForOversizedDocuments?: boolean; /** For CSV blobs, specifies a comma-delimited list of column headers, useful for mapping source fields to destination fields in an index. */ delimitedTextHeaders?: string; @@ -485,6 +528,8 @@ export interface SearchIndexerSkillset { cognitiveServicesAccount?: CognitiveServicesAccountUnion; /** Definition of additional projections to Azure blob, table, or files, of enriched data. */ knowledgeStore?: SearchIndexerKnowledgeStore; + /** Definition of additional projections to secondary search index(es). */ + indexProjection?: SearchIndexerIndexProjection; /** The ETag of the skillset. */ etag?: string; /** A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your skillset definition when you want full assurance that no one, not even Microsoft, can decrypt your skillset definition. Once you have encrypted your skillset definition, it will always remain encrypted. The search service will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. */ @@ -512,8 +557,9 @@ export interface SearchIndexerSkill { | "#Microsoft.Skills.Text.CustomEntityLookupSkill" | "#Microsoft.Skills.Text.TranslationSkill" | "#Microsoft.Skills.Util.DocumentExtractionSkill" - | "#Microsoft.Skills.Custom.WebApiSkill"; - /** The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character `#`. */ + | "#Microsoft.Skills.Custom.WebApiSkill" + | "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; + /** The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. */ name?: string; /** The description of the skill which describes the inputs, outputs, and usage of the skill. */ description?: string; @@ -587,6 +633,34 @@ export interface SearchIndexerKnowledgeStoreProjectionSelector { inputs?: InputFieldMappingEntry[]; } +/** Definition of additional projections to secondary search indexes. */ +export interface SearchIndexerIndexProjection { + /** A list of projections to be performed to secondary search indexes. */ + selectors: SearchIndexerIndexProjectionSelector[]; + /** A dictionary of index projection-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. */ + parameters?: SearchIndexerIndexProjectionParameters; +} + +/** Description for what data to store in the designated search index. */ +export interface SearchIndexerIndexProjectionSelector { + /** Name of the search index to project to. Must have a key field with the 'keyword' analyzer set. */ + targetIndexName: string; + /** Name of the field in the search index to map the parent document's key value to. Must be a string field that is filterable and not the key field. */ + parentKeyFieldName: string; + /** Source context for the projections. Represents the cardinality at which the document will be split into multiple sub documents. */ + sourceContext: string; + /** Mappings for the projection, or which source should be mapped to which field in the target index. */ + mappings: InputFieldMappingEntry[]; +} + +/** A dictionary of index projection-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. */ +export interface SearchIndexerIndexProjectionParameters { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Defines behavior of the index projections in relation to the rest of the indexer. */ + projectionMode?: IndexProjectionMode; +} + /** Response from a list skillset request. If successful, it includes the full definitions of all skillsets. */ export interface ListSkillsetsResult { /** @@ -604,7 +678,7 @@ export interface SynonymMap { format: "solr"; /** A series of synonym rules in the specified synonym map format. The rules must be separated by newlines. */ synonyms: string; - /** A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your sensitive data. Once you have encrypted your data, it will always remain encrypted. The search service will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. */ + /** A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data. Once you have encrypted your data, it will always remain encrypted. The search service will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. */ encryptionKey?: SearchResourceEncryptionKey; /** The ETag of the synonym map. */ etag?: string; @@ -661,8 +735,10 @@ export interface SearchField { type: SearchFieldDataType; /** A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type Edm.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is false for simple fields and null for complex fields. */ key?: boolean; - /** A value indicating whether the field can be returned in a search result. You can disable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be true for key fields, and it must be null for complex fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is true for simple fields and null for complex fields. */ + /** A value indicating whether the field can be returned in a search result. You can disable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be true for key fields, and it must be null for complex fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is true for simple fields, false for vector fields, and null for complex fields. */ retrievable?: boolean; + /** An immutable value indicating whether the field will be persisted separately on disk to be returned in a search result. You can disable this option if you don't plan to return the field contents in a search response to save on storage overhead. This can only be set during index creation and only for vector fields. This property cannot be changed for existing fields or set as false for new fields. If this property is set as false, the property 'retrievable' must also be set to false. This property must be true or unset for key fields, for new fields, and for non-vector fields, and it must be null for complex fields. Disabling this property will reduce index storage requirements. The default is true for vector fields. */ + stored?: boolean; /** A value indicating whether the field is full-text searchable. This means it will undergo analysis such as word-breaking during indexing. If you set a searchable field to a value like "sunny day", internally it will be split into the individual tokens "sunny" and "day". This enables full-text searches for these terms. Fields of type Edm.String or Collection(Edm.String) are searchable by default. This property must be false for simple fields of other non-string data types, and it must be null for complex fields. Note: searchable fields consume extra space in your index to accommodate additional tokenized versions of the field value for full-text searches. If you want to save space in your index and you don't need a field to be included in searches, set searchable to false. */ searchable?: boolean; /** A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields of type Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so comparisons are for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property must be null for complex fields. Default is true for simple fields and null for complex fields. */ @@ -679,8 +755,10 @@ export interface SearchField { indexAnalyzer?: LexicalAnalyzerName; /** The dimensionality of the vector field. */ vectorSearchDimensions?: number; - /** The name of the vector search profile that specifies the algorithm to use when searching the vector field. */ + /** The name of the vector search profile that specifies the algorithm and vectorizer to use when searching the vector field. */ vectorSearchProfileName?: string; + /** The encoding format to interpret the field contents. */ + vectorEncodingFormat?: VectorEncodingFormat; /** A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using the rules in the synonym map. This attribute can be changed on existing fields. Must be null or an empty collection for complex fields. */ synonymMaps?: string[]; /** A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. */ @@ -719,7 +797,7 @@ export interface ScoringFunction { /** Defines options to control Cross-Origin Resource Sharing (CORS) for an index. */ export interface CorsOptions { - /** The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a single `*` to allow all origins (not recommended). */ + /** The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). */ allowedOrigins: string[]; /** The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes. */ maxAgeInSeconds?: number; @@ -855,6 +933,10 @@ export interface VectorSearch { profiles?: VectorSearchProfile[]; /** Contains configuration options specific to the algorithm used during indexing or querying. */ algorithms?: VectorSearchAlgorithmConfigurationUnion[]; + /** Contains configuration options on how to vectorize text vector queries. */ + vectorizers?: VectorSearchVectorizerUnion[]; + /** Contains configuration options specific to the compression method used during indexing or querying. */ + compressions?: VectorSearchCompressionUnion[]; } /** Defines a combination of configurations to use with vector search. */ @@ -863,6 +945,10 @@ export interface VectorSearchProfile { name: string; /** The name of the vector search algorithm configuration that specifies the algorithm and optional parameters. */ algorithmConfigurationName: string; + /** The name of the vectorization being configured for use with vector search. */ + vectorizerName?: string; + /** The name of the compression method configuration that specifies the compression method and optional parameters. */ + compressionName?: string; } /** Contains configuration options specific to the algorithm used during indexing or querying. */ @@ -873,6 +959,26 @@ export interface VectorSearchAlgorithmConfiguration { name: string; } +/** Specifies the vectorization method to be used during query time. */ +export interface VectorSearchVectorizer { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "azureOpenAI" | "customWebApi"; + /** The name to associate with this particular vectorization method. */ + vectorizerName: string; +} + +/** Contains configuration options specific to the compression method used during indexing or querying. */ +export interface VectorSearchCompression { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "scalarQuantization" | "binaryQuantization"; + /** The name to associate with this particular configuration. */ + compressionName: string; + /** If set to true, once the ordered set of results calculated using compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity scores. This will improve recall at the expense of latency. */ + rerankWithOriginalVectors?: boolean; + /** Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) in the initial search. This increases the set of results that will be reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. */ + defaultOversampling?: number; +} + /** Response from a List Indexes request. If successful, it includes the full definitions of all indexes. */ export interface ListIndexesResult { /** @@ -968,7 +1074,7 @@ export interface ServiceCounters { /** Total number of synonym maps. */ synonymMapCounter: ResourceCounter; /** Total number of skillsets. */ - skillsetCounter?: ResourceCounter; + skillsetCounter: ResourceCounter; /** Total memory consumption of all vector indexes within the service, in bytes. */ vectorIndexSizeCounter: ResourceCounter; } @@ -991,6 +1097,8 @@ export interface ServiceLimits { maxComplexCollectionFieldsPerIndex?: number; /** The maximum number of objects in complex collections allowed per document. */ maxComplexObjectsInCollectionsPerDocument?: number; + /** The maximum amount of storage in bytes allowed per index. */ + maxStoragePerIndexInBytes?: number; } /** Contains the parameters specific to the HNSW algorithm. */ @@ -1011,6 +1119,50 @@ export interface ExhaustiveKnnParameters { metric?: VectorSearchAlgorithmMetric; } +/** Contains the parameters specific to Scalar Quantization. */ +export interface ScalarQuantizationParameters { + /** The quantized data type of compressed vector values. */ + quantizedDataType?: VectorSearchCompressionTarget; +} + +/** Specifies the parameters for connecting to the Azure OpenAI resource. */ +export interface AzureOpenAIParameters { + /** The resource URI of the Azure OpenAI resource. */ + resourceUrl?: string; + /** ID of the Azure OpenAI model deployment on the designated resource. */ + deploymentId?: string; + /** API key of the designated Azure OpenAI resource. */ + apiKey?: string; + /** The user-assigned managed identity used for outbound connections. */ + authIdentity?: SearchIndexerDataIdentityUnion; + /** The name of the embedding model that is deployed at the provided deploymentId path. */ + modelName?: AzureOpenAIModelName; +} + +/** Abstract base type for data identities. */ +export interface SearchIndexerDataIdentity { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odatatype: + | "#Microsoft.Azure.Search.DataNoneIdentity" + | "#Microsoft.Azure.Search.DataUserAssignedIdentity"; +} + +/** Specifies the properties for connecting to a user-defined vectorizer. */ +export interface WebApiParameters { + /** The URI of the Web API providing the vectorizer. */ + uri?: string; + /** The headers required to make the HTTP request. */ + httpHeaders?: { [propertyName: string]: string }; + /** The method for the HTTP request. */ + httpMethod?: string; + /** The desired timeout for the request. Default is 30 seconds. */ + timeout?: string; + /** Applies to custom endpoints that connect to external code in an Azure function or some other application that provides the transformations. This value should be the application ID created for the function or app when it was registered with Azure Active Directory. When specified, the vectorization connects to the function or app using a managed ID (either system or user-assigned) of the search service and the access token of the function or app, using this value as the resource id for creating the scope of the access token. */ + authResourceId?: string; + /** The user-assigned managed identity used for outbound connections. If an authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. */ + authIdentity?: SearchIndexerDataIdentityUnion; +} + /** Provides parameter values to a distance scoring function. */ export interface DistanceScoringParameters { /** The name of the parameter passed in search queries to specify the reference location. */ @@ -1041,6 +1193,14 @@ export interface TagScoringParameters { tagsParameter: string; } +/** A dictionary of knowledge store-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. */ +export interface SearchIndexerKnowledgeStoreParameters { + /** Describes unknown properties. The value of an unknown property can be of "any" type. */ + [property: string]: any; + /** Whether or not projections should synthesize a generated key name if one isn't already present. */ + synthesizeGeneratedKeyName?: boolean; +} + /** An object that contains information about the matches that were found, and related metadata. */ export interface CustomEntity { /** The top-level entity descriptor. Matches in the skill output will be grouped by this name, and it should represent the "normalized" form of the text being found. */ @@ -1134,6 +1294,8 @@ export interface OcrSkill extends SearchIndexerSkill { defaultLanguageCode?: OcrSkillLanguage; /** A value indicating to turn orientation detection on or not. Default is false. */ shouldDetectOrientation?: boolean; + /** Defines the sequence of characters to use between the lines of text recognized by the OCR skill. The default value is "space". */ + lineEnding?: OcrLineEnding; } /** A skill that analyzes image files. It extracts a rich set of visual features based on the image content. */ @@ -1175,7 +1337,7 @@ export interface MergeSkill extends SearchIndexerSkill { } /** - * Text analytics entity recognition. + * This skill is deprecated. Use the V3.EntityRecognitionSkill instead. * * @deprecated */ @@ -1193,7 +1355,7 @@ export interface EntityRecognitionSkill extends SearchIndexerSkill { } /** - * Text analytics positive-negative sentiment analysis, scored as a floating point value in a range of zero to 1. + * This skill is deprecated. Use the V3.SentimentSkill instead. * * @deprecated */ @@ -1238,7 +1400,7 @@ export interface EntityRecognitionSkillV3 extends SearchIndexerSkill { defaultLanguageCode?: string; /** A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. */ minimumPrecision?: number; - /** The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. */ + /** The version of the model to use when calling the Text Analytics API. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. */ modelVersion?: string; } @@ -1252,7 +1414,7 @@ export interface PIIDetectionSkill extends SearchIndexerSkill { minimumPrecision?: number; /** A parameter that provides various ways to mask the personal information detected in the input text. Default is 'none'. */ maskingMode?: PIIDetectionSkillMaskingMode; - /** The character used to mask the text if the maskingMode parameter is set to replace. Default is `*`. */ + /** The character used to mask the text if the maskingMode parameter is set to replace. Default is '*'. */ maskingCharacter?: string; /** The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. */ modelVersion?: string; @@ -1272,6 +1434,10 @@ export interface SplitSkill extends SearchIndexerSkill { textSplitMode?: TextSplitMode; /** The desired maximum page length. Default is 10000. */ maxPageLength?: number; + /** Only applicable when textSplitMode is set to 'pages'. If specified, n+1th chunk will start with this number of characters/tokens from the end of the nth chunk. */ + pageOverlapLength?: number; + /** Only applicable when textSplitMode is set to 'pages'. If specified, the SplitSkill will discontinue splitting after processing the first 'maximumPagesToTake' pages, in order to improve performance when only a few initial pages are needed from each document. */ + maximumPagesToTake?: number; } /** A skill looks for text from a custom, user-defined list of words and phrases. */ @@ -1317,23 +1483,25 @@ export interface DocumentExtractionSkill extends SearchIndexerSkill { } /** A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code. */ -export interface WebApiSkill extends SearchIndexerSkill { +export interface WebApiSkill extends SearchIndexerSkill, WebApiParameters { /** Polymorphic discriminator, which specifies the different types this object can be */ odatatype: "#Microsoft.Skills.Custom.WebApiSkill"; - /** The url for the Web API. */ - uri: string; - /** The headers required to make the http request. */ - httpHeaders?: { [propertyName: string]: string }; - /** The method for the http request. */ - httpMethod?: string; - /** The desired timeout for the request. Default is 30 seconds. */ - timeout?: string; /** The desired batch size which indicates number of documents. */ batchSize?: number; /** If set, the number of parallel calls that can be made to the Web API. */ degreeOfParallelism?: number; } +/** Allows you to generate a vector embedding for a given text input using the Azure OpenAI resource. */ +export interface AzureOpenAIEmbeddingSkill + extends SearchIndexerSkill, + AzureOpenAIParameters { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odatatype: "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; + /** The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. */ + dimensions?: number; +} + /** An empty object that represents the default Azure AI service resource for a skillset. */ export interface DefaultCognitiveServicesAccount extends CognitiveServicesAccount { @@ -1341,7 +1509,7 @@ export interface DefaultCognitiveServicesAccount odatatype: "#Microsoft.Azure.Search.DefaultCognitiveServices"; } -/** An Azure AI service resource provisioned with a key that is attached to a skillset. */ +/** The multi-region account key of an Azure AI service resource that's attached to a skillset. */ export interface CognitiveServicesAccountKey extends CognitiveServicesAccount { /** Polymorphic discriminator, which specifies the different types this object can be */ odatatype: "#Microsoft.Azure.Search.CognitiveServicesByKey"; @@ -1893,6 +2061,52 @@ export interface ExhaustiveKnnAlgorithmConfiguration parameters?: ExhaustiveKnnParameters; } +/** Specifies the Azure OpenAI resource used to vectorize a query string. */ +export interface AzureOpenAIVectorizer extends VectorSearchVectorizer { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "azureOpenAI"; + /** Contains the parameters specific to Azure OpenAI embedding vectorization. */ + parameters?: AzureOpenAIParameters; +} + +/** Specifies a user-defined vectorizer for generating the vector embedding of a query string. Integration of an external vectorizer is achieved using the custom Web API interface of a skillset. */ +export interface WebApiVectorizer extends VectorSearchVectorizer { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "customWebApi"; + /** Specifies the properties of the user-defined vectorizer. */ + parameters?: WebApiParameters; +} + +/** Contains configuration options specific to the scalar quantization compression method used during indexing and querying. */ +export interface ScalarQuantizationCompression extends VectorSearchCompression { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "scalarQuantization"; + /** Contains the parameters specific to Scalar Quantization. */ + parameters?: ScalarQuantizationParameters; +} + +/** Contains configuration options specific to the binary quantization compression method used during indexing and querying. */ +export interface BinaryQuantizationCompression extends VectorSearchCompression { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "binaryQuantization"; +} + +/** Clears the identity property of a datasource. */ +export interface SearchIndexerDataNoneIdentity + extends SearchIndexerDataIdentity { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odatatype: "#Microsoft.Azure.Search.DataNoneIdentity"; +} + +/** Specifies the identity for a datasource to use. */ +export interface SearchIndexerDataUserAssignedIdentity + extends SearchIndexerDataIdentity { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odatatype: "#Microsoft.Azure.Search.DataUserAssignedIdentity"; + /** The fully qualified Azure resource Id of a user assigned managed identity typically in the form "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" that should have been assigned to the search service. */ + resourceId: string; +} + /** Projection definition for what data to store in Azure Blob. */ export interface SearchIndexerKnowledgeStoreObjectProjectionSelector extends SearchIndexerKnowledgeStoreBlobProjectionSelector {} @@ -1901,20 +2115,20 @@ export interface SearchIndexerKnowledgeStoreObjectProjectionSelector export interface SearchIndexerKnowledgeStoreFileProjectionSelector extends SearchIndexerKnowledgeStoreBlobProjectionSelector {} -/** Known values of {@link ApiVersion20231101} that the service accepts. */ -export enum KnownApiVersion20231101 { - /** Api Version '2023-11-01' */ - TwoThousandTwentyThree1101 = "2023-11-01", +/** Known values of {@link ApiVersion20240701} that the service accepts. */ +export enum KnownApiVersion20240701 { + /** Api Version '2024-07-01' */ + TwoThousandTwentyFour0701 = "2024-07-01", } /** - * Defines values for ApiVersion20231101. \ - * {@link KnownApiVersion20231101} can be used interchangeably with ApiVersion20231101, + * Defines values for ApiVersion20240701. \ + * {@link KnownApiVersion20240701} can be used interchangeably with ApiVersion20240701, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **2023-11-01**: Api Version '2023-11-01' + * **2024-07-01**: Api Version '2024-07-01' */ -export type ApiVersion20231101 = string; +export type ApiVersion20240701 = string; /** Known values of {@link SearchIndexerDataSourceType} that the service accepts. */ export enum KnownSearchIndexerDataSourceType { @@ -2054,6 +2268,24 @@ export enum KnownIndexerExecutionEnvironment { */ export type IndexerExecutionEnvironment = string; +/** Known values of {@link IndexProjectionMode} that the service accepts. */ +export enum KnownIndexProjectionMode { + /** The source document will be skipped from writing into the indexer's target index. */ + SkipIndexingParentDocuments = "skipIndexingParentDocuments", + /** The source document will be written into the indexer's target index. This is the default pattern. */ + IncludeIndexingParentDocuments = "includeIndexingParentDocuments", +} + +/** + * Defines values for IndexProjectionMode. \ + * {@link KnownIndexProjectionMode} can be used interchangeably with IndexProjectionMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **skipIndexingParentDocuments**: The source document will be skipped from writing into the indexer's target index. \ + * **includeIndexingParentDocuments**: The source document will be written into the indexer's target index. This is the default pattern. + */ +export type IndexProjectionMode = string; + /** Known values of {@link SearchFieldDataType} that the service accepts. */ export enum KnownSearchFieldDataType { /** Indicates that a field contains a string. */ @@ -2074,6 +2306,14 @@ export enum KnownSearchFieldDataType { Complex = "Edm.ComplexType", /** Indicates that a field contains a single-precision floating point number. This is only valid when used with Collection(Edm.Single). */ Single = "Edm.Single", + /** Indicates that a field contains a half-precision floating point number. This is only valid when used with Collection(Edm.Half). */ + Half = "Edm.Half", + /** Indicates that a field contains a 16-bit signed integer. This is only valid when used with Collection(Edm.Int16). */ + Int16 = "Edm.Int16", + /** Indicates that a field contains a 8-bit signed integer. This is only valid when used with Collection(Edm.SByte). */ + SByte = "Edm.SByte", + /** Indicates that a field contains a 8-bit unsigned integer. This is only valid when used with Collection(Edm.Byte). */ + Byte = "Edm.Byte", } /** @@ -2089,7 +2329,11 @@ export enum KnownSearchFieldDataType { * **Edm.DateTimeOffset**: Indicates that a field contains a date\/time value, including timezone information. \ * **Edm.GeographyPoint**: Indicates that a field contains a geo-location in terms of longitude and latitude. \ * **Edm.ComplexType**: Indicates that a field contains one or more complex objects that in turn have sub-fields of other types. \ - * **Edm.Single**: Indicates that a field contains a single-precision floating point number. This is only valid when used with Collection(Edm.Single). + * **Edm.Single**: Indicates that a field contains a single-precision floating point number. This is only valid when used with Collection(Edm.Single). \ + * **Edm.Half**: Indicates that a field contains a half-precision floating point number. This is only valid when used with Collection(Edm.Half). \ + * **Edm.Int16**: Indicates that a field contains a 16-bit signed integer. This is only valid when used with Collection(Edm.Int16). \ + * **Edm.SByte**: Indicates that a field contains a 8-bit signed integer. This is only valid when used with Collection(Edm.SByte). \ + * **Edm.Byte**: Indicates that a field contains a 8-bit unsigned integer. This is only valid when used with Collection(Edm.Byte). */ export type SearchFieldDataType = string; @@ -2269,7 +2513,7 @@ export enum KnownLexicalAnalyzerName { ViMicrosoft = "vi.microsoft", /** Standard Lucene analyzer. */ StandardLucene = "standard.lucene", - /** Standard ASCII Folding Lucene analyzer. See https:\//docs.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#Analyzers */ + /** Standard ASCII Folding Lucene analyzer. See https:\//learn.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#Analyzers */ StandardAsciiFoldingLucene = "standardasciifolding.lucene", /** Treats the entire content of a field as a single token. This is useful for data like zip codes, ids, and some product names. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/KeywordAnalyzer.html */ Keyword = "keyword", @@ -2375,7 +2619,7 @@ export enum KnownLexicalAnalyzerName { * **ur.microsoft**: Microsoft analyzer for Urdu. \ * **vi.microsoft**: Microsoft analyzer for Vietnamese. \ * **standard.lucene**: Standard Lucene analyzer. \ - * **standardasciifolding.lucene**: Standard ASCII Folding Lucene analyzer. See https:\/\/docs.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#Analyzers \ + * **standardasciifolding.lucene**: Standard ASCII Folding Lucene analyzer. See https:\/\/learn.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#Analyzers \ * **keyword**: Treats the entire content of a field as a single token. This is useful for data like zip codes, ids, and some product names. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/KeywordAnalyzer.html \ * **pattern**: Flexibly separates text into terms via a regular expression pattern. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/PatternAnalyzer.html \ * **simple**: Divides text at non-letters and converts them to lower case. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/SimpleAnalyzer.html \ @@ -2384,6 +2628,21 @@ export enum KnownLexicalAnalyzerName { */ export type LexicalAnalyzerName = string; +/** Known values of {@link VectorEncodingFormat} that the service accepts. */ +export enum KnownVectorEncodingFormat { + /** Encoding format representing bits packed into a wider data type. */ + PackedBit = "packedBit", +} + +/** + * Defines values for VectorEncodingFormat. \ + * {@link KnownVectorEncodingFormat} can be used interchangeably with VectorEncodingFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **packedBit**: Encoding format representing bits packed into a wider data type. + */ +export type VectorEncodingFormat = string; + /** Known values of {@link VectorSearchAlgorithmKind} that the service accepts. */ export enum KnownVectorSearchAlgorithmKind { /** HNSW (Hierarchical Navigable Small World), a type of approximate nearest neighbors algorithm. */ @@ -2402,14 +2661,52 @@ export enum KnownVectorSearchAlgorithmKind { */ export type VectorSearchAlgorithmKind = string; +/** Known values of {@link VectorSearchVectorizerKind} that the service accepts. */ +export enum KnownVectorSearchVectorizerKind { + /** Generate embeddings using an Azure OpenAI resource at query time. */ + AzureOpenAI = "azureOpenAI", + /** Generate embeddings using a custom web endpoint at query time. */ + CustomWebApi = "customWebApi", +} + +/** + * Defines values for VectorSearchVectorizerKind. \ + * {@link KnownVectorSearchVectorizerKind} can be used interchangeably with VectorSearchVectorizerKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **azureOpenAI**: Generate embeddings using an Azure OpenAI resource at query time. \ + * **customWebApi**: Generate embeddings using a custom web endpoint at query time. + */ +export type VectorSearchVectorizerKind = string; + +/** Known values of {@link VectorSearchCompressionKind} that the service accepts. */ +export enum KnownVectorSearchCompressionKind { + /** Scalar Quantization, a type of compression method. In scalar quantization, the original vectors values are compressed to a narrower type by discretizing and representing each component of a vector using a reduced set of quantized values, thereby reducing the overall data size. */ + ScalarQuantization = "scalarQuantization", + /** Binary Quantization, a type of compression method. In binary quantization, the original vectors values are compressed to the narrower binary type by discretizing and representing each component of a vector using binary values, thereby reducing the overall data size. */ + BinaryQuantization = "binaryQuantization", +} + +/** + * Defines values for VectorSearchCompressionKind. \ + * {@link KnownVectorSearchCompressionKind} can be used interchangeably with VectorSearchCompressionKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **scalarQuantization**: Scalar Quantization, a type of compression method. In scalar quantization, the original vectors values are compressed to a narrower type by discretizing and representing each component of a vector using a reduced set of quantized values, thereby reducing the overall data size. \ + * **binaryQuantization**: Binary Quantization, a type of compression method. In binary quantization, the original vectors values are compressed to the narrower binary type by discretizing and representing each component of a vector using binary values, thereby reducing the overall data size. + */ +export type VectorSearchCompressionKind = string; + /** Known values of {@link VectorSearchAlgorithmMetric} that the service accepts. */ export enum KnownVectorSearchAlgorithmMetric { - /** Cosine */ + /** Measures the angle between vectors to quantify their similarity, disregarding magnitude. The smaller the angle, the closer the similarity. */ Cosine = "cosine", - /** Euclidean */ + /** Computes the straight-line distance between vectors in a multi-dimensional space. The smaller the distance, the closer the similarity. */ Euclidean = "euclidean", - /** DotProduct */ + /** Calculates the sum of element-wise products to gauge alignment and magnitude similarity. The larger and more positive, the closer the similarity. */ DotProduct = "dotProduct", + /** Only applicable to bit-packed binary data types. Determines dissimilarity by counting differing positions in binary vectors. The fewer differences, the closer the similarity. */ + Hamming = "hamming", } /** @@ -2417,12 +2714,49 @@ export enum KnownVectorSearchAlgorithmMetric { * {@link KnownVectorSearchAlgorithmMetric} can be used interchangeably with VectorSearchAlgorithmMetric, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **cosine** \ - * **euclidean** \ - * **dotProduct** + * **cosine**: Measures the angle between vectors to quantify their similarity, disregarding magnitude. The smaller the angle, the closer the similarity. \ + * **euclidean**: Computes the straight-line distance between vectors in a multi-dimensional space. The smaller the distance, the closer the similarity. \ + * **dotProduct**: Calculates the sum of element-wise products to gauge alignment and magnitude similarity. The larger and more positive, the closer the similarity. \ + * **hamming**: Only applicable to bit-packed binary data types. Determines dissimilarity by counting differing positions in binary vectors. The fewer differences, the closer the similarity. */ export type VectorSearchAlgorithmMetric = string; +/** Known values of {@link VectorSearchCompressionTarget} that the service accepts. */ +export enum KnownVectorSearchCompressionTarget { + /** Int8 */ + Int8 = "int8", +} + +/** + * Defines values for VectorSearchCompressionTarget. \ + * {@link KnownVectorSearchCompressionTarget} can be used interchangeably with VectorSearchCompressionTarget, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **int8** + */ +export type VectorSearchCompressionTarget = string; + +/** Known values of {@link AzureOpenAIModelName} that the service accepts. */ +export enum KnownAzureOpenAIModelName { + /** TextEmbeddingAda002 */ + TextEmbeddingAda002 = "text-embedding-ada-002", + /** TextEmbedding3Large */ + TextEmbedding3Large = "text-embedding-3-large", + /** TextEmbedding3Small */ + TextEmbedding3Small = "text-embedding-3-small", +} + +/** + * Defines values for AzureOpenAIModelName. \ + * {@link KnownAzureOpenAIModelName} can be used interchangeably with AzureOpenAIModelName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **text-embedding-ada-002** \ + * **text-embedding-3-large** \ + * **text-embedding-3-small** + */ +export type AzureOpenAIModelName = string; + /** Known values of {@link KeyPhraseExtractionSkillLanguage} that the service accepts. */ export enum KnownKeyPhraseExtractionSkillLanguage { /** Danish */ @@ -3005,6 +3339,30 @@ export enum KnownOcrSkillLanguage { */ export type OcrSkillLanguage = string; +/** Known values of {@link OcrLineEnding} that the service accepts. */ +export enum KnownOcrLineEnding { + /** Lines are separated by a single space character. */ + Space = "space", + /** Lines are separated by a carriage return ('\r') character. */ + CarriageReturn = "carriageReturn", + /** Lines are separated by a single line feed ('\n') character. */ + LineFeed = "lineFeed", + /** Lines are separated by a carriage return and a line feed ('\r\n') character. */ + CarriageReturnLineFeed = "carriageReturnLineFeed", +} + +/** + * Defines values for OcrLineEnding. \ + * {@link KnownOcrLineEnding} can be used interchangeably with OcrLineEnding, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **space**: Lines are separated by a single space character. \ + * **carriageReturn**: Lines are separated by a carriage return ('\r') character. \ + * **lineFeed**: Lines are separated by a single line feed ('\n') character. \ + * **carriageReturnLineFeed**: Lines are separated by a carriage return and a line feed ('\r\n') character. + */ +export type OcrLineEnding = string; + /** Known values of {@link ImageAnalysisSkillLanguage} that the service accepts. */ export enum KnownImageAnalysisSkillLanguage { /** Arabic */ @@ -3647,6 +4005,10 @@ export enum KnownTextTranslationSkillLanguage { Sw = "sw", /** Klingon */ Tlh = "tlh", + /** Klingon (Latin script) */ + TlhLatn = "tlh-Latn", + /** Klingon (Klingon script) */ + TlhPiqd = "tlh-Piqd", /** Korean */ Ko = "ko", /** Latvian */ @@ -3667,6 +4029,10 @@ export enum KnownTextTranslationSkillLanguage { Pl = "pl", /** Portuguese */ Pt = "pt", + /** Portuguese (Brazil) */ + PtBr = "pt-br", + /** Portuguese (Portugal) */ + PtPT = "pt-PT", /** Queretaro Otomi */ Otq = "otq", /** Romanian */ @@ -3709,6 +4075,16 @@ export enum KnownTextTranslationSkillLanguage { Cy = "cy", /** Yucatec Maya */ Yua = "yua", + /** Irish */ + Ga = "ga", + /** Kannada */ + Kn = "kn", + /** Maori */ + Mi = "mi", + /** Malayalam */ + Ml = "ml", + /** Punjabi */ + Pa = "pa", } /** @@ -3748,6 +4124,8 @@ export enum KnownTextTranslationSkillLanguage { * **ja**: Japanese \ * **sw**: Kiswahili \ * **tlh**: Klingon \ + * **tlh-Latn**: Klingon (Latin script) \ + * **tlh-Piqd**: Klingon (Klingon script) \ * **ko**: Korean \ * **lv**: Latvian \ * **lt**: Lithuanian \ @@ -3758,6 +4136,8 @@ export enum KnownTextTranslationSkillLanguage { * **fa**: Persian \ * **pl**: Polish \ * **pt**: Portuguese \ + * **pt-br**: Portuguese (Brazil) \ + * **pt-PT**: Portuguese (Portugal) \ * **otq**: Queretaro Otomi \ * **ro**: Romanian \ * **ru**: Russian \ @@ -3778,7 +4158,12 @@ export enum KnownTextTranslationSkillLanguage { * **ur**: Urdu \ * **vi**: Vietnamese \ * **cy**: Welsh \ - * **yua**: Yucatec Maya + * **yua**: Yucatec Maya \ + * **ga**: Irish \ + * **kn**: Kannada \ + * **mi**: Maori \ + * **ml**: Malayalam \ + * **pa**: Punjabi */ export type TextTranslationSkillLanguage = string; @@ -3867,7 +4252,7 @@ export enum KnownTokenFilterName { Length = "length", /** Limits the number of tokens while indexing. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/LimitTokenCountFilter.html */ Limit = "limit", - /** Normalizes token text to lower case. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/LowerCaseFilter.htm */ + /** Normalizes token text to lower case. See https:\//lucene.apache.org\/core\/6_6_1\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/LowerCaseFilter.html */ Lowercase = "lowercase", /** Generates n-grams of the given size(s). See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/ngram\/NGramTokenFilter.html */ NGram = "nGram_v2", @@ -3889,7 +4274,7 @@ export enum KnownTokenFilterName { Snowball = "snowball", /** Normalizes the Unicode representation of Sorani text. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/ckb\/SoraniNormalizationFilter.html */ SoraniNormalization = "sorani_normalization", - /** Language specific stemming filter. See https:\//docs.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#TokenFilters */ + /** Language specific stemming filter. See https:\//learn.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#TokenFilters */ Stemmer = "stemmer", /** Removes stop words from a token stream. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/StopFilter.html */ Stopwords = "stopwords", @@ -3899,7 +4284,7 @@ export enum KnownTokenFilterName { Truncate = "truncate", /** Filters out tokens with same text as the previous token. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/RemoveDuplicatesTokenFilter.html */ Unique = "unique", - /** Normalizes token text to upper case. See http:\//lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/UpperCaseFilter.html */ + /** Normalizes token text to upper case. See https:\//lucene.apache.org\/core\/6_6_1\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/UpperCaseFilter.html */ Uppercase = "uppercase", /** Splits words into subwords and performs optional transformations on subword groups. */ WordDelimiter = "word_delimiter", @@ -3926,7 +4311,7 @@ export enum KnownTokenFilterName { * **kstem**: A high-performance kstem filter for English. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/en\/KStemFilter.html \ * **length**: Removes words that are too long or too short. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/LengthFilter.html \ * **limit**: Limits the number of tokens while indexing. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/LimitTokenCountFilter.html \ - * **lowercase**: Normalizes token text to lower case. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/LowerCaseFilter.htm \ + * **lowercase**: Normalizes token text to lower case. See https:\/\/lucene.apache.org\/core\/6_6_1\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/LowerCaseFilter.html \ * **nGram_v2**: Generates n-grams of the given size(s). See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/ngram\/NGramTokenFilter.html \ * **persian_normalization**: Applies normalization for Persian. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/fa\/PersianNormalizationFilter.html \ * **phonetic**: Create tokens for phonetic matches. See https:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-phonetic\/org\/apache\/lucene\/analysis\/phonetic\/package-tree.html \ @@ -3937,12 +4322,12 @@ export enum KnownTokenFilterName { * **shingle**: Creates combinations of tokens as a single token. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/shingle\/ShingleFilter.html \ * **snowball**: A filter that stems words using a Snowball-generated stemmer. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/snowball\/SnowballFilter.html \ * **sorani_normalization**: Normalizes the Unicode representation of Sorani text. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/ckb\/SoraniNormalizationFilter.html \ - * **stemmer**: Language specific stemming filter. See https:\/\/docs.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#TokenFilters \ + * **stemmer**: Language specific stemming filter. See https:\/\/learn.microsoft.com\/rest\/api\/searchservice\/Custom-analyzers-in-Azure-Search#TokenFilters \ * **stopwords**: Removes stop words from a token stream. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/StopFilter.html \ * **trim**: Trims leading and trailing whitespace from tokens. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/TrimFilter.html \ * **truncate**: Truncates the terms to a specific length. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/TruncateTokenFilter.html \ * **unique**: Filters out tokens with same text as the previous token. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/miscellaneous\/RemoveDuplicatesTokenFilter.html \ - * **uppercase**: Normalizes token text to upper case. See http:\/\/lucene.apache.org\/core\/4_10_3\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/UpperCaseFilter.html \ + * **uppercase**: Normalizes token text to upper case. See https:\/\/lucene.apache.org\/core\/6_6_1\/analyzers-common\/org\/apache\/lucene\/analysis\/core\/UpperCaseFilter.html \ * **word_delimiter**: Splits words into subwords and performs optional transformations on subword groups. */ export type TokenFilterName = string; @@ -4282,7 +4667,7 @@ export type DataSourcesGetResponse = SearchIndexerDataSource; /** Optional parameters. */ export interface DataSourcesListOptionalParams extends coreClient.OperationOptions { - /** Selects which top-level properties of the data sources to retrieve. Specified as a comma-separated list of JSON property names, or `*` for all properties. The default is all properties. */ + /** Selects which top-level properties of the data sources to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. */ select?: string; } @@ -4335,7 +4720,7 @@ export type IndexersGetResponse = SearchIndexer; /** Optional parameters. */ export interface IndexersListOptionalParams extends coreClient.OperationOptions { - /** Selects which top-level properties of the indexers to retrieve. Specified as a comma-separated list of JSON property names, or `*` for all properties. The default is all properties. */ + /** Selects which top-level properties of the indexers to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. */ select?: string; } @@ -4387,7 +4772,7 @@ export type SkillsetsGetResponse = SearchIndexerSkillset; /** Optional parameters. */ export interface SkillsetsListOptionalParams extends coreClient.OperationOptions { - /** Selects which top-level properties of the skillsets to retrieve. Specified as a comma-separated list of JSON property names, or `*` for all properties. The default is all properties. */ + /** Selects which top-level properties of the skillsets to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. */ select?: string; } @@ -4432,7 +4817,7 @@ export type SynonymMapsGetResponse = SynonymMap; /** Optional parameters. */ export interface SynonymMapsListOptionalParams extends coreClient.OperationOptions { - /** Selects which top-level properties of the synonym maps to retrieve. Specified as a comma-separated list of JSON property names, or `*` for all properties. The default is all properties. */ + /** Selects which top-level properties of the synonym maps to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. */ select?: string; } @@ -4455,7 +4840,7 @@ export type IndexesCreateResponse = SearchIndex; /** Optional parameters. */ export interface IndexesListOptionalParams extends coreClient.OperationOptions { - /** Selects which top-level properties of the index definitions to retrieve. Specified as a comma-separated list of JSON property names, or `*` for all properties. The default is all properties. */ + /** Selects which top-level properties of the index definitions to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. */ select?: string; } diff --git a/sdk/search/search-documents/src/generated/service/models/mappers.ts b/sdk/search/search-documents/src/generated/service/models/mappers.ts index 8aded5c5e865..7c580008a25c 100644 --- a/sdk/search/search-documents/src/generated/service/models/mappers.ts +++ b/sdk/search/search-documents/src/generated/service/models/mappers.ts @@ -217,10 +217,26 @@ export const AzureActiveDirectoryApplicationCredentials: coreClient.CompositeMap }, }; -export const SearchError: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SearchError", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", modelProperties: { code: { serializedName: "code", @@ -231,7 +247,13 @@ export const SearchError: coreClient.CompositeMapper = { }, message: { serializedName: "message", - required: true, + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", readOnly: true, type: { name: "String", @@ -245,7 +267,20 @@ export const SearchError: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SearchError", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", }, }, }, @@ -254,6 +289,30 @@ export const SearchError: coreClient.CompositeMapper = { }, }; +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + }, + }, +}; + export const ListDataSourcesResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -601,6 +660,7 @@ export const FieldMappingFunction: coreClient.CompositeMapper = { }, parameters: { serializedName: "parameters", + nullable: true, type: { name: "Dictionary", value: { type: { name: "any" } }, @@ -950,6 +1010,13 @@ export const SearchIndexerSkillset: coreClient.CompositeMapper = { className: "SearchIndexerKnowledgeStore", }, }, + indexProjection: { + serializedName: "indexProjections", + type: { + name: "Composite", + className: "SearchIndexerIndexProjection", + }, + }, etag: { serializedName: "@odata\\.etag", type: { @@ -1243,6 +1310,96 @@ export const SearchIndexerKnowledgeStoreProjectionSelector: coreClient.Composite }, }; +export const SearchIndexerIndexProjection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SearchIndexerIndexProjection", + modelProperties: { + selectors: { + serializedName: "selectors", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SearchIndexerIndexProjectionSelector", + }, + }, + }, + }, + parameters: { + serializedName: "parameters", + type: { + name: "Composite", + className: "SearchIndexerIndexProjectionParameters", + }, + }, + }, + }, +}; + +export const SearchIndexerIndexProjectionSelector: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SearchIndexerIndexProjectionSelector", + modelProperties: { + targetIndexName: { + serializedName: "targetIndexName", + required: true, + type: { + name: "String", + }, + }, + parentKeyFieldName: { + serializedName: "parentKeyFieldName", + required: true, + type: { + name: "String", + }, + }, + sourceContext: { + serializedName: "sourceContext", + required: true, + type: { + name: "String", + }, + }, + mappings: { + serializedName: "mappings", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InputFieldMappingEntry", + }, + }, + }, + }, + }, + }, + }; + +export const SearchIndexerIndexProjectionParameters: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SearchIndexerIndexProjectionParameters", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + projectionMode: { + serializedName: "projectionMode", + type: { + name: "String", + }, + }, + }, + }, + }; + export const ListSkillsetsResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1512,6 +1669,12 @@ export const SearchField: coreClient.CompositeMapper = { name: "Boolean", }, }, + stored: { + serializedName: "stored", + type: { + name: "Boolean", + }, + }, searchable: { serializedName: "searchable", type: { @@ -1575,6 +1738,13 @@ export const SearchField: coreClient.CompositeMapper = { name: "String", }, }, + vectorEncodingFormat: { + serializedName: "vectorEncoding", + nullable: true, + type: { + name: "String", + }, + }, synonymMaps: { serializedName: "synonymMaps", type: { @@ -2041,6 +2211,30 @@ export const VectorSearch: coreClient.CompositeMapper = { }, }, }, + vectorizers: { + serializedName: "vectorizers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VectorSearchVectorizer", + }, + }, + }, + }, + compressions: { + serializedName: "compressions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VectorSearchCompression", + }, + }, + }, + }, }, }, }; @@ -2064,6 +2258,18 @@ export const VectorSearchProfile: coreClient.CompositeMapper = { name: "String", }, }, + vectorizerName: { + serializedName: "vectorizer", + type: { + name: "String", + }, + }, + compressionName: { + serializedName: "compression", + type: { + name: "String", + }, + }, }, }, }; @@ -2096,6 +2302,76 @@ export const VectorSearchAlgorithmConfiguration: coreClient.CompositeMapper = { }, }; +export const VectorSearchVectorizer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VectorSearchVectorizer", + uberParent: "VectorSearchVectorizer", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind", + }, + modelProperties: { + vectorizerName: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const VectorSearchCompression: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VectorSearchCompression", + uberParent: "VectorSearchCompression", + polymorphicDiscriminator: { + serializedName: "kind", + clientName: "kind", + }, + modelProperties: { + compressionName: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + kind: { + serializedName: "kind", + required: true, + type: { + name: "String", + }, + }, + rerankWithOriginalVectors: { + defaultValue: true, + serializedName: "rerankWithOriginalVectors", + type: { + name: "Boolean", + }, + }, + defaultOversampling: { + serializedName: "defaultOversampling", + nullable: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + export const ListIndexesResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2409,6 +2685,13 @@ export const ServiceLimits: coreClient.CompositeMapper = { name: "Number", }, }, + maxStoragePerIndexInBytes: { + serializedName: "maxStoragePerIndex", + nullable: true, + type: { + name: "Number", + }, + }, }, }, }; @@ -2481,6 +2764,131 @@ export const ExhaustiveKnnParameters: coreClient.CompositeMapper = { }, }; +export const ScalarQuantizationParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScalarQuantizationParameters", + modelProperties: { + quantizedDataType: { + serializedName: "quantizedDataType", + nullable: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AzureOpenAIParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureOpenAIParameters", + modelProperties: { + resourceUrl: { + serializedName: "resourceUri", + type: { + name: "String", + }, + }, + deploymentId: { + serializedName: "deploymentId", + type: { + name: "String", + }, + }, + apiKey: { + serializedName: "apiKey", + type: { + name: "String", + }, + }, + authIdentity: { + serializedName: "authIdentity", + type: { + name: "Composite", + className: "SearchIndexerDataIdentity", + }, + }, + modelName: { + serializedName: "modelName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SearchIndexerDataIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SearchIndexerDataIdentity", + uberParent: "SearchIndexerDataIdentity", + polymorphicDiscriminator: { + serializedName: "@odata\\.type", + clientName: "odatatype", + }, + modelProperties: { + odatatype: { + serializedName: "@odata\\.type", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const WebApiParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WebApiParameters", + modelProperties: { + uri: { + serializedName: "uri", + type: { + name: "String", + }, + }, + httpHeaders: { + serializedName: "httpHeaders", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + httpMethod: { + serializedName: "httpMethod", + type: { + name: "String", + }, + }, + timeout: { + serializedName: "timeout", + type: { + name: "TimeSpan", + }, + }, + authResourceId: { + serializedName: "authResourceId", + nullable: true, + type: { + name: "String", + }, + }, + authIdentity: { + serializedName: "authIdentity", + type: { + name: "Composite", + className: "SearchIndexerDataIdentity", + }, + }, + }, + }, +}; + export const DistanceScoringParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2565,6 +2973,24 @@ export const TagScoringParameters: coreClient.CompositeMapper = { }, }; +export const SearchIndexerKnowledgeStoreParameters: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SearchIndexerKnowledgeStoreParameters", + additionalProperties: { type: { name: "Object" } }, + modelProperties: { + synthesizeGeneratedKeyName: { + defaultValue: false, + serializedName: "synthesizeGeneratedKeyName", + type: { + name: "Boolean", + }, + }, + }, + }, + }; + export const CustomEntity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2832,6 +3258,12 @@ export const OcrSkill: coreClient.CompositeMapper = { name: "Boolean", }, }, + lineEnding: { + serializedName: "lineEnding", + type: { + name: "String", + }, + }, }, }, }; @@ -3228,6 +3660,20 @@ export const SplitSkill: coreClient.CompositeMapper = { name: "Number", }, }, + pageOverlapLength: { + serializedName: "pageOverlapLength", + nullable: true, + type: { + name: "Number", + }, + }, + maximumPagesToTake: { + serializedName: "maximumPagesToTake", + nullable: true, + type: { + name: "Number", + }, + }, }, }, }; @@ -3370,32 +3816,7 @@ export const WebApiSkill: coreClient.CompositeMapper = { polymorphicDiscriminator: SearchIndexerSkill.type.polymorphicDiscriminator, modelProperties: { ...SearchIndexerSkill.type.modelProperties, - uri: { - serializedName: "uri", - required: true, - type: { - name: "String", - }, - }, - httpHeaders: { - serializedName: "httpHeaders", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - httpMethod: { - serializedName: "httpMethod", - type: { - name: "String", - }, - }, - timeout: { - serializedName: "timeout", - type: { - name: "TimeSpan", - }, - }, + ...WebApiParameters.type.modelProperties, batchSize: { serializedName: "batchSize", nullable: true, @@ -3414,6 +3835,27 @@ export const WebApiSkill: coreClient.CompositeMapper = { }, }; +export const AzureOpenAIEmbeddingSkill: coreClient.CompositeMapper = { + serializedName: "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill", + type: { + name: "Composite", + className: "AzureOpenAIEmbeddingSkill", + uberParent: "SearchIndexerSkill", + polymorphicDiscriminator: SearchIndexerSkill.type.polymorphicDiscriminator, + modelProperties: { + ...SearchIndexerSkill.type.modelProperties, + ...AzureOpenAIParameters.type.modelProperties, + dimensions: { + serializedName: "dimensions", + nullable: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + export const DefaultCognitiveServicesAccount: coreClient.CompositeMapper = { serializedName: "#Microsoft.Azure.Search.DefaultCognitiveServices", type: { @@ -5309,6 +5751,119 @@ export const ExhaustiveKnnAlgorithmConfiguration: coreClient.CompositeMapper = { }, }; +export const AzureOpenAIVectorizer: coreClient.CompositeMapper = { + serializedName: "azureOpenAI", + type: { + name: "Composite", + className: "AzureOpenAIVectorizer", + uberParent: "VectorSearchVectorizer", + polymorphicDiscriminator: + VectorSearchVectorizer.type.polymorphicDiscriminator, + modelProperties: { + ...VectorSearchVectorizer.type.modelProperties, + parameters: { + serializedName: "azureOpenAIParameters", + type: { + name: "Composite", + className: "AzureOpenAIParameters", + }, + }, + }, + }, +}; + +export const WebApiVectorizer: coreClient.CompositeMapper = { + serializedName: "customWebApi", + type: { + name: "Composite", + className: "WebApiVectorizer", + uberParent: "VectorSearchVectorizer", + polymorphicDiscriminator: + VectorSearchVectorizer.type.polymorphicDiscriminator, + modelProperties: { + ...VectorSearchVectorizer.type.modelProperties, + parameters: { + serializedName: "customWebApiParameters", + type: { + name: "Composite", + className: "WebApiParameters", + }, + }, + }, + }, +}; + +export const ScalarQuantizationCompression: coreClient.CompositeMapper = { + serializedName: "scalarQuantization", + type: { + name: "Composite", + className: "ScalarQuantizationCompression", + uberParent: "VectorSearchCompression", + polymorphicDiscriminator: + VectorSearchCompression.type.polymorphicDiscriminator, + modelProperties: { + ...VectorSearchCompression.type.modelProperties, + parameters: { + serializedName: "scalarQuantizationParameters", + type: { + name: "Composite", + className: "ScalarQuantizationParameters", + }, + }, + }, + }, +}; + +export const BinaryQuantizationCompression: coreClient.CompositeMapper = { + serializedName: "binaryQuantization", + type: { + name: "Composite", + className: "BinaryQuantizationCompression", + uberParent: "VectorSearchCompression", + polymorphicDiscriminator: + VectorSearchCompression.type.polymorphicDiscriminator, + modelProperties: { + ...VectorSearchCompression.type.modelProperties, + }, + }, +}; + +export const SearchIndexerDataNoneIdentity: coreClient.CompositeMapper = { + serializedName: "#Microsoft.Azure.Search.DataNoneIdentity", + type: { + name: "Composite", + className: "SearchIndexerDataNoneIdentity", + uberParent: "SearchIndexerDataIdentity", + polymorphicDiscriminator: + SearchIndexerDataIdentity.type.polymorphicDiscriminator, + modelProperties: { + ...SearchIndexerDataIdentity.type.modelProperties, + }, + }, +}; + +export const SearchIndexerDataUserAssignedIdentity: coreClient.CompositeMapper = + { + serializedName: "#Microsoft.Azure.Search.DataUserAssignedIdentity", + type: { + name: "Composite", + className: "SearchIndexerDataUserAssignedIdentity", + uberParent: "SearchIndexerDataIdentity", + polymorphicDiscriminator: + SearchIndexerDataIdentity.type.polymorphicDiscriminator, + modelProperties: { + ...SearchIndexerDataIdentity.type.modelProperties, + resourceId: { + serializedName: "userAssignedIdentity", + required: true, + type: { + name: "String", + }, + }, + }, + }, + }; + export const SearchIndexerKnowledgeStoreObjectProjectionSelector: coreClient.CompositeMapper = { type: { @@ -5345,6 +5900,9 @@ export let discriminators = { CharFilter: CharFilter, Similarity: Similarity, VectorSearchAlgorithmConfiguration: VectorSearchAlgorithmConfiguration, + VectorSearchVectorizer: VectorSearchVectorizer, + VectorSearchCompression: VectorSearchCompression, + SearchIndexerDataIdentity: SearchIndexerDataIdentity, "DataChangeDetectionPolicy.#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy": HighWaterMarkChangeDetectionPolicy, "DataChangeDetectionPolicy.#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy": @@ -5381,6 +5939,8 @@ export let discriminators = { "SearchIndexerSkill.#Microsoft.Skills.Util.DocumentExtractionSkill": DocumentExtractionSkill, "SearchIndexerSkill.#Microsoft.Skills.Custom.WebApiSkill": WebApiSkill, + "SearchIndexerSkill.#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill": + AzureOpenAIEmbeddingSkill, "CognitiveServicesAccount.#Microsoft.Azure.Search.DefaultCognitiveServices": DefaultCognitiveServicesAccount, "CognitiveServicesAccount.#Microsoft.Azure.Search.CognitiveServicesByKey": @@ -5462,4 +6022,12 @@ export let discriminators = { "VectorSearchAlgorithmConfiguration.hnsw": HnswAlgorithmConfiguration, "VectorSearchAlgorithmConfiguration.exhaustiveKnn": ExhaustiveKnnAlgorithmConfiguration, + "VectorSearchVectorizer.azureOpenAI": AzureOpenAIVectorizer, + "VectorSearchVectorizer.customWebApi": WebApiVectorizer, + "VectorSearchCompression.scalarQuantization": ScalarQuantizationCompression, + "VectorSearchCompression.binaryQuantization": BinaryQuantizationCompression, + "SearchIndexerDataIdentity.#Microsoft.Azure.Search.DataNoneIdentity": + SearchIndexerDataNoneIdentity, + "SearchIndexerDataIdentity.#Microsoft.Azure.Search.DataUserAssignedIdentity": + SearchIndexerDataUserAssignedIdentity, }; diff --git a/sdk/search/search-documents/src/generated/service/operations/dataSources.ts b/sdk/search/search-documents/src/generated/service/operations/dataSources.ts index af7cdf6bb635..71292ac4e3d3 100644 --- a/sdk/search/search-documents/src/generated/service/operations/dataSources.ts +++ b/sdk/search/search-documents/src/generated/service/operations/dataSources.ts @@ -122,7 +122,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerDataSource, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.dataSource, @@ -145,7 +145,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -165,7 +165,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerDataSource, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -181,7 +181,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListDataSourcesResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.select], @@ -197,7 +197,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerDataSource, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.dataSource, diff --git a/sdk/search/search-documents/src/generated/service/operations/indexers.ts b/sdk/search/search-documents/src/generated/service/operations/indexers.ts index ee18adcc3747..dbdb52a59026 100644 --- a/sdk/search/search-documents/src/generated/service/operations/indexers.ts +++ b/sdk/search/search-documents/src/generated/service/operations/indexers.ts @@ -161,7 +161,7 @@ const resetOperationSpec: coreClient.OperationSpec = { responses: { 204: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -175,7 +175,7 @@ const runOperationSpec: coreClient.OperationSpec = { responses: { 202: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -194,7 +194,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexer, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.indexer, @@ -217,7 +217,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -237,7 +237,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexer, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -253,7 +253,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListIndexersResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.select], @@ -269,7 +269,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexer, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.indexer, @@ -287,7 +287,7 @@ const getStatusOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerStatus, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/search/search-documents/src/generated/service/operations/indexes.ts b/sdk/search/search-documents/src/generated/service/operations/indexes.ts index bce69da396fd..c456c969db12 100644 --- a/sdk/search/search-documents/src/generated/service/operations/indexes.ts +++ b/sdk/search/search-documents/src/generated/service/operations/indexes.ts @@ -156,7 +156,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndex, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.index, @@ -174,7 +174,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListIndexesResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.select], @@ -193,7 +193,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndex, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.index, @@ -216,7 +216,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -236,7 +236,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndex, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -252,7 +252,7 @@ const getStatisticsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.GetIndexStatisticsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -268,7 +268,7 @@ const analyzeOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AnalyzeResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.request, diff --git a/sdk/search/search-documents/src/generated/service/operations/skillsets.ts b/sdk/search/search-documents/src/generated/service/operations/skillsets.ts index 8fd88946e093..c9394176f298 100644 --- a/sdk/search/search-documents/src/generated/service/operations/skillsets.ts +++ b/sdk/search/search-documents/src/generated/service/operations/skillsets.ts @@ -120,7 +120,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerSkillset, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.skillset, @@ -143,7 +143,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -163,7 +163,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerSkillset, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -179,7 +179,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListSkillsetsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.select], @@ -195,7 +195,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SearchIndexerSkillset, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.skillset, diff --git a/sdk/search/search-documents/src/generated/service/operations/synonymMaps.ts b/sdk/search/search-documents/src/generated/service/operations/synonymMaps.ts index b46c53de5d39..afde7649c7d9 100644 --- a/sdk/search/search-documents/src/generated/service/operations/synonymMaps.ts +++ b/sdk/search/search-documents/src/generated/service/operations/synonymMaps.ts @@ -122,7 +122,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SynonymMap, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.synonymMap, @@ -145,7 +145,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 204: {}, 404: {}, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -165,7 +165,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SynonymMap, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], @@ -181,7 +181,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListSynonymMapsResult, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.select], @@ -197,7 +197,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SynonymMap, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.synonymMap, diff --git a/sdk/search/search-documents/src/generated/service/searchServiceClient.ts b/sdk/search/search-documents/src/generated/service/searchServiceClient.ts index a29986b2a281..c21faa69bd76 100644 --- a/sdk/search/search-documents/src/generated/service/searchServiceClient.ts +++ b/sdk/search/search-documents/src/generated/service/searchServiceClient.ts @@ -30,7 +30,7 @@ import { import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { - ApiVersion20231101, + ApiVersion20240701, SearchServiceClientOptionalParams, GetServiceStatisticsOptionalParams, GetServiceStatisticsResponse, @@ -39,7 +39,7 @@ import { /** @internal */ export class SearchServiceClient extends coreHttpCompat.ExtendedServiceClient { endpoint: string; - apiVersion: ApiVersion20231101; + apiVersion: ApiVersion20240701; /** * Initializes a new instance of the SearchServiceClient class. @@ -49,7 +49,7 @@ export class SearchServiceClient extends coreHttpCompat.ExtendedServiceClient { */ constructor( endpoint: string, - apiVersion: ApiVersion20231101, + apiVersion: ApiVersion20240701, options?: SearchServiceClientOptionalParams, ) { if (endpoint === undefined) { @@ -151,7 +151,7 @@ const getServiceStatisticsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ServiceStatistics, }, default: { - bodyMapper: Mappers.SearchError, + bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/search/search-documents/src/index.ts b/sdk/search/search-documents/src/index.ts index 36eaa5788e73..175ecfa37700 100644 --- a/sdk/search/search-documents/src/index.ts +++ b/sdk/search/search-documents/src/index.ts @@ -26,6 +26,8 @@ export { AnalyzeResult, AsciiFoldingTokenFilter, AzureActiveDirectoryApplicationCredentials, + AzureOpenAIModelName, + BinaryQuantizationCompression, BM25Similarity, CharFilter as BaseCharFilter, CharFilterName, @@ -61,9 +63,11 @@ export { IndexerExecutionStatus, IndexerStatus, IndexingSchedule, + IndexProjectionMode, InputFieldMappingEntry, KeepTokenFilter, KeywordMarkerTokenFilter, + KnownAzureOpenAIModelName, KnownBlobIndexerDataToExtract, KnownBlobIndexerImageAction, KnownBlobIndexerParsingMode, @@ -74,18 +78,27 @@ export { KnownEntityRecognitionSkillLanguage, KnownImageAnalysisSkillLanguage, KnownImageDetail, + KnownIndexerExecutionEnvironment, + KnownIndexProjectionMode, KnownKeyPhraseExtractionSkillLanguage, KnownLexicalTokenizerName as KnownTokenizerNames, + KnownOcrLineEnding, KnownOcrSkillLanguage, + KnownPIIDetectionSkillMaskingMode, KnownRegexFlags, + KnownSearchFieldDataType, KnownSearchIndexerDataSourceType, KnownSentimentSkillLanguage, KnownSplitSkillLanguage, KnownTextSplitMode, KnownTextTranslationSkillLanguage, KnownTokenFilterName as KnownTokenFilterNames, + KnownVectorEncodingFormat, KnownVectorSearchAlgorithmKind, KnownVectorSearchAlgorithmMetric, + KnownVectorSearchCompressionKind, + KnownVectorSearchCompressionTarget, + KnownVectorSearchVectorizerKind, KnownVisualFeature, LanguageDetectionSkill, LengthTokenFilter, @@ -104,6 +117,7 @@ export { MicrosoftStemmingTokenizerLanguage, MicrosoftTokenizerLanguage, NGramTokenizer, + OcrLineEnding, OutputFieldMappingEntry, PathHierarchyTokenizerV2 as PathHierarchyTokenizer, PatternCaptureTokenFilter, @@ -112,11 +126,17 @@ export { PhoneticEncoder, PhoneticTokenFilter, ResourceCounter, + ScalarQuantizationCompression, + ScalarQuantizationParameters, ScoringFunction as BaseScoringFunction, ScoringFunctionAggregation, ScoringFunctionInterpolation, SearchIndexerDataContainer, + SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity, + SearchIndexerDataNoneIdentity, + SearchIndexerDataUserAssignedIdentity, SearchIndexerError, + SearchIndexerIndexProjectionSelector, SearchIndexerKnowledgeStoreBlobProjectionSelector, SearchIndexerKnowledgeStoreFileProjectionSelector, SearchIndexerKnowledgeStoreObjectProjectionSelector, @@ -158,7 +178,12 @@ export { TruncateTokenFilter, UaxUrlEmailTokenizer, UniqueTokenFilter, + VectorEncodingFormat, + VectorSearchCompression as BaseVectorSearchCompression, + VectorSearchCompressionKind, + VectorSearchCompressionTarget, VectorSearchProfile, + VectorSearchVectorizerKind, WordDelimiterTokenFilter, } from "./generated/service/models"; export { default as GeographyPoint } from "./geographyPoint"; @@ -213,6 +238,7 @@ export { UnionToIntersection, UploadDocumentsOptions, VectorFilterMode, + VectorizableTextQuery, VectorizedQuery, VectorQuery, VectorQueryKind, @@ -233,7 +259,11 @@ export { export { AnalyzeRequest, AnalyzeTextOptions, + AzureOpenAIEmbeddingSkill, + AzureOpenAIParameters, + AzureOpenAIVectorizer, BaseVectorSearchAlgorithmConfiguration, + BaseVectorSearchVectorizer, BlobIndexerDataToExtract, BlobIndexerImageAction, BlobIndexerParsingMode, @@ -314,9 +344,13 @@ export { SearchFieldDataType, SearchIndex, SearchIndexer, + SearchIndexerDataIdentity, SearchIndexerDataSourceConnection, SearchIndexerDataSourceType, + SearchIndexerIndexProjection, + SearchIndexerIndexProjectionParameters, SearchIndexerKnowledgeStore, + SearchIndexerKnowledgeStoreParameters, SearchIndexerSkill, SearchIndexerSkillset, SearchIndexStatistics, @@ -337,7 +371,11 @@ export { VectorSearchAlgorithmConfiguration, VectorSearchAlgorithmKind, VectorSearchAlgorithmMetric, + VectorSearchCompression, + VectorSearchVectorizer, VisualFeature, + WebApiParameters, WebApiSkill, + WebApiVectorizer, } from "./serviceModels"; export { createSynonymMapFromFile } from "./synonymMapHelper"; diff --git a/sdk/search/search-documents/src/indexModels.ts b/sdk/search/search-documents/src/indexModels.ts index bd6cd388a03f..529aa660011e 100644 --- a/sdk/search/search-documents/src/indexModels.ts +++ b/sdk/search/search-documents/src/indexModels.ts @@ -179,7 +179,9 @@ export type SearchIterator< >; /** The query parameters for vector and hybrid search queries. */ -export type VectorQuery = VectorizedQuery; +export type VectorQuery = + | VectorizedQuery + | VectorizableTextQuery; /** The query parameters for vector and hybrid search queries. */ export interface BaseVectorQuery { @@ -199,6 +201,15 @@ export interface BaseVectorQuery { * truth values. */ exhaustive?: boolean; + /** + * Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter + * configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is + * true. This parameter is only permitted when a compression method is used on the underlying + * vector field. + */ + oversampling?: number; + /** Relative weight of the vector query when compared to other vector query and/or the text query within the same search request. This value is used when combining the results of multiple ranking lists produced by the different vector queries and/or the results retrieved through the text query. The higher the weight, the higher the documents that matched that query will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero. */ + weight?: number; } /** The query parameters to use for vector search when a raw vector value is provided. */ @@ -209,6 +220,14 @@ export interface VectorizedQuery extends BaseVectorQuery< vector: number[]; } +/** The query parameters to use for vector search when a text value that needs to be vectorized is provided. */ +export interface VectorizableTextQuery extends BaseVectorQuery { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: "text"; + /** The text to be vectorized to perform a vector search query. */ + text: string; +} + /** * Parameters for filtering, sorting, faceting, paging, and other search query behaviors. */ @@ -824,15 +843,6 @@ export interface QueryResultDocumentSemanticField { readonly name?: string; } -/** Contains debugging information that can be used to further explore your search results. */ -export interface DocumentDebugInfo { - /** - * Contains debugging information specific to semantic search queries. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly semantic?: SemanticDebugInfo; -} - /** * Debug options for semantic search queries. */ @@ -920,6 +930,12 @@ export interface SemanticSearchOptions { * to 'None'. */ captions?: QueryCaption; + /** + * Allows setting a separate search query that will be solely used for semantic reranking, + * semantic captions and semantic answers. Is useful for scenarios where there is a need to use + * different queries between the base retrieval and ranking phase, and the L2 semantic phase. + */ + semanticQuery?: string; } /** diff --git a/sdk/search/search-documents/src/searchClient.ts b/sdk/search/search-documents/src/searchClient.ts index be841b54fd1b..f3a1e90697ab 100644 --- a/sdk/search/search-documents/src/searchClient.ts +++ b/sdk/search/search-documents/src/searchClient.ts @@ -6,7 +6,7 @@ import { isTokenCredential, KeyCredential, TokenCredential } from "@azure/core-auth"; import { InternalClientPipelineOptions } from "@azure/core-client"; import { ExtendedCommonClientOptions } from "@azure/core-http-compat"; -import { bearerTokenAuthenticationPolicy, Pipeline } from "@azure/core-rest-pipeline"; +import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline"; import { decode, encode } from "./base64"; import { AutocompleteRequest, @@ -115,11 +115,6 @@ export class SearchClient implements IndexDocumentsClient */ private readonly client: GeneratedClient; - /** - * A reference to the internal HTTP pipeline for use with raw requests - */ - public readonly pipeline: Pipeline; - /** * Creates an instance of SearchClient. * @@ -193,7 +188,6 @@ export class SearchClient implements IndexDocumentsClient this.serviceVersion, internalClientPipelineOptions, ); - this.pipeline = this.client.pipeline; if (isTokenCredential(credential)) { const scope: string = options.audience diff --git a/sdk/search/search-documents/src/searchIndexClient.ts b/sdk/search/search-documents/src/searchIndexClient.ts index a44b61e5fb34..2b8a26c1bf82 100644 --- a/sdk/search/search-documents/src/searchIndexClient.ts +++ b/sdk/search/search-documents/src/searchIndexClient.ts @@ -6,7 +6,7 @@ import { isTokenCredential, KeyCredential, TokenCredential } from "@azure/core-auth"; import { InternalClientPipelineOptions } from "@azure/core-client"; import { ExtendedCommonClientOptions } from "@azure/core-http-compat"; -import { bearerTokenAuthenticationPolicy, Pipeline } from "@azure/core-rest-pipeline"; +import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline"; import { AnalyzeResult } from "./generated/service/models"; import { SearchServiceClient as GeneratedClient } from "./generated/service/searchServiceClient"; import { logger } from "./logger"; @@ -89,11 +89,6 @@ export class SearchIndexClient { */ private readonly client: GeneratedClient; - /** - * A reference to the internal HTTP pipeline for use with raw requests - */ - public readonly pipeline: Pipeline; - /** * Used to authenticate requests to the service. */ @@ -155,7 +150,6 @@ export class SearchIndexClient { this.serviceVersion, internalClientPipelineOptions, ); - this.pipeline = this.client.pipeline; if (isTokenCredential(credential)) { const scope: string = this.options.audience diff --git a/sdk/search/search-documents/src/searchIndexerClient.ts b/sdk/search/search-documents/src/searchIndexerClient.ts index d05bfdb33ed4..b378dea65105 100644 --- a/sdk/search/search-documents/src/searchIndexerClient.ts +++ b/sdk/search/search-documents/src/searchIndexerClient.ts @@ -4,7 +4,7 @@ import { isTokenCredential, KeyCredential, TokenCredential } from "@azure/core-auth"; import { InternalClientPipelineOptions } from "@azure/core-client"; import { ExtendedCommonClientOptions } from "@azure/core-http-compat"; -import { bearerTokenAuthenticationPolicy, Pipeline } from "@azure/core-rest-pipeline"; +import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline"; import { SearchIndexerStatus } from "./generated/service/models"; import { SearchServiceClient as GeneratedClient } from "./generated/service/searchServiceClient"; import { logger } from "./logger"; @@ -88,11 +88,6 @@ export class SearchIndexerClient { */ private readonly client: GeneratedClient; - /** - * A reference to the internal HTTP pipeline for use with raw requests - */ - public readonly pipeline: Pipeline; - /** * Creates an instance of SearchIndexerClient. * @@ -142,7 +137,6 @@ export class SearchIndexerClient { this.serviceVersion, internalClientPipelineOptions, ); - this.pipeline = this.client.pipeline; if (isTokenCredential(credential)) { const scope: string = options.audience diff --git a/sdk/search/search-documents/src/serviceModels.ts b/sdk/search/search-documents/src/serviceModels.ts index 75aa928699cf..af471e70e576 100644 --- a/sdk/search/search-documents/src/serviceModels.ts +++ b/sdk/search/search-documents/src/serviceModels.ts @@ -2,8 +2,11 @@ // Licensed under the MIT license. import { OperationOptions } from "@azure/core-client"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { AsciiFoldingTokenFilter, + AzureOpenAIModelName, + BinaryQuantizationCompression, BM25Similarity, CharFilterName, CjkBigramTokenFilter, @@ -27,6 +30,7 @@ import { FreshnessScoringFunction, HighWaterMarkChangeDetectionPolicy, IndexingSchedule, + IndexProjectionMode, KeepTokenFilter, KeywordMarkerTokenFilter, KnownBlobIndexerDataToExtract, @@ -73,8 +77,12 @@ import { PatternReplaceCharFilter, PatternReplaceTokenFilter, PhoneticTokenFilter, + ScalarQuantizationCompression, ScoringFunctionAggregation, SearchIndexerDataContainer, + SearchIndexerDataNoneIdentity, + SearchIndexerDataUserAssignedIdentity, + SearchIndexerIndexProjectionSelector, SearchIndexerKnowledgeStoreProjection, SearchIndexerSkill as BaseSearchIndexerSkill, SemanticSearch, @@ -98,13 +106,12 @@ import { TruncateTokenFilter, UaxUrlEmailTokenizer, UniqueTokenFilter, + VectorEncodingFormat, VectorSearchProfile, + VectorSearchVectorizerKind, WordDelimiterTokenFilter, } from "./generated/service/models"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { KnownVectorFilterMode } from "./generated/data"; - /** * Options for a list skillsets operation. */ @@ -561,12 +568,29 @@ export interface WebApiSkill extends BaseSearchIndexerSkill { * If set, the number of parallel calls that can be made to the Web API. */ degreeOfParallelism?: number; + /** + * Applies to custom skills that connect to external code in an Azure function or some other + * application that provides the transformations. This value should be the application ID + * created for the function or app when it was registered with Azure Active Directory. When + * specified, the custom skill connects to the function or app using a managed ID (either system + * or user-assigned) of the search service and the access token of the function or app, using + * this value as the resource id for creating the scope of the access token. + */ + authResourceId?: string; + /** + * The user-assigned managed identity used for outbound connections. If an authResourceId is + * provided and it's not specified, the system-assigned managed identity is used. On updates to + * the indexer, if the identity is unspecified, the value remains unchanged. If undefined, the + * value of this property is cleared. + */ + authIdentity?: SearchIndexerDataIdentity; } /** * Contains the possible cases for Skill. */ export type SearchIndexerSkill = + | AzureOpenAIEmbeddingSkill | ConditionalSkill | CustomEntityLookupSkill | DocumentExtractionSkill @@ -731,6 +755,14 @@ export interface SearchIndexerKnowledgeStore { * A list of additional projections to perform during indexing. */ projections: SearchIndexerKnowledgeStoreProjection[]; + /** + * The user-assigned managed identity used for connections to Azure Storage when writing + * knowledge store projections. If the connection string indicates an identity (ResourceId) and + * it's not specified, the system-assigned managed identity is used. On updates to the indexer, + * if the identity is unspecified, the value remains unchanged. If set to "none", the value of + * this property is cleared. + */ + identity?: SearchIndexerDataIdentity; } /** @@ -850,6 +882,16 @@ export interface SimpleField { * otherwise. */ hidden?: boolean; + /** + * An immutable value indicating whether the field will be persisted separately on disk to be + * returned in a search result. You can disable this option if you don't plan to return the field + * contents in a search response to save on storage overhead. This can only be set during index + * creation and only for vector fields. This property cannot be changed for existing fields or set + * as false for new fields. If this property is set as false, the property 'hidden' must be set to + * 'true'. This property must be false or unset for key fields, for new fields, and for non-vector + * fields. Disabling this property will reduce index storage requirements. + */ + stored?: boolean; /** * A value indicating whether the field is full-text searchable. This means it will undergo * analysis such as word-breaking during indexing. If you set a searchable field to a value like @@ -927,6 +969,10 @@ export interface SimpleField { * searching the vector field. */ vectorSearchProfileName?: string; + /** + * The encoding format to interpret the field contents. + */ + vectorEncodingFormat?: VectorEncodingFormat; } export function isComplexField(field: SearchField): field is ComplexField { @@ -949,9 +995,9 @@ export interface ComplexField { */ type: ComplexDataType; /** - * The list of sub-fields or collection elements. + * A list of sub-fields. */ - fields: SearchField[]; + fields?: SearchField[]; } /** @@ -1086,6 +1132,13 @@ export interface SearchIndexerCache { * Specifies whether incremental reprocessing is enabled. */ enableReprocessing?: boolean; + /** The user-assigned managed identity used for connections to the enrichment cache. If the + * connection string indicates an identity (ResourceId) and it's not specified, the + * system-assigned managed identity is used. On updates to the indexer, if the identity is + * unspecified, the value remains unchanged. If set to "none", the value of this property is + * cleared. + */ + identity?: SearchIndexerDataIdentity; } /** @@ -1181,6 +1234,13 @@ export interface SearchResourceEncryptionKey { * The authentication key of the specified AAD application. */ applicationSecret?: string; + /** + * An explicit managed identity to use for this encryption key. If not specified and the access + * credentials property is null, the system-assigned managed identity is used. On update to the + * resource, if the explicit identity is unspecified, it remains unchanged. If "none" is specified, + * the value of this property is cleared. + */ + identity?: SearchIndexerDataIdentity; } /** @@ -1207,6 +1267,10 @@ export interface SearchIndexerSkillset { * Definition of additional projections to azure blob, table, or files, of enriched data. */ knowledgeStore?: SearchIndexerKnowledgeStore; + /** + * Definition of additional projections to secondary search index(es). + */ + indexProjection?: SearchIndexerIndexProjection; /** * The ETag of the skillset. */ @@ -1902,6 +1966,13 @@ export type DataChangeDetectionPolicy = | HighWaterMarkChangeDetectionPolicy | SqlIntegratedChangeTrackingPolicy; +/** + * Contains the possible cases for SearchIndexerDataIdentity. + */ +export type SearchIndexerDataIdentity = + | SearchIndexerDataNoneIdentity + | SearchIndexerDataUserAssignedIdentity; + /** * Contains the possible cases for DataDeletionDetectionPolicy. */ @@ -1932,6 +2003,12 @@ export interface SearchIndexerDataSourceConnection { * The data container for the datasource. */ container: SearchIndexerDataContainer; + /** + * An explicit managed identity to use for this datasource. If not specified and the connection + * string is a managed identity, the system-assigned managed identity is used. If not specified, + * the value remains unchanged. If "none" is specified, the value of this property is cleared. + */ + identity?: SearchIndexerDataIdentity; /** * The data change detection policy for the datasource. */ @@ -1964,6 +2041,10 @@ export interface VectorSearch { profiles?: VectorSearchProfile[]; /** Contains configuration options specific to the algorithm used during indexing or querying. */ algorithms?: VectorSearchAlgorithmConfiguration[]; + /** Contains configuration options on how to vectorize text vector queries. */ + vectorizers?: VectorSearchVectorizer[]; + /** Contains configuration options specific to the compression method used during indexing or querying. */ + compressions?: VectorSearchCompression[]; } /** Contains configuration options specific to the algorithm used during indexing and/or querying. */ @@ -2039,21 +2120,27 @@ export interface ExhaustiveKnnParameters { } /** A dictionary of index projection-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. */ -export interface SearchIndexerIndexProjectionsParameters { +export interface SearchIndexerIndexProjectionParameters { /** Describes unknown properties.*/ [property: string]: unknown; + /** Defines behavior of the index projections in relation to the rest of the indexer. */ + projectionMode?: IndexProjectionMode; } /** Definition of additional projections to secondary search indexes. */ -export interface SearchIndexerIndexProjections { +export interface SearchIndexerIndexProjection { + /** A list of projections to be performed to secondary search indexes. */ + selectors: SearchIndexerIndexProjectionSelector[]; /** A dictionary of index projection-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. */ - parameters?: SearchIndexerIndexProjectionsParameters; + parameters?: SearchIndexerIndexProjectionParameters; } /** Contains specific details for a vectorization method to be used during query time. */ export interface BaseVectorSearchVectorizer { + /** Polymorphic discriminator, which specifies the different types this object can be */ + kind: VectorSearchVectorizerKind; /** The name to associate with this particular vectorization method. */ - name: string; + vectorizerName: string; } /** Contains the parameters specific to using an Azure Open AI service for vectorization at query time. */ @@ -2061,7 +2148,7 @@ export interface AzureOpenAIVectorizer extends BaseVectorSearchVectorizer { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "azureOpenAI"; /** Contains the parameters specific to Azure Open AI embedding vectorization. */ - azureOpenAIParameters?: AzureOpenAIParameters; + parameters?: AzureOpenAIParameters; } /** Specifies a user-defined vectorizer for generating the vector embedding of a query string. Integration of an external vectorizer is achieved using the custom Web API interface of a skillset. */ @@ -2069,7 +2156,7 @@ export interface WebApiVectorizer extends BaseVectorSearchVectorizer { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "customWebApi"; /** Specifies the properties of the user-defined vectorizer. */ - webAPIParameters?: WebApiParameters; + parameters?: WebApiParameters; } /** Specifies the properties for connecting to a user-defined vectorizer. */ @@ -2084,16 +2171,33 @@ export interface WebApiParameters { timeout?: string; /** Applies to custom endpoints that connect to external code in an Azure function or some other application that provides the transformations. This value should be the application ID created for the function or app when it was registered with Azure Active Directory. When specified, the vectorization connects to the function or app using a managed ID (either system or user-assigned) of the search service and the access token of the function or app, using this value as the resource id for creating the scope of the access token. */ authResourceId?: string; + /** The user-assigned managed identity used for outbound connections. If an authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. */ + authIdentity?: SearchIndexerDataIdentity; } +/** Contains configuration options on how to vectorize text vector queries. */ +export type VectorSearchVectorizer = AzureOpenAIVectorizer | WebApiVectorizer; + /** Contains the parameters specific to using an Azure Open AI service for vectorization at query time. */ export interface AzureOpenAIParameters { /** The resource uri for your Azure Open AI resource. */ - resourceUri?: string; + resourceUrl?: string; /** ID of your Azure Open AI model deployment on the designated resource. */ deploymentId?: string; /** API key for the designated Azure Open AI resource. */ apiKey?: string; + /** The user-assigned managed identity used for outbound connections. */ + authIdentity?: SearchIndexerDataIdentity; + /** The name of the embedding model that is deployed at the provided deploymentId path. */ + modelName?: AzureOpenAIModelName; +} + +/** Allows you to generate a vector embedding for a given text input using the Azure OpenAI resource. */ +export interface AzureOpenAIEmbeddingSkill extends BaseSearchIndexerSkill, AzureOpenAIParameters { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odatatype: "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; + /** The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. */ + dimensions?: number; } /** A dictionary of knowledge store-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. */ @@ -2292,6 +2396,9 @@ export interface ImageAnalysisSkill extends BaseSearchIndexerSkill { details?: ImageDetail[]; } +/** Contains configuration options specific to the compression method used during indexing or querying. */ +export type VectorSearchCompression = BinaryQuantizationCompression | ScalarQuantizationCompression; + export type AnalyzerNames = `${KnownLexicalAnalyzerName}`; export type BlobIndexerDataToExtract = `${KnownBlobIndexerDataToExtract}`; export type BlobIndexerImageAction = `${KnownBlobIndexerImageAction}`; @@ -2358,7 +2465,6 @@ export type TextSplitMode = `${KnownTextSplitMode}`; export type TextTranslationSkillLanguage = `${KnownTextTranslationSkillLanguage}`; export type TokenFilterNames = `${KnownTokenFilterName}`; export type TokenizerNames = `${KnownLexicalTokenizerName}`; -export type VectorFilterMode = `${KnownVectorFilterMode}`; export type VectorSearchAlgorithmKind = `${KnownVectorSearchAlgorithmKind}`; export type VectorSearchAlgorithmMetric = `${KnownVectorSearchAlgorithmMetric}`; export type VisualFeature = `${KnownVisualFeature}`; diff --git a/sdk/search/search-documents/src/serviceUtils.ts b/sdk/search/search-documents/src/serviceUtils.ts index fd02ce0fd6bd..541b61278975 100644 --- a/sdk/search/search-documents/src/serviceUtils.ts +++ b/sdk/search/search-documents/src/serviceUtils.ts @@ -6,6 +6,7 @@ import { SuggestDocumentsResult as GeneratedSuggestDocumentsResult, } from "./generated/data/models"; import { + AzureOpenAIVectorizer as GeneratedAzureOpenAIVectorizer, BM25Similarity, ClassicSimilarity, CognitiveServicesAccountKey, @@ -25,7 +26,10 @@ import { SearchField as GeneratedSearchField, SearchIndex as GeneratedSearchIndex, SearchIndexer as GeneratedSearchIndexer, + SearchIndexerDataIdentityUnion, + SearchIndexerDataNoneIdentity, SearchIndexerDataSource as GeneratedSearchIndexerDataSourceConnection, + SearchIndexerDataUserAssignedIdentity, SearchIndexerSkillset as GeneratedSearchIndexerSkillset, SearchIndexerSkillUnion, SearchResourceEncryptionKey as GeneratedSearchResourceEncryptionKey, @@ -37,9 +41,13 @@ import { TokenFilterUnion, VectorSearch as GeneratedVectorSearch, VectorSearchAlgorithmConfigurationUnion as GeneratedVectorSearchAlgorithmConfiguration, + VectorSearchVectorizerUnion as GeneratedVectorSearchVectorizer, + WebApiVectorizer as GeneratedWebAPIVectorizer, } from "./generated/service/models"; import { SearchResult, SelectFields, SuggestDocumentsResult, SuggestResult } from "./indexModels"; +import { logger } from "./logger"; import { + AzureOpenAIVectorizer, BlobIndexerDataToExtract, BlobIndexerImageAction, BlobIndexerParsingMode, @@ -62,8 +70,10 @@ import { SearchFieldDataType, SearchIndex, SearchIndexer, + SearchIndexerDataIdentity, SearchIndexerDataSourceConnection, SearchIndexerDataSourceType, + SearchIndexerIndexProjection, SearchIndexerSkill, SearchIndexerSkillset, SearchResourceEncryptionKey, @@ -74,12 +84,15 @@ import { VectorSearch, VectorSearchAlgorithmConfiguration, VectorSearchAlgorithmMetric, + VectorSearchVectorizer, + WebApiVectorizer, } from "./serviceModels"; -export const defaultServiceVersion = "2023-11-01"; +export const defaultServiceVersion = "2024-07-01"; const knownSkills: Record<`${SearchIndexerSkillUnion["odatatype"]}`, true> = { "#Microsoft.Skills.Custom.WebApiSkill": true, + "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill": true, "#Microsoft.Skills.Text.CustomEntityLookupSkill": true, "#Microsoft.Skills.Text.EntityRecognitionSkill": true, "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": true, @@ -404,6 +417,41 @@ export function generatedIndexToPublicIndex(generatedIndex: GeneratedSearchIndex }; } +export function generatedVectorSearchVectorizerToPublicVectorizer(): undefined; +export function generatedVectorSearchVectorizerToPublicVectorizer( + generatedVectorizer: GeneratedVectorSearchVectorizer, +): VectorSearchVectorizer; +export function generatedVectorSearchVectorizerToPublicVectorizer( + generatedVectorizer?: GeneratedVectorSearchVectorizer, +): VectorSearchVectorizer | undefined { + if (!generatedVectorizer) { + return generatedVectorizer; + } + + switch (generatedVectorizer.kind) { + case "azureOpenAI": { + const { parameters } = generatedVectorizer as GeneratedAzureOpenAIVectorizer; + const authIdentity = convertSearchIndexerDataIdentityToPublic(parameters?.authIdentity); + const vectorizer: AzureOpenAIVectorizer = { + ...(generatedVectorizer as GeneratedAzureOpenAIVectorizer), + parameters: { ...parameters, authIdentity }, + }; + return vectorizer; + } + case "customWebApi": { + const { parameters } = generatedVectorizer as GeneratedWebAPIVectorizer; + const authIdentity = convertSearchIndexerDataIdentityToPublic(parameters?.authIdentity); + const vectorizer: WebApiVectorizer = { + ...(generatedVectorizer as GeneratedWebAPIVectorizer), + parameters: { ...parameters, authIdentity }, + }; + return vectorizer; + } + } + logger.warning(`Unsupported vectorizer kind: ${(generatedVectorizer as any).kind}`); + return generatedVectorizer as any; +} + export function generatedVectorSearchAlgorithmConfigurationToPublicVectorSearchAlgorithmConfiguration(): undefined; export function generatedVectorSearchAlgorithmConfigurationToPublicVectorSearchAlgorithmConfiguration( generatedAlgorithmConfiguration: GeneratedVectorSearchAlgorithmConfiguration, @@ -441,6 +489,7 @@ export function generatedVectorSearchToPublicVectorSearch( algorithms: vectorSearch.algorithms?.map( generatedVectorSearchAlgorithmConfigurationToPublicVectorSearchAlgorithmConfiguration, ), + vectorizers: vectorSearch.vectorizers?.map(generatedVectorSearchVectorizerToPublicVectorizer), }; } @@ -510,12 +559,14 @@ export function publicIndexToGeneratedIndex(index: SearchIndex): GeneratedSearch export function generatedSkillsetToPublicSkillset( generatedSkillset: GeneratedSearchIndexerSkillset, ): SearchIndexerSkillset { - const { skills, cognitiveServicesAccount, encryptionKey, ...props } = generatedSkillset; + const { skills, cognitiveServicesAccount, encryptionKey, indexProjection, ...props } = + generatedSkillset; return { ...props, skills: convertSkillsToPublic(skills), cognitiveServicesAccount: convertCognitiveServicesAccountToPublic(cognitiveServicesAccount), encryptionKey: convertEncryptionKeyToPublic(encryptionKey), + indexProjection: indexProjection as SearchIndexerIndexProjection, }; } @@ -523,6 +574,7 @@ export function publicSkillsetToGeneratedSkillset( skillset: SearchIndexerSkillset, ): GeneratedSearchIndexerSkillset { return { + ...skillset, name: skillset.name, description: skillset.description, etag: skillset.etag, @@ -645,6 +697,20 @@ export function generatedDataSourceToPublicDataSource( }; } +export function convertSearchIndexerDataIdentityToPublic( + searchIndexerDataIdentity?: SearchIndexerDataIdentityUnion, +): SearchIndexerDataIdentity | undefined { + if (!searchIndexerDataIdentity) { + return searchIndexerDataIdentity; + } + + if (searchIndexerDataIdentity.odatatype === "#Microsoft.Azure.Search.DataNoneIdentity") { + return searchIndexerDataIdentity as SearchIndexerDataNoneIdentity; + } else { + return searchIndexerDataIdentity as SearchIndexerDataUserAssignedIdentity; + } +} + export function convertDataChangeDetectionPolicyToPublic( dataChangeDetectionPolicy?: DataChangeDetectionPolicyUnion, ): DataChangeDetectionPolicy | undefined { diff --git a/sdk/search/search-documents/swagger/Data.md b/sdk/search/search-documents/swagger/Data.md index 98185eed6060..87b1151b6660 100644 --- a/sdk/search/search-documents/swagger/Data.md +++ b/sdk/search/search-documents/swagger/Data.md @@ -10,7 +10,7 @@ generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ source-code-folder-path: ./src/generated/data -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/58e92dd03733bc175e6a9540f4bc53703b57fcc9/specification/search/data-plane/Azure.Search/stable/2023-11-01/searchindex.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/dc27f9b32787533cd4d07fe0de5245f2f8354dbe/specification/search/data-plane/Azure.Search/stable/2024-07-01/searchindex.json add-credentials: false title: SearchClient use-extension: diff --git a/sdk/search/search-documents/swagger/Service.md b/sdk/search/search-documents/swagger/Service.md index e789f080aba1..1e68cb052f51 100644 --- a/sdk/search/search-documents/swagger/Service.md +++ b/sdk/search/search-documents/swagger/Service.md @@ -10,7 +10,7 @@ generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ source-code-folder-path: ./src/generated/service -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/58e92dd03733bc175e6a9540f4bc53703b57fcc9/specification/search/data-plane/Azure.Search/stable/2023-11-01/searchservice.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/dc27f9b32787533cd4d07fe0de5245f2f8354dbe/specification/search/data-plane/Azure.Search/stable/2024-07-01/searchservice.json add-credentials: false use-extension: "@autorest/typescript": "6.0.23" @@ -364,7 +364,112 @@ directive: directive: - from: swagger-document where: $.definitions.VectorSearchCompressionConfiguration - transform: $["x-ms-client-name"] = "BaseVectorSearchCompressionConfiguration"; + transform: $["x-ms-client-name"] = "VectorSearchCompression"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.ScalarQuantizationVectorSearchCompressionConfiguration + transform: $["x-ms-client-name"] = "ScalarQuantizationCompression" +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.BinaryQuantizationVectorSearchCompressionConfiguration + transform: $["x-ms-client-name"] = "BinaryQuantizationCompression" +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.VectorSearchVectorizer.properties.name + transform: $["x-ms-client-name"] = "vectorizerName" +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.VectorSearchCompressionConfiguration.properties.name + transform: $["x-ms-client-name"] = "compressionName"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.OcrSkillLineEnding + transform: $["x-ms-enum"].name = "OcrLineEnding"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.SearchIndexerDataUserAssignedIdentity.properties.userAssignedIdentity + transform: $["x-ms-client-name"] = "resourceId"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.SearchIndexerIndexProjections + transform: $["x-ms-client-name"] = "SearchIndexerIndexProjection"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.SearchIndexerIndexProjectionsParameters + transform: $["x-ms-client-name"] = "SearchIndexerIndexProjectionParameters"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.SearchIndexerSkillset.properties.indexProjections + transform: $["x-ms-client-name"] = "indexProjection"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.VectorSearchCompressionTargetDataType + transform: $["x-ms-enum"].name = "VectorSearchCompressionTarget"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.VectorSearchProfile.properties.compression + transform: $["x-ms-client-name"] = "compressionName"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.WebApiVectorizer.properties.customWebApiParameters + transform: $["x-ms-client-name"] = "parameters"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.AzureOpenAIVectorizer.properties.azureOpenAIParameters + transform: $["x-ms-client-name"] = "parameters"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.AzureOpenAIParameters.properties.resourceUri + transform: $["x-ms-client-name"] = "resourceUrl"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.AzureOpenAIParameters.properties.deploymentId + transform: $["x-ms-client-name"] = "deploymentId"; ``` ### Deprecations diff --git a/sdk/search/search-documents/test/public/node/searchClient.spec.ts b/sdk/search/search-documents/test/public/node/searchClient.spec.ts index da6fc9fcff7c..70ce9aa4c9eb 100644 --- a/sdk/search/search-documents/test/public/node/searchClient.spec.ts +++ b/sdk/search/search-documents/test/public/node/searchClient.spec.ts @@ -69,6 +69,7 @@ describe("SearchClient", function (this: Suite) { let indexClient: SearchIndexClient; let openAIClient: OpenAIClient; let TEST_INDEX_NAME: string; + let indexDefinition: SearchIndex; beforeEach(async function (this: Context) { recorder = new Recorder(this.currentTest); @@ -79,7 +80,7 @@ describe("SearchClient", function (this: Suite) { indexName: TEST_INDEX_NAME, openAIClient, } = await createClients(defaultServiceVersion, recorder, TEST_INDEX_NAME)); - await createIndex(indexClient, TEST_INDEX_NAME); + indexDefinition = await createIndex(indexClient, TEST_INDEX_NAME, defaultServiceVersion); await delay(WAIT_TIME); await populateIndex(searchClient, openAIClient); }); @@ -412,44 +413,6 @@ describe("SearchClient", function (this: Suite) { const documentCount = await searchClient.getDocumentsCount(); assert.equal(documentCount, 11); }); - }); - - describe("preview", function () { - let recorder: Recorder; - let searchClient: SearchClient; - let indexClient: SearchIndexClient; - let openAIClient: OpenAIClient; - let TEST_INDEX_NAME: string; - let indexDefinition: SearchIndex; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - TEST_INDEX_NAME = createRandomIndexName(); - ({ - searchClient, - indexClient, - indexName: TEST_INDEX_NAME, - openAIClient, - } = await createClients(defaultServiceVersion, recorder, TEST_INDEX_NAME)); - indexDefinition = await createIndex(indexClient, TEST_INDEX_NAME); - await delay(WAIT_TIME); - await populateIndex(searchClient, openAIClient); - }); - - afterEach(async function () { - await indexClient.deleteIndex(TEST_INDEX_NAME); - await delay(WAIT_TIME); - await recorder?.stop(); - }); - - it("search with speller", async function () { - const searchResults = await searchClient.search("budjet", { - skip: 0, - top: 5, - includeTotalCount: true, - }); - assert.equal(searchResults.count, 6); - }); it("search with semantic ranking", async function () { const searchResults = await searchClient.search("luxury", { @@ -599,6 +562,7 @@ describe("SearchClient", function (this: Suite) { vector: embedding, kNearestNeighborsCount: 3, fields: ["compressedVectorDescription"], + oversampling: 2, }, ], }, diff --git a/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts b/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts index 6219c5f5358f..0f01c72fe061 100644 --- a/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts +++ b/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { isLiveMode, Recorder } from "@azure-tools/test-recorder"; +import { env, isLiveMode, Recorder } from "@azure-tools/test-recorder"; import { delay } from "@azure/core-util"; import { assert } from "chai"; import { Context, Suite } from "mocha"; import { AzureKeyCredential, + AzureOpenAIVectorizer, SearchIndex, SearchIndexClient, SynonymMap, @@ -266,33 +267,6 @@ describe("SearchIndexClient", function (this: Suite) { assert.equal(index.fields.length, 6); }); }); - }); - - describe("preview", function () { - let recorder: Recorder; - let indexClient: SearchIndexClient; - let TEST_INDEX_NAME: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - TEST_INDEX_NAME = createRandomIndexName(); - ({ indexClient, indexName: TEST_INDEX_NAME } = await createClients( - defaultServiceVersion, - recorder, - TEST_INDEX_NAME, - )); - - await createSynonymMaps(indexClient); - await createSimpleIndex(indexClient, TEST_INDEX_NAME); - await delay(WAIT_TIME); - }); - - afterEach(async function () { - await indexClient.deleteIndex(TEST_INDEX_NAME); - await delay(WAIT_TIME); - await deleteSynonymMaps(indexClient); - await recorder?.stop(); - }); it("creates the index object vector fields", async function () { const indexName: string = isLiveMode() ? createRandomIndexName() : "hotel-live-test4"; @@ -302,10 +276,19 @@ describe("SearchIndexClient", function (this: Suite) { kind: "hnsw", parameters: { m: 10, efSearch: 1000, efConstruction: 1000, metric: "dotProduct" }, }; - + const vectorizer: AzureOpenAIVectorizer = { + kind: "azureOpenAI", + vectorizerName: "vectorizer", + parameters: { + deploymentId: env.AZURE_OPENAI_DEPLOYMENT_NAME, + resourceUrl: env.AZURE_OPENAI_ENDPOINT, + modelName: "text-embedding-ada-002", + }, + }; const profile: VectorSearchProfile = { name: "profile", algorithmConfigurationName: algorithm.name, + vectorizerName: vectorizer.vectorizerName, }; let index: SearchIndex = { @@ -326,6 +309,7 @@ describe("SearchIndexClient", function (this: Suite) { ], vectorSearch: { algorithms: [algorithm], + vectorizers: [vectorizer], profiles: [profile], }, }; @@ -333,6 +317,10 @@ describe("SearchIndexClient", function (this: Suite) { await indexClient.createOrUpdateIndex(index); index = await indexClient.getIndex(indexName); assert.deepEqual(index.vectorSearch?.algorithms?.[0].name, algorithm.name); + assert.deepEqual( + index.vectorSearch?.vectorizers?.[0].vectorizerName, + vectorizer.vectorizerName, + ); assert.deepEqual(index.vectorSearch?.profiles?.[0].name, profile.name); } finally { await indexClient.deleteIndex(index); diff --git a/sdk/search/search-documents/test/public/typeDefinitions.ts b/sdk/search/search-documents/test/public/typeDefinitions.ts index 0f159e0aaa4f..3afd59df59d6 100644 --- a/sdk/search/search-documents/test/public/typeDefinitions.ts +++ b/sdk/search/search-documents/test/public/typeDefinitions.ts @@ -54,7 +54,7 @@ type ExpectPIIDetectionSkillMaskingMode = `${KnownPIIDetectionSkillMaskingMode}` type ExpectRegexFlags = `${KnownRegexFlags}`; type ExpectSearchFieldDataType = Exclude< `${KnownSearchFieldDataType}` | `Collection(${KnownSearchFieldDataType})`, - "Edm.ComplexType" | "Edm.Single" + "Edm.ComplexType" | "Edm.Byte" | "Edm.Half" | "Edm.Int16" | "Edm.SByte" | "Edm.Single" >; type ExpectSearchIndexerDataSourceType = `${KnownSearchIndexerDataSourceType}`; type ExpectSemanticErrorMode = `${KnownSemanticErrorMode}`; @@ -371,12 +371,16 @@ type RegexFlags = | "UNIX_LINES"; type SearchFieldDataType = | "Collection(Edm.Boolean)" + | "Collection(Edm.Byte)" | "Collection(Edm.ComplexType)" | "Collection(Edm.DateTimeOffset)" | "Collection(Edm.Double)" | "Collection(Edm.GeographyPoint)" + | "Collection(Edm.Half)" + | "Collection(Edm.Int16)" | "Collection(Edm.Int32)" | "Collection(Edm.Int64)" + | "Collection(Edm.SByte)" | "Collection(Edm.Single)" | "Collection(Edm.String)" | "Edm.Boolean" @@ -467,6 +471,7 @@ type TextTranslationSkillLanguage = | "fil" | "fj" | "fr" + | "ga" | "he" | "hi" | "hr" @@ -476,17 +481,23 @@ type TextTranslationSkillLanguage = | "is" | "it" | "ja" + | "kn" | "ko" | "lt" | "lv" | "mg" + | "mi" + | "ml" | "ms" | "mt" | "mww" | "nb" | "nl" | "otq" + | "pa" | "pl" + | "pt-br" + | "pt-PT" | "pt" | "ro" | "ru" @@ -500,6 +511,8 @@ type TextTranslationSkillLanguage = | "ta" | "te" | "th" + | "tlh-Latn" + | "tlh-Piqd" | "tlh" | "to" | "tr" @@ -512,9 +525,9 @@ type TextTranslationSkillLanguage = | "zh-Hans" | "zh-Hant"; type VectorFilterMode = "postFilter" | "preFilter"; -type VectorQueryKind = "vector"; +type VectorQueryKind = "text" | "vector"; type VectorSearchAlgorithmKind = "exhaustiveKnn" | "hnsw"; -type VectorSearchAlgorithmMetric = "cosine" | "dotProduct" | "euclidean"; +type VectorSearchAlgorithmMetric = "cosine" | "dotProduct" | "euclidean" | "hamming"; type VisualFeature = | "adult" | "brands" @@ -617,8 +630,9 @@ const foo: [ "VectorSearchAlgorithmMetric", never >, - IsEqual + IsEqual, ] = [ + // List of custom string literal unions. Update with any new authored string literal unions. "BlobIndexerDataToExtract", "BlobIndexerImageAction", "BlobIndexerParsingMode", diff --git a/sdk/search/search-documents/test/public/utils/setup.ts b/sdk/search/search-documents/test/public/utils/setup.ts index f1f4002937a1..6680ae288d51 100644 --- a/sdk/search/search-documents/test/public/utils/setup.ts +++ b/sdk/search/search-documents/test/public/utils/setup.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { isLiveMode, isPlaybackMode } from "@azure-tools/test-recorder"; +import { assertEnvironmentVariable, isLiveMode, isPlaybackMode } from "@azure-tools/test-recorder"; import { computeSha256Hash, delay, isDefined } from "@azure/core-util"; import { OpenAIClient } from "@azure/openai"; import { assert } from "chai"; @@ -14,13 +14,35 @@ import { SearchIndexClient, SearchIndexerClient, VectorSearchAlgorithmConfiguration, + VectorSearchCompression, + VectorSearchVectorizer, } from "../../../src"; import { Hotel } from "./interfaces"; export const WAIT_TIME = isPlaybackMode() ? 0 : 4000; // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters -export async function createIndex(client: SearchIndexClient, name: string): Promise { +export async function createIndex( + client: SearchIndexClient, + name: string, + serviceVersion: string, +): Promise { + const isPreview = serviceVersion.toLowerCase().includes("preview"); + + const vectorizers: VectorSearchVectorizer[] = [ + { + kind: "azureOpenAI", + vectorizerName: "vector-search-vectorizer", + parameters: { + deploymentId: assertEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME"), + resourceUrl: assertEnvironmentVariable("AZURE_OPENAI_ENDPOINT"), + modelName: "text-embedding-ada-002", + }, + }, + ]; + await Promise.all(vectorizers.map(renameUniquelyInPlace("vectorizerName"))); + const [azureOpenAiVectorizerName] = vectorizers.map((v) => v.vectorizerName); + const algorithmConfigurations: VectorSearchAlgorithmConfiguration[] = [ { name: "vector-search-algorithm-configuration", @@ -33,22 +55,41 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom parameters: { metric: "euclidean" }, }, ]; - await Promise.all(algorithmConfigurations.map(renameUniquelyInPlace)); + await Promise.all(algorithmConfigurations.map(renameUniquelyInPlace("name"))); const [hnswAlgorithmConfigurationName, exhaustiveKnnAlgorithmConfigurationName] = algorithmConfigurations.map((c) => c.name); + const compressionConfigurations: VectorSearchCompression[] = [ + { + compressionName: "vector-search-compression-configuration", + kind: "scalarQuantization", + parameters: { quantizedDataType: "int8" }, + rerankWithOriginalVectors: true, + }, + ]; + await Promise.all(compressionConfigurations.map(renameUniquelyInPlace("compressionName"))); + const [scalarQuantizationCompressionConfigurationName] = compressionConfigurations.map( + (c) => c.compressionName, + ); + const vectorSearchProfiles = [ { name: "vector-search-profile", + vectorizer: isPreview ? azureOpenAiVectorizerName : undefined, algorithmConfigurationName: exhaustiveKnnAlgorithmConfigurationName, }, { name: "vector-search-profile", + vectorizer: isPreview ? azureOpenAiVectorizerName : undefined, algorithmConfigurationName: hnswAlgorithmConfigurationName, + compressionConfigurationName: isPreview + ? scalarQuantizationCompressionConfigurationName + : undefined, }, ]; - await Promise.all(vectorSearchProfiles.map(renameUniquelyInPlace)); - const [azureOpenAiVectorSearchProfileName] = vectorSearchProfiles.map((p) => p.name); + await Promise.all(vectorSearchProfiles.map(renameUniquelyInPlace("name"))); + const [azureOpenAiVectorSearchProfileName, azureOpenAiCompressedVectorSearchProfileName] = + vectorSearchProfiles.map((p) => p.name); const vectorFields: SearchField[] = [ { @@ -59,6 +100,15 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom hidden: true, vectorSearchProfileName: azureOpenAiVectorSearchProfileName, }, + { + type: "Collection(Edm.Half)", + name: "compressedVectorDescription", + searchable: true, + hidden: true, + vectorSearchDimensions: 1536, + vectorSearchProfileName: azureOpenAiCompressedVectorSearchProfileName, + stored: false, + }, ]; const fields: SearchField[] = [ @@ -273,6 +323,8 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom }, vectorSearch: { algorithms: algorithmConfigurations, + vectorizers: isPreview ? vectorizers : undefined, + compressions: isPreview ? compressionConfigurations : undefined, profiles: vectorSearchProfiles, }, semanticSearch: { @@ -716,8 +768,12 @@ export function createRandomIndexName(): string { return `hotel-live-test-${Math.floor(Math.random() * 100000) + 1000000}`; } -async function renameUniquelyInPlace(obj: { name: string }): Promise { - const hash = await computeSha256Hash(JSON.stringify(obj), "hex"); - const name = [obj.name, hash.toLowerCase()].join("-"); - obj.name = name; +function renameUniquelyInPlace( + prop: T, +): (obj: Record) => Promise { + return async (obj) => { + const hash = await computeSha256Hash(JSON.stringify(obj), "hex"); + const name = [obj[prop], hash.toLowerCase()].join("-"); + obj[prop] = name; + }; }