From 6d3160929f7f7bad8887f12e1055626920d2a03d Mon Sep 17 00:00:00 2001 From: Yangyang Lu Date: Thu, 22 Oct 2026 18:53:30 -0700 Subject: [PATCH 01/20] Add Azure AI Search 2026-11-01-preview SDK support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-search-documents/CHANGELOG.md | 111 +- sdk/search/azure-search-documents/README.md | 73 +- sdk/search/azure-search-documents/cspell.json | 9 + .../src/main/java/SearchCustomizations.java | 1121 ++--- .../search/documents/SearchAsyncClient.java | 328 +- .../azure/search/documents/SearchClient.java | 327 +- .../documents/SearchServiceVersion.java | 12 +- .../KnowledgeBaseRetrievalClientImpl.java | 410 +- .../OperationLocationPollingStrategy.java | 140 + .../implementation/PollingUtils.java | 151 + .../implementation/SearchClientImpl.java | 1040 ++++- .../implementation/SearchIndexClientImpl.java | 3691 +++++++++++++++-- .../SearchIndexerClientImpl.java | 586 ++- .../documents/implementation/SearchUtils.java | 55 +- .../SyncOperationLocationPollingStrategy.java | 133 + .../implementation/models/GraphRequest.java | 361 ++ .../models/SearchPostRequest.java | 209 + .../indexes/SearchIndexAsyncClient.java | 1198 +++++- .../documents/indexes/SearchIndexClient.java | 1136 ++++- .../indexes/SearchIndexerAsyncClient.java | 441 +- .../indexes/SearchIndexerClient.java | 406 +- .../AzureBlobKnowledgeSourceParameters.java | 74 + .../indexes/models/AzureOpenAIModelName.java | 24 + .../models/DistanceScoringFunction.java | 88 +- .../models/FreshnessScoringFunction.java | 88 +- .../indexes/models/GraphFieldMappings.java | 558 +++ .../indexes/models/GraphProfile.java | 144 + .../indexes/models/GraphProfileKind.java | 51 + .../models/IndexerPermissionOption.java | 17 + .../indexes/models/KnowledgeBase.java | 113 + ...KnowledgeBaseMicrosoftRetriever1Model.java | 80 + .../indexes/models/KnowledgeBaseModel.java | 4 + .../models/KnowledgeBaseModelKind.java | 13 + .../KnowledgeBaseOpenAICompatibleModel.java | 108 + ...owledgeBaseOpenAICompatibleParameters.java | 248 ++ .../indexes/models/KnowledgeBaseTool.java | 209 + ...ledgeBaseToolKnowledgeSourceReference.java | 262 ++ .../KnowledgeSourceFileIngestionError.java | 104 + ...KnowledgeSourceFileIngestionOperation.java | 167 + ...wledgeSourceGraphExtractionParameters.java | 194 + .../models/KnowledgeSourceGraphGrounding.java | 124 + .../KnowledgeSourceGraphGroundingIndex.java | 119 + ...owledgeSourceGraphGroundingSourceKind.java | 52 + .../models/KnowledgeSourceGraphOntology.java | 144 + ...nowledgeSourceGraphOntologySourceKind.java | 52 + ...wledgeSourceIngestionPermissionOption.java | 16 + .../models/MagnitudeScoringFunction.java | 88 +- .../indexes/models/OneLakeSecuritySource.java | 105 + .../models/OpenAICompatibleVectorizer.java | 113 + .../OpenAICompatibleVectorizerParameters.java | 285 ++ .../indexes/models/PermissionFilter.java | 14 + .../indexes/models/RandomScoringFunction.java | 129 + .../models/RandomScoringParameters.java | 83 + .../indexes/models/ScoringFunction.java | 126 +- .../documents/indexes/models/SearchField.java | 140 + .../documents/indexes/models/SearchIndex.java | 74 + .../SearchIndexKnowledgeSourceFilterHint.java | 217 + ...edgeSourceFilterHintAutoConfiguration.java | 138 + .../SearchIndexKnowledgeSourceParameters.java | 70 + .../indexes/models/SearchIndexResponse.java | 66 + .../indexes/models/TagScoringFunction.java | 88 +- .../indexes/models/VectorSearch.java | 34 + .../models/VectorSearchTopicGraphProfile.java | 204 + .../models/VectorSearchVectorizer.java | 2 + .../models/VectorSearchVectorizerKind.java | 6 + .../KnowledgeBaseRetrievalAsyncClient.java | 238 +- .../KnowledgeBaseRetrievalClient.java | 257 +- ...entRuntimeGraphHydrateDocumentsParams.java | 125 + .../models/AgentRuntimeGraphParams.java | 123 + .../AgentRuntimeGraphProvenanceParams.java | 125 + .../AzureBlobKnowledgeSourceParams.java | 119 + .../models/CompletedSynchronizationState.java | 26 +- .../models/FileKnowledgeSourceParams.java | 47 + .../IndexedOneLakeKnowledgeSourceParams.java | 48 + ...ndexedSharePointKnowledgeSourceParams.java | 48 + .../IndexedSqlKnowledgeSourceParams.java | 47 + ...ledgeBaseActivityCompletedStreamEvent.java | 1 + .../models/KnowledgeBaseActivityRecord.java | 4 +- .../KnowledgeBaseActivityRecordType.java | 6 + ...owledgeBaseActivityStartedStreamEvent.java | 1 + ...owledgeBaseAnswerCompletedStreamEvent.java | 1 + .../models/KnowledgeBaseErrorStreamEvent.java | 31 +- ...ledgeBaseGraphSearchActivityArguments.java | 236 ++ ...nowledgeBaseGraphSearchActivityRecord.java | 229 + .../KnowledgeBaseGraphSearchReference.java | 126 + .../models/KnowledgeBaseReference.java | 4 +- .../models/KnowledgeBaseReferenceType.java | 6 + ...dgeBaseReferencesCompletedStreamEvent.java | 1 + ...ledgeBaseResponseCompletedStreamEvent.java | 31 +- .../models/KnowledgeBaseRetrievalOptions.java | 67 +- ...wledgeBaseRetrievalStartedStreamEvent.java | 1 + .../KnowledgeBaseRetrievalStreamEvent.java | 1 + .../models/KnowledgeSourceCache.java | 161 + .../KnowledgeSourceGraphProvenanceKind.java | 57 + .../KnowledgeSourceGraphStatistics.java | 99 + .../KnowledgeSourceIngestionParameters.java | 37 + ...ledgeSourceOpenAICompatibleVectorizer.java | 109 + .../models/KnowledgeSourceVectorizer.java | 4 +- .../SearchIndexKnowledgeSourceParams.java | 122 + .../models/SynchronizationState.java | 21 + .../models/AgenticSearchDebugInfo.java | 121 + .../models/AgenticSearchOptions.java | 92 + .../models/AgenticSearchSubQuery.java | 99 + .../AgenticSearchTerminationReason.java | 64 + .../documents/models/AgenticSearchUsage.java | 100 + .../models/BalancedVectorQueryTopicGraph.java | 116 + .../search/documents/models/DebugInfo.java | 97 + .../models/DiverseVectorQueryTopicGraph.java | 148 + .../search/documents/models/GraphOptions.java | 334 ++ .../models/GraphQueryDiagnostic.java | 176 + .../models/GraphQueryDiagnosticPhase.java | 75 + .../models/GraphQueryDiagnosticSeverity.java | 63 + .../documents/models/GraphQueryEvidence.java | 135 + .../models/GraphQueryEvidenceConfidence.java | 135 + .../models/GraphQueryEvidenceCount.java | 98 + .../GraphQueryEvidenceCountRelation.java | 57 + .../models/GraphQueryExecutionMode.java | 57 + .../documents/models/GraphQueryExplain.java | 85 + .../models/GraphQueryExplainStage.java | 87 + .../models/GraphQueryProvenanceDocument.java | 85 + .../models/GraphQueryProvenanceDocuments.java | 87 + ...yProvenanceHydrateDocumentsParameters.java | 94 + .../models/GraphQueryProvenanceKind.java | 57 + .../GraphQueryProvenanceParameters.java | 154 + .../documents/models/GraphQueryResult.java | 172 + .../documents/models/GraphQueryRow.java | 105 + .../models/GraphQueryRowProvenance.java | 119 + .../models/GraphQueryStatistics.java | 193 + .../models/NoneVectorQueryTopicGraph.java | 79 + .../documents/models/OperationState.java | 75 + .../documents/models/QueryDebugMode.java | 7 + .../search/documents/models/QueryType.java | 7 + .../documents/models/SearchOptions.java | 62 + .../documents/models/SearchPagedResponse.java | 18 + .../documents/models/SearchRequest.java | 65 + .../search/documents/models/VectorQuery.java | 143 + .../models/VectorQueryTopicGraph.java | 109 + .../models/VectorSearchTopicGraphKind.java | 64 + .../models/VectorizableImageBinaryQuery.java | 231 ++ .../models/VectorizableImageUrlQuery.java | 228 + .../models/VectorizableTextQuery.java | 95 + .../documents/models/VectorizedQuery.java | 60 + .../src/main/java/module-info.java | 2 +- .../azure-search-documents_metadata.json | 2 +- .../documents/PreviewSearchSamples.java | 77 + .../search/documents/PreviewApiTests.java | 257 ++ .../implementation/SearchUtilsTests.java | 94 + .../azure-search-documents/tsp-location.yaml | 2 +- 148 files changed, 21844 insertions(+), 2570 deletions(-) create mode 100644 sdk/search/azure-search-documents/cspell.json create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/OperationLocationPollingStrategy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/PollingUtils.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SyncOperationLocationPollingStrategy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GraphRequest.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphFieldMappings.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfile.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfileKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseMicrosoftRetriever1Model.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleModel.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseTool.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseToolKnowledgeSourceReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionError.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionOperation.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphExtractionParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGrounding.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingIndex.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingSourceKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntology.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntologySourceKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OneLakeSecuritySource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizerParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringFunction.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHint.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHintAutoConfiguration.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphHydrateDocumentsParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphProvenanceParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityArguments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityRecord.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceCache.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphProvenanceKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphStatistics.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceOpenAICompatibleVectorizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchDebugInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchSubQuery.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchTerminationReason.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchUsage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BalancedVectorQueryTopicGraph.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DebugInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DiverseVectorQueryTopicGraph.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphOptions.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnostic.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticPhase.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticSeverity.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidence.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceConfidence.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCount.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCountRelation.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExecutionMode.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplain.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplainStage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocument.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocuments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceHydrateDocumentsParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryResult.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRow.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRowProvenance.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryStatistics.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NoneVectorQueryTopicGraph.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OperationState.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQueryTopicGraph.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSearchTopicGraphKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageBinaryQuery.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageUrlQuery.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java create mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java create mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/implementation/SearchUtilsTests.java diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index d73d3ee92afa0..119229724b9bd 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,111 +1,25 @@ # Release History -## 12.3.0-beta.1 (Unreleased) +## 12.1.0-beta.3 (Unreleased) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 12.2.0 (2026-11-13) - -These release notes compare `12.2.0` with the previous GA release, `12.1.1`. Changes that apply only when upgrading -from a preview release are not included. - -### Features Added - -- Added support for the `2026-10-01` GA service version, which is now the default service version. -- Added `SearchOptions.moreLikeThis` to find documents similar to an existing document. -- Added `GetDocumentOptions` and three-argument `getDocumentWithResponse` overloads on `SearchClient` and - `SearchAsyncClient` to group document lookup authorization, elevated-read, and selected-field options while - preserving existing overloads, including `getDocument(key, null)`. -- Added query-source authorization and elevated-read controls to `SearchOptions` and document lookup overloads, and - query-source authorization overloads and a header-only `KnowledgeBaseRetrievalOptions.querySourceAuthorization` - option to knowledge base retrieval. Non-null explicit authorization arguments override the option; null falls - back to the option. -- Added document-level permission configuration through `SearchField.permissionFilter`, `organizationAccessExpiration`, - and `sharepointSiteUrl`, `SearchIndex.permissionFilterOption`, and `SharePointConnectorAppRegistration`. -- Added `SearchIndexerDataSourceConnection.indexerPermissionOptions`, - `IndexingParametersConfiguration.refreshAllAcls`, and - `SearchIndexerDataUserAssignedIdentity.federatedIdentityClientId` for permission ingestion and federated identity. -- Added `SearchIndexerClient.resync` and `SearchIndexerAsyncClient.resync` to resynchronize indexed permissions. -- Added `SearchIndexerStatus.runtime` and `SearchServiceStatistics.indexersRuntime`, including used and remaining - runtime and the reporting period. -- Added service-driven pagination and name-prefix filtering for resource listings, with `ListingSearchType` and - `search`, `searchType`, and `pageSize` query parameters. Added typed request-options overloads for synonym maps, - indexers, data sources, skillsets, and indexes with selected properties. -- Added pageable index statistics through `listIndexStatsSummary` and `IndexStatisticsSummary`. -- Added file knowledge sources and multipart file upload, update, listing, and deletion APIs on `SearchIndexClient` - and `SearchIndexAsyncClient`, with file metadata, directory-like prefixes, parsing and extraction modes, and - retrieval parameter, reference, and activity models. -- Added `KnowledgeSourceFileCapacity` and `KnowledgeSourceStatus.fileCapacity` for maximum file size, maximum file - count, and remaining file count. -- Added indexed SQL and indexed SharePoint knowledge sources, their retrieval parameter, reference, and activity - models, SQL content and embedding column mappings, and SharePoint container selection. -- Added knowledge source ingestion permission options and network access mode, and - `SearchIndexKnowledgeSourceParameters.baseFilter`. -- Added low and medium retrieval reasoning effort, answer-synthesis and extractive-data output modes, retrieval and - answer instructions, and CORS configuration on knowledge bases. -- Added model-based `createOrUpdateKnowledgeBase` and typed knowledge base/source update response overloads on - `SearchIndexAsyncClient`. -- Added conversation messages, reasoning effort, output mode, and maximum output document counts to knowledge - retrieval requests. Added constructors for message content and image URLs, and a writable message role. -- Added `alwaysQuerySource`, `failOnError`, and `maxOutputDocuments` to knowledge source retrieval parameters, and - `language`, `market`, `count`, and `freshness` to web knowledge source configuration. -- Added typed source, query-planning, and answer-synthesis activity records, activity timestamps and warnings, model - and deployment details, and citation URLs on search-index, Azure Blob, and indexed OneLake references. -- Added typed `retrieveStream` APIs returning `CloseableIterableStream` on the - synchronous retrieval client and `Flux` on the asynchronous client. Events - include retrieval start, activity start and completion, answers, references, errors, and response completion. - Response-completion events expose their numeric status code as `Integer`, including unknown status values. -- Added `modelName` and `modelDeployment` to `ContentUnderstandingSkill`, fixed-size and semantic chunking method - selection, and token-based chunking units. -- Added `GPT54`, `GPT55`, `GPT56SOL`, `GPT56TERRA`, and `GPT56LUNA` to `AzureOpenAIModelName`. +- Added support for `2026-11-01-preview`, now the default service version. Previously supported service versions remain available. +- Added synchronous and asynchronous graph queries, typed HTTP responses, query planning, diagnostics, statistics, and provenance models. +- Added graph extraction, enrichment cache, graph retrieval activities and references, and updated knowledge source and model options. +- Added `none`, `diverse`, and `balanced` vector topic graph retrieval, facet-backed filter hint auto-configuration, and random scoring. +- Restored preview search options, including more-like-this and agentic search, and exposed query diagnostics on paged responses. ### Breaking Changes -These removals correct preview-only APIs accidentally exposed by the GA specification. The corresponding features -were not supported by the previous GA service API. The specification correction was signed off as a bug fix in -[Azure/azure-rest-api-specs#47112](https://github.com/Azure/azure-rest-api-specs/pull/47112). -Removing these published Java APIs remains a source and binary compatibility break, despite the lack of supported -service behavior. - -The following APIs were public in GA `12.1.1` and have been removed in `12.2.0`: - -- Removed `AIFoundryModelCatalogName`, `AzureMachineLearningParameters`, and `AzureMachineLearningVectorizer`. -- Removed `VectorizableImageBinaryQuery` and `VectorizableImageUrlQuery`, along with `VectorQueryKind.IMAGE_BINARY` - and `VectorQueryKind.IMAGE_URL`. -- Removed `VectorFilterMode.STRICT_POST_FILTER`. -- Removed `KnowledgeBaseAgenticReasoningActivityRecord.getRetrievalReasoningEffort()`. For streaming retrieval, - the effective reasoning effort is available through - `KnowledgeBaseRetrievalStartedStreamEvent.getValue().getReasoningEffort()`. +- Removed preview query hints and query hint overrides from non-SearchIndex knowledge sources, and their query hint processing activity properties, to match the service contract. SearchIndex knowledge source hints remain supported. ### Bugs Fixed -- Fixed knowledge source status deserialization for compact synchronization intervals such as `1d`, while - preserving the existing Java `Duration` API. - -## 12.1.1 (2026-11-02) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.60.0` to version `1.61.0`. -- Upgraded `azure-core-http-netty` from `1.16.8` to version `1.17.0`. - -## 12.0.3 (2026-10-06) +- Fixed convenience search requests dropping preview query language, spelling, rewriting, hybrid, semantic field, and authorization options. ### Other Changes -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.16.6` to version `1.16.8`. -- Upgraded `azure-core` from `1.59.0` to version `1.60.0`. - ## 12.1.0-beta.2 (2026-08-28) ### Features Added @@ -148,6 +62,15 @@ The following APIs were public in GA `12.1.1` and have been removed in `12.2.0`: - Fixed knowledge source status deserialization for compact synchronization intervals such as `1d` while preserving the existing Java `Duration` API. +## 12.0.3 (2026-10-06) + +### Other Changes + +#### Dependency Updates + +- Upgraded `azure-core-http-netty` from `1.16.6` to version `1.16.8`. +- Upgraded `azure-core` from `1.59.0` to version `1.60.0`. + ## 12.0.2 (2026-08-18) ### Other Changes diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 23d68ece5eed9..53f1e264976c4 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -33,43 +33,6 @@ Use the Azure AI Search client library to: ## Getting started -### Service API version - -This development version targets the `2026-10-01` GA service API by default. -Use `SearchServiceVersion.V2026_10_01` to select this version explicitly on a client builder. -Preview-only APIs that are not included in this GA service version are not available in this development version. -Previously supported GA service versions remain selectable with `SearchServiceVersion`. - -This release also removes public Java APIs for preview-only features accidentally exposed by the previous GA -specification. The corresponding features were not supported by that GA service API, but removing the published Java -APIs is a source and binary compatibility break. Selecting an older service version does not restore removed Java -APIs. See the changelog's [Breaking Changes](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/CHANGELOG.md#breaking-changes) -section and the [specification correction](https://github.com/Azure/azure-rest-api-specs/pull/47112) for details. - -Knowledge bases, typed retrieval streaming, and file knowledge sources are included in this GA API. -See the [knowledge base configuration sample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseConfigurationExample.java), -[retrieval response sample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalResponseExample.java), -[retrieval streaming sample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java), and -[file knowledge source sample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFileExample.java). -See [the changelog](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/CHANGELOG.md) for additions, breaking changes, and fixes relative to the previous GA release, -`12.1.1`. The [sample feature-coverage table](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/README.md#new-ga-feature-coverage) maps the new capabilities -to runnable examples and configuration snippets, including document permissions, indexed SQL and SharePoint sources, -and content-understanding chunking. - -### Listing and pagination - -Listing operations use `list...` names and return typed `PagedIterable` results on synchronous clients and -`PagedFlux` results on asynchronous clients. Pages are fetched lazily, and service-provided continuation links -are followed automatically. Use `iterableByPage()` or `byPage()` to inspect pages, and pass a page's continuation -token to the corresponding overload to resume a listing. - -Request-options overloads accept service-supported listing filters such as `search`, `searchType`, `pageSize`, -and `$select` where applicable. A page size limits each service response, not the total number of returned items. -Set `pageSize` explicitly in the request options or the listing overload that accepts it; the current generated -listing APIs do not forward page-size hints from `iterableByPage(int)` or `byPage(int)` to the service. -Use a new `RequestOptions` instance for each independently configured listing. The `list...Names()` methods request -only resource names and retain pagination. - ### Include the package #### Include the BOM file @@ -112,7 +75,7 @@ add the direct dependency to your project as follows. com.azure azure-search-documents - 12.2.0 + 11.8.0 ``` [//]: # ({x-version-update-end}) @@ -301,6 +264,7 @@ tables.)_ The `azure-search-documents` client library exposes operations on thes * `SearchIndexClient` allows you to: * [Create, delete, update, or configure a search index](https://learn.microsoft.com/rest/api/searchservice/index-operations) * [Declare custom synonym maps to expand or rewrite queries](https://learn.microsoft.com/rest/api/searchservice/synonym-map-operations) + * `SearchIndexerClient` allows you to: * [Start indexers to automatically crawl data sources](https://learn.microsoft.com/rest/api/searchservice/indexer-operations) @@ -413,26 +377,6 @@ SearchPagedIterable searchResultsIterable = SEARCH_CLIENT.search(options); // ... ``` -To find documents similar to an existing document, supply its key with `setMoreLikeThis`. -Do not combine this option with search text. - -```java readme-sample-searchMoreLikeThis -SearchOptions options = new SearchOptions().setMoreLikeThis("hotel-1") - .setSearchFields("HotelName", "Description") - .setTop(5); -SEARCH_CLIENT.search(options).forEach(result -> System.out.println(result.getAdditionalProperties())); -``` - -For permission-filtered search, supply the user's query-source authorization token. These header options are preserved -on continuation pages. Elevated reads bypass document-level permission checks and are disabled in this example. - -```java readme-sample-searchWithDocumentPermissions -SearchOptions options = new SearchOptions().setSearchText("hotel") - .setQuerySourceAuthorization(querySourceToken) - .setEnableElevatedRead(false); -SEARCH_CLIENT.search(options).forEach(result -> System.out.println(result.getAdditionalProperties())); -``` - ### Creating an index You can use the [`SearchIndexClient`](#create-a-searchindexclient) to create a search index. Indexes can also define @@ -609,6 +553,18 @@ provides more information on configuring or changing the HTTP client. ## Next steps +### November 2026 preview + +The unreleased beta defaults to `SearchServiceVersion.V2026_11_01_PREVIEW`. +Set `serviceVersion` on a client builder to continue using a previously supported API version. +The preview includes graph querying and diagnostics, knowledge source graph extraction and enrichment caches, +vector topic graph retrieval, automatic facet-backed filter hints, and random scoring. + +Use `SearchClient.graph` or `SearchAsyncClient.graph` with `GraphOptions` to query an existing graph index. +For response headers and status, use `graphWithResponse`. A plan-only request must request at least one explain stage. +See the [preview samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java). +These APIs require a service that supports the preview; the samples do not provision resources. + * Samples are explained in detail [here][samples_readme]. * Read more about the [Azure AI Search service](https://learn.microsoft.com/azure/search/search-what-is-azure-search) @@ -649,3 +605,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [HttpResponseException]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/exception/HttpResponseException.java [status_codes]: https://learn.microsoft.com/rest/api/searchservice/http-status-codes [search-get-started-portal]: https://learn.microsoft.com/azure/search/search-get-started-portal + diff --git a/sdk/search/azure-search-documents/cspell.json b/sdk/search/azure-search-documents/cspell.json new file mode 100644 index 0000000000000..ba6f13bfb4c50 --- /dev/null +++ b/sdk/search/azure-search-documents/cspell.json @@ -0,0 +1,9 @@ +{ + "version": "0.2", + "import": [ + "../cspell.yml" + ], + "words": [ + "aicompatible" + ] +} diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index f8e6743cc9840..7e63195d00bbd 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -14,7 +14,6 @@ import com.github.javaparser.ast.body.VariableDeclarator; import com.github.javaparser.ast.expr.StringLiteralExpr; import com.github.javaparser.ast.stmt.BlockStmt; -import com.github.javaparser.ast.stmt.Statement; import com.github.javaparser.ast.type.Type; import org.slf4j.Logger; @@ -25,12 +24,6 @@ * Contains customizations for Azure AI Search code generation. */ public class SearchCustomizations extends Customization { - /** - * Creates the Azure AI Search code generation customizations. - */ - public SearchCustomizations() { - } - @Override public void customize(LibraryCustomization libraryCustomization, Logger logger) { PackageCustomization documents = libraryCustomization.getPackage("com.azure.search.documents"); @@ -46,7 +39,7 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) ClassCustomization serviceVersion = documents.getClass("SearchServiceVersion"); includeOldApiVersions(serviceVersion); - removePreviewApiVersions(serviceVersion); + removeOldPreviewApiVersions(serviceVersion); ClassCustomization searchClient = documents.getClass("SearchClient"); ClassCustomization searchAsyncClient = documents.getClass("SearchAsyncClient"); @@ -59,58 +52,234 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) hideWithResponseBinaryDataApis(searchClient); hideWithResponseBinaryDataApis(searchAsyncClient); - - addGetDocumentOptionsToImpl(libraryCustomization.getPackage("com.azure.search.documents.implementation") - .getClass("SearchClientImpl")); - addTypedGetDocumentWithOptions(searchClient); - addTypedGetDocumentWithOptions(searchAsyncClient); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexClient")); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexAsyncClient")); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexerClient")); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexerAsyncClient")); hideWithResponseBinaryDataApis(knowledge.getClass("KnowledgeBaseRetrievalClient")); hideWithResponseBinaryDataApis(knowledge.getClass("KnowledgeBaseRetrievalAsyncClient")); + preserveFileParameterOrder(indexes.getClass("SearchIndexClient")); + preserveFileParameterOrder(indexes.getClass("SearchIndexAsyncClient")); + for (boolean async : Arrays.asList(false, true)) { + String suffix = async ? "AsyncClient" : "Client"; + repairListingConvenience(indexes.getClass("SearchIndex" + suffix), "SynonymMaps", "SynonymMap", async); + repairListingConvenience(indexes.getClass("SearchIndexer" + suffix), "DataSourceConnections", + "SearchIndexerDataSourceConnection", async); + repairListingConvenience(indexes.getClass("SearchIndexer" + suffix), "Indexers", "SearchIndexer", async); + repairListingConvenience(indexes.getClass("SearchIndexer" + suffix), "Skillsets", "SearchIndexerSkillset", + async); + } - customizeKnowledgeBaseRetrievalStream(libraryCustomization, logger); - addQuerySourceAuthorizationOption( - libraryCustomization.getPackage("com.azure.search.documents.knowledgebases.models") - .getClass("KnowledgeBaseRetrievalOptions")); - forwardQuerySourceAuthorizationOption(knowledge.getClass("KnowledgeBaseRetrievalClient")); - forwardQuerySourceAuthorizationOption(knowledge.getClass("KnowledgeBaseRetrievalAsyncClient")); - addQuerySourceAuthorizationToRetrieveImpl( - libraryCustomization.getPackage("com.azure.search.documents.implementation") - .getClass("KnowledgeBaseRetrievalClientImpl")); + addGraphResponseMethods(searchClient, false); + addGraphResponseMethods(searchAsyncClient, true); + preservePagedSearchAuthorization(searchClient); + preservePagedSearchAuthorization(searchAsyncClient); + preserveScoringFunctionCompatibility( + libraryCustomization.getPackage("com.azure.search.documents.indexes.models").getClass("ScoringFunction")); + libraryCustomization.getPackage("com.azure.search.documents.indexes.models") + .getClass("KnowledgeSourceFileIngestionOperation") + .customizeAst(ast -> { + ast.getClassByName("KnowledgeSourceFileIngestionOperation").ifPresent(clazz -> clazz + .getFieldByName("kind").ifPresent(field -> { + field.setModifiers(Modifier.Keyword.PRIVATE, Modifier.Keyword.STATIC, Modifier.Keyword.FINAL); + field.getVariable(0).setName("KIND"); + })); + ast.findAll(com.github.javaparser.ast.expr.FieldAccessExpr.class).stream() + .filter(access -> access.getScope().isThisExpr() && access.getNameAsString().equals("kind")) + .forEach(access -> access + .setScope(StaticJavaParser.parseExpression("KnowledgeSourceFileIngestionOperation")) + .setName("KIND")); + }); + for (String kind : Arrays.asList("Distance", "Freshness", "Magnitude", "Tag")) { + preserveScoringConstructor( + libraryCustomization.getPackage("com.azure.search.documents.indexes.models") + .getClass(kind + "ScoringFunction"), kind); + } + libraryCustomization.getPackage("com.azure.search.documents.indexes.models") + .getClass("SearchIndexKnowledgeSourceFilterHint") + .customizeAst(ast -> ast.getClassByName("SearchIndexKnowledgeSourceFilterHint").ifPresent(clazz -> { + if (clazz.getConstructors().stream().noneMatch(constructor -> constructor.getParameters().size() == 2)) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration( + "public SearchIndexKnowledgeSourceFilterHint(String field, List fieldValues) {" + + "this(field); setFieldValues(fieldValues); }")); + clazz.getConstructors().stream().filter(constructor -> constructor.getParameters().size() == 2) + .forEach(constructor -> constructor.setJavadocComment("Creates a filter hint with explicit values.\n" + + "@param field the field to filter.\n@param fieldValues the allowed filter values.")); + } + })); - customizeResponseCompletedStatusCode(libraryCustomization); + customizeKnowledgeBaseRetrievalStream(libraryCustomization, logger); customizeKnowledgeSourceStatusDurationParsing( libraryCustomization.getPackage("com.azure.search.documents.knowledgebases.models") .getClass("KnowledgeSourceStatus")); - for (String className : Arrays.asList("SearchIndexClient", "SearchIndexAsyncClient")) { - ClassCustomization client = indexes.getClass(className); - addTypedListingMethod(client, "listIndexStatsSummary", "IndexStatisticsSummary", false); - addTypedListingMethod(client, "listKnowledgeSourceFiles", "KnowledgeSourceFile", true); - } + repairAsyncSynonymMapsConvenienceMethod(indexes.getClass("SearchIndexAsyncClient")); // After hiding BinaryData protocol methods, add typed public convenience wrappers on the async client // that mirror what the sync client already has as hand-written methods. addAsyncKnowledgeBaseConvenienceMethods(indexes.getClass("SearchIndexAsyncClient")); - // The JSON property remains docUrl; only the Java getter name changes. - libraryCustomization.getPackage("com.azure.search.documents.knowledgebases.models") - .getClass("KnowledgeBaseIndexedSqlReference") - .customizeAst(ast -> { - List getters = ast.getClassByName("KnowledgeBaseIndexedSqlReference") - .orElseThrow(() -> new IllegalStateException("Class KnowledgeBaseIndexedSqlReference not found.")) - .getMethodsByName("getDocUrl") - .stream() - .filter(method -> method.getParameters().isEmpty()) - .collect(java.util.stream.Collectors.toList()); - if (getters.size() != 1) { - throw new IllegalStateException("Expected exactly one zero-argument getDocUrl() method in " - + "KnowledgeBaseIndexedSqlReference but found " + getters.size() + "."); + // SearchResourceEncryptionKey workaround: the spec marks keyVaultUri and keyVaultKeyName as required, + // but they are not required when isServiceLevelKey is true. Add a no-arg constructor. + addNoArgConstructorToEncryptionKey(libraryCustomization.getPackage("com.azure.search.documents.indexes.models") + .getClass("SearchResourceEncryptionKey")); + } + + private static void preservePagedSearchAuthorization(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> clazz + .getMethodsByName("search").forEach(method -> method + .findAll(com.github.javaparser.ast.expr.MethodCallExpr.class) + .stream() + .filter(call -> call.getNameAsString().equals("searchWithResponse") + && call.getArguments().size() == 2 + && call.getArgument(1).toString().equals("requestOptions")) + .forEach(call -> call.setArgument(1, + StaticJavaParser.parseExpression("SearchUtils.addSearchHeaders(requestOptions, options)")))))); + } + + private static void repairListingConvenience(ClassCustomization customization, String operation, String model, + boolean async) { + customization.customizeAst(ast -> { + ast.addImport("com.azure.search.documents.indexes.models.ListingSearchType"); + ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + String methodName = "get" + operation; + String serviceMethod = "list" + operation + (async ? "Async" : ""); + String body = "{ RequestOptions requestOptions = new RequestOptions();" + + "if (select != null) { requestOptions.addQueryParam(\"$select\", String.join(\",\", select), false); }" + + "if (search != null) { requestOptions.addQueryParam(\"search\", search, false); }" + + "if (pageSize != null) { requestOptions.addQueryParam(\"pageSize\", pageSize.toString(), false); }" + + "if (searchType != null) { requestOptions.addQueryParam(\"searchType\", searchType.toString(), false); }" + + "return serviceClient." + serviceMethod + + "(requestOptions).mapPage(value -> value.toObject(" + model + ".class)); }"; + if (clazz.getMethodsByName(methodName).stream() + .noneMatch(method -> method.getParameters().size() == 4)) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration((async ? "PagedFlux<" : "PagedIterable<") + + model + "> " + methodName + + "(List select, String search, Integer pageSize, ListingSearchType searchType) " + body)); + } else { + clazz.getMethodsByName(methodName).stream() + .filter(method -> method.getParameters().size() == 4) + .forEach(method -> method.setBody(StaticJavaParser.parseBlock(body))); } - getters.get(0).setName("getDocumentUrl"); }); + }); + } + + private static void preserveFileParameterOrder(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + for (MethodDeclaration method : clazz.getMethods()) { + if (method.isPublic() && method.getParameters().size() >= 2 + && method.getParameter(0).getNameAsString().equals("name") + && (method.getNameAsString().equals("deleteKnowledgeSourceFile") + || method.getNameAsString().equals("deleteKnowledgeSourceFileWithResponse") + || method.getNameAsString().equals("updateKnowledgeSourceFile") + || method.getNameAsString().equals("uploadKnowledgeSourceFile"))) { + com.github.javaparser.ast.body.Parameter first = method.getParameter(0); + method.getParameters().set(0, method.getParameter(1)); + method.getParameters().set(1, first); + clazz.findAll(com.github.javaparser.ast.expr.MethodCallExpr.class).stream() + .filter(call -> call.getNameAsString().equals(method.getNameAsString()) + && call.getArguments().size() >= 2 + && (!call.getScope().isPresent() || call.getScope().get().isThisExpr())) + .forEach(call -> { + com.github.javaparser.ast.expr.Expression argument = call.getArgument(0); + call.getArguments().set(0, call.getArgument(1)); + call.getArguments().set(1, argument); + }); + } + } + })); + } + + private static void preserveScoringConstructor(ClassCustomization customization, String kind) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + if (clazz.getConstructors().stream().noneMatch(constructor -> constructor.getParameters().size() == 3 + && constructor.getParameter(0).getType().asString().equals("String"))) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration( + "public " + kind + "ScoringFunction(String fieldName, double boost, " + kind + + "ScoringParameters parameters) { this(boost, fieldName, parameters); }")); + clazz.getConstructors().stream().filter(constructor -> constructor.getParameters().size() == 3 + && constructor.getParameter(0).getType().asString().equals("String")) + .forEach(constructor -> constructor.setJavadocComment("Creates a field-based scoring function.\n" + + "@param fieldName the field used as input.\n@param boost the score multiplier.\n" + + "@param parameters the scoring parameters.")); + } + })); + } + + private static void addGraphResponseMethods(ClassCustomization customization, boolean async) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + String responseType = async ? "Mono>" : "Response"; + String converter = async ? "mapResponse" : "convertResponse"; + if (clazz.getMethodsByName("graphWithResponse").isEmpty()) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration( + "public " + responseType + + " graphWithResponse(GraphOptions options, RequestOptions requestOptions) {" + + "return SearchUtils." + converter + + "(hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options))," + + "SearchUtils.addGraphHeaders(requestOptions, options)), GraphQueryResult.class); }")); + } + clazz.getMethodsByName("graphWithResponse") + .forEach(method -> method.getAllContainedComments().forEach(com.github.javaparser.ast.comments.Comment::remove)); + clazz.getMethodsByName("graphWithResponse").forEach(method -> method.setJavadocComment( + "Executes a graph query and returns its HTTP response and diagnostics.\n" + + "@param options the graph query and diagnostic options.\n" + + "@param requestOptions the HTTP request options.\n" + + "@return the graph result together with the HTTP response.\n" + + "@throws NullPointerException if options is null.")); + })); + } + + private static void preserveScoringFunctionCompatibility(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + if (!clazz.getFieldByName("fieldName").isPresent()) { + clazz.addField(String.class, "fieldName", Modifier.Keyword.PRIVATE); + clazz.addField(double.class, "boost", Modifier.Keyword.PRIVATE); + } + if (clazz.getConstructors().stream().noneMatch(constructor -> constructor.getParameters().size() == 2)) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration( + "public ScoringFunction(String fieldName, double boost) {" + + "this.fieldName = fieldName; this.boost = boost; }")); + } + if (clazz.getMethodsByName("getFieldName").isEmpty()) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration( + "public String getFieldName() { return this.fieldName; }")); + } + if (clazz.getMethodsByName("getBoost").isEmpty()) { + clazz.addMember(StaticJavaParser.parseBodyDeclaration( + "public double getBoost() { return this.boost; }")); + } + clazz.getConstructors().stream().filter(constructor -> constructor.getParameters().size() == 2) + .forEach(constructor -> constructor.getAllContainedComments() + .forEach(com.github.javaparser.ast.comments.Comment::remove)); + for (String getter : Arrays.asList("getFieldName", "getBoost")) { + clazz.getMethodsByName(getter).forEach(method -> method.getAllContainedComments() + .forEach(com.github.javaparser.ast.comments.Comment::remove)); + } + clazz.getConstructors().stream().filter(constructor -> constructor.getParameters().size() == 2) + .forEach(constructor -> constructor.setJavadocComment("Creates a field-based scoring function.\n" + + "@param fieldName the field used as input.\n@param boost the score multiplier.")); + clazz.getMethodsByName("getFieldName").forEach(method -> method.setJavadocComment( + "Gets the field used as input.\n@return the field name.")); + clazz.getMethodsByName("getBoost").forEach(method -> method.setJavadocComment( + "Gets the score multiplier.\n@return the boost.")); + clazz.getMethodsByName("toJson").stream() + .filter(method -> !method.getBody().get().toString().contains("this.fieldName")) + .forEach(method -> method.setBody(StaticJavaParser.parseBlock( + method.getBody().get().toString().replace("jsonWriter.writeStartObject();", + "jsonWriter.writeStartObject(); if (this.fieldName != null) {" + + "jsonWriter.writeStringField(\"fieldName\", this.fieldName);" + + "jsonWriter.writeDoubleField(\"boost\", this.boost); }")))); + clazz.getMethodsByName("fromJsonKnownDiscriminator") + .stream() + .filter(method -> !method.getBody().get().toString().contains("deserializedScoringFunction.fieldName")) + .forEach(method -> method.setBody(StaticJavaParser.parseBlock( + method.getBody().get().toString().replace("if (\"type\".equals(fieldName)) {", + "if (\"fieldName\".equals(fieldName)) {" + + "deserializedScoringFunction.fieldName = reader.getString();" + + "} else if (\"boost\".equals(fieldName)) {" + + "deserializedScoringFunction.boost = reader.getDouble();" + + "} else if (\"type\".equals(fieldName)) {")))); + })); } // Weird quirk in the Java generator where SearchOptions is inferred from the parameters of searchPost in TypeSpec, @@ -137,7 +306,7 @@ private static void hideGeneratedSearchApis(PackageCustomization documents) { } } - // The TypeSpec Java emitter compiles and loads only this configured customization class. Keep the + // The TypeSpec Java emitter compiles and loads only this configured customization class. Keep the premature // retrieval stream API customizations isolated so they can be removed when native support is available. private static final String MODELS_PATH = "src/main/java/com/azure/search/documents/knowledgebases/models/"; @@ -153,40 +322,73 @@ private static void customizeKnowledgeBaseRetrievalStream(LibraryCustomization l } private static void addStreamModels(LibraryCustomization customization) { + customization.getRawEditor().addFile(MODELS_PATH + "KnowledgeBaseRetrievalStreamEvent.java", baseEventSource()); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseRetrievalStreamEvent.java", baseEventSource()); + .addFile(MODELS_PATH + "UnknownKnowledgeBaseRetrievalStreamEvent.java", unknownEventSource()); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseRetrievalStartedStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseRetrievalStartedStreamEvent.java", wrapperSource("KnowledgeBaseRetrievalStartedStreamEvent", "KnowledgeBaseRetrievalStartedEvent", "retrieval.started", false, false)); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseActivityStartedStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseActivityStartedStreamEvent.java", wrapperSource("KnowledgeBaseActivityStartedStreamEvent", "KnowledgeBaseActivityStartedEvent", "activity.started", false, false)); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseActivityCompletedStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseActivityCompletedStreamEvent.java", wrapperSource("KnowledgeBaseActivityCompletedStreamEvent", "KnowledgeBaseActivityRecord", "activity.completed", false, false)); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseAnswerCompletedStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseAnswerCompletedStreamEvent.java", wrapperSource("KnowledgeBaseAnswerCompletedStreamEvent", "KnowledgeBaseAnswerCompletedEvent", "answer.completed", false, false)); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseReferencesCompletedStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseReferencesCompletedStreamEvent.java", wrapperSource("KnowledgeBaseReferencesCompletedStreamEvent", "KnowledgeBaseReference", "references.completed", false, true)); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseErrorStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseErrorStreamEvent.java", wrapperSource("KnowledgeBaseErrorStreamEvent", "KnowledgeBaseStreamErrorEvent", "error", true, false)); customization.getRawEditor() - .replaceFile(MODELS_PATH + "KnowledgeBaseResponseCompletedStreamEvent.java", + .addFile(MODELS_PATH + "KnowledgeBaseResponseCompletedStreamEvent.java", wrapperSource("KnowledgeBaseResponseCompletedStreamEvent", "KnowledgeBaseResponseCompletedEvent", "response.completed", true, false)); + replaceStreamModel(customization, "KnowledgeBaseRetrievalStreamEvent", baseEventSource()); + replaceStreamModel(customization, "KnowledgeBaseRetrievalStartedStreamEvent", + wrapperSource("KnowledgeBaseRetrievalStartedStreamEvent", "KnowledgeBaseRetrievalStartedEvent", + "retrieval.started", false, false)); + replaceStreamModel(customization, "KnowledgeBaseActivityStartedStreamEvent", + wrapperSource("KnowledgeBaseActivityStartedStreamEvent", "KnowledgeBaseActivityStartedEvent", + "activity.started", false, false)); + replaceStreamModel(customization, "KnowledgeBaseActivityCompletedStreamEvent", + wrapperSource("KnowledgeBaseActivityCompletedStreamEvent", "KnowledgeBaseActivityRecord", + "activity.completed", false, false)); + replaceStreamModel(customization, "KnowledgeBaseAnswerCompletedStreamEvent", + wrapperSource("KnowledgeBaseAnswerCompletedStreamEvent", "KnowledgeBaseAnswerCompletedEvent", + "answer.completed", false, false)); + replaceStreamModel(customization, "KnowledgeBaseReferencesCompletedStreamEvent", + wrapperSource("KnowledgeBaseReferencesCompletedStreamEvent", "KnowledgeBaseReference", + "references.completed", false, true)); + replaceStreamModel(customization, "KnowledgeBaseErrorStreamEvent", + wrapperSource("KnowledgeBaseErrorStreamEvent", "KnowledgeBaseStreamErrorEvent", "error", true, false)); + replaceStreamModel(customization, "KnowledgeBaseResponseCompletedStreamEvent", + wrapperSource("KnowledgeBaseResponseCompletedStreamEvent", "KnowledgeBaseResponseCompletedEvent", + "response.completed", true, false)); + } + + private static void replaceStreamModel(LibraryCustomization customization, String className, String source) { + customization.getPackage("com.azure.search.documents.knowledgebases.models") + .getClass(className) + .customizeAst(ast -> { + com.github.javaparser.ast.CompilationUnit replacement = StaticJavaParser.parse(source); + ast.setImports(replacement.getImports()); + ast.setTypes(replacement.getTypes()); + }); } private static void customizeKnowledgeSourceStatusDurationParsing(ClassCustomization customization) { customization.customizeAst(ast -> ast - .addImport("com.azure.search.documents.knowledgebases.implementation.KnowledgeSourceDurationParser") + .addImport( + "com.azure.search.documents.knowledgebases.implementation.KnowledgeSourceDurationParser") .getClassByName(customization.getClassName()) .ifPresent(clazz -> clazz.getMethodsByName("fromJson").forEach(method -> { BlockStmt body = method.getBody() @@ -204,6 +406,7 @@ private static void customizeKnowledgeSourceStatusDurationParsing(ClassCustomiza private static void addAsyncRetrieveStream(ClassCustomization customization) { customization.customizeAst(ast -> ast.addImport("com.azure.core.http.HttpHeaderName") + .addImport("com.azure.search.documents.models.ServerSentEvent") .addImport("com.azure.search.documents.models.implementation.sse.ServerSentEventStreams") .addImport( "com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter") @@ -212,20 +415,22 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { .getClassByName(customization.getClassName()) .ifPresent(clazz -> { clazz.getMethodsByName("retrieveStream").forEach(MethodDeclaration::remove); - MethodDeclaration method = StaticJavaParser - .parseBodyDeclaration( - "@Generated\n" + "public Flux retrieveStream(" - + "KnowledgeBaseRetrievalOptions retrievalRequest) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " return hiddenGeneratedRetrieveStreamWithResponse(" - + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" - + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " KnowledgeBaseRetrievalStreamEvent::isTerminal));\n" + "}\n") - .asMethodDeclaration(); + MethodDeclaration method + = StaticJavaParser + .parseBodyDeclaration("@Generated\n" + + "public Flux> retrieveStream(" + + "KnowledgeBaseRetrievalOptions retrievalRequest) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " return hiddenGeneratedRetrieveStreamWithResponse(" + + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" + + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " event -> event.getData().isTerminal()));\n" + + "}\n") + .asMethodDeclaration(); method.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" + streamEventDocumentation() + + "events.\n\n" + "If received, the terminal {@code error} or {@code response.completed} event is emitted " + "before the stream completes. End-of-stream without a terminal event completes normally. " + "Transport and decoding failures are propagated through the reactive error path. The client " @@ -234,23 +439,32 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { + "@return A stream of typed knowledge base retrieval events."); clazz.addMember(method); - MethodDeclaration methodWithAuthorizationHeaders = StaticJavaParser - .parseBodyDeclaration( - "@Generated\n" + "public Flux retrieveStream(" - + "KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " if (querySourceAuthorization != null) {\n" + " requestOptions.setHeader(\n" - + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" - + " querySourceAuthorization);\n" + " }\n" - + " return hiddenGeneratedRetrieveStreamWithResponse(" - + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" - + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " KnowledgeBaseRetrievalStreamEvent::isTerminal));\n" + "}\n") - .asMethodDeclaration(); + MethodDeclaration methodWithAuthorizationHeaders + = StaticJavaParser + .parseBodyDeclaration("@Generated\n" + + "public Flux> retrieveStream(" + + "KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization,\n" + + " String queryWorkIQSourceAuthorization) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " if (querySourceAuthorization != null) {\n" + + " requestOptions.setHeader(\n" + + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" + + " querySourceAuthorization);\n" + + " }\n" + + " if (queryWorkIQSourceAuthorization != null) {\n" + + " requestOptions.setHeader(\n" + + " HttpHeaderName.fromString(\"x-ms-query-work-iq-source-authorization\"),\n" + + " queryWorkIQSourceAuthorization);\n" + + " }\n" + + " return hiddenGeneratedRetrieveStreamWithResponse(" + + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" + + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " event -> event.getData().isTerminal()));\n" + "}\n") + .asMethodDeclaration(); methodWithAuthorizationHeaders.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" + streamEventDocumentation() + + "events.\n\n" + "If received, the terminal {@code error} or {@code response.completed} event is emitted " + "before the stream completes. End-of-stream without a terminal event completes normally. " + "Transport and decoding failures are propagated through the reactive error path. The client " @@ -258,6 +472,9 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { + "@param retrievalRequest The retrieval request to process.\n" + "@param querySourceAuthorization Token identifying the user for which the query is being " + "executed. This token is used to enforce security restrictions on documents.\n" + + "@param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app " + + "registration configured on a Work IQ knowledge source. Used for on-behalf-of " + + "authentication to the Work IQ API.\n" + "@return A stream of typed knowledge base retrieval events."); clazz.addMember(methodWithAuthorizationHeaders); })); @@ -265,7 +482,7 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { private static void addSyncRetrieveStream(ClassCustomization customization) { customization.customizeAst(ast -> ast.addImport("com.azure.core.http.HttpHeaderName") - .addImport("com.azure.core.util.CloseableIterableStream") + .addImport("com.azure.search.documents.models.ServerSentEventListener") .addImport("com.azure.search.documents.models.implementation.sse.ServerSentEventStreams") .addImport( "com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter") @@ -273,390 +490,120 @@ private static void addSyncRetrieveStream(ClassCustomization customization) { .getClassByName(customization.getClassName()) .ifPresent(clazz -> { clazz.getMethodsByName("retrieveStream").forEach(MethodDeclaration::remove); - MethodDeclaration method = StaticJavaParser.parseBodyDeclaration("@Generated\n" - + "public CloseableIterableStream retrieveStream(" - + "KnowledgeBaseRetrievalOptions retrievalRequest) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " return ServerSentEventStreams.toIterableStream(hiddenGeneratedRetrieveStreamWithResponse(\n" - + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " KnowledgeBaseRetrievalStreamEvent::isTerminal);\n" + "}\n").asMethodDeclaration(); + MethodDeclaration method + = StaticJavaParser + .parseBodyDeclaration("@Generated\n" + + "public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest,\n" + + " ServerSentEventListener listener) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " ServerSentEventStreams.listen(hiddenGeneratedRetrieveStreamWithResponse(\n" + + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " event -> event.getData().isTerminal(), listener);\n" + + "}\n") + .asMethodDeclaration(); method.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" + streamEventDocumentation() - + "Events are decoded lazily by a single iterator. Use try-with-resources to close the " - + "stream when iteration ends early. The response is also closed on end-of-stream, a " - + "terminal event, or an iteration failure. Closing the stream is idempotent and may throw " - + "{@link java.io.IOException}.\n\n" - + "If received, the terminal {@code error} or {@code response.completed} event is emitted " - + "before iteration ends. A failure while closing after a terminal event is reported by the " - + "next iterator access or explicit close, after the terminal event is delivered. " - + "End-of-stream without a terminal event completes normally. " - + "Transport and decoding failures are thrown during iteration. The client does not " - + "reconnect automatically.\n\n" + "@param retrievalRequest The retrieval request to process.\n" - + "@return A closeable stream of typed knowledge base retrieval events."); + + "events.\n\n" + + "If received, the terminal {@code error} or {@code response.completed} event is delivered " + + "before {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a " + + "terminal event closes normally. Transport and decoding failures are reported through " + + "{@link ServerSentEventListener#onError(Throwable)}. The client does not reconnect " + + "automatically.\n\n" + + "@param retrievalRequest The retrieval request to process.\n" + + "@param listener The listener that receives events and lifecycle notifications."); clazz.addMember(method); - MethodDeclaration methodWithAuthorizationHeaders = StaticJavaParser.parseBodyDeclaration("@Generated\n" - + "public CloseableIterableStream retrieveStream(" - + "KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " if (querySourceAuthorization != null) {\n" + " requestOptions.setHeader(\n" - + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" - + " querySourceAuthorization);\n" + " }\n" - + " return ServerSentEventStreams.toIterableStream(hiddenGeneratedRetrieveStreamWithResponse(\n" - + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " KnowledgeBaseRetrievalStreamEvent::isTerminal);\n" + "}\n").asMethodDeclaration(); + MethodDeclaration methodWithAuthorizationHeaders + = StaticJavaParser + .parseBodyDeclaration("@Generated\n" + + "public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest,\n" + + " String querySourceAuthorization, String queryWorkIQSourceAuthorization,\n" + + " ServerSentEventListener listener) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " if (querySourceAuthorization != null) {\n" + + " requestOptions.setHeader(\n" + + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" + + " querySourceAuthorization);\n" + + " }\n" + + " if (queryWorkIQSourceAuthorization != null) {\n" + + " requestOptions.setHeader(\n" + + " HttpHeaderName.fromString(\"x-ms-query-work-iq-source-authorization\"),\n" + + " queryWorkIQSourceAuthorization);\n" + + " }\n" + + " ServerSentEventStreams.listen(hiddenGeneratedRetrieveStreamWithResponse(\n" + + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " event -> event.getData().isTerminal(), listener);\n" + "}\n") + .asMethodDeclaration(); methodWithAuthorizationHeaders.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" + streamEventDocumentation() - + "Events are decoded lazily by a single iterator. Use try-with-resources to close the " - + "stream when iteration ends early. The response is also closed on end-of-stream, a " - + "terminal event, or an iteration failure. Closing the stream is idempotent and may throw " - + "{@link java.io.IOException}.\n\n" - + "If received, the terminal {@code error} or {@code response.completed} event is emitted " - + "before iteration ends. A failure while closing after a terminal event is reported by the " - + "next iterator access or explicit close, after the terminal event is delivered. " - + "End-of-stream without a terminal event completes normally. " - + "Transport and decoding failures are thrown during iteration. The client does not " - + "reconnect automatically.\n\n" + "@param retrievalRequest The retrieval request to process.\n" + + "events.\n\n" + + "If received, the terminal {@code error} or {@code response.completed} event is delivered " + + "before {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a " + + "terminal event closes normally. Transport and decoding failures are reported through " + + "{@link ServerSentEventListener#onError(Throwable)}. The client does not reconnect " + + "automatically.\n\n" + + "@param retrievalRequest The retrieval request to process.\n" + "@param querySourceAuthorization Token identifying the user for which the query is being " + "executed. This token is used to enforce security restrictions on documents.\n" - + "@return A closeable stream of typed knowledge base retrieval events."); + + "@param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app " + + "registration configured on a Work IQ knowledge source. Used for on-behalf-of " + + "authentication to the Work IQ API.\n" + + "@param listener The listener that receives events and lifecycle notifications."); clazz.addMember(methodWithAuthorizationHeaders); })); } - private static final String KNOWLEDGE_MODELS_PACKAGE = "com.azure.search.documents.knowledgebases.models"; - - // The status code is exposed as a nullable Integer so unknown values round trip without a public wrapper type. - private static void customizeResponseCompletedStatusCode(LibraryCustomization libraryCustomization) { - String className = "KnowledgeBaseResponseCompletedEvent"; - libraryCustomization.getPackage(KNOWLEDGE_MODELS_PACKAGE) - .getClass(className) - .customizeAst(ast -> ast.getClassByName(className).ifPresent(clazz -> { - clazz.getFieldByName("statusCode") - .orElseThrow(() -> new IllegalStateException("statusCode field not found.")) - .getVariable(0) - .setType("Integer"); - clazz.getConstructors().get(0).getParameter(0).setType("Integer"); - clazz.getMethodsByName("getStatusCode").get(0).setType("Integer"); - - MethodDeclaration toJson = clazz.getMethodsByName("toJson").get(0); - String toJsonBody = toJson.getBody().orElseThrow(() -> new IllegalStateException("No body.")).toString(); - String generatedWrite = "this.statusCode == null ? null : this.statusCode.getValue()"; - if (!toJsonBody.contains(generatedWrite)) { - throw new IllegalStateException("toJson no longer uses the expected generated statusCode write."); - } - toJson.setBody(StaticJavaParser.parseBlock(toJsonBody.replace(generatedWrite, "this.statusCode"))); - - MethodDeclaration fromJson = clazz.getMethodsByName("fromJson").get(0); - String fromJsonBody - = fromJson.getBody().orElseThrow(() -> new IllegalStateException("No body.")).toString(); - String generatedDeclaration = "KnowledgeBaseRetrievalStatusCode statusCode = null;"; - String generatedRead = "statusCode = KnowledgeBaseRetrievalStatusCode.fromValue(reader.getInt());"; - if (!fromJsonBody.contains(generatedDeclaration) || !fromJsonBody.contains(generatedRead)) { - throw new IllegalStateException("fromJson no longer uses the expected generated statusCode read."); - } - fromJson.setBody(StaticJavaParser.parseBlock( - fromJsonBody.replace(generatedDeclaration, "Integer statusCode = null;") - .replace(generatedRead, "statusCode = reader.getNullable(JsonReader::getInt);"))); - - MethodDeclaration getStatusCode = clazz.getMethodsByName("getStatusCode").get(0); - getStatusCode.setJavadocComment("Get the statusCode property: The semantic HTTP status of the completed " - + "retrieval, not the actual HTTP transport response status. The service wire schema requires " - + "this value, but the SDK treats it as nullable: it returns null when the status code is missing " - + "or JSON null, and unknown values round trip as plain integers.\n\n" - + "@return the statusCode value, or null if it was not provided."); - })); - - libraryCustomization.getRawEditor().removeFile(MODELS_PATH + "KnowledgeBaseRetrievalStatusCode.java"); - } - - // Client-only transport metadata: stored on the options but never serialized to or read from JSON. - private static void addQuerySourceAuthorizationOption(ClassCustomization customization) { - customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { - clazz.getFieldByName("querySourceAuthorization").ifPresent(FieldDeclaration::remove); - clazz.getMethodsByName("getQuerySourceAuthorization").forEach(MethodDeclaration::remove); - clazz.getMethodsByName("setQuerySourceAuthorization").forEach(MethodDeclaration::remove); - - FieldDeclaration field = clazz.addField("String", "querySourceAuthorization", Modifier.Keyword.PRIVATE); - field.addMarkerAnnotation("Generated"); - field.setJavadocComment("Token identifying the user for which the query is being executed. Client-only " - + "value that is sent as the x-ms-query-source-authorization header and is never serialized " - + "into the request body."); - - MethodDeclaration getter = StaticJavaParser - .parseBodyDeclaration("@Generated\n" - + "public String getQuerySourceAuthorization() {\n return this.querySourceAuthorization;\n}\n") - .asMethodDeclaration(); - getter.setJavadocComment("Get the querySourceAuthorization property: Token identifying the user for which " - + "the query is being executed. This token is used to enforce security restrictions on documents. " - + "It is only sent as the x-ms-query-source-authorization request header and is never part of the " - + "request body. A non-null authorization passed explicitly to a retrieve method overrides this " - + "value; a null explicit authorization falls back to it.\n\n" - + "@return the querySourceAuthorization value."); - clazz.addMember(getter); - - MethodDeclaration setter = StaticJavaParser.parseBodyDeclaration("@Generated\n" - + "public KnowledgeBaseRetrievalOptions setQuerySourceAuthorization(String querySourceAuthorization) {\n" - + " this.querySourceAuthorization = querySourceAuthorization;\n return this;\n}\n") - .asMethodDeclaration(); - setter.setJavadocComment("Set the querySourceAuthorization property: Token identifying the user for which " - + "the query is being executed. This token is used to enforce security restrictions on documents. " - + "It is only sent as the x-ms-query-source-authorization request header and is never part of the " - + "request body. A non-null authorization passed explicitly to a retrieve method overrides this " - + "value; a null explicit authorization falls back to it. An empty string is treated as a value.\n\n" - + "@param querySourceAuthorization the querySourceAuthorization value to set.\n" - + "@return the KnowledgeBaseRetrievalOptions object itself."); - clazz.addMember(setter); - })); - } - - // Must run after the stream methods are assembled. A non-null explicit parameter overrides the option, and a null - // explicit parameter falls back to KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization(). - private static void forwardQuerySourceAuthorizationOption(ClassCustomization customization) { - customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { - clazz.getMethodsByName("createRetrieveRequestOptions").forEach(MethodDeclaration::remove); - clazz.addMember(StaticJavaParser.parseBodyDeclaration("@Generated\n" - + "private static RequestOptions createRetrieveRequestOptions(" - + "KnowledgeBaseRetrievalOptions retrievalRequest,\n" + " String querySourceAuthorization) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " String authorization = querySourceAuthorization != null\n" - + " ? querySourceAuthorization\n" - + " : (retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization());\n" - + " if (authorization != null) {\n" - + " requestOptions.setHeader(HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" - + " authorization);\n" + " }\n" + " return requestOptions;\n" + "}\n")); - - int updated = 0; - for (MethodDeclaration method : clazz.getMethods()) { - String name = method.getNameAsString(); - if (!method.isPublic() || !("retrieve".equals(name) || "retrieveStream".equals(name))) { - continue; - } - boolean hasExplicit = method.getParameters().size() == 2; - BlockStmt body = method.getBody() - .orElseThrow(() -> new IllegalStateException("Retrieve method has no body.")); - body.getStatements().removeIf(SearchCustomizations::isQuerySourceAuthorizationHeaderBlock); - boolean replaced = false; - for (int i = 0; i < body.getStatements().size(); i++) { - if (body.getStatements().get(i).toString().contains("new RequestOptions()")) { - body.getStatements() - .set(i, StaticJavaParser.parseStatement("RequestOptions requestOptions = " - + "createRetrieveRequestOptions(retrievalRequest, " - + (hasExplicit ? "querySourceAuthorization" : "null") + ");")); - replaced = true; - break; - } - } - if (!replaced) { - throw new IllegalStateException("Could not find the request options in " + name + "."); - } - - method.getJavadocComment().ifPresent(javadoc -> { - String content = javadoc.getContent() - .replaceFirst("@param retrievalRequest The retrieval request to process\\.", - "@param retrievalRequest The retrieval request to process. If its " - + "{@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is " - + "sent only as the x-ms-query-source-authorization header and is never serialized " - + "into the request body."); - if (hasExplicit) { - content = content.replaceFirst("security[\\s*]+restrictions[\\s*]+on[\\s*]+documents\\.", - "security restrictions on documents. A non-null value overrides " - + "{@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls " - + "back to it, and an empty string is treated as an explicit value."); - } - javadoc.setContent(content); - }); - updated++; - } - if (updated != 4) { - throw new IllegalStateException("Expected to update 4 retrieve methods in " - + customization.getClassName() + " but updated " + updated + "."); - } - })); - } - - // Adds a querySourceAuthorization header parameter to the internal retrieve REST methods so typed callers can - // supply the header without mutating or copying the caller's RequestOptions. RestProxy applies the header before - // RequestOptions callbacks, so a header explicitly set on RequestOptions still takes precedence. - private static void addQuerySourceAuthorizationToRetrieveImpl(ClassCustomization customization) { - customization.customizeAst(ast -> { - ast.addImport("com.azure.core.annotation.Generated"); - com.github.javaparser.ast.body.ClassOrInterfaceDeclaration clazz - = ast.getClassByName(customization.getClassName()) - .orElseThrow(() -> new IllegalStateException("Class not found.")); - - com.github.javaparser.ast.body.ClassOrInterfaceDeclaration service = clazz.getMembers() - .stream() - .filter(member -> member.isClassOrInterfaceDeclaration()) - .map(member -> member.asClassOrInterfaceDeclaration()) - .filter(type -> "KnowledgeBaseRetrievalClientService".equals(type.getNameAsString())) - .findFirst() - .orElseThrow(() -> new IllegalStateException("KnowledgeBaseRetrievalClientService not found.")); - int serviceUpdated = 0; - for (String name : Arrays.asList("retrieve", "retrieveSync")) { - for (MethodDeclaration method : service.getMethodsByName(name)) { - method.getParameters().removeIf(p -> "querySourceAuthorization".equals(p.getNameAsString())); - int index = -1; - for (int i = 0; i < method.getParameters().size(); i++) { - if ("requestOptions".equals(method.getParameter(i).getNameAsString())) { - index = i; - } - } - if (index < 0) { - throw new IllegalStateException("requestOptions parameter not found in " + name + "."); - } - method.getParameters() - .add(index, StaticJavaParser.parseParameter( - "@HeaderParam(\"x-ms-query-source-authorization\") String querySourceAuthorization")); - serviceUpdated++; - } - } - if (serviceUpdated != 2) { - throw new IllegalStateException( - "Expected to update 2 service retrieve methods but updated " + serviceUpdated + "."); - } - - for (boolean async : new boolean[] { true, false }) { - String name = async ? "retrieveWithResponseAsync" : "retrieveWithResponse"; - clazz.getMethodsByName(name) - .stream() - .filter(method -> method.getParameters().size() == 3) - .collect(java.util.stream.Collectors.toList()) - .forEach(MethodDeclaration::remove); - MethodDeclaration original = clazz.getMethodsByName(name) - .stream() - .filter(method -> method.getParameters().size() == 2 - && "BinaryData".equals(method.getParameter(0).getTypeAsString())) - .findFirst() - .orElseThrow(() -> new IllegalStateException(name + " not found.")); - - String returnType = original.getTypeAsString(); - String signature = "@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public " + returnType - + " " + name + "(BinaryData retrievalRequest, String querySourceAuthorization,\n" - + " RequestOptions requestOptions) {\n" - + " final String accept = \"application/json;odata.metadata=minimal\";\n" - + " final String contentType = \"application/json\";\n"; - String overloadSource; - String delegate; - if (async) { - overloadSource = signature - + " return FluxUtil.withContext(context -> service.retrieve(this.getEndpoint(),\n" - + " this.getServiceVersion().getVersion(), accept, this.getKnowledgeBaseName(), " - + "contentType,\n" - + " retrievalRequest, querySourceAuthorization, requestOptions, context));\n" + "}\n"; - delegate = "{\n return retrieveWithResponseAsync(retrievalRequest, null, requestOptions);\n}"; - } else { - overloadSource = signature - + " return service.retrieveSync(this.getEndpoint(), this.getServiceVersion().getVersion(),\n" - + " accept, this.getKnowledgeBaseName(), contentType, retrievalRequest,\n" - + " querySourceAuthorization, requestOptions, Context.NONE);\n" + "}\n"; - delegate = "{\n return retrieveWithResponse(retrievalRequest, null, requestOptions);\n}"; - } - MethodDeclaration overload - = StaticJavaParser.parseBodyDeclaration(overloadSource).asMethodDeclaration(); - original.getJavadocComment().ifPresent(javadoc -> { - String content = javadoc.getContent(); - String updated = content.replaceFirst("(\\* @param retrievalRequest [^\\n]*\\n)", - "$1 * @param querySourceAuthorization Token identifying the user for which the query is " - + "being executed. This token is used to enforce security restrictions on documents. A " - + "header set explicitly on requestOptions takes precedence.\n"); - if (updated.equals(content)) { - throw new IllegalStateException("Could not locate retrievalRequest javadoc for " + name + "."); - } - overload.setJavadocComment(updated); - }); - original.setBody(StaticJavaParser.parseBlock(delegate)); - clazz.addMember(overload); - } - }); - } - - - - // Matches only the generated `if (querySourceAuthorization != null) { requestOptions.setHeader(...); }` block. - private static boolean isQuerySourceAuthorizationHeaderBlock(Statement statement) { - return statement.isIfStmt() - && "querySourceAuthorization != null".equals(statement.asIfStmt().getCondition().toString()) - && statement.toString().contains("x-ms-query-source-authorization"); - } - - private static String streamEventDocumentation() { - return "Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. " - + "Use a known subtype's {@code getValue()} to access its typed payload, for example " - + "{@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent" - + "#getValue()}. " + "Unrecognized events expose only their names through " - + "{@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; their payloads are not available.\n\n"; - } - private static String baseEventSource() { return header("com.azure.search.documents.knowledgebases.models") - + "import com.azure.core.annotation.Generated;\n" - + "import com.azure.search.documents.knowledgebases.implementation." - + "KnowledgeBaseRetrievalStreamEventConverter;\n" + "import java.util.List;\n\n" + "/**\n" - + " * Base for polymorphic events emitted by a streaming knowledge base retrieval.\n" - + " * Known events expose typed payloads through their subtype's {@code getValue()} method.\n" - + " * Unrecognized events expose only their names through\n" - + " * {@link #getEventName()}; their payloads are not available and they are not terminal.\n" - + " * Stream events are envelopes, not JSON payload models; serialize the typed payload instead.\n" + " *\n" - + " * @see KnowledgeBaseRetrievalStartedStreamEvent\n" + " * @see KnowledgeBaseActivityStartedStreamEvent\n" - + " * @see KnowledgeBaseActivityCompletedStreamEvent\n" - + " * @see KnowledgeBaseAnswerCompletedStreamEvent\n" - + " * @see KnowledgeBaseReferencesCompletedStreamEvent\n" + " * @see KnowledgeBaseErrorStreamEvent\n" - + " * @see KnowledgeBaseResponseCompletedStreamEvent\n" + " */\n" - + "public abstract class KnowledgeBaseRetrievalStreamEvent {\n" + " static {\n" - + " KnowledgeBaseRetrievalStreamEventConverter.setConstructorAccessor(\n" - + " new KnowledgeBaseRetrievalStreamEventConverter.ConstructorAccessor() {\n" - + " @Override\n" - + " public KnowledgeBaseRetrievalStreamEvent createEvent(String eventName) {\n" - + " return new KnowledgeBaseRetrievalStreamEvent(eventName) { };\n" - + " }\n\n" + " @Override\n" - + " public KnowledgeBaseRetrievalStartedStreamEvent createRetrievalStarted(\n" - + " KnowledgeBaseRetrievalStartedEvent value) {\n" - + " return new KnowledgeBaseRetrievalStartedStreamEvent(value);\n" - + " }\n\n" + " @Override\n" - + " public KnowledgeBaseActivityStartedStreamEvent createActivityStarted(\n" - + " KnowledgeBaseActivityStartedEvent value) {\n" - + " return new KnowledgeBaseActivityStartedStreamEvent(value);\n" - + " }\n\n" + " @Override\n" - + " public KnowledgeBaseActivityCompletedStreamEvent createActivityCompleted(\n" - + " KnowledgeBaseActivityRecord value) {\n" - + " return new KnowledgeBaseActivityCompletedStreamEvent(value);\n" - + " }\n\n" + " @Override\n" - + " public KnowledgeBaseAnswerCompletedStreamEvent createAnswerCompleted(\n" - + " KnowledgeBaseAnswerCompletedEvent value) {\n" - + " return new KnowledgeBaseAnswerCompletedStreamEvent(value);\n" - + " }\n\n" + " @Override\n" - + " public KnowledgeBaseReferencesCompletedStreamEvent createReferencesCompleted(\n" - + " List value) {\n" - + " return new KnowledgeBaseReferencesCompletedStreamEvent(value);\n" - + " }\n\n" + " @Override\n" - + " public KnowledgeBaseErrorStreamEvent createError(KnowledgeBaseStreamErrorEvent value) {\n" - + " return new KnowledgeBaseErrorStreamEvent(value);\n" + " }\n\n" - + " @Override\n" - + " public KnowledgeBaseResponseCompletedStreamEvent createResponseCompleted(\n" - + " KnowledgeBaseResponseCompletedEvent value) {\n" - + " return new KnowledgeBaseResponseCompletedStreamEvent(value);\n" - + " }\n" + " });\n" + " }\n\n" + " @Generated\n" + + "import com.azure.core.annotation.Generated;\n\n" + "/**\n" + + " * Base type for events emitted by a streaming knowledge base retrieval.\n" + " */\n" + + "public abstract class KnowledgeBaseRetrievalStreamEvent {\n" + " @Generated\n" + " private final String eventName;\n\n" + " /**\n" + " * Creates a stream event.\n" + " *\n" - + " * @param eventName The server-sent event name.\n" + " */\n" + " @Generated\n" - + " KnowledgeBaseRetrievalStreamEvent(String eventName) {\n" + " this.eventName = eventName;\n" - + " }\n\n" + " /**\n" + " * Gets the server-sent event name.\n" + " *\n" - + " * @return The event name.\n" + " */\n" + " @Generated\n" - + " public final String getEventName() {\n" + " return eventName;\n" + " }\n\n" + " /**\n" - + " * Gets whether this event terminates the retrieval stream.\n" + " *\n" + + " * @param eventName The server-sent event name.\n" + " */\n" + + " @Generated\n" + " protected KnowledgeBaseRetrievalStreamEvent(String eventName) {\n" + + " this.eventName = eventName;\n" + " }\n\n" + " /**\n" + + " * Gets the server-sent event name.\n" + " *\n" + " * @return The event name.\n" + + " */\n" + " @Generated\n" + " public final String getEventName() {\n" + + " return eventName;\n" + " }\n\n" + + " /**\n" + " * Gets whether this event terminates the retrieval stream.\n" + " *\n" + " * @return {@code true} if this is a terminal event; otherwise {@code false}.\n" + " */\n" + " @Generated\n" + " public boolean isTerminal() {\n" + " return false;\n" + " }\n" + "}\n"; } + + private static String unknownEventSource() { + return header("com.azure.search.documents.knowledgebases.models") + + "import com.azure.core.annotation.Generated;\n" + "import com.azure.core.annotation.Immutable;\n\n" + + "/**\n" + + " * Represents a knowledge base retrieval stream event that is not recognized by this SDK version.\n" + + " */\n" + "@Immutable\n" + "public final class UnknownKnowledgeBaseRetrievalStreamEvent\n" + + " extends KnowledgeBaseRetrievalStreamEvent {\n" + " @Generated\n" + + " private final String data;\n\n" + " /**\n" + + " * Creates an unknown stream event.\n" + " *\n" + + " * @param eventName The server-sent event name.\n" + + " * @param data The raw server-sent event data.\n" + " */\n" + + " @Generated\n" + " public UnknownKnowledgeBaseRetrievalStreamEvent(String eventName, String data) {\n" + + " super(eventName);\n" + " this.data = data;\n" + " }\n\n" + " /**\n" + + " * Gets the raw server-sent event data.\n" + " *\n" + " * @return The raw event data.\n" + + " */\n" + " @Generated\n" + " public String getData() {\n" + " return data;\n" + + " }\n" + "}\n"; + } + + private static String wrapperSource(String className, String payloadType, String eventName, boolean terminal, boolean listPayload) { String valueType = listPayload ? "List<" + payloadType + ">" : payloadType; - String listImports = listPayload ? "import java.util.List;\n" : ""; + String listImport = listPayload ? "import java.util.List;\n" : ""; + String toJson = listPayload + ? " return jsonWriter.writeArray(value, (writer, item) -> item.toJson(writer));\n" + : " return value.toJson(jsonWriter);\n"; + String fromJson = listPayload + ? " return new " + className + "(jsonReader.readArray(reader -> " + payloadType + + ".fromJson(reader)));\n" + : " return new " + className + "(" + payloadType + ".fromJson(jsonReader));\n"; String terminalOverride = terminal ? "\n @Generated\n" + " @Override\n" + " public boolean isTerminal() {\n" + " return true;\n" + " }\n" @@ -664,23 +611,34 @@ private static String wrapperSource(String className, String payloadType, String return header("com.azure.search.documents.knowledgebases.models") + "import com.azure.core.annotation.Generated;\n" + "import com.azure.core.annotation.Immutable;\n" - + listImports + "\n" + "/**\n" + " * Represents the {@code " + eventName - + "} knowledge base retrieval stream event.\n" + " * Access the typed payload with {@link #getValue()}.\n" - + " *\n" + " * @see KnowledgeBaseRetrievalStreamEvent\n" + " */\n" + "@Immutable\n" + "public final class " - + className + " extends KnowledgeBaseRetrievalStreamEvent {\n" + " @Generated\n" + " private final " - + valueType + " value;\n\n" + " /**\n" + " * Creates an event wrapper.\n" + " *\n" - + " * @param value The event payload.\n" + " */\n" + " @Generated\n" + " " + className + "(" + + "import com.azure.json.JsonReader;\n" + + "import com.azure.json.JsonSerializable;\n" + "import com.azure.json.JsonWriter;\n\n" + + "import java.io.IOException;\n" + listImport + "\n" + "/**\n" + " * Represents the {@code " + eventName + + "} knowledge base retrieval stream event.\n" + " */\n" + "@Immutable\n" + "public final class " + className + + " extends KnowledgeBaseRetrievalStreamEvent\n" + " implements JsonSerializable<" + className + "> {\n" + + " @Generated\n" + " private final " + valueType + " value;\n\n" + " /**\n" + + " * Creates an event wrapper.\n" + " *\n" + " * @param value The event payload.\n" + + " */\n" + " @Generated\n" + " public " + className + "(" + valueType + " value) {\n" + " super(\"" + eventName + "\");\n" + " this.value = value;\n" - + " }\n\n" + " /**\n" + " * Gets the event payload.\n" + " *\n" - + " * @return The event payload.\n" + " */\n" + " @Generated\n" + " public " + valueType - + " getValue() {\n" + " return value;\n" + " }\n" + terminalOverride + "}\n"; + + " }\n\n" + " /**\n" + + " * Gets the event payload.\n" + " *\n" + " * @return The event payload.\n" + " */\n" + + " @Generated\n" + " public " + valueType + " getValue() {\n" + " return value;\n" + + " }\n\n" + terminalOverride + "\n" + " @Generated\n" + " @Override\n" + + " public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {\n" + toJson + " }\n\n" + + " /**\n" + " * Reads an event wrapper from JSON.\n" + " *\n" + + " * @param jsonReader The reader to read from.\n" + " * @return The parsed event wrapper.\n" + + " * @throws IOException If the event payload cannot be read.\n" + " */\n" + " @Generated\n" + + " public static " + className + " fromJson(JsonReader jsonReader) throws IOException {\n" + fromJson + + " }\n" + "}\n"; } + private static String header(String packageName) { return "// Copyright (c) Microsoft Corporation. All rights reserved.\n" + "// Licensed under the MIT License.\n\n" + "package " + packageName + ";\n\n"; } + // Adds SearchAudience handling to generated builders. This is a temporary fix until // https://github.com/microsoft/typespec/issues/9458 is addressed. private static void addSearchAudienceScopeHandling(ClassCustomization customization, Logger logger) { @@ -717,9 +675,12 @@ private static void addSearchAudienceScopeHandling(ClassCustomization customizat private static void includeOldApiVersions(ClassCustomization customization) { customization.customizeAst(ast -> ast.getEnumByName(customization.getClassName()).ifPresent(enumDeclaration -> { NodeList entries = enumDeclaration.getEntries(); - for (String version : Arrays.asList("2025-09-01", "2024-07-01", "2023-11-01", "2020-06-30")) { + for (String version : Arrays.asList("2026-08-01-preview", "2026-04-01", "2025-09-01", + "2024-07-01", "2023-11-01", "2020-06-30")) { String enumName = ("V" + version.replace("-", "_")); - if (entries.stream().noneMatch(entry -> enumName.equals(entry.getNameAsString()))) { + enumName = enumName.toUpperCase(java.util.Locale.ROOT); + final String name = enumName; + if (entries.stream().noneMatch(entry -> entry.getNameAsString().equals(name))) { entries.add(0, new EnumConstantDeclaration(enumName).addArgument(new StringLiteralExpr(version)) .setJavadocComment("Enum value " + version + ".")); } @@ -729,10 +690,11 @@ private static void includeOldApiVersions(ClassCustomization customization) { })); } - private static void removePreviewApiVersions(ClassCustomization customization) { + private static void removeOldPreviewApiVersions(ClassCustomization customization) { customization.customizeAst(ast -> ast.getEnumByName(customization.getClassName()) .ifPresent(enumDeclaration -> enumDeclaration.getEntries() - .removeIf(entry -> entry.getNameAsString().endsWith("_PREVIEW")))); + .removeIf(entry -> Arrays.asList("V2025_11_01_PREVIEW", "V2026_05_01_PREVIEW") + .contains(entry.getNameAsString())))); } // At the time this was added, Java TypeSpec for Azure-type generation doesn't use 'T' in WithResponse APIs, which @@ -777,208 +739,14 @@ private static boolean hasBinaryDataInType(Type type) { return type.toString().contains("BinaryData"); } - private static void addTypedListingMethod(ClassCustomization customization, String methodName, String itemType, - boolean hasKnowledgeSourceName) { - boolean async = customization.getClassName().endsWith("AsyncClient"); - String pagedType = async ? "PagedFlux" : "PagedIterable"; - String parameters - = hasKnowledgeSourceName ? "String name, RequestOptions requestOptions" : "RequestOptions requestOptions"; - String arguments = hasKnowledgeSourceName ? "name, requestOptions" : "requestOptions"; - customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { - String[] parameterTypes = hasKnowledgeSourceName - ? new String[] { "String", "RequestOptions" } - : new String[] { "RequestOptions" }; - clazz.getMethodsBySignature(methodName, parameterTypes).forEach(MethodDeclaration::remove); - MethodDeclaration method = StaticJavaParser - .parseMethodDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.COLLECTION)\npublic " - + pagedType + "<" + itemType + "> " + methodName + "(" + parameters + ") {\n" - + " return this.serviceClient." + methodName + (async ? "Async" : "") + "(" + arguments + ")\n" - + " .mapPage(binaryData -> binaryData.toObject(" + itemType + ".class));\n}"); - method.setJavadocComment("Lists matching resources as typed, lazily retrieved pages.\n\n" - + (hasKnowledgeSourceName ? "@param name The name of the knowledge source.\n" : "") - + "@param requestOptions The options to configure the HTTP request, including listing filters.\n" - + "@throws HttpResponseException if the service rejects the request.\n" - + "@return The matching resources as a paginated response with {@link " + pagedType + "}."); - clazz.addMember(method); - })); - } - - // Adds query source authorization, elevated read and $select parameters to the internal getDocument REST methods - // so typed callers don't need to mutate or copy the caller's RequestOptions. RestProxy applies these before the - // RequestOptions callbacks, so headers set explicitly on RequestOptions override them while query parameters - // added through RequestOptions are appended. Existing internal - // signatures are preserved and forward null for the new parameters. - private static void addGetDocumentOptionsToImpl(ClassCustomization customization) { - customization.customizeAst(ast -> { - ast.addImport("com.azure.core.annotation.Generated"); - ast.addImport("com.azure.search.documents.models.GetDocumentOptions"); - ast.addImport("java.util.Objects"); - ast.addImport("java.util.stream.Collectors"); - com.github.javaparser.ast.body.ClassOrInterfaceDeclaration clazz - = ast.getClassByName(customization.getClassName()) - .orElseThrow(() -> new IllegalStateException("Class not found.")); - - com.github.javaparser.ast.body.ClassOrInterfaceDeclaration service = clazz.getMembers() - .stream() - .filter(member -> member.isClassOrInterfaceDeclaration()) - .map(member -> member.asClassOrInterfaceDeclaration()) - .filter(type -> "SearchClientService".equals(type.getNameAsString())) - .findFirst() - .orElseThrow(() -> new IllegalStateException("SearchClientService not found.")); - int serviceUpdated = 0; - for (String name : Arrays.asList("getDocument", "getDocumentSync")) { - for (MethodDeclaration method : service.getMethodsByName(name)) { - method.getParameters() - .removeIf(p -> "querySourceAuthorization".equals(p.getNameAsString()) - || "enableElevatedRead".equals(p.getNameAsString()) - || "selectedFields".equals(p.getNameAsString())); - int index = -1; - for (int i = 0; i < method.getParameters().size(); i++) { - if ("requestOptions".equals(method.getParameter(i).getNameAsString())) { - index = i; - } - } - if (index < 0) { - throw new IllegalStateException("requestOptions parameter not found in " + name + "."); - } - method.getParameters() - .add(index, StaticJavaParser.parseParameter("@QueryParam(\"$select\") String selectedFields")); - method.getParameters() - .add(index, StaticJavaParser - .parseParameter("@HeaderParam(\"x-ms-enable-elevated-read\") Boolean enableElevatedRead")); - method.getParameters() - .add(index, StaticJavaParser.parseParameter( - "@HeaderParam(\"x-ms-query-source-authorization\") String querySourceAuthorization")); - serviceUpdated++; - } - } - if (serviceUpdated != 2) { - throw new IllegalStateException( - "Expected to update 2 service getDocument methods but updated " + serviceUpdated + "."); - } - - for (boolean async : new boolean[] { true, false }) { - String name = async ? "getDocumentWithResponseAsync" : "getDocumentWithResponse"; - clazz.getMethodsByName(name) - .stream() - .filter(method -> method.getParameters().size() == 3) - .collect(java.util.stream.Collectors.toList()) - .forEach(MethodDeclaration::remove); - MethodDeclaration original = clazz.getMethodsByName(name) - .stream() - .filter(method -> method.getParameters().size() == 2 - && "String".equals(method.getParameter(0).getTypeAsString())) - .findFirst() - .orElseThrow(() -> new IllegalStateException(name + " not found.")); - - String returnType = original.getTypeAsString(); - String signature = "@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public " + returnType - + " " + name + "(String key, GetDocumentOptions options, RequestOptions requestOptions) {\n" - + " final String accept = \"application/json;odata.metadata=none\";\n" - + " final String querySourceAuthorization = options == null ? null\n" - + " : options.getQuerySourceAuthorization();\n" - + " final Boolean enableElevatedRead = options == null ? null : options.isEnableElevatedRead();\n" - + " final String selectedFields = options == null || options.getSelectedFields() == null ? null\n" - + " : options.getSelectedFields()\n" - + " .stream()\n" - + " .map(paramItemValue -> Objects.toString(paramItemValue, \"\"))\n" - + " .collect(Collectors.joining(\",\"));\n" - + " final RequestOptions effectiveOptions = requestOptions == null ? new RequestOptions() : requestOptions;\n"; - String overloadSource; - String delegate; - if (async) { - overloadSource = signature - + " return FluxUtil.withContext(context -> service.getDocument(this.getEndpoint(),\n" - + " this.getServiceVersion().getVersion(), this.getIndexName(), accept, key,\n" - + " querySourceAuthorization, enableElevatedRead, selectedFields, effectiveOptions, context));\n" - + "}\n"; - delegate = "{\n return getDocumentWithResponseAsync(key, null, requestOptions);\n}"; - } else { - overloadSource = signature - + " return service.getDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(),\n" - + " this.getIndexName(), accept, key, querySourceAuthorization, enableElevatedRead,\n" - + " selectedFields, effectiveOptions, Context.NONE);\n" + "}\n"; - delegate = "{\n return getDocumentWithResponse(key, null, requestOptions);\n}"; - } - MethodDeclaration overload - = StaticJavaParser.parseBodyDeclaration(overloadSource).asMethodDeclaration(); - original.getJavadocComment().ifPresent(javadoc -> { - String content = removeLookupResponseBodySchema(javadoc.getContent()); - String updated = content.replaceFirst("(\\* @param key [^\\n]*\\n)", - "$1 * @param options The options for the lookup: query source authorization, elevated read " - + "and selected fields. May be null.\n"); - if (updated.equals(content)) { - throw new IllegalStateException("Could not locate key javadoc for " + name + "."); - } - overload.setJavadocComment(updated); - }); - original.setBody(StaticJavaParser.parseBlock(delegate)); - if (!original.getAnnotationByName("Generated").isPresent()) { - original.addMarkerAnnotation("Generated"); - } - clazz.addMember(overload); - } - }); - } - - // Both typed response signatures are generator-owned so a preserved wrapper cannot suppress the new overload. - // No getDocument(String, GetDocumentOptions) is added so getDocument(key, null) stays source compatible. - private static void addTypedGetDocumentWithOptions(ClassCustomization customization) { - boolean async = customization.getClassName().endsWith("AsyncClient"); - customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { - ast.addImport("com.azure.search.documents.models.GetDocumentOptions"); - clazz.getMethodsBySignature("getDocumentWithResponse", "String", "RequestOptions") - .forEach(MethodDeclaration::remove); - clazz.getMethodsBySignature("getDocumentWithResponse", "String", "GetDocumentOptions", "RequestOptions") - .forEach(MethodDeclaration::remove); - String returnType = async ? "Mono>" : "Response"; - MethodDeclaration legacy = clazz - .getMethodsBySignature("hiddenGeneratedGetDocumentWithResponse", "String", "RequestOptions") - .stream() - .findFirst() - .orElseThrow(() -> new IllegalStateException("Generated lookup response method not found.")) - .clone(); - legacy.setName("getDocumentWithResponse"); - legacy.setModifiers(Modifier.Keyword.PUBLIC); - legacy.setType(returnType); - legacy.setBody(StaticJavaParser.parseBlock(async - ? "{ return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, requestOptions), " - + "LookupDocument.class); }" - : "{ return convertResponse(this.serviceClient.getDocumentWithResponse(key, requestOptions), " - + "LookupDocument.class); }")); - legacy.getJavadocComment() - .ifPresent(javadoc -> legacy.setJavadocComment(removeLookupResponseBodySchema(javadoc.getContent()))); - clazz.addMember(legacy); - String body = async - ? " return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, options, requestOptions),\n" - + " LookupDocument.class);\n" - : " return convertResponse(this.serviceClient.getDocumentWithResponse(key, options, requestOptions),\n" - + " LookupDocument.class);\n"; - MethodDeclaration method = StaticJavaParser - .parseMethodDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\npublic " + returnType - + " getDocumentWithResponse(String key, GetDocumentOptions options,\n" - + " RequestOptions requestOptions) {\n" + body + "}"); - method.setJavadocComment("Retrieves a document from the index.\n\n" - + "@param key The key of the document to retrieve.\n" - + "@param options The options for the lookup: query source authorization, elevated read and selected " - + "fields. May be null.\n" - + "@param requestOptions The options to configure the HTTP request before HTTP client sends it. May be " - + "null. Its callbacks run after the operation options are applied, so a header set explicitly " - + "with setHeader overrides the corresponding header from {@code options}. Query parameters added " - + "through RequestOptions are appended to the request, not substituted.\n" - + "@throws HttpResponseException thrown if the request is rejected by server.\n" - + "@throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.\n" - + "@throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.\n" - + "@throws ResourceModifiedException thrown if the request is rejected by server on status code 409.\n" - + "@return a document retrieved via a document lookup operation along with {@link Response}" - + (async ? " on successful completion of {@link Mono}." : ".")); - clazz.addMember(method); - })); - } - - private static String removeLookupResponseBodySchema(String javadoc) { - return javadoc.replaceAll( - "(?s)\\n\\s*\\*

Response Body Schema

.*?(?=\\n\\s*\\* @param key)", "\n *"); + private static void repairAsyncSynonymMapsConvenienceMethod(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> clazz + .getMethodsByName("getSynonymMaps") + .stream() + .filter(method -> method.getParameters().isEmpty() && method.isAnnotationPresent("Generated")) + .findFirst() + .ifPresent(method -> method.setBody( + StaticJavaParser.parseBlock("{ return getSynonymMaps(null, null, null, null); }"))))); } // Removes GET equivalents of POST APIs in SearchClient and SearchAsyncClient as we never plan to expose those. @@ -1004,34 +772,31 @@ private static void hideSearchDocumentsResultInternalProperties(ClassCustomizati })); } - + // SearchResourceEncryptionKey has keyName and vaultUrl as required (final) fields, but when + // isServiceLevelKey is true, they are not needed. This adds a no-arg constructor and makes those fields non-final. + private static void addNoArgConstructorToEncryptionKey(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + // Make keyName and vaultUrl non-final + clazz.getFieldByName("keyName").ifPresent(field -> field.setModifiers(Modifier.Keyword.PRIVATE)); + clazz.getFieldByName("vaultUrl").ifPresent(field -> field.setModifiers(Modifier.Keyword.PRIVATE)); + + // Add no-arg constructor + clazz.addMember(StaticJavaParser.parseBodyDeclaration("/**\n" + + " * Creates an instance of SearchResourceEncryptionKey class. Used when isServiceLevelKey is\n" + + " * set to true, in which case keyName and vaultUrl are not required.\n" + " */\n" + + "public SearchResourceEncryptionKey() {\n" + " this.keyName = null;\n" + + " this.vaultUrl = null;\n" + "}\n")); + })); + } // Adds public convenience methods to SearchIndexAsyncClient for knowledge base and knowledge source // createOrUpdate operations. The sync client has equivalent hand-written wrappers, but the async client // only has package-private generated convenience methods after hideWithResponseBinaryDataApis runs. private static void addAsyncKnowledgeBaseConvenienceMethods(ClassCustomization customization) { customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { - clazz.getMethodsByName("createOrUpdateKnowledgeBase") - .stream() - .filter(method -> method.getParameters().size() == 1 - && "KnowledgeBase".equals(method.getParameter(0).getTypeAsString())) - .forEach(MethodDeclaration::remove); - clazz.getMethodsByName("createOrUpdateKnowledgeBaseWithResponse") - .stream() - .filter(method -> method.getParameters().size() == 2 - && "KnowledgeBase".equals(method.getParameter(0).getTypeAsString()) - && "RequestOptions".equals(method.getParameter(1).getTypeAsString())) - .forEach(MethodDeclaration::remove); - clazz.getMethodsByName("createOrUpdateKnowledgeSourceWithResponse") - .stream() - .filter(method -> method.getParameters().size() == 2 - && "KnowledgeSource".equals(method.getParameter(0).getTypeAsString()) - && "RequestOptions".equals(method.getParameter(1).getTypeAsString())) - .forEach(MethodDeclaration::remove); - // Add: public Mono createOrUpdateKnowledgeBase(KnowledgeBase knowledgeBase) MethodDeclaration createOrUpdateKB = StaticJavaParser - .parseBodyDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + .parseBodyDeclaration("@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public Mono createOrUpdateKnowledgeBase(KnowledgeBase knowledgeBase) {\n" + " return createOrUpdateKnowledgeBase(knowledgeBase.getName(), knowledgeBase);\n" + "}\n") .asMethodDeclaration(); @@ -1044,7 +809,7 @@ private static void addAsyncKnowledgeBaseConvenienceMethods(ClassCustomization c // Add: public Mono> createOrUpdateKnowledgeBaseWithResponse( // KnowledgeBase knowledgeBase, RequestOptions requestOptions) MethodDeclaration createOrUpdateKBWithResponse - = StaticJavaParser.parseBodyDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + = StaticJavaParser.parseBodyDeclaration("@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public Mono> createOrUpdateKnowledgeBaseWithResponse(" + "KnowledgeBase knowledgeBase, RequestOptions requestOptions) {\n" + " return mapResponse(this.serviceClient.createOrUpdateKnowledgeBaseWithResponseAsync(" @@ -1060,7 +825,7 @@ private static void addAsyncKnowledgeBaseConvenienceMethods(ClassCustomization c // Add: public Mono> createOrUpdateKnowledgeSourceWithResponse( // KnowledgeSource knowledgeSource, RequestOptions requestOptions) MethodDeclaration createOrUpdateKSWithResponse - = StaticJavaParser.parseBodyDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + = StaticJavaParser.parseBodyDeclaration("@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public Mono> createOrUpdateKnowledgeSourceWithResponse(" + "KnowledgeSource knowledgeSource, RequestOptions requestOptions) {\n" + " return mapResponse(this.serviceClient.createOrUpdateKnowledgeSourceWithResponseAsync(" diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java index bacba66b225a4..61764b818f4ac 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java @@ -23,10 +23,12 @@ import com.azure.search.documents.implementation.SearchClientImpl; import com.azure.search.documents.implementation.SearchUtils; import com.azure.search.documents.implementation.models.AutocompletePostRequest; +import com.azure.search.documents.implementation.models.GraphRequest; import com.azure.search.documents.implementation.models.SuggestPostRequest; import com.azure.search.documents.models.AutocompleteOptions; import com.azure.search.documents.models.AutocompleteResult; -import com.azure.search.documents.models.GetDocumentOptions; +import com.azure.search.documents.models.GraphOptions; +import com.azure.search.documents.models.GraphQueryResult; import com.azure.search.documents.models.IndexBatchException; import com.azure.search.documents.models.IndexDocumentsBatch; import com.azure.search.documents.models.IndexDocumentsOptions; @@ -389,19 +391,24 @@ public Mono> indexDocumentsWithResponse(IndexDocu * orderby (Optional): [ * String (Optional) * ] - * queryType: String(simple/full/semantic) (Optional) + * queryType: String(simple/full/semantic/agentic) (Optional) + * agenticOptions (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * } * scoringStatistics: String(local/global) (Optional) * sessionId: String (Optional) * scoringParameters (Optional): [ * String (Optional) * ] * scoringProfile: String (Optional) - * debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional) + * debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional) * search: String (Optional) * searchFields (Optional): [ * String (Optional) * ] * searchMode: String(any/all) (Optional) + * queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional) + * speller: String(none/lexicon) (Optional) * select (Optional): [ * String (Optional) * ] @@ -413,17 +420,33 @@ public Mono> indexDocumentsWithResponse(IndexDocu * semanticQuery: String (Optional) * answers: String(none/extractive) (Optional) * captions: String(none/extractive) (Optional) + * queryRewrites: String(none/generative) (Optional) + * semanticFields (Optional): [ + * String (Optional) + * ] * vectorQueries (Optional): [ * (Optional){ - * kind: String(vector/text) (Required) + * kind: String(vector/text/imageUrl/imageBinary) (Required) * k: Integer (Optional) * fields: String (Optional) * exhaustive: Boolean (Optional) * oversampling: Double (Optional) * weight: Float (Optional) + * threshold (Optional): { + * kind: String(vectorSimilarity/searchScore) (Required) + * } + * filterOverride: String (Optional) + * perDocumentVectorLimit: Integer (Optional) + * topicGraph (Optional): { + * kind: String(none/diverse/balanced) (Required) + * } * } * ] - * vectorFilterMode: String(postFilter/preFilter) (Optional) + * vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional) + * hybridSearch (Optional): { + * maxTextRecallSize: Integer (Optional) + * countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional) + * } * } * } * @@ -439,6 +462,16 @@ public Mono> indexDocumentsWithResponse(IndexDocu * String (Required): [ * (Required){ * count: Long (Optional) + * avg: Double (Optional) + * min: Double (Optional) + * max: Double (Optional) + * sum: Double (Optional) + * cardinality: Long (Optional) + * @search.facets (Optional): { + * String (Required): [ + * (recursive schema, see above) + * ] + * } * (Optional): { * String: Object (Required) * } @@ -456,6 +489,32 @@ public Mono> indexDocumentsWithResponse(IndexDocu * } * } * ] + * @search.debug (Optional): { + * queryRewrites (Optional): { + * text (Optional): { + * inputQuery: String (Optional) + * rewrites (Optional): [ + * String (Optional) + * ] + * } + * vectors (Optional): [ + * (recursive schema, see above) + * ] + * } + * agentic (Optional): { + * terminationReason: String(modelStopped/maxRuntimeExceeded/modelFailed) (Optional) + * subQueries (Optional): [ + * (Optional){ + * search: String (Required) + * iteration: int (Required) + * } + * ] + * usage (Optional): { + * agenticPlanningTokens: long (Required) + * reasoningTokens: long (Required) + * } + * } + * } * @search.nextPageParameters (Optional): { * count: Boolean (Optional) * facets (Optional): [ @@ -472,19 +531,24 @@ public Mono> indexDocumentsWithResponse(IndexDocu * orderby (Optional): [ * String (Optional) * ] - * queryType: String(simple/full/semantic) (Optional) + * queryType: String(simple/full/semantic/agentic) (Optional) + * agenticOptions (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * } * scoringStatistics: String(local/global) (Optional) * sessionId: String (Optional) * scoringParameters (Optional): [ * String (Optional) * ] * scoringProfile: String (Optional) - * debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional) + * debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional) * search: String (Optional) * searchFields (Optional): [ * String (Optional) * ] * searchMode: String(any/all) (Optional) + * queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional) + * speller: String(none/lexicon) (Optional) * select (Optional): [ * String (Optional) * ] @@ -496,17 +560,33 @@ public Mono> indexDocumentsWithResponse(IndexDocu * semanticQuery: String (Optional) * answers: String(none/extractive) (Optional) * captions: String(none/extractive) (Optional) + * queryRewrites: String(none/generative) (Optional) + * semanticFields (Optional): [ + * String (Optional) + * ] * vectorQueries (Optional): [ * (Optional){ - * kind: String(vector/text) (Required) + * kind: String(vector/text/imageUrl/imageBinary) (Required) * k: Integer (Optional) * fields: String (Optional) * exhaustive: Boolean (Optional) * oversampling: Double (Optional) * weight: Float (Optional) + * threshold (Optional): { + * kind: String(vectorSimilarity/searchScore) (Required) + * } + * filterOverride: String (Optional) + * perDocumentVectorLimit: Integer (Optional) + * topicGraph (Optional): { + * kind: String(none/diverse/balanced) (Required) + * } * } * ] - * vectorFilterMode: String(postFilter/preFilter) (Optional) + * vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional) + * hybridSearch (Optional): { + * maxTextRecallSize: Integer (Optional) + * countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional) + * } * } * value (Required): [ * (Required){ @@ -528,6 +608,23 @@ public Mono> indexDocumentsWithResponse(IndexDocu * } * ] * @search.documentDebugInfo (Optional): { + * semantic (Optional): { + * titleField (Optional): { + * name: String (Optional) + * state: String(used/unused/partial) (Optional) + * } + * contentFields (Optional): [ + * (recursive schema, see above) + * ] + * keywordFields (Optional): [ + * (recursive schema, see above) + * ] + * rerankerInput (Optional): { + * title: String (Optional) + * content: String (Optional) + * keywords: String (Optional) + * } + * } * vectors (Optional): { * subscores (Optional): { * text (Optional): { @@ -544,6 +641,18 @@ public Mono> indexDocumentsWithResponse(IndexDocu * documentBoost: Double (Optional) * } * } + * innerHits (Optional): { + * String (Required): [ + * (Required){ + * ordinal: Long (Optional) + * vectors (Optional): [ + * (Optional){ + * String (Required): (recursive schema, see String above) + * } + * ] + * } + * ] + * } * } * (Optional): { * String: Object (Required) @@ -553,6 +662,7 @@ public Mono> indexDocumentsWithResponse(IndexDocu * @odata.nextLink: String (Optional) * @search.semanticPartialResponseReason: String(maxWaitExceeded/capacityOverloaded/transient) (Optional) * @search.semanticPartialResponseType: String(baseResults/rerankedResults) (Optional) + * @search.semanticQueryRewritesResultType: String(originalQueryOnly) (Optional) * } * } * @@ -859,7 +969,6 @@ public Mono> getDocumentCountWithResponse(RequestOptions requestO * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion * of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDocumentWithResponse(String key, RequestOptions requestOptions) { return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, requestOptions), LookupDocument.class); @@ -980,27 +1089,200 @@ public Mono getDocument(String key, String querySourceAuthorizat } /** - * Retrieves a document from the index. + * Executes a graph query over an index with an edge-list graph profile. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which + * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that + * bypass document level permission checks for the query operation.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     gql: String (Required)
+     *     search: String (Optional)
+     *     filter: String (Optional)
+     *     vectorQueries (Optional): [
+     *          (Optional){
+     *             kind: String(vector/text/imageUrl/imageBinary) (Required)
+     *             k: Integer (Optional)
+     *             fields: String (Optional)
+     *             exhaustive: Boolean (Optional)
+     *             oversampling: Double (Optional)
+     *             weight: Float (Optional)
+     *             threshold (Optional): {
+     *                 kind: String(vectorSimilarity/searchScore) (Required)
+     *             }
+     *             filterOverride: String (Optional)
+     *             perDocumentVectorLimit: Integer (Optional)
+     *             topicGraph (Optional): {
+     *                 kind: String(none/diverse/balanced) (Required)
+     *             }
+     *         }
+     *     ]
+     *     executionMode: String(execute/planOnly) (Optional)
+     *     explain (Optional): [
+     *         String(syntax/semanticIr/logicalPlan/optimizedLogicalPlan/physicalPlan/requestAttributions/full) (Optional)
+     *     ]
+     *     includeStatistics: Boolean (Optional)
+     *     includeDiagnostics: Boolean (Optional)
+     *     provenance (Optional): {
+     *         kind: String(ids/hydrate) (Required)
+     *         maxEvidencePerRow: Integer (Optional)
+     *         hydrateDocuments (Optional): {
+     *             select: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     @odata.count: Long (Optional)
+     *     value (Required): [
+     *          (Required){
+     *             @search.graphProvenance (Optional): {
+     *                 kind: String(ids/hydrate) (Optional)
+     *                 evidenceCount (Optional): {
+     *                     value: Integer (Optional)
+     *                     relation: String(exact/lowerBound) (Optional)
+     *                 }
+     *                 evidence (Optional): [
+     *                      (Optional){
+     *                         edgeId: String (Optional)
+     *                         chunkId: String (Optional)
+     *                         parentId: String (Optional)
+     *                         confidence (Optional): {
+     *                             edge: Double (Optional)
+     *                             subject: Double (Optional)
+     *                             predicate: Double (Optional)
+     *                             object: Double (Optional)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *              (Optional): {
+     *                 String: Object (Required)
+     *             }
+     *         }
+     *     ]
+     *     @search.graphStats (Optional): {
+     *         executionMode: String(execute/planOnly) (Optional)
+     *         queryCount: Integer (Optional)
+     *         documentsFetched: Integer (Optional)
+     *         isEstimated: Boolean (Optional)
+     *         totalMs: Long (Optional)
+     *         searchMs: Long (Optional)
+     *         planningMs: Long (Optional)
+     *     }
+     *     @search.graphDiagnostics (Optional): [
+     *          (Optional){
+     *             code: String (Optional)
+     *             severity: String(error/warning/info) (Optional)
+     *             phase: String(parse/bind/validation/planning/execution) (Optional)
+     *             message: String (Optional)
+     *             span: String (Optional)
+     *             suggestions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     @search.graphExplain (Optional): {
+     *          (Optional): {
+     *             String: Object (Required)
+     *         }
+     *     }
+     *     @search.graphProvenanceDocuments (Optional): {
+     *          (Optional): {
+     *             String (Required): {
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *         }
+     *     }
+     * }
+     * }
+     * 
* - * @param key The key of the document to retrieve. - * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be - * null. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. May be null. Its - * callbacks run after the operation options are applied, so a header set explicitly with setHeader overrides the - * corresponding header from {@code options}. Query parameters added through RequestOptions are appended to the - * request, not substituted. + * @param graphRequest The graphRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion - * of {@link Mono}. + * @return a graph query's projected rows and optional execution information along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDocumentWithResponse(String key, GetDocumentOptions options, + Mono> hiddenGeneratedGraphWithResponse(BinaryData graphRequest, RequestOptions requestOptions) { - return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, options, requestOptions), - LookupDocument.class); + return this.serviceClient.graphWithResponseAsync(graphRequest, requestOptions); + } + + /** + * Executes a graph query over an index with an edge-list graph profile. + * + * @param options Options for graph API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a graph query's projected rows and optional execution information on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono graph(GraphOptions options) { + // Generated convenience method for hiddenGeneratedGraphWithResponse + RequestOptions requestOptions = new RequestOptions(); + String querySourceAuthorization = options.getQuerySourceAuthorization(); + Boolean enableElevatedRead = options.isEnableElevatedRead(); + GraphRequest graphRequestObj = new GraphRequest(options.getGql()).setSearch(options.getSearch()) + .setFilter(options.getFilter()) + .setVectorQueries(options.getVectorQueries()) + .setExecutionMode(options.getExecutionMode()) + .setExplain(options.getExplain()) + .setIncludeStatistics(options.isIncludeStatistics()) + .setIncludeDiagnostics(options.isIncludeDiagnostics()) + .setProvenance(options.getProvenance()); + BinaryData graphRequest = BinaryData.fromObject(graphRequestObj); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (enableElevatedRead != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-enable-elevated-read"), + String.valueOf(enableElevatedRead)); + } + return hiddenGeneratedGraphWithResponse(graphRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(GraphQueryResult.class)); + } + + /** + * Executes a graph query and returns its HTTP response and diagnostics. + * + * @param options the graph query and diagnostic options. + * @param requestOptions the HTTP request options. + * @return the graph result together with the HTTP response. + * @throws NullPointerException if options is null. + */ + public Mono> graphWithResponse(GraphOptions options, RequestOptions requestOptions) { + return SearchUtils + .mapResponse(hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options)), + SearchUtils.addGraphHeaders(requestOptions, options)), GraphQueryResult.class); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java index 1ced02a05e042..98559c4501e56 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java @@ -23,10 +23,12 @@ import com.azure.search.documents.implementation.SearchClientImpl; import com.azure.search.documents.implementation.SearchUtils; import com.azure.search.documents.implementation.models.AutocompletePostRequest; +import com.azure.search.documents.implementation.models.GraphRequest; import com.azure.search.documents.implementation.models.SuggestPostRequest; import com.azure.search.documents.models.AutocompleteOptions; import com.azure.search.documents.models.AutocompleteResult; -import com.azure.search.documents.models.GetDocumentOptions; +import com.azure.search.documents.models.GraphOptions; +import com.azure.search.documents.models.GraphQueryResult; import com.azure.search.documents.models.IndexBatchException; import com.azure.search.documents.models.IndexDocumentsBatch; import com.azure.search.documents.models.IndexDocumentsOptions; @@ -390,19 +392,24 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * orderby (Optional): [ * String (Optional) * ] - * queryType: String(simple/full/semantic) (Optional) + * queryType: String(simple/full/semantic/agentic) (Optional) + * agenticOptions (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * } * scoringStatistics: String(local/global) (Optional) * sessionId: String (Optional) * scoringParameters (Optional): [ * String (Optional) * ] * scoringProfile: String (Optional) - * debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional) + * debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional) * search: String (Optional) * searchFields (Optional): [ * String (Optional) * ] * searchMode: String(any/all) (Optional) + * queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional) + * speller: String(none/lexicon) (Optional) * select (Optional): [ * String (Optional) * ] @@ -414,17 +421,33 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * semanticQuery: String (Optional) * answers: String(none/extractive) (Optional) * captions: String(none/extractive) (Optional) + * queryRewrites: String(none/generative) (Optional) + * semanticFields (Optional): [ + * String (Optional) + * ] * vectorQueries (Optional): [ * (Optional){ - * kind: String(vector/text) (Required) + * kind: String(vector/text/imageUrl/imageBinary) (Required) * k: Integer (Optional) * fields: String (Optional) * exhaustive: Boolean (Optional) * oversampling: Double (Optional) * weight: Float (Optional) + * threshold (Optional): { + * kind: String(vectorSimilarity/searchScore) (Required) + * } + * filterOverride: String (Optional) + * perDocumentVectorLimit: Integer (Optional) + * topicGraph (Optional): { + * kind: String(none/diverse/balanced) (Required) + * } * } * ] - * vectorFilterMode: String(postFilter/preFilter) (Optional) + * vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional) + * hybridSearch (Optional): { + * maxTextRecallSize: Integer (Optional) + * countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional) + * } * } * } * @@ -440,6 +463,16 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * String (Required): [ * (Required){ * count: Long (Optional) + * avg: Double (Optional) + * min: Double (Optional) + * max: Double (Optional) + * sum: Double (Optional) + * cardinality: Long (Optional) + * @search.facets (Optional): { + * String (Required): [ + * (recursive schema, see above) + * ] + * } * (Optional): { * String: Object (Required) * } @@ -457,6 +490,32 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * } * } * ] + * @search.debug (Optional): { + * queryRewrites (Optional): { + * text (Optional): { + * inputQuery: String (Optional) + * rewrites (Optional): [ + * String (Optional) + * ] + * } + * vectors (Optional): [ + * (recursive schema, see above) + * ] + * } + * agentic (Optional): { + * terminationReason: String(modelStopped/maxRuntimeExceeded/modelFailed) (Optional) + * subQueries (Optional): [ + * (Optional){ + * search: String (Required) + * iteration: int (Required) + * } + * ] + * usage (Optional): { + * agenticPlanningTokens: long (Required) + * reasoningTokens: long (Required) + * } + * } + * } * @search.nextPageParameters (Optional): { * count: Boolean (Optional) * facets (Optional): [ @@ -473,19 +532,24 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * orderby (Optional): [ * String (Optional) * ] - * queryType: String(simple/full/semantic) (Optional) + * queryType: String(simple/full/semantic/agentic) (Optional) + * agenticOptions (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * } * scoringStatistics: String(local/global) (Optional) * sessionId: String (Optional) * scoringParameters (Optional): [ * String (Optional) * ] * scoringProfile: String (Optional) - * debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional) + * debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional) * search: String (Optional) * searchFields (Optional): [ * String (Optional) * ] * searchMode: String(any/all) (Optional) + * queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional) + * speller: String(none/lexicon) (Optional) * select (Optional): [ * String (Optional) * ] @@ -497,17 +561,33 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * semanticQuery: String (Optional) * answers: String(none/extractive) (Optional) * captions: String(none/extractive) (Optional) + * queryRewrites: String(none/generative) (Optional) + * semanticFields (Optional): [ + * String (Optional) + * ] * vectorQueries (Optional): [ * (Optional){ - * kind: String(vector/text) (Required) + * kind: String(vector/text/imageUrl/imageBinary) (Required) * k: Integer (Optional) * fields: String (Optional) * exhaustive: Boolean (Optional) * oversampling: Double (Optional) * weight: Float (Optional) + * threshold (Optional): { + * kind: String(vectorSimilarity/searchScore) (Required) + * } + * filterOverride: String (Optional) + * perDocumentVectorLimit: Integer (Optional) + * topicGraph (Optional): { + * kind: String(none/diverse/balanced) (Required) + * } * } * ] - * vectorFilterMode: String(postFilter/preFilter) (Optional) + * vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional) + * hybridSearch (Optional): { + * maxTextRecallSize: Integer (Optional) + * countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional) + * } * } * value (Required): [ * (Required){ @@ -529,6 +609,23 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * } * ] * @search.documentDebugInfo (Optional): { + * semantic (Optional): { + * titleField (Optional): { + * name: String (Optional) + * state: String(used/unused/partial) (Optional) + * } + * contentFields (Optional): [ + * (recursive schema, see above) + * ] + * keywordFields (Optional): [ + * (recursive schema, see above) + * ] + * rerankerInput (Optional): { + * title: String (Optional) + * content: String (Optional) + * keywords: String (Optional) + * } + * } * vectors (Optional): { * subscores (Optional): { * text (Optional): { @@ -545,6 +642,18 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * documentBoost: Double (Optional) * } * } + * innerHits (Optional): { + * String (Required): [ + * (Required){ + * ordinal: Long (Optional) + * vectors (Optional): [ + * (Optional){ + * String (Required): (recursive schema, see String above) + * } + * ] + * } + * ] + * } * } * (Optional): { * String: Object (Required) @@ -554,6 +663,7 @@ public Response indexDocumentsWithResponse(IndexDocumentsB * @odata.nextLink: String (Optional) * @search.semanticPartialResponseReason: String(maxWaitExceeded/capacityOverloaded/transient) (Optional) * @search.semanticPartialResponseType: String(baseResults/rerankedResults) (Optional) + * @search.semanticQueryRewritesResultType: String(originalQueryOnly) (Optional) * } * } * @@ -855,7 +965,6 @@ public Response getDocumentCountWithResponse(RequestOptions requestOptions * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a document retrieved via a document lookup operation along with {@link Response}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getDocumentWithResponse(String key, RequestOptions requestOptions) { return convertResponse(this.serviceClient.getDocumentWithResponse(key, requestOptions), LookupDocument.class); @@ -974,26 +1083,198 @@ public LookupDocument getDocument(String key, String querySourceAuthorization, B } /** - * Retrieves a document from the index. + * Executes a graph query over an index with an edge-list graph profile. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which + * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that + * bypass document level permission checks for the query operation.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     gql: String (Required)
+     *     search: String (Optional)
+     *     filter: String (Optional)
+     *     vectorQueries (Optional): [
+     *          (Optional){
+     *             kind: String(vector/text/imageUrl/imageBinary) (Required)
+     *             k: Integer (Optional)
+     *             fields: String (Optional)
+     *             exhaustive: Boolean (Optional)
+     *             oversampling: Double (Optional)
+     *             weight: Float (Optional)
+     *             threshold (Optional): {
+     *                 kind: String(vectorSimilarity/searchScore) (Required)
+     *             }
+     *             filterOverride: String (Optional)
+     *             perDocumentVectorLimit: Integer (Optional)
+     *             topicGraph (Optional): {
+     *                 kind: String(none/diverse/balanced) (Required)
+     *             }
+     *         }
+     *     ]
+     *     executionMode: String(execute/planOnly) (Optional)
+     *     explain (Optional): [
+     *         String(syntax/semanticIr/logicalPlan/optimizedLogicalPlan/physicalPlan/requestAttributions/full) (Optional)
+     *     ]
+     *     includeStatistics: Boolean (Optional)
+     *     includeDiagnostics: Boolean (Optional)
+     *     provenance (Optional): {
+     *         kind: String(ids/hydrate) (Required)
+     *         maxEvidencePerRow: Integer (Optional)
+     *         hydrateDocuments (Optional): {
+     *             select: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     @odata.count: Long (Optional)
+     *     value (Required): [
+     *          (Required){
+     *             @search.graphProvenance (Optional): {
+     *                 kind: String(ids/hydrate) (Optional)
+     *                 evidenceCount (Optional): {
+     *                     value: Integer (Optional)
+     *                     relation: String(exact/lowerBound) (Optional)
+     *                 }
+     *                 evidence (Optional): [
+     *                      (Optional){
+     *                         edgeId: String (Optional)
+     *                         chunkId: String (Optional)
+     *                         parentId: String (Optional)
+     *                         confidence (Optional): {
+     *                             edge: Double (Optional)
+     *                             subject: Double (Optional)
+     *                             predicate: Double (Optional)
+     *                             object: Double (Optional)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *              (Optional): {
+     *                 String: Object (Required)
+     *             }
+     *         }
+     *     ]
+     *     @search.graphStats (Optional): {
+     *         executionMode: String(execute/planOnly) (Optional)
+     *         queryCount: Integer (Optional)
+     *         documentsFetched: Integer (Optional)
+     *         isEstimated: Boolean (Optional)
+     *         totalMs: Long (Optional)
+     *         searchMs: Long (Optional)
+     *         planningMs: Long (Optional)
+     *     }
+     *     @search.graphDiagnostics (Optional): [
+     *          (Optional){
+     *             code: String (Optional)
+     *             severity: String(error/warning/info) (Optional)
+     *             phase: String(parse/bind/validation/planning/execution) (Optional)
+     *             message: String (Optional)
+     *             span: String (Optional)
+     *             suggestions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     @search.graphExplain (Optional): {
+     *          (Optional): {
+     *             String: Object (Required)
+     *         }
+     *     }
+     *     @search.graphProvenanceDocuments (Optional): {
+     *          (Optional): {
+     *             String (Required): {
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *         }
+     *     }
+     * }
+     * }
+     * 
* - * @param key The key of the document to retrieve. - * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be - * null. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. May be null. Its - * callbacks run after the operation options are applied, so a header set explicitly with setHeader overrides the - * corresponding header from {@code options}. Query parameters added through RequestOptions are appended to the - * request, not substituted. + * @param graphRequest The graphRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a document retrieved via a document lookup operation along with {@link Response}. + * @return a graph query's projected rows and optional execution information along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDocumentWithResponse(String key, GetDocumentOptions options, - RequestOptions requestOptions) { - return convertResponse(this.serviceClient.getDocumentWithResponse(key, options, requestOptions), - LookupDocument.class); + Response hiddenGeneratedGraphWithResponse(BinaryData graphRequest, RequestOptions requestOptions) { + return this.serviceClient.graphWithResponse(graphRequest, requestOptions); + } + + /** + * Executes a graph query over an index with an edge-list graph profile. + * + * @param options Options for graph API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a graph query's projected rows and optional execution information. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphQueryResult graph(GraphOptions options) { + // Generated convenience method for hiddenGeneratedGraphWithResponse + RequestOptions requestOptions = new RequestOptions(); + String querySourceAuthorization = options.getQuerySourceAuthorization(); + Boolean enableElevatedRead = options.isEnableElevatedRead(); + GraphRequest graphRequestObj = new GraphRequest(options.getGql()).setSearch(options.getSearch()) + .setFilter(options.getFilter()) + .setVectorQueries(options.getVectorQueries()) + .setExecutionMode(options.getExecutionMode()) + .setExplain(options.getExplain()) + .setIncludeStatistics(options.isIncludeStatistics()) + .setIncludeDiagnostics(options.isIncludeDiagnostics()) + .setProvenance(options.getProvenance()); + BinaryData graphRequest = BinaryData.fromObject(graphRequestObj); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (enableElevatedRead != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-enable-elevated-read"), + String.valueOf(enableElevatedRead)); + } + return hiddenGeneratedGraphWithResponse(graphRequest, requestOptions).getValue() + .toObject(GraphQueryResult.class); + } + + /** + * Executes a graph query and returns its HTTP response and diagnostics. + * + * @param options the graph query and diagnostic options. + * @param requestOptions the HTTP request options. + * @return the graph result together with the HTTP response. + * @throws NullPointerException if options is null. + */ + public Response graphWithResponse(GraphOptions options, RequestOptions requestOptions) { + return SearchUtils.convertResponse( + hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options)), + SearchUtils.addGraphHeaders(requestOptions, options)), + GraphQueryResult.class); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java index 478a423a1c632..b56df7c6e4984 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java @@ -30,10 +30,18 @@ public enum SearchServiceVersion implements ServiceVersion { * Enum value 2026-04-01. */ V2026_04_01("2026-04-01"), + /** + * Enum value 2026-08-01-preview. + */ + V2026_08_01_PREVIEW("2026-08-01-preview"), /** * Enum value 2026-10-01. */ - V2026_10_01("2026-10-01"); + V2026_10_01("2026-10-01"), + /** + * Enum value 2026-11-01-preview. + */ + V2026_11_01_PREVIEW("2026-11-01-preview"); private final String version; @@ -55,6 +63,6 @@ public String getVersion() { * @return The latest {@link SearchServiceVersion}. */ public static SearchServiceVersion getLatest() { - return V2026_10_01; + return V2026_11_01_PREVIEW; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java index 06b7d215fd901..c57469f2ff25d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.search.documents.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Generated; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -39,7 +39,6 @@ * Initializes a new instance of the KnowledgeBaseRetrievalClient type. */ public final class KnowledgeBaseRetrievalClientImpl { - /** * The proxy service used to perform REST calls. */ @@ -52,7 +51,7 @@ public final class KnowledgeBaseRetrievalClientImpl { /** * Gets The endpoint URL of the search service. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -66,7 +65,7 @@ public String getEndpoint() { /** * Gets The name of the knowledge base. - * + * * @return the knowledgeBaseName value. */ public String getKnowledgeBaseName() { @@ -80,7 +79,7 @@ public String getKnowledgeBaseName() { /** * Gets Service version. - * + * * @return the serviceVersion value. */ public SearchServiceVersion getServiceVersion() { @@ -94,7 +93,7 @@ public SearchServiceVersion getServiceVersion() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -108,7 +107,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -117,7 +116,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of KnowledgeBaseRetrievalClient client. - * + * * @param endpoint The endpoint URL of the search service. * @param knowledgeBaseName The name of the knowledge base. * @param serviceVersion Service version. @@ -130,7 +129,7 @@ public KnowledgeBaseRetrievalClientImpl(String endpoint, String knowledgeBaseNam /** * Initializes an instance of KnowledgeBaseRetrievalClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint URL of the search service. * @param knowledgeBaseName The name of the knowledge base. @@ -144,7 +143,7 @@ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, String endpoi /** * Initializes an instance of KnowledgeBaseRetrievalClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint URL of the search service. @@ -169,7 +168,6 @@ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, SerializerAda @Host("{endpoint}") @ServiceInterface(name = "KnowledgeBaseRetrievalClient") public interface KnowledgeBaseRetrievalClientService { - @Post("/knowledgebases('{knowledgeBaseName}')/retrieve") @ExpectedResponses({ 200, 206 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -179,9 +177,7 @@ public interface KnowledgeBaseRetrievalClientService { Mono> retrieve(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @PathParam("knowledgeBaseName") String knowledgeBaseName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData retrievalRequest, - @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, - RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData retrievalRequest, RequestOptions requestOptions, Context context); @Post("/knowledgebases('{knowledgeBaseName}')/retrieve") @ExpectedResponses({ 200, 206 }) @@ -192,9 +188,7 @@ Mono> retrieve(@HostParam("endpoint") String endpoint, Response retrieveSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @PathParam("knowledgeBaseName") String knowledgeBaseName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData retrievalRequest, - @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, - RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData retrievalRequest, RequestOptions requestOptions, Context context); @Post("/knowledgebases('{knowledgeBaseName}')/retrieve") @ExpectedResponses({ 200 }) @@ -227,10 +221,13 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint, * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -250,31 +247,36 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint,
      *         }
      *     ]
      *     maxRuntimeInSeconds: Integer (Optional)
+     *     maxOutputSize: Integer (Optional)
      *     maxOutputDocuments: Integer (Optional)
      *     maxOutputSizeInTokens: Integer (Optional)
      *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
+     *         kind: String(minimal/low/medium/auto) (Required)
      *     }
      *     includeActivity: Boolean (Optional)
      *     outputMode: String(extractiveData/answerSynthesis) (Optional)
      *     knowledgeSourceParams (Optional): [
      *          (Optional){
-     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *             knowledgeSourceName: String (Required)
      *             includeReferences: Boolean (Optional)
      *             includeReferenceSourceData: Boolean (Optional)
      *             alwaysQuerySource: Boolean (Optional)
+     *             neverQuerySource: Boolean (Optional)
      *             failOnError: Boolean (Optional)
      *             rerankerThreshold: Float (Optional)
+     *             resultsProcessing: String(rerank/none) (Optional)
      *             maxOutputDocuments: Integer (Optional)
+     *             enableImageServing: Boolean (Optional)
      *         }
      *     ]
+     *     toolName: String (Optional)
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -290,7 +292,7 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint,
      *     ]
      *     activity (Optional): [
      *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required)
+     *             type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required)
      *             id: int (Required)
      *             startedAt: OffsetDateTime (Optional)
      *             completedAt: OffsetDateTime (Optional)
@@ -316,7 +318,7 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint,
      *     ]
      *     references (Optional): [
      *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql) (Required)
+     *             type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql) (Required)
      *             id: String (Required)
      *             activitySource: int (Required)
      *             sourceData (Optional): {
@@ -325,10 +327,18 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint,
      *             rerankerScore: Float (Optional)
      *         }
      *     ]
+     *     responseSensitivityLabelInfo (Optional): {
+     *         displayName: String (Optional)
+     *         sensitivityLabelId: String (Optional)
+     *         toolTip: String (Optional)
+     *         priority: Integer (Optional)
+     *         color: String (Optional)
+     *         isEncrypted: Boolean (Optional)
+     *     }
      * }
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -341,7 +351,11 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> retrieveWithResponseAsync(BinaryData retrievalRequest, RequestOptions requestOptions) { - return retrieveWithResponseAsync(retrievalRequest, null, requestOptions); + final String accept = "application/json;odata.metadata=minimal"; + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.retrieve(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + this.getKnowledgeBaseName(), contentType, retrievalRequest, requestOptions, context)); } /** @@ -352,10 +366,13 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -375,31 +392,36 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval
      *         }
      *     ]
      *     maxRuntimeInSeconds: Integer (Optional)
+     *     maxOutputSize: Integer (Optional)
      *     maxOutputDocuments: Integer (Optional)
      *     maxOutputSizeInTokens: Integer (Optional)
      *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
+     *         kind: String(minimal/low/medium/auto) (Required)
      *     }
      *     includeActivity: Boolean (Optional)
      *     outputMode: String(extractiveData/answerSynthesis) (Optional)
      *     knowledgeSourceParams (Optional): [
      *          (Optional){
-     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *             knowledgeSourceName: String (Required)
      *             includeReferences: Boolean (Optional)
      *             includeReferenceSourceData: Boolean (Optional)
      *             alwaysQuerySource: Boolean (Optional)
+     *             neverQuerySource: Boolean (Optional)
      *             failOnError: Boolean (Optional)
      *             rerankerThreshold: Float (Optional)
+     *             resultsProcessing: String(rerank/none) (Optional)
      *             maxOutputDocuments: Integer (Optional)
+     *             enableImageServing: Boolean (Optional)
      *         }
      *     ]
+     *     toolName: String (Optional)
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -415,7 +437,7 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval
      *     ]
      *     activity (Optional): [
      *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required)
+     *             type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required)
      *             id: int (Required)
      *             startedAt: OffsetDateTime (Optional)
      *             completedAt: OffsetDateTime (Optional)
@@ -441,7 +463,7 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval
      *     ]
      *     references (Optional): [
      *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql) (Required)
+     *             type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql) (Required)
      *             id: String (Required)
      *             activitySource: int (Required)
      *             sourceData (Optional): {
@@ -450,10 +472,18 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval
      *             rerankerScore: Float (Optional)
      *         }
      *     ]
+     *     responseSensitivityLabelInfo (Optional): {
+     *         displayName: String (Optional)
+     *         sensitivityLabelId: String (Optional)
+     *         toolTip: String (Optional)
+     *         priority: Integer (Optional)
+     *         color: String (Optional)
+     *         isEncrypted: Boolean (Optional)
+     *     }
      * }
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -464,13 +494,16 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval */ @ServiceMethod(returns = ReturnType.SINGLE) public Response retrieveWithResponse(BinaryData retrievalRequest, RequestOptions requestOptions) { - return retrieveWithResponse(retrievalRequest, null, requestOptions); + final String accept = "application/json;odata.metadata=minimal"; + final String contentType = "application/json"; + return service.retrieveSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + this.getKnowledgeBaseName(), contentType, retrievalRequest, requestOptions, Context.NONE); } /** * Retrieves relevant data from backing stores and streams progress and results as server-sent * events. - * + * * Process the response incrementally using server-sent event framing. Each event contains an * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated @@ -482,10 +515,13 @@ public Response retrieveWithResponse(BinaryData retrievalRequest, Re * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -505,37 +541,42 @@ public Response retrieveWithResponse(BinaryData retrievalRequest, Re
      *         }
      *     ]
      *     maxRuntimeInSeconds: Integer (Optional)
+     *     maxOutputSize: Integer (Optional)
      *     maxOutputDocuments: Integer (Optional)
      *     maxOutputSizeInTokens: Integer (Optional)
      *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
+     *         kind: String(minimal/low/medium/auto) (Required)
      *     }
      *     includeActivity: Boolean (Optional)
      *     outputMode: String(extractiveData/answerSynthesis) (Optional)
      *     knowledgeSourceParams (Optional): [
      *          (Optional){
-     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *             knowledgeSourceName: String (Required)
      *             includeReferences: Boolean (Optional)
      *             includeReferenceSourceData: Boolean (Optional)
      *             alwaysQuerySource: Boolean (Optional)
+     *             neverQuerySource: Boolean (Optional)
      *             failOnError: Boolean (Optional)
      *             rerankerThreshold: Float (Optional)
+     *             resultsProcessing: String(rerank/none) (Optional)
      *             maxOutputDocuments: Integer (Optional)
+     *             enableImageServing: Boolean (Optional)
      *         }
      *     ]
+     *     toolName: String (Optional)
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * BinaryData
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -557,7 +598,7 @@ public Mono> retrieveStreamWithResponseAsync(BinaryData ret /** * Retrieves relevant data from backing stores and streams progress and results as server-sent * events. - * + * * Process the response incrementally using server-sent event framing. Each event contains an * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated @@ -569,10 +610,13 @@ public Mono> retrieveStreamWithResponseAsync(BinaryData ret * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -592,37 +636,42 @@ public Mono> retrieveStreamWithResponseAsync(BinaryData ret
      *         }
      *     ]
      *     maxRuntimeInSeconds: Integer (Optional)
+     *     maxOutputSize: Integer (Optional)
      *     maxOutputDocuments: Integer (Optional)
      *     maxOutputSizeInTokens: Integer (Optional)
      *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
+     *         kind: String(minimal/low/medium/auto) (Required)
      *     }
      *     includeActivity: Boolean (Optional)
      *     outputMode: String(extractiveData/answerSynthesis) (Optional)
      *     knowledgeSourceParams (Optional): [
      *          (Optional){
-     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *             knowledgeSourceName: String (Required)
      *             includeReferences: Boolean (Optional)
      *             includeReferenceSourceData: Boolean (Optional)
      *             alwaysQuerySource: Boolean (Optional)
+     *             neverQuerySource: Boolean (Optional)
      *             failOnError: Boolean (Optional)
      *             rerankerThreshold: Float (Optional)
+     *             resultsProcessing: String(rerank/none) (Optional)
      *             maxOutputDocuments: Integer (Optional)
+     *             enableImageServing: Boolean (Optional)
      *         }
      *     ]
+     *     toolName: String (Optional)
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * BinaryData
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -638,267 +687,4 @@ public Response retrieveStreamWithResponse(BinaryData retrievalReque return service.retrieveStreamSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, this.getKnowledgeBaseName(), contentType, retrievalRequest, requestOptions, Context.NONE); } - - /** - * KnowledgeBase retrieves relevant data from backing stores. - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which - * the query is being executed. This token is used to enforce security restrictions on documents.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     messages (Optional): [
-     *          (Optional){
-     *             role: String (Optional)
-     *             content (Required): [
-     *                  (Required){
-     *                     type: String(text/image) (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     *     intents (Optional): [
-     *          (Optional){
-     *             type: String(semantic) (Required)
-     *         }
-     *     ]
-     *     maxRuntimeInSeconds: Integer (Optional)
-     *     maxOutputDocuments: Integer (Optional)
-     *     maxOutputSizeInTokens: Integer (Optional)
-     *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
-     *     }
-     *     includeActivity: Boolean (Optional)
-     *     outputMode: String(extractiveData/answerSynthesis) (Optional)
-     *     knowledgeSourceParams (Optional): [
-     *          (Optional){
-     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
-     *             knowledgeSourceName: String (Required)
-     *             includeReferences: Boolean (Optional)
-     *             includeReferenceSourceData: Boolean (Optional)
-     *             alwaysQuerySource: Boolean (Optional)
-     *             failOnError: Boolean (Optional)
-     *             rerankerThreshold: Float (Optional)
-     *             maxOutputDocuments: Integer (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     response (Optional): [
-     *          (Optional){
-     *             role: String (Optional)
-     *             content (Required): [
-     *                  (Required){
-     *                     type: String(text/image) (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     *     activity (Optional): [
-     *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required)
-     *             id: int (Required)
-     *             startedAt: OffsetDateTime (Optional)
-     *             completedAt: OffsetDateTime (Optional)
-     *             elapsedMs: Integer (Optional)
-     *             error (Optional): {
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 additionalInfo (Optional): [
-     *                      (Optional){
-     *                         type: String (Optional)
-     *                         info (Optional): {
-     *                             String: Object (Required)
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             warning: String (Optional)
-     *         }
-     *     ]
-     *     references (Optional): [
-     *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql) (Required)
-     *             id: String (Required)
-     *             activitySource: int (Required)
-     *             sourceData (Optional): {
-     *                 String: Object (Required)
-     *             }
-     *             rerankerScore: Float (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param retrievalRequest The retrieval request to process. - * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. A header set explicitly on requestOptions takes precedence. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the output contract for the retrieval response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveWithResponseAsync(BinaryData retrievalRequest, - String querySourceAuthorization, RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.retrieve(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, this.getKnowledgeBaseName(), contentType, retrievalRequest, - querySourceAuthorization, requestOptions, context)); - } - - /** - * KnowledgeBase retrieves relevant data from backing stores. - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which - * the query is being executed. This token is used to enforce security restrictions on documents.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     messages (Optional): [
-     *          (Optional){
-     *             role: String (Optional)
-     *             content (Required): [
-     *                  (Required){
-     *                     type: String(text/image) (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     *     intents (Optional): [
-     *          (Optional){
-     *             type: String(semantic) (Required)
-     *         }
-     *     ]
-     *     maxRuntimeInSeconds: Integer (Optional)
-     *     maxOutputDocuments: Integer (Optional)
-     *     maxOutputSizeInTokens: Integer (Optional)
-     *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
-     *     }
-     *     includeActivity: Boolean (Optional)
-     *     outputMode: String(extractiveData/answerSynthesis) (Optional)
-     *     knowledgeSourceParams (Optional): [
-     *          (Optional){
-     *             kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
-     *             knowledgeSourceName: String (Required)
-     *             includeReferences: Boolean (Optional)
-     *             includeReferenceSourceData: Boolean (Optional)
-     *             alwaysQuerySource: Boolean (Optional)
-     *             failOnError: Boolean (Optional)
-     *             rerankerThreshold: Float (Optional)
-     *             maxOutputDocuments: Integer (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     response (Optional): [
-     *          (Optional){
-     *             role: String (Optional)
-     *             content (Required): [
-     *                  (Required){
-     *                     type: String(text/image) (Required)
-     *                 }
-     *             ]
-     *         }
-     *     ]
-     *     activity (Optional): [
-     *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required)
-     *             id: int (Required)
-     *             startedAt: OffsetDateTime (Optional)
-     *             completedAt: OffsetDateTime (Optional)
-     *             elapsedMs: Integer (Optional)
-     *             error (Optional): {
-     *                 code: String (Optional)
-     *                 message: String (Optional)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 additionalInfo (Optional): [
-     *                      (Optional){
-     *                         type: String (Optional)
-     *                         info (Optional): {
-     *                             String: Object (Required)
-     *                         }
-     *                     }
-     *                 ]
-     *             }
-     *             warning: String (Optional)
-     *         }
-     *     ]
-     *     references (Optional): [
-     *          (Optional){
-     *             type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql) (Required)
-     *             id: String (Required)
-     *             activitySource: int (Required)
-     *             sourceData (Optional): {
-     *                 String: Object (Required)
-     *             }
-     *             rerankerScore: Float (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param retrievalRequest The retrieval request to process. - * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. A header set explicitly on requestOptions takes precedence. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the output contract for the retrieval response along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveWithResponse(BinaryData retrievalRequest, String querySourceAuthorization, - RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - final String contentType = "application/json"; - return service.retrieveSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - this.getKnowledgeBaseName(), contentType, retrievalRequest, querySourceAuthorization, requestOptions, - Context.NONE); - } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/OperationLocationPollingStrategy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/OperationLocationPollingStrategy.java new file mode 100644 index 0000000000000..2369bf303136d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/OperationLocationPollingStrategy.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.search.documents.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.OperationResourcePollingStrategy; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +/** + * Implements an operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class OperationLocationPollingStrategy extends OperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(OperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + final Mono> pollResponseMono + = PollingUtils.deserializeResponse((BinaryData) response.getValue(), serializer, pollResponseType) + .onErrorResume(exception -> { + LOGGER.info("Failed to parse initial response."); + return Mono.empty(); + }) + .map(value -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, value, retryAfter)); + return pollResponseMono.switchIfEmpty( + Mono.fromSupplier(() -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, null, retryAfter))); + } else { + return Mono + .error( + new AzureException(String.format( + "Operation failed or cancelled with status code %d," + + ", '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Mono getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + return Mono.error(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + return Mono.error(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + return PollingUtils + .deserializeResponse(latestResponseBody, serializer, PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE) + .flatMap(value -> { + if (value.get(propertyName) != null) { + return BinaryData.fromObjectAsync(value.get(propertyName)) + .flatMap(result -> PollingUtils.deserializeResponse(result, serializer, resultType)); + } else { + return Mono.error(new AzureException("Cannot get final result")); + } + }) + .switchIfEmpty(Mono.error(new AzureException("Cannot get final result"))); + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/PollingUtils.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/PollingUtils.java new file mode 100644 index 0000000000000..eb7577ff15866 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/PollingUtils.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.search.documents.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.DateTimeException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; +import java.util.Map; +import java.util.function.Function; +import java.util.function.Supplier; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +final class PollingUtils { + + public static final TypeReference> POST_POLL_RESULT_TYPE_REFERENCE + = new TypeReference>() { + }; + + public static final HttpHeaderName OPERATION_LOCATION_HEADER = HttpHeaderName.fromString("Operation-Location"); + + public static final String HTTP_METHOD = "httpMethod"; + public static final String REQUEST_URL = "requestURL"; + public static final String POLL_RESPONSE_BODY = "pollResponseBody"; + + private static final String FORWARD_SLASH = "/"; + + public static String getAbsolutePath(String path, String endpoint, ClientLogger logger) { + try { + URI uri = new URI(path); + if (!uri.isAbsolute()) { + if (CoreUtils.isNullOrEmpty(endpoint)) { + throw logger.logExceptionAsError(new IllegalArgumentException( + "Relative path requires endpoint to be non-null and non-empty to create an absolute path.")); + } + + if (endpoint.endsWith(FORWARD_SLASH) && path.startsWith(FORWARD_SLASH)) { + return endpoint + path.substring(1); + } else if (!endpoint.endsWith(FORWARD_SLASH) && !path.startsWith(FORWARD_SLASH)) { + return endpoint + FORWARD_SLASH + path; + } else { + return endpoint + path; + } + } + } catch (URISyntaxException ex) { + throw logger.logExceptionAsWarning(new IllegalArgumentException("'path' must be a valid URI.", ex)); + } + return path; + } + + public static T deserializeResponseSync(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + T value; + if (binaryData == null) { + value = null; + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = typeReference.getJavaClass().cast(binaryData.toReplayableBinaryData()); + } else { + value = binaryData.toObject(typeReference, serializer); + } + return value; + } + + @SuppressWarnings("unchecked") + public static Mono deserializeResponse(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + Mono value; + if (binaryData == null) { + value = Mono.empty(); + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = (Mono) binaryData.toReplayableBinaryDataAsync(); + } else { + value = binaryData.toObjectAsync(typeReference, serializer); + } + return value; + } + + private static final HttpHeaderName RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("retry-after-ms"); + private static final HttpHeaderName X_MS_RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("x-ms-retry-after-ms"); + + public static Duration getRetryAfterFromHeaders(HttpHeaders headers, Supplier nowSupplier) { + // Found 'x-ms-retry-after-ms' header, use a Duration of milliseconds based on the value. + Duration retryDelay = tryGetRetryDelay(headers, X_MS_RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'retry-after-ms' header, use a Duration of milliseconds based on the value. + retryDelay = tryGetRetryDelay(headers, RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'Retry-After' header. First, attempt to resolve it as a Duration of seconds. If that fails, then + // attempt to resolve it as an HTTP date (RFC1123). + retryDelay = tryGetRetryDelay(headers, HttpHeaderName.RETRY_AFTER, + headerValue -> tryParseLongOrDateTime(headerValue, nowSupplier)); + + // Either the retry delay will have been found or it'll be null, null indicates no retry after. + return retryDelay; + } + + private static Duration tryGetRetryDelay(HttpHeaders headers, HttpHeaderName headerName, + Function delayParser) { + String headerValue = headers.getValue(headerName); + + return CoreUtils.isNullOrEmpty(headerValue) ? null : delayParser.apply(headerValue); + } + + private static Duration tryParseLongOrDateTime(String value, Supplier nowSupplier) { + long delaySeconds; + try { + OffsetDateTime retryAfter = new DateTimeRfc1123(value).getDateTime(); + + delaySeconds = nowSupplier.get().until(retryAfter, ChronoUnit.SECONDS); + } catch (DateTimeException ex) { + delaySeconds = tryParseLong(value); + } + + return (delaySeconds >= 0) ? Duration.ofSeconds(delaySeconds) : null; + } + + private static long tryParseLong(String value) { + try { + return Long.parseLong(value); + } catch (NumberFormatException ex) { + return -1; + } + } + + private static Duration tryGetDelayMillis(String value) { + long delayMillis = tryParseLong(value); + return (delayMillis >= 0) ? Duration.ofMillis(delayMillis) : null; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java index 36b0491ed1259..0cfa80874168b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.search.documents.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Generated; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; @@ -34,16 +34,12 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.search.documents.SearchServiceVersion; -import com.azure.search.documents.models.GetDocumentOptions; -import java.util.Objects; -import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** * Initializes a new instance of the SearchClient type. */ public final class SearchClientImpl { - /** * The proxy service used to perform REST calls. */ @@ -56,7 +52,7 @@ public final class SearchClientImpl { /** * Gets The endpoint URL of the search service. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -70,7 +66,7 @@ public String getEndpoint() { /** * Gets The name of the index. - * + * * @return the indexName value. */ public String getIndexName() { @@ -84,7 +80,7 @@ public String getIndexName() { /** * Gets Service version. - * + * * @return the serviceVersion value. */ public SearchServiceVersion getServiceVersion() { @@ -98,7 +94,7 @@ public SearchServiceVersion getServiceVersion() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -112,7 +108,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -121,7 +117,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SearchClient client. - * + * * @param endpoint The endpoint URL of the search service. * @param indexName The name of the index. * @param serviceVersion Service version. @@ -133,7 +129,7 @@ public SearchClientImpl(String endpoint, String indexName, SearchServiceVersion /** * Initializes an instance of SearchClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint URL of the search service. * @param indexName The name of the index. @@ -146,7 +142,7 @@ public SearchClientImpl(HttpPipeline httpPipeline, String endpoint, String index /** * Initializes an instance of SearchClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint URL of the search service. @@ -169,6 +165,27 @@ public SearchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerA @Host("{endpoint}") @ServiceInterface(name = "SearchClient") public interface SearchClientService { + @Post("/indexes('{indexName}')/docs/search.graph") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> graph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("indexName") String indexName, + @HeaderParam("Accept") String accept, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData graphRequest, RequestOptions requestOptions, Context context); + + @Post("/indexes('{indexName}')/docs/search.graph") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response graphSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("indexName") String indexName, + @HeaderParam("Accept") String accept, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData graphRequest, RequestOptions requestOptions, Context context); @Get("/indexes('{indexName}')/docs/$count") @ExpectedResponses({ 200 }) @@ -242,10 +259,8 @@ Response searchSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDocument(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("indexName") String indexName, - @HeaderParam("Accept") String accept, @PathParam("key") String key, - @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, - @HeaderParam("x-ms-enable-elevated-read") Boolean enableElevatedRead, - @QueryParam("$select") String selectedFields, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, @PathParam("key") String key, RequestOptions requestOptions, + Context context); @Get("/indexes('{indexName}')/docs('{key}')") @ExpectedResponses({ 200 }) @@ -255,10 +270,8 @@ Mono> getDocument(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDocumentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("indexName") String indexName, - @HeaderParam("Accept") String accept, @PathParam("key") String key, - @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, - @HeaderParam("x-ms-enable-elevated-read") Boolean enableElevatedRead, - @QueryParam("$select") String selectedFields, RequestOptions requestOptions, Context context); + @HeaderParam("Accept") String accept, @PathParam("key") String key, RequestOptions requestOptions, + Context context); @Get("/indexes('{indexName}')/docs/search.suggest") @ExpectedResponses({ 200 }) @@ -375,16 +388,303 @@ Response autocompleteSync(@HostParam("endpoint") String endpoint, Context context); } + /** + * Executes a graph query over an index with an edge-list graph profile. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which + * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that + * bypass document level permission checks for the query operation.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     gql: String (Required)
+     *     search: String (Optional)
+     *     filter: String (Optional)
+     *     vectorQueries (Optional): [
+     *          (Optional){
+     *             kind: String(vector/text/imageUrl/imageBinary) (Required)
+     *             k: Integer (Optional)
+     *             fields: String (Optional)
+     *             exhaustive: Boolean (Optional)
+     *             oversampling: Double (Optional)
+     *             weight: Float (Optional)
+     *             threshold (Optional): {
+     *                 kind: String(vectorSimilarity/searchScore) (Required)
+     *             }
+     *             filterOverride: String (Optional)
+     *             perDocumentVectorLimit: Integer (Optional)
+     *             topicGraph (Optional): {
+     *                 kind: String(none/diverse/balanced) (Required)
+     *             }
+     *         }
+     *     ]
+     *     executionMode: String(execute/planOnly) (Optional)
+     *     explain (Optional): [
+     *         String(syntax/semanticIr/logicalPlan/optimizedLogicalPlan/physicalPlan/requestAttributions/full) (Optional)
+     *     ]
+     *     includeStatistics: Boolean (Optional)
+     *     includeDiagnostics: Boolean (Optional)
+     *     provenance (Optional): {
+     *         kind: String(ids/hydrate) (Required)
+     *         maxEvidencePerRow: Integer (Optional)
+     *         hydrateDocuments (Optional): {
+     *             select: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     @odata.count: Long (Optional)
+     *     value (Required): [
+     *          (Required){
+     *             @search.graphProvenance (Optional): {
+     *                 kind: String(ids/hydrate) (Optional)
+     *                 evidenceCount (Optional): {
+     *                     value: Integer (Optional)
+     *                     relation: String(exact/lowerBound) (Optional)
+     *                 }
+     *                 evidence (Optional): [
+     *                      (Optional){
+     *                         edgeId: String (Optional)
+     *                         chunkId: String (Optional)
+     *                         parentId: String (Optional)
+     *                         confidence (Optional): {
+     *                             edge: Double (Optional)
+     *                             subject: Double (Optional)
+     *                             predicate: Double (Optional)
+     *                             object: Double (Optional)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *              (Optional): {
+     *                 String: Object (Required)
+     *             }
+     *         }
+     *     ]
+     *     @search.graphStats (Optional): {
+     *         executionMode: String(execute/planOnly) (Optional)
+     *         queryCount: Integer (Optional)
+     *         documentsFetched: Integer (Optional)
+     *         isEstimated: Boolean (Optional)
+     *         totalMs: Long (Optional)
+     *         searchMs: Long (Optional)
+     *         planningMs: Long (Optional)
+     *     }
+     *     @search.graphDiagnostics (Optional): [
+     *          (Optional){
+     *             code: String (Optional)
+     *             severity: String(error/warning/info) (Optional)
+     *             phase: String(parse/bind/validation/planning/execution) (Optional)
+     *             message: String (Optional)
+     *             span: String (Optional)
+     *             suggestions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     @search.graphExplain (Optional): {
+     *          (Optional): {
+     *             String: Object (Required)
+     *         }
+     *     }
+     *     @search.graphProvenanceDocuments (Optional): {
+     *          (Optional): {
+     *             String (Required): {
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param graphRequest The graphRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a graph query's projected rows and optional execution information along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> graphWithResponseAsync(BinaryData graphRequest, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=none"; + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.graph(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getIndexName(), accept, contentType, graphRequest, requestOptions, context)); + } + + /** + * Executes a graph query over an index with an edge-list graph profile. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which + * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that + * bypass document level permission checks for the query operation.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     gql: String (Required)
+     *     search: String (Optional)
+     *     filter: String (Optional)
+     *     vectorQueries (Optional): [
+     *          (Optional){
+     *             kind: String(vector/text/imageUrl/imageBinary) (Required)
+     *             k: Integer (Optional)
+     *             fields: String (Optional)
+     *             exhaustive: Boolean (Optional)
+     *             oversampling: Double (Optional)
+     *             weight: Float (Optional)
+     *             threshold (Optional): {
+     *                 kind: String(vectorSimilarity/searchScore) (Required)
+     *             }
+     *             filterOverride: String (Optional)
+     *             perDocumentVectorLimit: Integer (Optional)
+     *             topicGraph (Optional): {
+     *                 kind: String(none/diverse/balanced) (Required)
+     *             }
+     *         }
+     *     ]
+     *     executionMode: String(execute/planOnly) (Optional)
+     *     explain (Optional): [
+     *         String(syntax/semanticIr/logicalPlan/optimizedLogicalPlan/physicalPlan/requestAttributions/full) (Optional)
+     *     ]
+     *     includeStatistics: Boolean (Optional)
+     *     includeDiagnostics: Boolean (Optional)
+     *     provenance (Optional): {
+     *         kind: String(ids/hydrate) (Required)
+     *         maxEvidencePerRow: Integer (Optional)
+     *         hydrateDocuments (Optional): {
+     *             select: String (Optional)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     @odata.count: Long (Optional)
+     *     value (Required): [
+     *          (Required){
+     *             @search.graphProvenance (Optional): {
+     *                 kind: String(ids/hydrate) (Optional)
+     *                 evidenceCount (Optional): {
+     *                     value: Integer (Optional)
+     *                     relation: String(exact/lowerBound) (Optional)
+     *                 }
+     *                 evidence (Optional): [
+     *                      (Optional){
+     *                         edgeId: String (Optional)
+     *                         chunkId: String (Optional)
+     *                         parentId: String (Optional)
+     *                         confidence (Optional): {
+     *                             edge: Double (Optional)
+     *                             subject: Double (Optional)
+     *                             predicate: Double (Optional)
+     *                             object: Double (Optional)
+     *                         }
+     *                     }
+     *                 ]
+     *             }
+     *              (Optional): {
+     *                 String: Object (Required)
+     *             }
+     *         }
+     *     ]
+     *     @search.graphStats (Optional): {
+     *         executionMode: String(execute/planOnly) (Optional)
+     *         queryCount: Integer (Optional)
+     *         documentsFetched: Integer (Optional)
+     *         isEstimated: Boolean (Optional)
+     *         totalMs: Long (Optional)
+     *         searchMs: Long (Optional)
+     *         planningMs: Long (Optional)
+     *     }
+     *     @search.graphDiagnostics (Optional): [
+     *          (Optional){
+     *             code: String (Optional)
+     *             severity: String(error/warning/info) (Optional)
+     *             phase: String(parse/bind/validation/planning/execution) (Optional)
+     *             message: String (Optional)
+     *             span: String (Optional)
+     *             suggestions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     @search.graphExplain (Optional): {
+     *          (Optional): {
+     *             String: Object (Required)
+     *         }
+     *     }
+     *     @search.graphProvenanceDocuments (Optional): {
+     *          (Optional): {
+     *             String (Required): {
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param graphRequest The graphRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a graph query's projected rows and optional execution information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response graphWithResponse(BinaryData graphRequest, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=none"; + final String contentType = "application/json"; + return service.graphSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), accept, + contentType, graphRequest, requestOptions, Context.NONE); + } + /** * Queries the number of documents in the index. *

Response Body Schema

- * + * *
      * {@code
      * long
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -402,13 +702,13 @@ public Mono> getDocumentCountWithResponseAsync(RequestOptio /** * Queries the number of documents in the index. *

Response Body Schema

- * + * *
      * {@code
      * long
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -460,7 +760,7 @@ public Response getDocumentCountWithResponse(RequestOptions requestO * clauses. In the form of "," separated string. * queryTypeStringNoA value that specifies the syntax of the search query. The * default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Allowed values: "simple", "full", - * "semantic". + * "semantic", "agentic". * scoringParameterList<String>NoThe list of parameter values to be used in * scoring functions (for example, referencePointParameter) using the format name-values. For example, if the * scoring profile defines a function with a parameter called 'mylocation' the parameter string would be @@ -517,8 +817,28 @@ public Response getDocumentCountWithResponse(RequestOptions requestO * 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. + * queryRewritesStringNoWhen QueryRewrites is set to `generative`, the query + * terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the + * request. The requested count can be configured by appending the pipe character `|` followed by the + * `count-<number of rewrites>` option, such as `generative|count-3`. Defaults to `None`. This parameter is + * only valid if the query type is `semantic`. Allowed values: "none", "generative". * debugStringNoEnables a debugging tool that can be used to further explore your - * search results. Allowed values: "disabled", "semantic", "vector", "queryRewrites", "innerHits", "all". + * search results. Allowed values: "disabled", "semantic", "vector", "queryRewrites", "agentic", "innerHits", + * "all". + * queryLanguageStringNoThe language of the query. Allowed values: "none", + * "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", "zh-tw", + * "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", "hu-hu", "pl-pl", "sv-se", + * "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", + * "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", + * "lv-lv", "et-ee", "ca-es", "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", + * "gl-es", "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". + * spellerStringNoImprove search recall by spell-correcting individual search + * query terms. Allowed values: "none", "lexicon". + * semanticFieldsList<String>NoThe list of field names used for semantic + * ranking. In the form of "," separated string. + * agenticMaxRuntimeInSecondsIntegerNoMaximum duration in seconds for the + * complete agentic search request, including retrieval, ranking and retries. Not supported with other query + * modes. * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

@@ -532,7 +852,7 @@ public Response getDocumentCountWithResponse(RequestOptions requestO * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -542,6 +862,16 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *         String (Required): [
      *              (Required){
      *                 count: Long (Optional)
+     *                 avg: Double (Optional)
+     *                 min: Double (Optional)
+     *                 max: Double (Optional)
+     *                 sum: Double (Optional)
+     *                 cardinality: Long (Optional)
+     *                 @search.facets (Optional): {
+     *                     String (Required): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
      *                  (Optional): {
      *                     String: Object (Required)
      *                 }
@@ -559,6 +889,32 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *             }
      *         }
      *     ]
+     *     @search.debug (Optional): {
+     *         queryRewrites (Optional): {
+     *             text (Optional): {
+     *                 inputQuery: String (Optional)
+     *                 rewrites (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *             vectors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         agentic (Optional): {
+     *             terminationReason: String(modelStopped/maxRuntimeExceeded/modelFailed) (Optional)
+     *             subQueries (Optional): [
+     *                  (Optional){
+     *                     search: String (Required)
+     *                     iteration: int (Required)
+     *                 }
+     *             ]
+     *             usage (Optional): {
+     *                 agenticPlanningTokens: long (Required)
+     *                 reasoningTokens: long (Required)
+     *             }
+     *         }
+     *     }
      *     @search.nextPageParameters (Optional): {
      *         count: Boolean (Optional)
      *         facets (Optional): [
@@ -575,19 +931,24 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *         orderby (Optional): [
      *             String (Optional)
      *         ]
-     *         queryType: String(simple/full/semantic) (Optional)
+     *         queryType: String(simple/full/semantic/agentic) (Optional)
+     *         agenticOptions (Optional): {
+     *             maxRuntimeInSeconds: Integer (Optional)
+     *         }
      *         scoringStatistics: String(local/global) (Optional)
      *         sessionId: String (Optional)
      *         scoringParameters (Optional): [
      *             String (Optional)
      *         ]
      *         scoringProfile: String (Optional)
-     *         debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional)
+     *         debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional)
      *         search: String (Optional)
      *         searchFields (Optional): [
      *             String (Optional)
      *         ]
      *         searchMode: String(any/all) (Optional)
+     *         queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional)
+     *         speller: String(none/lexicon) (Optional)
      *         select (Optional): [
      *             String (Optional)
      *         ]
@@ -599,17 +960,33 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *         semanticQuery: String (Optional)
      *         answers: String(none/extractive) (Optional)
      *         captions: String(none/extractive) (Optional)
+     *         queryRewrites: String(none/generative) (Optional)
+     *         semanticFields (Optional): [
+     *             String (Optional)
+     *         ]
      *         vectorQueries (Optional): [
      *              (Optional){
-     *                 kind: String(vector/text) (Required)
+     *                 kind: String(vector/text/imageUrl/imageBinary) (Required)
      *                 k: Integer (Optional)
      *                 fields: String (Optional)
      *                 exhaustive: Boolean (Optional)
      *                 oversampling: Double (Optional)
      *                 weight: Float (Optional)
+     *                 threshold (Optional): {
+     *                     kind: String(vectorSimilarity/searchScore) (Required)
+     *                 }
+     *                 filterOverride: String (Optional)
+     *                 perDocumentVectorLimit: Integer (Optional)
+     *                 topicGraph (Optional): {
+     *                     kind: String(none/diverse/balanced) (Required)
+     *                 }
      *             }
      *         ]
-     *         vectorFilterMode: String(postFilter/preFilter) (Optional)
+     *         vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional)
+     *         hybridSearch (Optional): {
+     *             maxTextRecallSize: Integer (Optional)
+     *             countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional)
+     *         }
      *     }
      *     value (Required): [
      *          (Required){
@@ -631,6 +1008,23 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *                 }
      *             ]
      *             @search.documentDebugInfo (Optional): {
+     *                 semantic (Optional): {
+     *                     titleField (Optional): {
+     *                         name: String (Optional)
+     *                         state: String(used/unused/partial) (Optional)
+     *                     }
+     *                     contentFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     keywordFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     rerankerInput (Optional): {
+     *                         title: String (Optional)
+     *                         content: String (Optional)
+     *                         keywords: String (Optional)
+     *                     }
+     *                 }
      *                 vectors (Optional): {
      *                     subscores (Optional): {
      *                         text (Optional): {
@@ -647,6 +1041,18 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *                         documentBoost: Double (Optional)
      *                     }
      *                 }
+     *                 innerHits (Optional): {
+     *                     String (Required): [
+     *                          (Required){
+     *                             ordinal: Long (Optional)
+     *                             vectors (Optional): [
+     *                                  (Optional){
+     *                                     String (Required): (recursive schema, see String above)
+     *                                 }
+     *                             ]
+     *                         }
+     *                     ]
+     *                 }
      *             }
      *              (Optional): {
      *                 String: Object (Required)
@@ -656,10 +1062,11 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      *     @odata.nextLink: String (Optional)
      *     @search.semanticPartialResponseReason: String(maxWaitExceeded/capacityOverloaded/transient) (Optional)
      *     @search.semanticPartialResponseType: String(baseResults/rerankedResults) (Optional)
+     *     @search.semanticQueryRewritesResultType: String(originalQueryOnly) (Optional)
      * }
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -712,7 +1119,7 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ * clauses. In the form of "," separated string. * queryTypeStringNoA value that specifies the syntax of the search query. The * default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Allowed values: "simple", "full", - * "semantic". + * "semantic", "agentic". * scoringParameterList<String>NoThe list of parameter values to be used in * scoring functions (for example, referencePointParameter) using the format name-values. For example, if the * scoring profile defines a function with a parameter called 'mylocation' the parameter string would be @@ -769,8 +1176,28 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ * 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. + * queryRewritesStringNoWhen QueryRewrites is set to `generative`, the query + * terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the + * request. The requested count can be configured by appending the pipe character `|` followed by the + * `count-<number of rewrites>` option, such as `generative|count-3`. Defaults to `None`. This parameter is + * only valid if the query type is `semantic`. Allowed values: "none", "generative". * debugStringNoEnables a debugging tool that can be used to further explore your - * search results. Allowed values: "disabled", "semantic", "vector", "queryRewrites", "innerHits", "all". + * search results. Allowed values: "disabled", "semantic", "vector", "queryRewrites", "agentic", "innerHits", + * "all". + * queryLanguageStringNoThe language of the query. Allowed values: "none", + * "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", "es-mx", "zh-cn", "zh-tw", + * "pt-br", "pt-pt", "it-it", "ja-jp", "ko-kr", "ru-ru", "cs-cz", "nl-be", "nl-nl", "hu-hu", "pl-pl", "sv-se", + * "tr-tr", "hi-in", "ar-sa", "ar-eg", "ar-ma", "ar-kw", "ar-jo", "da-dk", "no-no", "bg-bg", "hr-hr", "hr-ba", + * "ms-my", "ms-bn", "sl-sl", "ta-in", "vi-vn", "el-gr", "ro-ro", "is-is", "id-id", "th-th", "lt-lt", "uk-ua", + * "lv-lv", "et-ee", "ca-es", "fi-fi", "sr-ba", "sr-me", "sr-rs", "sk-sk", "nb-no", "hy-am", "bn-in", "eu-es", + * "gl-es", "gu-in", "he-il", "ga-ie", "kn-in", "ml-in", "mr-in", "fa-ae", "pa-in", "te-in", "ur-pk". + * spellerStringNoImprove search recall by spell-correcting individual search + * query terms. Allowed values: "none", "lexicon". + * semanticFieldsList<String>NoThe list of field names used for semantic + * ranking. In the form of "," separated string. + * agenticMaxRuntimeInSecondsIntegerNoMaximum duration in seconds for the + * complete agentic search request, including retrieval, ranking and retries. Not supported with other query + * modes. * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

@@ -784,7 +1211,7 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -794,6 +1221,16 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *         String (Required): [
      *              (Required){
      *                 count: Long (Optional)
+     *                 avg: Double (Optional)
+     *                 min: Double (Optional)
+     *                 max: Double (Optional)
+     *                 sum: Double (Optional)
+     *                 cardinality: Long (Optional)
+     *                 @search.facets (Optional): {
+     *                     String (Required): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
      *                  (Optional): {
      *                     String: Object (Required)
      *                 }
@@ -811,6 +1248,32 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *             }
      *         }
      *     ]
+     *     @search.debug (Optional): {
+     *         queryRewrites (Optional): {
+     *             text (Optional): {
+     *                 inputQuery: String (Optional)
+     *                 rewrites (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *             vectors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         agentic (Optional): {
+     *             terminationReason: String(modelStopped/maxRuntimeExceeded/modelFailed) (Optional)
+     *             subQueries (Optional): [
+     *                  (Optional){
+     *                     search: String (Required)
+     *                     iteration: int (Required)
+     *                 }
+     *             ]
+     *             usage (Optional): {
+     *                 agenticPlanningTokens: long (Required)
+     *                 reasoningTokens: long (Required)
+     *             }
+     *         }
+     *     }
      *     @search.nextPageParameters (Optional): {
      *         count: Boolean (Optional)
      *         facets (Optional): [
@@ -827,19 +1290,24 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *         orderby (Optional): [
      *             String (Optional)
      *         ]
-     *         queryType: String(simple/full/semantic) (Optional)
+     *         queryType: String(simple/full/semantic/agentic) (Optional)
+     *         agenticOptions (Optional): {
+     *             maxRuntimeInSeconds: Integer (Optional)
+     *         }
      *         scoringStatistics: String(local/global) (Optional)
      *         sessionId: String (Optional)
      *         scoringParameters (Optional): [
      *             String (Optional)
      *         ]
      *         scoringProfile: String (Optional)
-     *         debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional)
+     *         debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional)
      *         search: String (Optional)
      *         searchFields (Optional): [
      *             String (Optional)
      *         ]
      *         searchMode: String(any/all) (Optional)
+     *         queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional)
+     *         speller: String(none/lexicon) (Optional)
      *         select (Optional): [
      *             String (Optional)
      *         ]
@@ -851,17 +1319,33 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *         semanticQuery: String (Optional)
      *         answers: String(none/extractive) (Optional)
      *         captions: String(none/extractive) (Optional)
+     *         queryRewrites: String(none/generative) (Optional)
+     *         semanticFields (Optional): [
+     *             String (Optional)
+     *         ]
      *         vectorQueries (Optional): [
      *              (Optional){
-     *                 kind: String(vector/text) (Required)
+     *                 kind: String(vector/text/imageUrl/imageBinary) (Required)
      *                 k: Integer (Optional)
      *                 fields: String (Optional)
      *                 exhaustive: Boolean (Optional)
      *                 oversampling: Double (Optional)
      *                 weight: Float (Optional)
+     *                 threshold (Optional): {
+     *                     kind: String(vectorSimilarity/searchScore) (Required)
+     *                 }
+     *                 filterOverride: String (Optional)
+     *                 perDocumentVectorLimit: Integer (Optional)
+     *                 topicGraph (Optional): {
+     *                     kind: String(none/diverse/balanced) (Required)
+     *                 }
      *             }
      *         ]
-     *         vectorFilterMode: String(postFilter/preFilter) (Optional)
+     *         vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional)
+     *         hybridSearch (Optional): {
+     *             maxTextRecallSize: Integer (Optional)
+     *             countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional)
+     *         }
      *     }
      *     value (Required): [
      *          (Required){
@@ -883,6 +1367,23 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *                 }
      *             ]
      *             @search.documentDebugInfo (Optional): {
+     *                 semantic (Optional): {
+     *                     titleField (Optional): {
+     *                         name: String (Optional)
+     *                         state: String(used/unused/partial) (Optional)
+     *                     }
+     *                     contentFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     keywordFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     rerankerInput (Optional): {
+     *                         title: String (Optional)
+     *                         content: String (Optional)
+     *                         keywords: String (Optional)
+     *                     }
+     *                 }
      *                 vectors (Optional): {
      *                     subscores (Optional): {
      *                         text (Optional): {
@@ -899,6 +1400,18 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *                         documentBoost: Double (Optional)
      *                     }
      *                 }
+     *                 innerHits (Optional): {
+     *                     String (Required): [
+     *                          (Required){
+     *                             ordinal: Long (Optional)
+     *                             vectors (Optional): [
+     *                                  (Optional){
+     *                                     String (Required): (recursive schema, see String above)
+     *                                 }
+     *                             ]
+     *                         }
+     *                     ]
+     *                 }
      *             }
      *              (Optional): {
      *                 String: Object (Required)
@@ -908,10 +1421,11 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      *     @odata.nextLink: String (Optional)
      *     @search.semanticPartialResponseReason: String(maxWaitExceeded/capacityOverloaded/transient) (Optional)
      *     @search.semanticPartialResponseType: String(baseResults/rerankedResults) (Optional)
+     *     @search.semanticQueryRewritesResultType: String(originalQueryOnly) (Optional)
      * }
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -939,7 +1453,7 @@ public Response searchGetWithResponse(RequestOptions requestOptions) * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -958,19 +1472,24 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *     orderby (Optional): [
      *         String (Optional)
      *     ]
-     *     queryType: String(simple/full/semantic) (Optional)
+     *     queryType: String(simple/full/semantic/agentic) (Optional)
+     *     agenticOptions (Optional): {
+     *         maxRuntimeInSeconds: Integer (Optional)
+     *     }
      *     scoringStatistics: String(local/global) (Optional)
      *     sessionId: String (Optional)
      *     scoringParameters (Optional): [
      *         String (Optional)
      *     ]
      *     scoringProfile: String (Optional)
-     *     debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional)
+     *     debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional)
      *     search: String (Optional)
      *     searchFields (Optional): [
      *         String (Optional)
      *     ]
      *     searchMode: String(any/all) (Optional)
+     *     queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional)
+     *     speller: String(none/lexicon) (Optional)
      *     select (Optional): [
      *         String (Optional)
      *     ]
@@ -982,23 +1501,39 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *     semanticQuery: String (Optional)
      *     answers: String(none/extractive) (Optional)
      *     captions: String(none/extractive) (Optional)
+     *     queryRewrites: String(none/generative) (Optional)
+     *     semanticFields (Optional): [
+     *         String (Optional)
+     *     ]
      *     vectorQueries (Optional): [
      *          (Optional){
-     *             kind: String(vector/text) (Required)
+     *             kind: String(vector/text/imageUrl/imageBinary) (Required)
      *             k: Integer (Optional)
      *             fields: String (Optional)
      *             exhaustive: Boolean (Optional)
      *             oversampling: Double (Optional)
      *             weight: Float (Optional)
+     *             threshold (Optional): {
+     *                 kind: String(vectorSimilarity/searchScore) (Required)
+     *             }
+     *             filterOverride: String (Optional)
+     *             perDocumentVectorLimit: Integer (Optional)
+     *             topicGraph (Optional): {
+     *                 kind: String(none/diverse/balanced) (Required)
+     *             }
      *         }
      *     ]
-     *     vectorFilterMode: String(postFilter/preFilter) (Optional)
+     *     vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional)
+     *     hybridSearch (Optional): {
+     *         maxTextRecallSize: Integer (Optional)
+     *         countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional)
+     *     }
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1008,6 +1543,16 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *         String (Required): [
      *              (Required){
      *                 count: Long (Optional)
+     *                 avg: Double (Optional)
+     *                 min: Double (Optional)
+     *                 max: Double (Optional)
+     *                 sum: Double (Optional)
+     *                 cardinality: Long (Optional)
+     *                 @search.facets (Optional): {
+     *                     String (Required): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
      *                  (Optional): {
      *                     String: Object (Required)
      *                 }
@@ -1025,6 +1570,32 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *             }
      *         }
      *     ]
+     *     @search.debug (Optional): {
+     *         queryRewrites (Optional): {
+     *             text (Optional): {
+     *                 inputQuery: String (Optional)
+     *                 rewrites (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *             vectors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         agentic (Optional): {
+     *             terminationReason: String(modelStopped/maxRuntimeExceeded/modelFailed) (Optional)
+     *             subQueries (Optional): [
+     *                  (Optional){
+     *                     search: String (Required)
+     *                     iteration: int (Required)
+     *                 }
+     *             ]
+     *             usage (Optional): {
+     *                 agenticPlanningTokens: long (Required)
+     *                 reasoningTokens: long (Required)
+     *             }
+     *         }
+     *     }
      *     @search.nextPageParameters (Optional): {
      *         count: Boolean (Optional)
      *         facets (Optional): [
@@ -1041,19 +1612,24 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *         orderby (Optional): [
      *             String (Optional)
      *         ]
-     *         queryType: String(simple/full/semantic) (Optional)
+     *         queryType: String(simple/full/semantic/agentic) (Optional)
+     *         agenticOptions (Optional): {
+     *             maxRuntimeInSeconds: Integer (Optional)
+     *         }
      *         scoringStatistics: String(local/global) (Optional)
      *         sessionId: String (Optional)
      *         scoringParameters (Optional): [
      *             String (Optional)
      *         ]
      *         scoringProfile: String (Optional)
-     *         debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional)
+     *         debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional)
      *         search: String (Optional)
      *         searchFields (Optional): [
      *             String (Optional)
      *         ]
      *         searchMode: String(any/all) (Optional)
+     *         queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional)
+     *         speller: String(none/lexicon) (Optional)
      *         select (Optional): [
      *             String (Optional)
      *         ]
@@ -1065,17 +1641,33 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *         semanticQuery: String (Optional)
      *         answers: String(none/extractive) (Optional)
      *         captions: String(none/extractive) (Optional)
+     *         queryRewrites: String(none/generative) (Optional)
+     *         semanticFields (Optional): [
+     *             String (Optional)
+     *         ]
      *         vectorQueries (Optional): [
      *              (Optional){
-     *                 kind: String(vector/text) (Required)
+     *                 kind: String(vector/text/imageUrl/imageBinary) (Required)
      *                 k: Integer (Optional)
      *                 fields: String (Optional)
      *                 exhaustive: Boolean (Optional)
      *                 oversampling: Double (Optional)
      *                 weight: Float (Optional)
+     *                 threshold (Optional): {
+     *                     kind: String(vectorSimilarity/searchScore) (Required)
+     *                 }
+     *                 filterOverride: String (Optional)
+     *                 perDocumentVectorLimit: Integer (Optional)
+     *                 topicGraph (Optional): {
+     *                     kind: String(none/diverse/balanced) (Required)
+     *                 }
      *             }
      *         ]
-     *         vectorFilterMode: String(postFilter/preFilter) (Optional)
+     *         vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional)
+     *         hybridSearch (Optional): {
+     *             maxTextRecallSize: Integer (Optional)
+     *             countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional)
+     *         }
      *     }
      *     value (Required): [
      *          (Required){
@@ -1097,6 +1689,23 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *                 }
      *             ]
      *             @search.documentDebugInfo (Optional): {
+     *                 semantic (Optional): {
+     *                     titleField (Optional): {
+     *                         name: String (Optional)
+     *                         state: String(used/unused/partial) (Optional)
+     *                     }
+     *                     contentFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     keywordFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     rerankerInput (Optional): {
+     *                         title: String (Optional)
+     *                         content: String (Optional)
+     *                         keywords: String (Optional)
+     *                     }
+     *                 }
      *                 vectors (Optional): {
      *                     subscores (Optional): {
      *                         text (Optional): {
@@ -1113,6 +1722,18 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *                         documentBoost: Double (Optional)
      *                     }
      *                 }
+     *                 innerHits (Optional): {
+     *                     String (Required): [
+     *                          (Required){
+     *                             ordinal: Long (Optional)
+     *                             vectors (Optional): [
+     *                                  (Optional){
+     *                                     String (Required): (recursive schema, see String above)
+     *                                 }
+     *                             ]
+     *                         }
+     *                     ]
+     *                 }
      *             }
      *              (Optional): {
      *                 String: Object (Required)
@@ -1122,10 +1743,11 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      *     @odata.nextLink: String (Optional)
      *     @search.semanticPartialResponseReason: String(maxWaitExceeded/capacityOverloaded/transient) (Optional)
      *     @search.semanticPartialResponseType: String(baseResults/rerankedResults) (Optional)
+     *     @search.semanticQueryRewritesResultType: String(originalQueryOnly) (Optional)
      * }
      * }
      * 
- * + * * @param searchPostRequest The searchPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1157,7 +1779,7 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1176,19 +1798,24 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *     orderby (Optional): [
      *         String (Optional)
      *     ]
-     *     queryType: String(simple/full/semantic) (Optional)
+     *     queryType: String(simple/full/semantic/agentic) (Optional)
+     *     agenticOptions (Optional): {
+     *         maxRuntimeInSeconds: Integer (Optional)
+     *     }
      *     scoringStatistics: String(local/global) (Optional)
      *     sessionId: String (Optional)
      *     scoringParameters (Optional): [
      *         String (Optional)
      *     ]
      *     scoringProfile: String (Optional)
-     *     debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional)
+     *     debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional)
      *     search: String (Optional)
      *     searchFields (Optional): [
      *         String (Optional)
      *     ]
      *     searchMode: String(any/all) (Optional)
+     *     queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional)
+     *     speller: String(none/lexicon) (Optional)
      *     select (Optional): [
      *         String (Optional)
      *     ]
@@ -1200,23 +1827,39 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *     semanticQuery: String (Optional)
      *     answers: String(none/extractive) (Optional)
      *     captions: String(none/extractive) (Optional)
+     *     queryRewrites: String(none/generative) (Optional)
+     *     semanticFields (Optional): [
+     *         String (Optional)
+     *     ]
      *     vectorQueries (Optional): [
      *          (Optional){
-     *             kind: String(vector/text) (Required)
+     *             kind: String(vector/text/imageUrl/imageBinary) (Required)
      *             k: Integer (Optional)
      *             fields: String (Optional)
      *             exhaustive: Boolean (Optional)
      *             oversampling: Double (Optional)
      *             weight: Float (Optional)
+     *             threshold (Optional): {
+     *                 kind: String(vectorSimilarity/searchScore) (Required)
+     *             }
+     *             filterOverride: String (Optional)
+     *             perDocumentVectorLimit: Integer (Optional)
+     *             topicGraph (Optional): {
+     *                 kind: String(none/diverse/balanced) (Required)
+     *             }
      *         }
      *     ]
-     *     vectorFilterMode: String(postFilter/preFilter) (Optional)
+     *     vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional)
+     *     hybridSearch (Optional): {
+     *         maxTextRecallSize: Integer (Optional)
+     *         countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional)
+     *     }
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1226,6 +1869,16 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *         String (Required): [
      *              (Required){
      *                 count: Long (Optional)
+     *                 avg: Double (Optional)
+     *                 min: Double (Optional)
+     *                 max: Double (Optional)
+     *                 sum: Double (Optional)
+     *                 cardinality: Long (Optional)
+     *                 @search.facets (Optional): {
+     *                     String (Required): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
      *                  (Optional): {
      *                     String: Object (Required)
      *                 }
@@ -1243,6 +1896,32 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *             }
      *         }
      *     ]
+     *     @search.debug (Optional): {
+     *         queryRewrites (Optional): {
+     *             text (Optional): {
+     *                 inputQuery: String (Optional)
+     *                 rewrites (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *             vectors (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         agentic (Optional): {
+     *             terminationReason: String(modelStopped/maxRuntimeExceeded/modelFailed) (Optional)
+     *             subQueries (Optional): [
+     *                  (Optional){
+     *                     search: String (Required)
+     *                     iteration: int (Required)
+     *                 }
+     *             ]
+     *             usage (Optional): {
+     *                 agenticPlanningTokens: long (Required)
+     *                 reasoningTokens: long (Required)
+     *             }
+     *         }
+     *     }
      *     @search.nextPageParameters (Optional): {
      *         count: Boolean (Optional)
      *         facets (Optional): [
@@ -1259,19 +1938,24 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *         orderby (Optional): [
      *             String (Optional)
      *         ]
-     *         queryType: String(simple/full/semantic) (Optional)
+     *         queryType: String(simple/full/semantic/agentic) (Optional)
+     *         agenticOptions (Optional): {
+     *             maxRuntimeInSeconds: Integer (Optional)
+     *         }
      *         scoringStatistics: String(local/global) (Optional)
      *         sessionId: String (Optional)
      *         scoringParameters (Optional): [
      *             String (Optional)
      *         ]
      *         scoringProfile: String (Optional)
-     *         debug: String(disabled/semantic/vector/queryRewrites/innerHits/all) (Optional)
+     *         debug: String(disabled/semantic/vector/queryRewrites/agentic/innerHits/all) (Optional)
      *         search: String (Optional)
      *         searchFields (Optional): [
      *             String (Optional)
      *         ]
      *         searchMode: String(any/all) (Optional)
+     *         queryLanguage: String(none/en-us/en-gb/en-in/en-ca/en-au/fr-fr/fr-ca/de-de/es-es/es-mx/zh-cn/zh-tw/pt-br/pt-pt/it-it/ja-jp/ko-kr/ru-ru/cs-cz/nl-be/nl-nl/hu-hu/pl-pl/sv-se/tr-tr/hi-in/ar-sa/ar-eg/ar-ma/ar-kw/ar-jo/da-dk/no-no/bg-bg/hr-hr/hr-ba/ms-my/ms-bn/sl-sl/ta-in/vi-vn/el-gr/ro-ro/is-is/id-id/th-th/lt-lt/uk-ua/lv-lv/et-ee/ca-es/fi-fi/sr-ba/sr-me/sr-rs/sk-sk/nb-no/hy-am/bn-in/eu-es/gl-es/gu-in/he-il/ga-ie/kn-in/ml-in/mr-in/fa-ae/pa-in/te-in/ur-pk) (Optional)
+     *         speller: String(none/lexicon) (Optional)
      *         select (Optional): [
      *             String (Optional)
      *         ]
@@ -1283,17 +1967,33 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *         semanticQuery: String (Optional)
      *         answers: String(none/extractive) (Optional)
      *         captions: String(none/extractive) (Optional)
+     *         queryRewrites: String(none/generative) (Optional)
+     *         semanticFields (Optional): [
+     *             String (Optional)
+     *         ]
      *         vectorQueries (Optional): [
      *              (Optional){
-     *                 kind: String(vector/text) (Required)
+     *                 kind: String(vector/text/imageUrl/imageBinary) (Required)
      *                 k: Integer (Optional)
      *                 fields: String (Optional)
      *                 exhaustive: Boolean (Optional)
      *                 oversampling: Double (Optional)
      *                 weight: Float (Optional)
+     *                 threshold (Optional): {
+     *                     kind: String(vectorSimilarity/searchScore) (Required)
+     *                 }
+     *                 filterOverride: String (Optional)
+     *                 perDocumentVectorLimit: Integer (Optional)
+     *                 topicGraph (Optional): {
+     *                     kind: String(none/diverse/balanced) (Required)
+     *                 }
      *             }
      *         ]
-     *         vectorFilterMode: String(postFilter/preFilter) (Optional)
+     *         vectorFilterMode: String(postFilter/preFilter/strictPostFilter) (Optional)
+     *         hybridSearch (Optional): {
+     *             maxTextRecallSize: Integer (Optional)
+     *             countAndFacetMode: String(countRetrievableResults/countAllResults) (Optional)
+     *         }
      *     }
      *     value (Required): [
      *          (Required){
@@ -1315,6 +2015,23 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *                 }
      *             ]
      *             @search.documentDebugInfo (Optional): {
+     *                 semantic (Optional): {
+     *                     titleField (Optional): {
+     *                         name: String (Optional)
+     *                         state: String(used/unused/partial) (Optional)
+     *                     }
+     *                     contentFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     keywordFields (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     rerankerInput (Optional): {
+     *                         title: String (Optional)
+     *                         content: String (Optional)
+     *                         keywords: String (Optional)
+     *                     }
+     *                 }
      *                 vectors (Optional): {
      *                     subscores (Optional): {
      *                         text (Optional): {
@@ -1331,6 +2048,18 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *                         documentBoost: Double (Optional)
      *                     }
      *                 }
+     *                 innerHits (Optional): {
+     *                     String (Required): [
+     *                          (Required){
+     *                             ordinal: Long (Optional)
+     *                             vectors (Optional): [
+     *                                  (Optional){
+     *                                     String (Required): (recursive schema, see String above)
+     *                                 }
+     *                             ]
+     *                         }
+     *                     ]
+     *                 }
      *             }
      *              (Optional): {
      *                 String: Object (Required)
@@ -1340,10 +2069,11 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      *     @odata.nextLink: String (Optional)
      *     @search.semanticPartialResponseReason: String(maxWaitExceeded/capacityOverloaded/transient) (Optional)
      *     @search.semanticPartialResponseType: String(baseResults/rerankedResults) (Optional)
+     *     @search.semanticQueryRewritesResultType: String(originalQueryOnly) (Optional)
      * }
      * }
      * 
- * + * * @param searchPostRequest The searchPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1392,7 +2122,7 @@ public Response searchWithResponse(BinaryData searchPostRequest, Req * } * } * - * + * * @param key The key of the document to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1403,9 +2133,10 @@ public Response searchWithResponse(BinaryData searchPostRequest, Req * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - @Generated public Mono> getDocumentWithResponseAsync(String key, RequestOptions requestOptions) { - return getDocumentWithResponseAsync(key, null, requestOptions); + final String accept = "application/json;odata.metadata=none"; + return FluxUtil.withContext(context -> service.getDocument(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getIndexName(), accept, key, requestOptions, context)); } /** @@ -1440,7 +2171,7 @@ public Mono> getDocumentWithResponseAsync(String key, Reque * } * } * - * + * * @param key The key of the document to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1450,9 +2181,10 @@ public Mono> getDocumentWithResponseAsync(String key, Reque * @return a document retrieved via a document lookup operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - @Generated public Response getDocumentWithResponse(String key, RequestOptions requestOptions) { - return getDocumentWithResponse(key, null, requestOptions); + final String accept = "application/json;odata.metadata=none"; + return service.getDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), + accept, key, requestOptions, Context.NONE); } /** @@ -1491,7 +2223,7 @@ public Response getDocumentWithResponse(String key, RequestOptions r * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1507,7 +2239,7 @@ public Response getDocumentWithResponse(String key, RequestOptions r
      * }
      * }
      * 
- * + * * @param searchText The search text to use to suggest documents. Must be at least 1 character, and no more than 100 * characters. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index @@ -1565,7 +2297,7 @@ public Mono> suggestGetWithResponseAsync(String searchText, * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1581,7 +2313,7 @@ public Mono> suggestGetWithResponseAsync(String searchText,
      * }
      * }
      * 
- * + * * @param searchText The search text to use to suggest documents. Must be at least 1 character, and no more than 100 * characters. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index @@ -1604,7 +2336,7 @@ public Response suggestGetWithResponse(String searchText, String sug /** * Suggests documents in the index that match the given partial query text. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1628,9 +2360,9 @@ public Response suggestGetWithResponse(String searchText, String sug
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1646,7 +2378,7 @@ public Response suggestGetWithResponse(String searchText, String sug
      * }
      * }
      * 
- * + * * @param suggestPostRequest The suggestPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1669,7 +2401,7 @@ public Mono> suggestWithResponseAsync(BinaryData suggestPos /** * Suggests documents in the index that match the given partial query text. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1693,9 +2425,9 @@ public Mono> suggestWithResponseAsync(BinaryData suggestPos
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1711,7 +2443,7 @@ public Mono> suggestWithResponseAsync(BinaryData suggestPos
      * }
      * }
      * 
- * + * * @param suggestPostRequest The suggestPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1731,7 +2463,7 @@ public Response suggestWithResponse(BinaryData suggestPostRequest, R /** * Sends a batch of document write actions to the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1746,9 +2478,9 @@ public Response suggestWithResponse(BinaryData suggestPostRequest, R
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1763,7 +2495,7 @@ public Response suggestWithResponse(BinaryData suggestPostRequest, R
      * }
      * }
      * 
- * + * * @param batch The batch of index actions. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1784,7 +2516,7 @@ public Mono> indexWithResponseAsync(BinaryData batch, Reque /** * Sends a batch of document write actions to the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1799,9 +2531,9 @@ public Mono> indexWithResponseAsync(BinaryData batch, Reque
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1816,7 +2548,7 @@ public Mono> indexWithResponseAsync(BinaryData batch, Reque
      * }
      * }
      * 
- * + * * @param batch The batch of index actions. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1865,7 +2597,7 @@ public Response indexWithResponse(BinaryData batch, RequestOptions r * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1879,7 +2611,7 @@ public Response indexWithResponse(BinaryData batch, RequestOptions r
      * }
      * }
      * 
- * + * * @param searchText The incomplete term which should be auto-completed. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index * definition. @@ -1930,7 +2662,7 @@ public Mono> autocompleteGetWithResponseAsync(String search * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1944,7 +2676,7 @@ public Mono> autocompleteGetWithResponseAsync(String search
      * }
      * }
      * 
- * + * * @param searchText The incomplete term which should be auto-completed. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index * definition. @@ -1966,7 +2698,7 @@ public Response autocompleteGetWithResponse(String searchText, Strin /** * Autocompletes incomplete query terms based on input text and matching terms in the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1985,9 +2717,9 @@ public Response autocompleteGetWithResponse(String searchText, Strin
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2001,7 +2733,7 @@ public Response autocompleteGetWithResponse(String searchText, Strin
      * }
      * }
      * 
- * + * * @param autocompletePostRequest The autocompletePostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2023,7 +2755,7 @@ public Mono> autocompleteWithResponseAsync(BinaryData autoc /** * Autocompletes incomplete query terms based on input text and matching terms in the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2042,9 +2774,9 @@ public Mono> autocompleteWithResponseAsync(BinaryData autoc
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2058,7 +2790,7 @@ public Mono> autocompleteWithResponseAsync(BinaryData autoc
      * }
      * }
      * 
- * + * * @param autocompletePostRequest The autocompletePostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2075,106 +2807,4 @@ public Response autocompleteWithResponse(BinaryData autocompletePost return service.autocompleteSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), accept, contentType, autocompletePostRequest, requestOptions, Context.NONE); } - - /** - * Retrieves a document from the index. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
$selectList<String>NoList of field names to retrieve for the document; - * Any field not retrieved will be missing from the returned document. In the form of "," separated - * string.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which - * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that - * bypass document level permission checks for the query operation.
- * You can add these to a request with {@link RequestOptions#addHeader} - * - * @param key The key of the document to retrieve. - * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be - * null. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion - * of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDocumentWithResponseAsync(String key, GetDocumentOptions options, - RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=none"; - final String querySourceAuthorization = options == null ? null : options.getQuerySourceAuthorization(); - final Boolean enableElevatedRead = options == null ? null : options.isEnableElevatedRead(); - final String selectedFields = options == null || options.getSelectedFields() == null - ? null - : options.getSelectedFields() - .stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - final RequestOptions effectiveOptions = requestOptions == null ? new RequestOptions() : requestOptions; - return FluxUtil.withContext(context -> service.getDocument(this.getEndpoint(), - this.getServiceVersion().getVersion(), this.getIndexName(), accept, key, querySourceAuthorization, - enableElevatedRead, selectedFields, effectiveOptions, context)); - } - - /** - * Retrieves a document from the index. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
$selectList<String>NoList of field names to retrieve for the document; - * Any field not retrieved will be missing from the returned document. In the form of "," separated - * string.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which - * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that - * bypass document level permission checks for the query operation.
- * You can add these to a request with {@link RequestOptions#addHeader} - * - * @param key The key of the document to retrieve. - * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be - * null. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a document retrieved via a document lookup operation along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDocumentWithResponse(String key, GetDocumentOptions options, - RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=none"; - final String querySourceAuthorization = options == null ? null : options.getQuerySourceAuthorization(); - final Boolean enableElevatedRead = options == null ? null : options.isEnableElevatedRead(); - final String selectedFields = options == null || options.getSelectedFields() == null - ? null - : options.getSelectedFields() - .stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - final RequestOptions effectiveOptions = requestOptions == null ? new RequestOptions() : requestOptions; - return service.getDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), - accept, key, querySourceAuthorization, enableElevatedRead, selectedFields, effectiveOptions, Context.NONE); - } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java index c728788a5a07b..ac2415dace0bb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java @@ -37,9 +37,16 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.TypeReference; import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; +import java.time.Duration; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -758,6 +765,30 @@ Response getKnowledgeSourceStatusSync(@HostParam("endpoint") String @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Post("/knowledgesources('{sourceName}')/files") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadKnowledgeSourceFile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("content-type") String contentType, + @HeaderParam("Content-Disposition") String contentDisposition, @HeaderParam("Accept") String accept, + @BodyParam("application/octet-stream") BinaryData file, RequestOptions requestOptions, Context context); + + @Post("/knowledgesources('{sourceName}')/files") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uploadKnowledgeSourceFileSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("content-type") String contentType, + @HeaderParam("Content-Disposition") String contentDisposition, @HeaderParam("Accept") String accept, + @BodyParam("application/octet-stream") BinaryData file, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy @Post("/knowledgesources('{sourceName}')/files") @ExpectedResponses({ 201 }) @@ -782,6 +813,30 @@ Response uploadKnowledgeSourceFileMultipartSync(@HostParam("endpoint @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy + @Post("/knowledgesources('{sourceName}')/files:ingest") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> ingestKnowledgeSourceFileMultipart(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/knowledgesources('{sourceName}')/files:ingest") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response ingestKnowledgeSourceFileMultipartSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + @Get("/knowledgesources('{sourceName}')/files") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -848,6 +903,74 @@ Response updateKnowledgeSourceFileSync(@HostParam("endpoint") String @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy + @Post("/knowledgesources('{sourceName}')/files('{fileId}'):ingest") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> ingestKnowledgeSourceFileReplacement(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @PathParam("fileId") String fileId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/knowledgesources('{sourceName}')/files('{fileId}'):ingest") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response ingestKnowledgeSourceFileReplacementSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @PathParam("fileId") String fileId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + @Get("/knowledgesources('{sourceName}')/files/operations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getKnowledgeSourceFileIngestionOperation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("Accept") String accept, @PathParam("operationId") String operationId, + RequestOptions requestOptions, Context context); + + @Get("/knowledgesources('{sourceName}')/files/operations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getKnowledgeSourceFileIngestionOperationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("Accept") String accept, @PathParam("operationId") String operationId, + RequestOptions requestOptions, Context context); + + @Get("/knowledgesources('{sourceName}')/files/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listKnowledgeSourceFileIngestionOperations(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/knowledgesources('{sourceName}')/files/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listKnowledgeSourceFileIngestionOperationsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("sourceName") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Get("/servicestats") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -1028,6 +1151,26 @@ Response listKnowledgeSourceFilesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listKnowledgeSourceFileIngestionOperationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listKnowledgeSourceFileIngestionOperationsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -1082,6 +1225,7 @@ Response listIndexStatsSummaryNextSync( * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1109,6 +1253,7 @@ Response listIndexStatsSummaryNextSync( * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1168,6 +1313,7 @@ public Mono> createOrUpdateSynonymMapWithResponseAsync(Stri * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1195,6 +1341,7 @@ public Mono> createOrUpdateSynonymMapWithResponseAsync(Stri * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1297,6 +1444,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1341,6 +1489,7 @@ public Mono> getSynonymMapWithResponseAsync(String name, Re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1400,6 +1549,7 @@ public Response getSynonymMapWithResponse(String name, RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1462,6 +1612,7 @@ private Mono> listSynonymMapsSinglePageAsync(RequestOp * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1522,6 +1673,7 @@ public PagedFlux listSynonymMapsAsync(RequestOptions requestOptions) * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1582,6 +1734,7 @@ private PagedResponse listSynonymMapsSinglePage(RequestOptions reque * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1627,6 +1780,7 @@ public PagedIterable listSynonymMaps(RequestOptions requestOptions) * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1654,6 +1808,7 @@ public PagedIterable listSynonymMaps(RequestOptions requestOptions) * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1700,6 +1855,7 @@ public Mono> createSynonymMapWithResponseAsync(BinaryData s * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1727,6 +1883,7 @@ public Mono> createSynonymMapWithResponseAsync(BinaryData s * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -1789,8 +1946,11 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -1798,6 +1958,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -1807,6 +1968,34 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -1818,8 +2007,6 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -1883,6 +2070,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -1904,6 +2092,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -1924,7 +2113,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -1940,13 +2129,27 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -1970,8 +2173,11 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -1979,6 +2185,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -1988,6 +2195,34 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -1999,8 +2234,6 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -2064,6 +2297,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -2085,6 +2319,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -2105,7 +2340,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -2121,13 +2356,27 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -2193,8 +2442,11 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -2202,6 +2454,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -2211,6 +2464,34 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -2222,8 +2503,6 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -2287,6 +2566,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -2308,6 +2588,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -2328,7 +2609,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -2344,13 +2625,27 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -2374,8 +2669,11 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -2383,6 +2681,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -2392,6 +2691,34 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -2403,8 +2730,6 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -2468,6 +2793,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -2489,6 +2815,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -2509,7 +2836,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -2525,13 +2852,27 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -2635,8 +2976,11 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -2644,6 +2988,7 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -2653,6 +2998,34 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -2664,8 +3037,6 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -2729,6 +3100,7 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -2750,6 +3122,7 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -2770,7 +3143,7 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -2786,13 +3159,27 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -2834,8 +3221,11 @@ public Mono> getIndexWithResponseAsync(String name, Request * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -2843,6 +3233,7 @@ public Mono> getIndexWithResponseAsync(String name, Request * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -2852,6 +3243,34 @@ public Mono> getIndexWithResponseAsync(String name, Request * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -2863,8 +3282,6 @@ public Mono> getIndexWithResponseAsync(String name, Request * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -2928,6 +3345,7 @@ public Mono> getIndexWithResponseAsync(String name, Request * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -2949,6 +3367,7 @@ public Mono> getIndexWithResponseAsync(String name, Request * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -2969,7 +3388,7 @@ public Mono> getIndexWithResponseAsync(String name, Request * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -2985,13 +3404,27 @@ public Mono> getIndexWithResponseAsync(String name, Request * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -3045,8 +3478,11 @@ public Response getIndexWithResponse(String name, RequestOptions req * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -3054,6 +3490,7 @@ public Response getIndexWithResponse(String name, RequestOptions req * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -3063,6 +3500,34 @@ public Response getIndexWithResponse(String name, RequestOptions req * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -3074,8 +3539,6 @@ public Response getIndexWithResponse(String name, RequestOptions req * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -3139,6 +3602,7 @@ public Response getIndexWithResponse(String name, RequestOptions req * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -3160,6 +3624,7 @@ public Response getIndexWithResponse(String name, RequestOptions req * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -3180,7 +3645,7 @@ public Response getIndexWithResponse(String name, RequestOptions req * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -3196,13 +3661,27 @@ public Response getIndexWithResponse(String name, RequestOptions req * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -3258,8 +3737,11 @@ private Mono> listIndexesSinglePageAsync(RequestOption * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -3267,6 +3749,7 @@ private Mono> listIndexesSinglePageAsync(RequestOption * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -3276,6 +3759,34 @@ private Mono> listIndexesSinglePageAsync(RequestOption * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -3287,8 +3798,6 @@ private Mono> listIndexesSinglePageAsync(RequestOption * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -3352,6 +3861,7 @@ private Mono> listIndexesSinglePageAsync(RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -3373,6 +3883,7 @@ private Mono> listIndexesSinglePageAsync(RequestOption * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -3393,7 +3904,7 @@ private Mono> listIndexesSinglePageAsync(RequestOption * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -3409,13 +3920,27 @@ private Mono> listIndexesSinglePageAsync(RequestOption * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -3469,8 +3994,11 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -3478,6 +4006,7 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -3487,6 +4016,34 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -3498,8 +4055,6 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -3563,6 +4118,7 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -3584,6 +4140,7 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -3604,7 +4161,7 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -3620,13 +4177,27 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -3680,8 +4251,11 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -3689,6 +4263,7 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -3698,6 +4273,34 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -3709,8 +4312,6 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -3774,6 +4375,7 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -3795,6 +4397,7 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -3815,7 +4418,7 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -3831,13 +4434,27 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -3894,8 +4511,11 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -3903,6 +4523,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -3912,6 +4533,34 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -3923,8 +4572,6 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -3988,6 +4635,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -4009,6 +4657,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -4029,7 +4678,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -4045,13 +4694,27 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -4111,8 +4774,11 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -4120,6 +4786,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -4129,6 +4796,34 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -4140,8 +4835,6 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -4205,6 +4898,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -4226,6 +4920,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -4246,7 +4941,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -4262,13 +4957,27 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -4325,8 +5034,11 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -4334,6 +5046,7 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -4343,6 +5056,34 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -4354,8 +5095,6 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -4419,6 +5158,7 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -4440,6 +5180,7 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -4460,7 +5201,7 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -4476,13 +5217,27 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -4539,8 +5294,11 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -4548,6 +5306,7 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -4557,6 +5316,34 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -4568,8 +5355,6 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -4633,6 +5418,7 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -4654,6 +5440,7 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -4674,7 +5461,7 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -4690,13 +5477,27 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -4738,8 +5539,11 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -4747,6 +5551,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -4756,6 +5561,34 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -4767,8 +5600,6 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -4832,6 +5663,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -4853,6 +5685,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -4873,7 +5706,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -4889,13 +5722,27 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -4919,8 +5766,11 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -4928,6 +5778,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -4937,6 +5788,34 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -4948,8 +5827,6 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -5013,6 +5890,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -5034,6 +5912,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -5054,7 +5933,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -5070,13 +5949,27 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -5119,8 +6012,11 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -5128,6 +6024,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -5137,6 +6034,34 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -5148,8 +6073,6 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -5213,6 +6136,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -5234,6 +6158,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -5254,7 +6179,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -5270,13 +6195,27 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -5300,8 +6239,11 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -5309,6 +6251,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -5318,6 +6261,34 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -5329,8 +6300,6 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -5394,6 +6363,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -5415,6 +6385,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -5435,7 +6406,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -5451,13 +6422,27 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -6184,16 +7169,40 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6207,8 +7216,12 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6217,6 +7230,7 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6230,16 +7244,40 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6253,8 +7291,12 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6263,6 +7305,7 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6309,16 +7352,40 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6332,8 +7399,12 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6342,6 +7413,7 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6355,16 +7427,40 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6378,8 +7474,12 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6388,6 +7488,7 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6476,16 +7577,40 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6499,8 +7624,12 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6509,6 +7638,7 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6540,16 +7670,40 @@ public Mono> getKnowledgeBaseWithResponseAsync(String name, * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6563,8 +7717,12 @@ public Mono> getKnowledgeBaseWithResponseAsync(String name, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6573,6 +7731,7 @@ public Mono> getKnowledgeBaseWithResponseAsync(String name, * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6615,16 +7774,40 @@ public Response getKnowledgeBaseWithResponse(String name, RequestOpt * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6638,8 +7821,12 @@ public Response getKnowledgeBaseWithResponse(String name, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6648,6 +7835,7 @@ public Response getKnowledgeBaseWithResponse(String name, RequestOpt * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6693,16 +7881,40 @@ private Mono> listKnowledgeBasesSinglePageAsync(Reques * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6716,8 +7928,12 @@ private Mono> listKnowledgeBasesSinglePageAsync(Reques * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6726,6 +7942,7 @@ private Mono> listKnowledgeBasesSinglePageAsync(Reques * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6769,16 +7986,40 @@ public PagedFlux listKnowledgeBasesAsync(RequestOptions requestOptio * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6792,8 +8033,12 @@ public PagedFlux listKnowledgeBasesAsync(RequestOptions requestOptio * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6802,6 +8047,7 @@ public PagedFlux listKnowledgeBasesAsync(RequestOptions requestOptio * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6845,16 +8091,40 @@ private PagedResponse listKnowledgeBasesSinglePage(RequestOptions re * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6868,8 +8138,12 @@ private PagedResponse listKnowledgeBasesSinglePage(RequestOptions re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6878,6 +8152,7 @@ private PagedResponse listKnowledgeBasesSinglePage(RequestOptions re * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6909,16 +8184,40 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6932,8 +8231,12 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6942,6 +8245,7 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -6955,16 +8259,40 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -6978,8 +8306,12 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -6988,6 +8320,7 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -7021,16 +8354,40 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -7044,8 +8401,12 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -7054,6 +8415,7 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -7067,16 +8429,40 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -7090,8 +8476,12 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -7100,6 +8490,7 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -7138,9 +8529,10 @@ public Response createKnowledgeBaseWithResponse(BinaryData knowledge *
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7153,6 +8545,7 @@ public Response createKnowledgeBaseWithResponse(BinaryData knowledge
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7163,9 +8556,10 @@ public Response createKnowledgeBaseWithResponse(BinaryData knowledge
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7178,6 +8572,7 @@ public Response createKnowledgeBaseWithResponse(BinaryData knowledge
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7221,9 +8616,10 @@ public Mono> createOrUpdateKnowledgeSourceWithResponseAsync
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7236,6 +8632,7 @@ public Mono> createOrUpdateKnowledgeSourceWithResponseAsync
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7246,9 +8643,10 @@ public Mono> createOrUpdateKnowledgeSourceWithResponseAsync
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7261,6 +8659,7 @@ public Mono> createOrUpdateKnowledgeSourceWithResponseAsync
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7346,9 +8745,10 @@ public Response deleteKnowledgeSourceWithResponse(String name, RequestOpti
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7361,6 +8761,7 @@ public Response deleteKnowledgeSourceWithResponse(String name, RequestOpti
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7389,9 +8790,10 @@ public Mono> getKnowledgeSourceWithResponseAsync(String nam
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7404,6 +8806,7 @@ public Mono> getKnowledgeSourceWithResponseAsync(String nam
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7443,9 +8846,10 @@ public Response getKnowledgeSourceWithResponse(String name, RequestO
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7458,6 +8862,7 @@ public Response getKnowledgeSourceWithResponse(String name, RequestO
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7500,9 +8905,10 @@ private Mono> listKnowledgeSourcesSinglePageAsync(Requ
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7515,6 +8921,7 @@ private Mono> listKnowledgeSourcesSinglePageAsync(Requ
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7555,9 +8962,10 @@ public PagedFlux listKnowledgeSourcesAsync(RequestOptions requestOpt
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7570,6 +8978,7 @@ public PagedFlux listKnowledgeSourcesAsync(RequestOptions requestOpt
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7610,9 +9019,10 @@ private PagedResponse listKnowledgeSourcesSinglePage(RequestOptions
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7625,6 +9035,7 @@ private PagedResponse listKnowledgeSourcesSinglePage(RequestOptions
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7653,9 +9064,10 @@ public PagedIterable listKnowledgeSources(RequestOptions requestOpti
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7668,6 +9080,7 @@ public PagedIterable listKnowledgeSources(RequestOptions requestOpti
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7678,9 +9091,10 @@ public PagedIterable listKnowledgeSources(RequestOptions requestOpti
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7693,6 +9107,7 @@ public PagedIterable listKnowledgeSources(RequestOptions requestOpti
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7723,9 +9138,10 @@ public Mono> createKnowledgeSourceWithResponseAsync(BinaryD
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7738,6 +9154,7 @@ public Mono> createKnowledgeSourceWithResponseAsync(BinaryD
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7748,9 +9165,10 @@ public Mono> createKnowledgeSourceWithResponseAsync(BinaryD
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -7763,6 +9181,7 @@ public Mono> createKnowledgeSourceWithResponseAsync(BinaryD
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -7792,10 +9211,14 @@ public Response createKnowledgeSourceWithResponse(BinaryData knowled
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Optional)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Optional)
      *     synchronizationStatus: String(creating/active/deleting) (Required)
      *     synchronizationInterval: Duration (Optional)
      *     currentSynchronizationState (Optional): {
+     *         graphStatistics (Optional): {
+     *             ontologyName: String (Optional)
+     *             triplesWritten: long (Required)
+     *         }
      *         startTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
      *         itemsUpdatesFailed: int (Required)
@@ -7812,6 +9235,7 @@ public Response createKnowledgeSourceWithResponse(BinaryData knowled
      *         ]
      *     }
      *     lastSynchronizationState (Optional): {
+     *         graphStatistics (Optional): (recursive schema, see graphStatistics above)
      *         startTime: OffsetDateTime (Required)
      *         endTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
@@ -7856,10 +9280,14 @@ public Mono> getKnowledgeSourceStatusWithResponseAsync(Stri
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Optional)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Optional)
      *     synchronizationStatus: String(creating/active/deleting) (Required)
      *     synchronizationInterval: Duration (Optional)
      *     currentSynchronizationState (Optional): {
+     *         graphStatistics (Optional): {
+     *             ontologyName: String (Optional)
+     *             triplesWritten: long (Required)
+     *         }
      *         startTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
      *         itemsUpdatesFailed: int (Required)
@@ -7876,6 +9304,7 @@ public Mono> getKnowledgeSourceStatusWithResponseAsync(Stri
      *         ]
      *     }
      *     lastSynchronizationState (Optional): {
+     *         graphStatistics (Optional): (recursive schema, see graphStatistics above)
      *         startTime: OffsetDateTime (Required)
      *         endTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
@@ -7912,8 +9341,15 @@ public Response getKnowledgeSourceStatusWithResponse(String name, Re
     }
 
     /**
-     * Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom
-     * metadata) and a 'content' part with the raw file bytes.
+     * Uploads a file to a File knowledge source for processing and indexing.
+     * 

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * *

Response Body Schema

* *
@@ -7936,7 +9372,10 @@ public Response getKnowledgeSourceStatusWithResponse(String name, Re
      * 
* * @param name The name of the knowledge source. - * @param body The multipart/form-data body containing the metadata and content parts. + * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. + * Must follow the format: `attachment; filename="<filename>"`. + * For example: `attachment; filename="installation-guide.pdf"`. + * @param file The file content to upload. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7946,17 +9385,25 @@ public Response getKnowledgeSourceStatusWithResponse(String name, Re * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadKnowledgeSourceFileMultipartWithResponseInternalAsync(String name, - BinaryData body, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + public Mono> uploadKnowledgeSourceFileWithResponseAsync(String name, String contentDisposition, + BinaryData file, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadKnowledgeSourceFileMultipart(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, contentType, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.uploadKnowledgeSourceFile(this.getEndpoint(), this.getServiceVersion().getVersion(), + name, contentType, contentDisposition, accept, file, requestOptions, context)); } /** - * Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom - * metadata) and a 'content' part with the raw file bytes. + * Uploads a file to a File knowledge source for processing and indexing. + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * *

Response Body Schema

* *
@@ -7979,7 +9426,10 @@ public Mono> uploadKnowledgeSourceFileMultipartWithResponse
      * 
* * @param name The name of the knowledge source. - * @param body The multipart/form-data body containing the metadata and content parts. + * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. + * Must follow the format: `attachment; filename="<filename>"`. + * For example: `attachment; filename="installation-guide.pdf"`. + * @param file The file content to upload. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7988,30 +9438,17 @@ public Mono> uploadKnowledgeSourceFileMultipartWithResponse * @return metadata for a file uploaded to a File knowledge source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadKnowledgeSourceFileMultipartWithResponseInternal(String name, BinaryData body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + public Response uploadKnowledgeSourceFileWithResponse(String name, String contentDisposition, + BinaryData file, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; final String accept = "application/json"; - return service.uploadKnowledgeSourceFileMultipartSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - name, contentType, accept, body, requestOptions, Context.NONE); + return service.uploadKnowledgeSourceFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, + contentType, contentDisposition, accept, file, requestOptions, Context.NONE); } /** - * Lists all files in a File knowledge source. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like - * path.
searchStringNoA string used to narrow down the listing so that fewer results - * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The - * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently - * only 'prefix' is supported. Allowed values: "prefix".
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom + * metadata) and a 'content' part with the raw file bytes. *

Response Body Schema

* *
@@ -8034,41 +9471,27 @@ public Response uploadKnowledgeSourceFileMultipartWithResponseIntern
      * 
* * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response from a List Files request along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return metadata for a file uploaded to a File knowledge source along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKnowledgeSourceFilesSinglePageAsync(String name, - RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - return FluxUtil - .withContext(context -> service.listKnowledgeSourceFiles(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null)); + public Mono> uploadKnowledgeSourceFileMultipartWithResponseInternalAsync(String name, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.uploadKnowledgeSourceFileMultipart(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, contentType, accept, body, requestOptions, context)); } /** - * Lists all files in a File knowledge source. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like - * path.
searchStringNoA string used to narrow down the listing so that fewer results - * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The - * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently - * only 'prefix' is supported. Allowed values: "prefix".
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom + * metadata) and a 'content' part with the raw file bytes. *

Response Body Schema

* *
@@ -8091,55 +9514,1213 @@ private Mono> listKnowledgeSourceFilesSinglePageAsync(
      * 
* * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response from a List Files request as paginated response with {@link PagedFlux}. + * @return metadata for a file uploaded to a File knowledge source along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listKnowledgeSourceFilesAsync(String name, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listKnowledgeSourceFilesSinglePageAsync(name, requestOptions), - nextLink -> listKnowledgeSourceFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadKnowledgeSourceFileMultipartWithResponseInternal(String name, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.uploadKnowledgeSourceFileMultipartSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + name, contentType, accept, body, requestOptions, Context.NONE); } /** - * Lists all files in a File knowledge source. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like - * path.
searchStringNoA string used to narrow down the listing so that fewer results - * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The - * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently - * only 'prefix' is supported. Allowed values: "prefix".
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. *

Response Body Schema

* *
      * {@code
      * {
-     *     fileId: String (Optional)
-     *     fileName: String (Optional)
-     *     fileSizeBytes: Long (Optional)
-     *     createdAt: OffsetDateTime (Optional)
-     *     lastUpdatedAt: OffsetDateTime (Optional)
-     *     errorMessage: String (Optional)
-     *     prefix: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return tracks asynchronous upload or replacement of a file in a knowledge source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> ingestKnowledgeSourceFileMultipartWithResponseAsync(String name, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.ingestKnowledgeSourceFileMultipart(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, contentType, accept, body, requestOptions, context)); + } + + /** + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return tracks asynchronous upload or replacement of a file in a knowledge source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response ingestKnowledgeSourceFileMultipartWithResponse(String name, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.ingestKnowledgeSourceFileMultipartSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + name, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginIngestKnowledgeSourceFileMultipartWithModelAsync(String name, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileMultipartWithResponseAsync(name, body, requestOptions), + new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(KnowledgeSourceFileIngestionOperation.class), + TypeReference.createInstance(KnowledgeSourceFile.class)); + } + + /** + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginIngestKnowledgeSourceFileMultipartWithModel(String name, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileMultipartWithResponse(name, body, requestOptions), + new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(KnowledgeSourceFileIngestionOperation.class), + TypeReference.createInstance(KnowledgeSourceFile.class)); + } + + /** + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginIngestKnowledgeSourceFileMultipartInternalAsync(String name, + BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileMultipartWithResponseAsync(name, body, requestOptions), + new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginIngestKnowledgeSourceFileMultipartInternal(String name, + BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileMultipartWithResponse(name, body, requestOptions), + new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Lists all files in a File knowledge source. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like + * path.
searchStringNoA string used to narrow down the listing so that fewer results + * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The + * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently + * only 'prefix' is supported. Allowed values: "prefix".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response from a List Files request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKnowledgeSourceFilesSinglePageAsync(String name, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil + .withContext(context -> service.listKnowledgeSourceFiles(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null)); + } + + /** + * Lists all files in a File knowledge source. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like + * path.
searchStringNoA string used to narrow down the listing so that fewer results + * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The + * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently + * only 'prefix' is supported. Allowed values: "prefix".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response from a List Files request as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listKnowledgeSourceFilesAsync(String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listKnowledgeSourceFilesSinglePageAsync(name, requestOptions), + nextLink -> listKnowledgeSourceFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Lists all files in a File knowledge source. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like + * path.
searchStringNoA string used to narrow down the listing so that fewer results + * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The + * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently + * only 'prefix' is supported. Allowed values: "prefix".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response from a List Files request along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listKnowledgeSourceFilesSinglePage(String name, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + Response res = service.listKnowledgeSourceFilesSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null); + } + + /** + * Lists all files in a File knowledge source. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like + * path.
searchStringNoA string used to narrow down the listing so that fewer results + * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The + * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently + * only 'prefix' is supported. Allowed values: "prefix".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response from a List Files request as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listKnowledgeSourceFiles(String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listKnowledgeSourceFilesSinglePage(name, requestOptions), + nextLink -> listKnowledgeSourceFilesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Deletes a file from a File knowledge source and removes all indexed content derived from it. + * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteKnowledgeSourceFileWithResponseAsync(String name, String fileId, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil.withContext(context -> service.deleteKnowledgeSourceFile(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, fileId, accept, requestOptions, context)); + } + + /** + * Deletes a file from a File knowledge source and removes all indexed content derived from it. + * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteKnowledgeSourceFileWithResponse(String name, String fileId, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + return service.deleteKnowledgeSourceFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, + fileId, accept, requestOptions, Context.NONE); + } + + /** + * Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses + * multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw + * file bytes. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metadata for a file uploaded to a File knowledge source along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateKnowledgeSourceFileWithResponseInternalAsync(String name, String fileId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateKnowledgeSourceFile(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, fileId, contentType, accept, body, requestOptions, context)); + } + + /** + * Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses + * multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw + * file bytes. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metadata for a file uploaded to a File knowledge source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateKnowledgeSourceFileWithResponseInternal(String name, String fileId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.updateKnowledgeSourceFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, + fileId, contentType, accept, body, requestOptions, Context.NONE); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return tracks asynchronous upload or replacement of a file in a knowledge source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> ingestKnowledgeSourceFileReplacementWithResponseAsync(String name, String fileId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.ingestKnowledgeSourceFileReplacement(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, fileId, contentType, accept, body, requestOptions, context)); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return tracks asynchronous upload or replacement of a file in a knowledge source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response ingestKnowledgeSourceFileReplacementWithResponse(String name, String fileId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.ingestKnowledgeSourceFileReplacementSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, fileId, contentType, accept, body, requestOptions, + Context.NONE); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginIngestKnowledgeSourceFileReplacementWithModelAsync(String name, String fileId, BinaryData body, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileReplacementWithResponseAsync(name, fileId, body, requestOptions), + new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(KnowledgeSourceFileIngestionOperation.class), + TypeReference.createInstance(KnowledgeSourceFile.class)); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginIngestKnowledgeSourceFileReplacementWithModel(String name, String fileId, BinaryData body, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileReplacementWithResponse(name, fileId, body, requestOptions), + new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(KnowledgeSourceFileIngestionOperation.class), + TypeReference.createInstance(KnowledgeSourceFile.class)); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginIngestKnowledgeSourceFileReplacementInternalAsync(String name, + String fileId, BinaryData body, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileReplacementWithResponseAsync(name, fileId, body, requestOptions), + new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginIngestKnowledgeSourceFileReplacementInternal(String name, + String fileId, BinaryData body, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.ingestKnowledgeSourceFileReplacementWithResponse(name, fileId, body, requestOptions), + new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Gets the status and, when successful, the result of a file ingestion operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Headers

+ * + * + * + * + *
Response Headers
NameTypeDescription
Retry-AfterintThe suggested delay in seconds before polling a nonterminal operation + * again.
+ * + * @param name The name of the knowledge source. + * @param operationId The server-generated identifier returned when ingestion was accepted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status and, when successful, the result of a file ingestion operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getKnowledgeSourceFileIngestionOperationWithResponseAsync(String name, + String operationId, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil.withContext(context -> service.getKnowledgeSourceFileIngestionOperation(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, operationId, requestOptions, context)); + } + + /** + * Gets the status and, when successful, the result of a file ingestion operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Headers

+ * + * + * + * + *
Response Headers
NameTypeDescription
Retry-AfterintThe suggested delay in seconds before polling a nonterminal operation + * again.
+ * + * @param name The name of the knowledge source. + * @param operationId The server-generated identifier returned when ingestion was accepted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status and, when successful, the result of a file ingestion operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getKnowledgeSourceFileIngestionOperationWithResponse(String name, String operationId, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + return service.getKnowledgeSourceFileIngestionOperationSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, operationId, requestOptions, Context.NONE); + } + + /** + * Lists retained file ingestion operations for this knowledge source. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pageSizeIntegerNoThe maximum number of operations to return.
continuationTokenStringNoAn opaque continuation token returned by the + * service.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
      *     }
-     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
-     *     extractionMode: String(minimal/standard) (Optional)
      * }
      * }
      * 
@@ -8150,31 +10731,29 @@ public PagedFlux listKnowledgeSourceFilesAsync(String name, RequestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response from a List Files request along with {@link PagedResponse}. + * @return a page of retained ingestion operations belonging to a knowledge source along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listKnowledgeSourceFilesSinglePage(String name, RequestOptions requestOptions) { + private Mono> listKnowledgeSourceFileIngestionOperationsSinglePageAsync(String name, + RequestOptions requestOptions) { final String accept = "application/json;odata.metadata=minimal"; - Response res = service.listKnowledgeSourceFilesSync(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null); + return FluxUtil + .withContext(context -> service.listKnowledgeSourceFileIngestionOperations(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null)); } /** - * Lists all files in a File knowledge source. + * Lists retained file ingestion operations for this knowledge source. *

Query Parameters

* * * - * - * - * - * + * + * *
Query Parameters
NameTypeRequiredDescription
prefixStringNoOptional prefix to filter files by their directory-like - * path.
searchStringNoA string used to narrow down the listing so that fewer results - * need to be paged through. If omitted or an empty string is passed, no narrowing is applied.
pageSizeIntegerNoThe maximum number of items to return in a single page. The - * server enforces a maximum; if omitted, the server determines a suitable default.
searchTypeStringNoSpecifies how the search parameter is interpreted. Currently - * only 'prefix' is supported. Allowed values: "prefix".
pageSizeIntegerNoThe maximum number of operations to return.
continuationTokenStringNoAn opaque continuation token returned by the + * service.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -8182,18 +10761,27 @@ private PagedResponse listKnowledgeSourceFilesSinglePage(String name *
      * {@code
      * {
-     *     fileId: String (Optional)
-     *     fileName: String (Optional)
-     *     fileSizeBytes: Long (Optional)
-     *     createdAt: OffsetDateTime (Optional)
-     *     lastUpdatedAt: OffsetDateTime (Optional)
-     *     errorMessage: String (Optional)
-     *     prefix: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
      *     }
-     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
-     *     extractionMode: String(minimal/standard) (Optional)
      * }
      * }
      * 
@@ -8204,142 +10792,137 @@ private PagedResponse listKnowledgeSourceFilesSinglePage(String name * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return response from a List Files request as paginated response with {@link PagedIterable}. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKnowledgeSourceFiles(String name, RequestOptions requestOptions) { + public PagedFlux listKnowledgeSourceFileIngestionOperationsAsync(String name, + RequestOptions requestOptions) { RequestOptions requestOptionsForNextPage = new RequestOptions(); requestOptionsForNextPage.setContext( requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listKnowledgeSourceFilesSinglePage(name, requestOptions), - nextLink -> listKnowledgeSourceFilesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Deletes a file from a File knowledge source and removes all indexed content derived from it. - * - * @param name The name of the knowledge source. - * @param fileId The unique identifier of the file to delete. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteKnowledgeSourceFileWithResponseAsync(String name, String fileId, - RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - return FluxUtil.withContext(context -> service.deleteKnowledgeSourceFile(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, fileId, accept, requestOptions, context)); - } - - /** - * Deletes a file from a File knowledge source and removes all indexed content derived from it. - * - * @param name The name of the knowledge source. - * @param fileId The unique identifier of the file to delete. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteKnowledgeSourceFileWithResponse(String name, String fileId, - RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - return service.deleteKnowledgeSourceFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, - fileId, accept, requestOptions, Context.NONE); + return new PagedFlux<>(() -> listKnowledgeSourceFileIngestionOperationsSinglePageAsync(name, requestOptions), + nextLink -> listKnowledgeSourceFileIngestionOperationsNextSinglePageAsync(nextLink, + requestOptionsForNextPage)); } /** - * Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses - * multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw - * file bytes. + * Lists retained file ingestion operations for this knowledge source. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pageSizeIntegerNoThe maximum number of operations to return.
continuationTokenStringNoAn opaque continuation token returned by the + * service.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     fileId: String (Optional)
-     *     fileName: String (Optional)
-     *     fileSizeBytes: Long (Optional)
-     *     createdAt: OffsetDateTime (Optional)
-     *     lastUpdatedAt: OffsetDateTime (Optional)
-     *     errorMessage: String (Optional)
-     *     prefix: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
      *     }
-     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
-     *     extractionMode: String(minimal/standard) (Optional)
      * }
      * }
      * 
* * @param name The name of the knowledge source. - * @param fileId The unique identifier of the file to update. - * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metadata for a file uploaded to a File knowledge source along with {@link Response} on successful - * completion of {@link Mono}. + * @return a page of retained ingestion operations belonging to a knowledge source along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateKnowledgeSourceFileWithResponseInternalAsync(String name, String fileId, - BinaryData body, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateKnowledgeSourceFile(this.getEndpoint(), - this.getServiceVersion().getVersion(), name, fileId, contentType, accept, body, requestOptions, context)); + private PagedResponse listKnowledgeSourceFileIngestionOperationsSinglePage(String name, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + Response res = service.listKnowledgeSourceFileIngestionOperationsSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null); } /** - * Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses - * multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw - * file bytes. + * Lists retained file ingestion operations for this knowledge source. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pageSizeIntegerNoThe maximum number of operations to return.
continuationTokenStringNoAn opaque continuation token returned by the + * service.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     fileId: String (Optional)
-     *     fileName: String (Optional)
-     *     fileSizeBytes: Long (Optional)
-     *     createdAt: OffsetDateTime (Optional)
-     *     lastUpdatedAt: OffsetDateTime (Optional)
-     *     errorMessage: String (Optional)
-     *     prefix: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
      *     }
-     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
-     *     extractionMode: String(minimal/standard) (Optional)
      * }
      * }
      * 
* * @param name The name of the knowledge source. - * @param fileId The unique identifier of the file to update. - * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metadata for a file uploaded to a File knowledge source along with {@link Response}. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateKnowledgeSourceFileWithResponseInternal(String name, String fileId, - BinaryData body, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.updateKnowledgeSourceFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, - fileId, contentType, accept, body, requestOptions, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listKnowledgeSourceFileIngestionOperations(String name, + RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listKnowledgeSourceFileIngestionOperationsSinglePage(name, requestOptions), + nextLink -> listKnowledgeSourceFileIngestionOperationsNextSinglePage(nextLink, requestOptionsForNextPage)); } /** @@ -8362,6 +10945,8 @@ public Response updateKnowledgeSourceFileWithResponseInternal(String * synonymMaps (Required): (recursive schema, see synonymMaps above) * skillsetCount (Required): (recursive schema, see skillsetCount above) * vectorIndexSize (Required): (recursive schema, see vectorIndexSize above) + * knowledgeBasesCount (Required): (recursive schema, see knowledgeBasesCount above) + * knowledgeSourcesCount (Required): (recursive schema, see knowledgeSourcesCount above) * } * limits (Required): { * maxFieldsPerIndex: Integer (Optional) @@ -8370,6 +10955,7 @@ public Response updateKnowledgeSourceFileWithResponseInternal(String * maxComplexObjectsInCollectionsPerDocument: Integer (Optional) * maxStoragePerIndex: Long (Optional) * maxCumulativeIndexerRuntimeSeconds: Long (Optional) + * maxVectorIndexSizePerIndexInBytes: Long (Optional) * } * indexersRuntime (Optional): { * usedSeconds: long (Required) @@ -8416,6 +11002,8 @@ public Mono> getServiceStatisticsWithResponseAsync(RequestO * synonymMaps (Required): (recursive schema, see synonymMaps above) * skillsetCount (Required): (recursive schema, see skillsetCount above) * vectorIndexSize (Required): (recursive schema, see vectorIndexSize above) + * knowledgeBasesCount (Required): (recursive schema, see knowledgeBasesCount above) + * knowledgeSourcesCount (Required): (recursive schema, see knowledgeSourcesCount above) * } * limits (Required): { * maxFieldsPerIndex: Integer (Optional) @@ -8424,6 +11012,7 @@ public Mono> getServiceStatisticsWithResponseAsync(RequestO * maxComplexObjectsInCollectionsPerDocument: Integer (Optional) * maxStoragePerIndex: Long (Optional) * maxCumulativeIndexerRuntimeSeconds: Long (Optional) + * maxVectorIndexSizePerIndexInBytes: Long (Optional) * } * indexersRuntime (Optional): { * usedSeconds: long (Required) @@ -8648,6 +11237,7 @@ public PagedIterable listIndexStatsSummary(RequestOptions requestOpt * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -8697,6 +11287,7 @@ private Mono> listSynonymMapsNextSinglePageAsync(Strin * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -8740,8 +11331,11 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -8749,6 +11343,7 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -8758,6 +11353,34 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -8769,8 +11392,6 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -8834,6 +11455,7 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -8855,6 +11477,7 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -8875,7 +11498,7 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -8891,13 +11514,27 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -8943,8 +11580,11 @@ private Mono> listIndexesNextSinglePageAsync(String ne * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -8952,6 +11592,7 @@ private Mono> listIndexesNextSinglePageAsync(String ne * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -8961,6 +11602,34 @@ private Mono> listIndexesNextSinglePageAsync(String ne * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -8972,8 +11641,6 @@ private Mono> listIndexesNextSinglePageAsync(String ne * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -9037,6 +11704,7 @@ private Mono> listIndexesNextSinglePageAsync(String ne * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -9058,6 +11726,7 @@ private Mono> listIndexesNextSinglePageAsync(String ne * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -9078,7 +11747,7 @@ private Mono> listIndexesNextSinglePageAsync(String ne * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -9094,13 +11763,27 @@ private Mono> listIndexesNextSinglePageAsync(String ne * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -9143,8 +11826,11 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -9152,6 +11838,7 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -9161,6 +11848,34 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -9172,8 +11887,6 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -9237,6 +11950,7 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -9258,6 +11972,7 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -9278,7 +11993,7 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -9294,13 +12009,27 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -9346,8 +12075,11 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -9355,6 +12087,7 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -9364,6 +12097,34 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -9375,8 +12136,6 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -9440,6 +12199,7 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -9461,6 +12221,7 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -9481,7 +12242,7 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -9497,13 +12258,27 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -9607,16 +12382,40 @@ private PagedResponse listAliasesNextSinglePage(String nextLink, Req * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -9630,8 +12429,12 @@ private PagedResponse listAliasesNextSinglePage(String nextLink, Req * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -9640,6 +12443,7 @@ private PagedResponse listAliasesNextSinglePage(String nextLink, Req * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -9674,16 +12478,40 @@ private Mono> listKnowledgeBasesNextSinglePageAsync(St * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -9697,8 +12525,12 @@ private Mono> listKnowledgeBasesNextSinglePageAsync(St * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -9707,6 +12539,7 @@ private Mono> listKnowledgeBasesNextSinglePageAsync(St * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -9735,9 +12568,10 @@ private PagedResponse listKnowledgeBasesNextSinglePage(String nextLi *
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -9750,6 +12584,7 @@ private PagedResponse listKnowledgeBasesNextSinglePage(String nextLi
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -9781,9 +12616,10 @@ private Mono> listKnowledgeSourcesNextSinglePageAsync(
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -9796,6 +12632,7 @@ private Mono> listKnowledgeSourcesNextSinglePageAsync(
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -9903,6 +12740,108 @@ private PagedResponse listKnowledgeSourceFilesNextSinglePage(String
             getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null);
     }
 
+    /**
+     * Get the next page of items.
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a page of retained ingestion operations belonging to a knowledge source along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listKnowledgeSourceFileIngestionOperationsNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil + .withContext(context -> service.listKnowledgeSourceFileIngestionOperationsNext(nextLink, this.getEndpoint(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a page of retained ingestion operations belonging to a knowledge source along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listKnowledgeSourceFileIngestionOperationsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + Response res = service.listKnowledgeSourceFileIngestionOperationsNextSync(nextLink, + this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "@odata.nextLink"), null); + } + /** * Get the next page of items. *

Response Body Schema

diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java index eb9a702443145..20042ce334902 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java @@ -23,6 +23,7 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.RetryPolicy; @@ -305,6 +306,26 @@ Response resyncSync(@HostParam("endpoint") String endpoint, @QueryParam("a @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData indexerResync, RequestOptions requestOptions, Context context); + @Post("/indexers('{indexerName}')/search.resetdocs") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> resetDocuments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("indexerName") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/indexers('{indexerName}')/search.resetdocs") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response resetDocumentsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("indexerName") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Post("/indexers('{indexerName}')/search.run") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -553,6 +574,28 @@ Response createSkillsetSync(@HostParam("endpoint") String endpoint, @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData skillset, RequestOptions requestOptions, Context context); + @Post("/skillsets('{skillsetName}')/search.resetskills") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> resetSkills(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("skillsetName") String name, + @HeaderParam("Accept") String accept, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData skillNames, RequestOptions requestOptions, Context context); + + @Post("/skillsets('{skillsetName}')/search.resetskills") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response resetSkillsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("skillsetName") String name, + @HeaderParam("Accept") String accept, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData skillNames, RequestOptions requestOptions, Context context); + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -616,6 +659,13 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode /** * Creates a new datasource or updates a datasource if it already exists. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -634,6 +684,7 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -645,7 +696,7 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -663,6 +714,7 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -676,6 +728,7 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -687,7 +740,7 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -705,6 +758,7 @@ Response listSkillsetsNextSync(@PathParam(value = "nextLink", encode * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -733,6 +787,13 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse /** * Creates a new datasource or updates a datasource if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -751,6 +812,7 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -762,7 +824,7 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -780,6 +842,7 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -793,6 +856,7 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -804,7 +868,7 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -822,6 +886,7 @@ public Mono> createOrUpdateDataSourceConnectionWithResponse * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -912,6 +977,7 @@ public Response deleteDataSourceConnectionWithResponse(String name, Reques * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -923,7 +989,7 @@ public Response deleteDataSourceConnectionWithResponse(String name, Reques * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -941,6 +1007,7 @@ public Response deleteDataSourceConnectionWithResponse(String name, Reques * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -973,6 +1040,7 @@ public Mono> getDataSourceConnectionWithResponseAsync(Strin * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -984,7 +1052,7 @@ public Mono> getDataSourceConnectionWithResponseAsync(Strin * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1002,6 +1070,7 @@ public Mono> getDataSourceConnectionWithResponseAsync(Strin * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1048,6 +1117,7 @@ public Response getDataSourceConnectionWithResponse(String name, Req * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1059,7 +1129,7 @@ public Response getDataSourceConnectionWithResponse(String name, Req * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1077,6 +1147,7 @@ public Response getDataSourceConnectionWithResponse(String name, Req * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1125,6 +1196,7 @@ private Mono> listDataSourceConnectionsSinglePageAsync * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1136,7 +1208,7 @@ private Mono> listDataSourceConnectionsSinglePageAsync * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1154,6 +1226,7 @@ private Mono> listDataSourceConnectionsSinglePageAsync * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1200,6 +1273,7 @@ public PagedFlux listDataSourceConnectionsAsync(RequestOptions reque * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1211,7 +1285,7 @@ public PagedFlux listDataSourceConnectionsAsync(RequestOptions reque * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1229,6 +1303,7 @@ public PagedFlux listDataSourceConnectionsAsync(RequestOptions reque * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1275,6 +1350,7 @@ private PagedResponse listDataSourceConnectionsSinglePage(RequestOpt * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1286,7 +1362,7 @@ private PagedResponse listDataSourceConnectionsSinglePage(RequestOpt * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1304,6 +1380,7 @@ private PagedResponse listDataSourceConnectionsSinglePage(RequestOpt * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1335,6 +1412,7 @@ public PagedIterable listDataSourceConnections(RequestOptions reques * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1346,7 +1424,7 @@ public PagedIterable listDataSourceConnections(RequestOptions reques * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1364,6 +1442,7 @@ public PagedIterable listDataSourceConnections(RequestOptions reques * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1377,6 +1456,7 @@ public PagedIterable listDataSourceConnections(RequestOptions reques * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1388,7 +1468,7 @@ public PagedIterable listDataSourceConnections(RequestOptions reques * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1406,6 +1486,7 @@ public PagedIterable listDataSourceConnections(RequestOptions reques * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1439,6 +1520,7 @@ public Mono> createDataSourceConnectionWithResponseAsync(Bi * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1450,7 +1532,7 @@ public Mono> createDataSourceConnectionWithResponseAsync(Bi * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1468,6 +1550,7 @@ public Mono> createDataSourceConnectionWithResponseAsync(Bi * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1481,6 +1564,7 @@ public Mono> createDataSourceConnectionWithResponseAsync(Bi * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1492,7 +1576,7 @@ public Mono> createDataSourceConnectionWithResponseAsync(Bi * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1510,6 +1594,7 @@ public Mono> createDataSourceConnectionWithResponseAsync(Bi * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1632,6 +1717,114 @@ public Response resyncWithResponse(String name, BinaryData indexerResync, indexerResync, requestOptions, Context.NONE); } + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
overwriteBooleanNoIf false, keys or ids will be appended to existing ones. If + * true, only the keys or ids in this payload will be queued to be re-ingested.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     documentKeys (Optional): [
+     *         String (Optional)
+     *     ]
+     *     datasourceDocumentIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the indexer. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resetDocumentsWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); + return FluxUtil.withContext(context -> service.resetDocuments(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, requestOptionsLocal, context)); + } + + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
overwriteBooleanNoIf false, keys or ids will be appended to existing ones. If + * true, only the keys or ids in this payload will be queued to be re-ingested.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     documentKeys (Optional): [
+     *         String (Optional)
+     *     ]
+     *     datasourceDocumentIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the indexer. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetDocumentsWithResponse(String name, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); + return service.resetDocumentsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, + requestOptionsLocal, Context.NONE); + } + /** * Runs an indexer on-demand. * @@ -1670,6 +1863,15 @@ public Response runIndexerWithResponse(String name, RequestOptions request /** * Creates a new indexer or updates an indexer if it already exists. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -1751,6 +1953,13 @@ public Response runIndexerWithResponse(String name, RequestOptions request * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -1827,6 +2036,13 @@ public Response runIndexerWithResponse(String name, RequestOptions request * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -1854,6 +2070,15 @@ public Mono> createOrUpdateIndexerWithResponseAsync(String /** * Creates a new indexer or updates an indexer if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -1935,6 +2160,13 @@ public Mono> createOrUpdateIndexerWithResponseAsync(String * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2011,6 +2243,13 @@ public Mono> createOrUpdateIndexerWithResponseAsync(String * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2162,6 +2401,13 @@ public Response deleteIndexerWithResponse(String name, RequestOptions requ * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2255,6 +2501,13 @@ public Mono> getIndexerWithResponseAsync(String name, Reque * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2363,6 +2616,13 @@ public Response getIndexerWithResponse(String name, RequestOptions r * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2474,6 +2734,13 @@ private Mono> listIndexersSinglePageAsync(RequestOptio * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2583,6 +2850,13 @@ public PagedFlux listIndexersAsync(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2692,6 +2966,13 @@ private PagedResponse listIndexersSinglePage(RequestOptions requestO * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2786,6 +3067,13 @@ public PagedIterable listIndexers(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2862,6 +3150,13 @@ public PagedIterable listIndexers(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2957,6 +3252,13 @@ public Mono> createIndexerWithResponseAsync(BinaryData inde * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -3033,6 +3335,13 @@ public Mono> createIndexerWithResponseAsync(BinaryData inde * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -3071,6 +3380,8 @@ public Response createIndexerWithResponse(BinaryData indexer, Reques * } * lastResult (Optional): { * status: String(transientFailure/success/inProgress/reset) (Required) + * statusDetail: String(resetDocs/resync) (Optional) + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) * errorMessage: String (Optional) * startTime: OffsetDateTime (Optional) * endTime: OffsetDateTime (Optional) @@ -3106,6 +3417,21 @@ public Response createIndexerWithResponse(BinaryData indexer, Reques * maxDocumentExtractionSize: Long (Optional) * maxDocumentContentCharactersToExtract: Long (Optional) * } + * currentState (Optional): { + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) + * allDocsInitialTrackingState: String (Optional) + * allDocsFinalTrackingState: String (Optional) + * resetDocsInitialTrackingState: String (Optional) + * resetDocsFinalTrackingState: String (Optional) + * resyncInitialTrackingState: String (Optional) + * resyncFinalTrackingState: String (Optional) + * resetDocumentKeys (Optional): [ + * String (Optional) + * ] + * resetDatasourceDocumentIds (Optional): [ + * String (Optional) + * ] + * } * } * } * @@ -3143,6 +3469,8 @@ public Mono> getIndexerStatusWithResponseAsync(String name, * } * lastResult (Optional): { * status: String(transientFailure/success/inProgress/reset) (Required) + * statusDetail: String(resetDocs/resync) (Optional) + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) * errorMessage: String (Optional) * startTime: OffsetDateTime (Optional) * endTime: OffsetDateTime (Optional) @@ -3178,6 +3506,21 @@ public Mono> getIndexerStatusWithResponseAsync(String name, * maxDocumentExtractionSize: Long (Optional) * maxDocumentContentCharactersToExtract: Long (Optional) * } + * currentState (Optional): { + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) + * allDocsInitialTrackingState: String (Optional) + * allDocsFinalTrackingState: String (Optional) + * resetDocsInitialTrackingState: String (Optional) + * resetDocsFinalTrackingState: String (Optional) + * resyncInitialTrackingState: String (Optional) + * resyncFinalTrackingState: String (Optional) + * resetDocumentKeys (Optional): [ + * String (Optional) + * ] + * resetDatasourceDocumentIds (Optional): [ + * String (Optional) + * ] + * } * } * } * @@ -3199,6 +3542,15 @@ public Response getIndexerStatusWithResponse(String name, RequestOpt /** * Creates a new skillset in a search service or updates the skillset if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -3289,6 +3641,12 @@ public Response getIndexerStatusWithResponse(String name, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -3318,6 +3676,7 @@ public Response getIndexerStatusWithResponse(String name, RequestOpt * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -3403,6 +3762,12 @@ public Response getIndexerStatusWithResponse(String name, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -3432,6 +3797,7 @@ public Response getIndexerStatusWithResponse(String name, RequestOpt * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -3459,6 +3825,15 @@ public Mono> createOrUpdateSkillsetWithResponseAsync(String /** * Creates a new skillset in a search service or updates the skillset if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -3549,6 +3924,12 @@ public Mono> createOrUpdateSkillsetWithResponseAsync(String * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -3578,6 +3959,7 @@ public Mono> createOrUpdateSkillsetWithResponseAsync(String * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -3663,6 +4045,12 @@ public Mono> createOrUpdateSkillsetWithResponseAsync(String * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -3692,6 +4080,7 @@ public Mono> createOrUpdateSkillsetWithResponseAsync(String * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -3852,6 +4241,12 @@ public Response deleteSkillsetWithResponse(String name, RequestOptions req * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -3881,6 +4276,7 @@ public Response deleteSkillsetWithResponse(String name, RequestOptions req * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -3983,6 +4379,12 @@ public Mono> getSkillsetWithResponseAsync(String name, Requ * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4012,6 +4414,7 @@ public Mono> getSkillsetWithResponseAsync(String name, Requ * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4129,6 +4532,12 @@ public Response getSkillsetWithResponse(String name, RequestOptions * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4158,6 +4567,7 @@ public Response getSkillsetWithResponse(String name, RequestOptions * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4278,6 +4688,12 @@ private Mono> listSkillsetsSinglePageAsync(RequestOpti * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4307,6 +4723,7 @@ private Mono> listSkillsetsSinglePageAsync(RequestOpti * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4425,6 +4842,12 @@ public PagedFlux listSkillsetsAsync(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4454,6 +4877,7 @@ public PagedFlux listSkillsetsAsync(RequestOptions requestOptions) { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4572,6 +4996,12 @@ private PagedResponse listSkillsetsSinglePage(RequestOptions request * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4601,6 +5031,7 @@ private PagedResponse listSkillsetsSinglePage(RequestOptions request * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4704,6 +5135,12 @@ public PagedIterable listSkillsets(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4733,6 +5170,7 @@ public PagedIterable listSkillsets(RequestOptions requestOptions) { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4818,6 +5256,12 @@ public PagedIterable listSkillsets(RequestOptions requestOptions) { * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4847,6 +5291,7 @@ public PagedIterable listSkillsets(RequestOptions requestOptions) { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -4951,6 +5396,12 @@ public Mono> createSkillsetWithResponseAsync(BinaryData ski * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -4980,6 +5431,7 @@ public Mono> createSkillsetWithResponseAsync(BinaryData ski * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -5065,6 +5517,12 @@ public Mono> createSkillsetWithResponseAsync(BinaryData ski * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -5094,6 +5552,7 @@ public Mono> createSkillsetWithResponseAsync(BinaryData ski * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -5115,6 +5574,69 @@ public Response createSkillsetWithResponse(BinaryData skillset, Requ contentType, skillset, requestOptions, Context.NONE); } + /** + * Reset an existing skillset in a search service. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     skillNames (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the skillset. + * @param skillNames The names of the skills to reset. If not specified, all skills in the skillset will be reset. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resetSkillsWithResponseAsync(String name, BinaryData skillNames, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.resetSkills(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, contentType, skillNames, requestOptions, context)); + } + + /** + * Reset an existing skillset in a search service. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     skillNames (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the skillset. + * @param skillNames The names of the skills to reset. If not specified, all skills in the skillset will be reset. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetSkillsWithResponse(String name, BinaryData skillNames, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + final String contentType = "application/json"; + return service.resetSkillsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, + contentType, skillNames, requestOptions, Context.NONE); + } + /** * Get the next page of items. *

Response Body Schema

@@ -5125,6 +5647,7 @@ public Response createSkillsetWithResponse(BinaryData skillset, Requ * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -5136,7 +5659,7 @@ public Response createSkillsetWithResponse(BinaryData skillset, Requ * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -5154,6 +5677,7 @@ public Response createSkillsetWithResponse(BinaryData skillset, Requ * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -5189,6 +5713,7 @@ private Mono> listDataSourceConnectionsNextSinglePageA * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -5200,7 +5725,7 @@ private Mono> listDataSourceConnectionsNextSinglePageA * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -5218,6 +5743,7 @@ private Mono> listDataSourceConnectionsNextSinglePageA * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -5314,6 +5840,13 @@ private PagedResponse listDataSourceConnectionsNextSinglePage(String * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -5412,6 +5945,13 @@ private Mono> listIndexersNextSinglePageAsync(String n * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -5516,6 +6056,12 @@ private PagedResponse listIndexersNextSinglePage(String nextLink, Re * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -5545,6 +6091,7 @@ private PagedResponse listIndexersNextSinglePage(String nextLink, Re * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -5652,6 +6199,12 @@ private Mono> listSkillsetsNextSinglePageAsync(String * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -5681,6 +6234,7 @@ private Mono> listSkillsetsNextSinglePageAsync(String * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java index 198194361ccb5..7475da8bc1a9e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java @@ -8,6 +8,8 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.json.JsonSerializable; +import com.azure.search.documents.implementation.models.GraphRequest; +import com.azure.search.documents.models.GraphOptions; import com.azure.search.documents.models.SearchOptions; import com.azure.search.documents.models.SearchRequest; import reactor.core.publisher.Mono; @@ -16,6 +18,38 @@ * Implementation utilities helper class. */ public final class SearchUtils { + /** + * Converts public graph options into the wire request. + * + * @param options The graph options. + * @return The graph request. + * @throws NullPointerException if options is null. + */ + public static GraphRequest fromGraphOptions(GraphOptions options) { + java.util.Objects.requireNonNull(options, "'options' cannot be null."); + return new GraphRequest(options.getGql()).setSearch(options.getSearch()) + .setFilter(options.getFilter()) + .setVectorQueries(options.getVectorQueries()) + .setExecutionMode(options.getExecutionMode()) + .setExplain(options.getExplain()) + .setIncludeStatistics(options.isIncludeStatistics()) + .setIncludeDiagnostics(options.isIncludeDiagnostics()) + .setProvenance(options.getProvenance()); + } + + /** + * Adds graph authorization options to the HTTP request. + * + * @param requestOptions The HTTP request options. + * @param options The graph options. + * @return The updated request options. + */ + public static RequestOptions addGraphHeaders(RequestOptions requestOptions, GraphOptions options) { + return addSearchHeaders(requestOptions, + new SearchOptions().setQuerySourceAuthorization(options.getQuerySourceAuthorization()) + .setEnableElevatedRead(options.isEnableElevatedRead())); + } + /** * Converts the public API {@link SearchOptions} into {@link SearchRequest}. * @@ -34,7 +68,6 @@ public static SearchRequest fromSearchOptions(SearchOptions options) { .setHighlightPostTag(options.getHighlightPostTag()) .setHighlightPreTag(options.getHighlightPreTag()) .setMinimumCoverage(options.getMinimumCoverage()) - .setMoreLikeThis(options.getMoreLikeThis()) .setOrderBy(options.getOrderBy()) .setQueryType(options.getQueryType()) .setScoringStatistics(options.getScoringStatistics()) @@ -55,7 +88,14 @@ public static SearchRequest fromSearchOptions(SearchOptions options) { .setAnswers(options.getAnswers()) .setCaptions(options.getCaptions()) .setVectorQueries(options.getVectorQueries()) - .setVectorFilterMode(options.getVectorFilterMode()); + .setVectorFilterMode(options.getVectorFilterMode()) + .setQueryLanguage(options.getQueryLanguage()) + .setQuerySpeller(options.getQuerySpeller()) + .setQueryRewrites(options.getQueryRewrites()) + .setSemanticFields(options.getSemanticFields()) + .setHybridSearch(options.getHybridSearch()) + .setMoreLikeThis(options.getMoreLikeThis()) + .setAgenticOptions(options.getAgenticOptions()); } /** @@ -66,21 +106,20 @@ public static SearchRequest fromSearchOptions(SearchOptions options) { * @return The updated {@link RequestOptions}. */ public static RequestOptions addSearchHeaders(RequestOptions requestOptions, SearchOptions searchOptions) { + if (searchOptions == null) { return requestOptions; } - if (requestOptions == null) { - requestOptions = new RequestOptions(); - } + RequestOptions options = requestOptions == null ? new RequestOptions() : requestOptions; if (searchOptions.getQuerySourceAuthorization() != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + options.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), searchOptions.getQuerySourceAuthorization()); } if (searchOptions.isEnableElevatedRead() != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-enable-elevated-read"), + options.setHeader(HttpHeaderName.fromString("x-ms-enable-elevated-read"), searchOptions.isEnableElevatedRead().toString()); } - return requestOptions; + return options; } /** diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SyncOperationLocationPollingStrategy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SyncOperationLocationPollingStrategy.java new file mode 100644 index 0000000000000..e594182ccae3c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SyncOperationLocationPollingStrategy.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.search.documents.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncOperationResourcePollingStrategy; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.io.UncheckedIOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Map; + +// DO NOT modify this helper class + +/** + * Implements a synchronous operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class SyncOperationLocationPollingStrategy extends SyncOperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(SyncOperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public PollResponse onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + T initialResponseType = null; + try { + initialResponseType = PollingUtils.deserializeResponseSync((BinaryData) response.getValue(), serializer, + pollResponseType); + } catch (UncheckedIOException e) { + LOGGER.info("Failed to parse initial response."); + } + return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, initialResponseType, retryAfter); + } + + throw LOGGER.logExceptionAsError(new AzureException( + String.format("Operation failed or cancelled with status code %d, '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + + /** + * {@inheritDoc} + */ + public U getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + Map pollResult = PollingUtils.deserializeResponseSync(latestResponseBody, serializer, + PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE); + if (pollResult != null && pollResult.get(propertyName) != null) { + return PollingUtils.deserializeResponseSync(BinaryData.fromObject(pollResult.get(propertyName)), + serializer, resultType); + } else { + throw LOGGER.logExceptionAsError(new AzureException("Cannot get final result")); + } + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GraphRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GraphRequest.java new file mode 100644 index 0000000000000..9d10189c527db --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/GraphRequest.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.models.GraphQueryExecutionMode; +import com.azure.search.documents.models.GraphQueryExplainStage; +import com.azure.search.documents.models.GraphQueryProvenanceParameters; +import com.azure.search.documents.models.VectorQuery; +import java.io.IOException; +import java.util.List; + +/** + * The GraphRequest model. + */ +@Fluent +public final class GraphRequest implements JsonSerializable { + + /* + * The nonempty GQL query to bind and execute. + */ + @Generated + private final String gql; + + /* + * Full-text search text used to constrain graph backend requests. + */ + @Generated + private String search; + + /* + * An OData filter over graph-index fields applied throughout graph execution. + */ + @Generated + private String filter; + + /* + * Vector queries used to constrain the graph's backend searches. + */ + @Generated + private List vectorQueries; + + /* + * Executes the query by default. planOnly builds the plan without backend query execution and requires at least one + * explain stage. + */ + @Generated + private GraphQueryExecutionMode executionMode; + + /* + * Diagnostic plan stages to include in the response. Plan representations are diagnostic information rather than an + * executable client contract. + */ + @Generated + private List explain; + + /* + * Whether to include graph execution statistics. Defaults to true. + */ + @Generated + private Boolean includeStatistics; + + /* + * Whether to include informational diagnostics. Errors and warnings are returned regardless of this setting. + */ + @Generated + private Boolean includeDiagnostics; + + /* + * Controls bounded assertion evidence and optional source-document hydration. + */ + @Generated + private GraphQueryProvenanceParameters provenance; + + /** + * Creates an instance of GraphRequest class. + * + * @param gql the gql value to set. + */ + @Generated + public GraphRequest(String gql) { + this.gql = gql; + } + + /** + * Get the gql property: The nonempty GQL query to bind and execute. + * + * @return the gql value. + */ + @Generated + public String getGql() { + return this.gql; + } + + /** + * Get the search property: Full-text search text used to constrain graph backend requests. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * Set the search property: Full-text search text used to constrain graph backend requests. + * + * @param search the search value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setSearch(String search) { + this.search = search; + return this; + } + + /** + * Get the filter property: An OData filter over graph-index fields applied throughout graph execution. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData filter over graph-index fields applied throughout graph execution. + * + * @param filter the filter value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the vectorQueries property: Vector queries used to constrain the graph's backend searches. + * + * @return the vectorQueries value. + */ + @Generated + public List getVectorQueries() { + return this.vectorQueries; + } + + /** + * Set the vectorQueries property: Vector queries used to constrain the graph's backend searches. + * + * @param vectorQueries the vectorQueries value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setVectorQueries(List vectorQueries) { + this.vectorQueries = vectorQueries; + return this; + } + + /** + * Get the executionMode property: Executes the query by default. planOnly builds the plan without backend query + * execution and requires at least one explain stage. + * + * @return the executionMode value. + */ + @Generated + public GraphQueryExecutionMode getExecutionMode() { + return this.executionMode; + } + + /** + * Set the executionMode property: Executes the query by default. planOnly builds the plan without backend query + * execution and requires at least one explain stage. + * + * @param executionMode the executionMode value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setExecutionMode(GraphQueryExecutionMode executionMode) { + this.executionMode = executionMode; + return this; + } + + /** + * Get the explain property: Diagnostic plan stages to include in the response. Plan representations are diagnostic + * information rather than an executable client contract. + * + * @return the explain value. + */ + @Generated + public List getExplain() { + return this.explain; + } + + /** + * Set the explain property: Diagnostic plan stages to include in the response. Plan representations are diagnostic + * information rather than an executable client contract. + * + * @param explain the explain value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setExplain(List explain) { + this.explain = explain; + return this; + } + + /** + * Get the includeStatistics property: Whether to include graph execution statistics. Defaults to true. + * + * @return the includeStatistics value. + */ + @Generated + public Boolean isIncludeStatistics() { + return this.includeStatistics; + } + + /** + * Set the includeStatistics property: Whether to include graph execution statistics. Defaults to true. + * + * @param includeStatistics the includeStatistics value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setIncludeStatistics(Boolean includeStatistics) { + this.includeStatistics = includeStatistics; + return this; + } + + /** + * Get the includeDiagnostics property: Whether to include informational diagnostics. Errors and warnings are + * returned regardless of this setting. + * + * @return the includeDiagnostics value. + */ + @Generated + public Boolean isIncludeDiagnostics() { + return this.includeDiagnostics; + } + + /** + * Set the includeDiagnostics property: Whether to include informational diagnostics. Errors and warnings are + * returned regardless of this setting. + * + * @param includeDiagnostics the includeDiagnostics value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setIncludeDiagnostics(Boolean includeDiagnostics) { + this.includeDiagnostics = includeDiagnostics; + return this; + } + + /** + * Get the provenance property: Controls bounded assertion evidence and optional source-document hydration. + * + * @return the provenance value. + */ + @Generated + public GraphQueryProvenanceParameters getProvenance() { + return this.provenance; + } + + /** + * Set the provenance property: Controls bounded assertion evidence and optional source-document hydration. + * + * @param provenance the provenance value to set. + * @return the GraphRequest object itself. + */ + @Generated + public GraphRequest setProvenance(GraphQueryProvenanceParameters provenance) { + this.provenance = provenance; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gql", this.gql); + jsonWriter.writeStringField("search", this.search); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeArrayField("vectorQueries", this.vectorQueries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("executionMode", this.executionMode == null ? null : this.executionMode.toString()); + jsonWriter.writeArrayField("explain", this.explain, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeBooleanField("includeStatistics", this.includeStatistics); + jsonWriter.writeBooleanField("includeDiagnostics", this.includeDiagnostics); + jsonWriter.writeJsonField("provenance", this.provenance); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphRequest. + */ + @Generated + public static GraphRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String gql = null; + String search = null; + String filter = null; + List vectorQueries = null; + GraphQueryExecutionMode executionMode = null; + List explain = null; + Boolean includeStatistics = null; + Boolean includeDiagnostics = null; + GraphQueryProvenanceParameters provenance = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("gql".equals(fieldName)) { + gql = reader.getString(); + } else if ("search".equals(fieldName)) { + search = reader.getString(); + } else if ("filter".equals(fieldName)) { + filter = reader.getString(); + } else if ("vectorQueries".equals(fieldName)) { + vectorQueries = reader.readArray(reader1 -> VectorQuery.fromJson(reader1)); + } else if ("executionMode".equals(fieldName)) { + executionMode = GraphQueryExecutionMode.fromString(reader.getString()); + } else if ("explain".equals(fieldName)) { + explain = reader.readArray(reader1 -> GraphQueryExplainStage.fromString(reader1.getString())); + } else if ("includeStatistics".equals(fieldName)) { + includeStatistics = reader.getNullable(JsonReader::getBoolean); + } else if ("includeDiagnostics".equals(fieldName)) { + includeDiagnostics = reader.getNullable(JsonReader::getBoolean); + } else if ("provenance".equals(fieldName)) { + provenance = GraphQueryProvenanceParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + GraphRequest deserializedGraphRequest = new GraphRequest(gql); + deserializedGraphRequest.search = search; + deserializedGraphRequest.filter = filter; + deserializedGraphRequest.vectorQueries = vectorQueries; + deserializedGraphRequest.executionMode = executionMode; + deserializedGraphRequest.explain = explain; + deserializedGraphRequest.includeStatistics = includeStatistics; + deserializedGraphRequest.includeDiagnostics = includeDiagnostics; + deserializedGraphRequest.provenance = provenance; + return deserializedGraphRequest; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchPostRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchPostRequest.java index 0fc1c28691858..c48037aa9be1a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchPostRequest.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchPostRequest.java @@ -9,9 +9,14 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.search.documents.models.AgenticSearchOptions; +import com.azure.search.documents.models.HybridSearch; import com.azure.search.documents.models.QueryAnswerType; import com.azure.search.documents.models.QueryCaptionType; import com.azure.search.documents.models.QueryDebugMode; +import com.azure.search.documents.models.QueryLanguage; +import com.azure.search.documents.models.QueryRewritesType; +import com.azure.search.documents.models.QuerySpellerType; import com.azure.search.documents.models.QueryType; import com.azure.search.documents.models.ScoringStatistics; import com.azure.search.documents.models.SearchMode; @@ -957,6 +962,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.orderBy.stream().map(element -> element == null ? "" : element).collect(Collectors.joining(","))); } jsonWriter.writeStringField("queryType", this.queryType == null ? null : this.queryType.toString()); + jsonWriter.writeJsonField("agenticOptions", this.agenticOptions); jsonWriter.writeStringField("scoringStatistics", this.scoringStatistics == null ? null : this.scoringStatistics.toString()); jsonWriter.writeStringField("sessionId", this.sessionId); @@ -972,6 +978,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { .collect(Collectors.joining(","))); } jsonWriter.writeStringField("searchMode", this.searchMode == null ? null : this.searchMode.toString()); + jsonWriter.writeStringField("queryLanguage", this.queryLanguage == null ? null : this.queryLanguage.toString()); + jsonWriter.writeStringField("speller", this.querySpeller == null ? null : this.querySpeller.toString()); if (this.select != null) { jsonWriter.writeStringField("select", this.select.stream().map(element -> element == null ? "" : element).collect(Collectors.joining(","))); @@ -985,9 +993,17 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("semanticQuery", this.semanticQuery); jsonWriter.writeStringField("answers", this.answers == null ? null : this.answers.toString()); jsonWriter.writeStringField("captions", this.captions == null ? null : this.captions.toString()); + jsonWriter.writeStringField("queryRewrites", this.queryRewrites == null ? null : this.queryRewrites.toString()); + if (this.semanticFields != null) { + jsonWriter.writeStringField("semanticFields", + this.semanticFields.stream() + .map(element -> element == null ? "" : element) + .collect(Collectors.joining(","))); + } jsonWriter.writeArrayField("vectorQueries", this.vectorQueries, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("vectorFilterMode", this.vectorFilterMode == null ? null : this.vectorFilterMode.toString()); + jsonWriter.writeJsonField("hybridSearch", this.hybridSearch); return jsonWriter.writeEndObject(); } @@ -1039,6 +1055,8 @@ public static SearchPostRequest fromJson(JsonReader jsonReader) throws IOExcepti deserializedSearchPostRequest.orderBy = orderBy; } else if ("queryType".equals(fieldName)) { deserializedSearchPostRequest.queryType = QueryType.fromString(reader.getString()); + } else if ("agenticOptions".equals(fieldName)) { + deserializedSearchPostRequest.agenticOptions = AgenticSearchOptions.fromJson(reader); } else if ("scoringStatistics".equals(fieldName)) { deserializedSearchPostRequest.scoringStatistics = ScoringStatistics.fromString(reader.getString()); } else if ("sessionId".equals(fieldName)) { @@ -1062,6 +1080,10 @@ public static SearchPostRequest fromJson(JsonReader jsonReader) throws IOExcepti deserializedSearchPostRequest.searchFields = searchFields; } else if ("searchMode".equals(fieldName)) { deserializedSearchPostRequest.searchMode = SearchMode.fromString(reader.getString()); + } else if ("queryLanguage".equals(fieldName)) { + deserializedSearchPostRequest.queryLanguage = QueryLanguage.fromString(reader.getString()); + } else if ("speller".equals(fieldName)) { + deserializedSearchPostRequest.querySpeller = QuerySpellerType.fromString(reader.getString()); } else if ("select".equals(fieldName)) { List select = reader.getNullable(nonNullReader -> { String selectEncodedAsString = nonNullReader.getString(); @@ -1088,11 +1110,23 @@ public static SearchPostRequest fromJson(JsonReader jsonReader) throws IOExcepti deserializedSearchPostRequest.answers = QueryAnswerType.fromString(reader.getString()); } else if ("captions".equals(fieldName)) { deserializedSearchPostRequest.captions = QueryCaptionType.fromString(reader.getString()); + } else if ("queryRewrites".equals(fieldName)) { + deserializedSearchPostRequest.queryRewrites = QueryRewritesType.fromString(reader.getString()); + } else if ("semanticFields".equals(fieldName)) { + List semanticFields = reader.getNullable(nonNullReader -> { + String semanticFieldsEncodedAsString = nonNullReader.getString(); + return semanticFieldsEncodedAsString.isEmpty() + ? new LinkedList<>() + : new LinkedList<>(Arrays.asList(semanticFieldsEncodedAsString.split(",", -1))); + }); + deserializedSearchPostRequest.semanticFields = semanticFields; } else if ("vectorQueries".equals(fieldName)) { List vectorQueries = reader.readArray(reader1 -> VectorQuery.fromJson(reader1)); deserializedSearchPostRequest.vectorQueries = vectorQueries; } else if ("vectorFilterMode".equals(fieldName)) { deserializedSearchPostRequest.vectorFilterMode = VectorFilterMode.fromString(reader.getString()); + } else if ("hybridSearch".equals(fieldName)) { + deserializedSearchPostRequest.hybridSearch = HybridSearch.fromJson(reader); } else { reader.skipChildren(); } @@ -1101,6 +1135,150 @@ public static SearchPostRequest fromJson(JsonReader jsonReader) throws IOExcepti }); } + /* + * A value that specifies the language of the search query. + */ + @Generated + private QueryLanguage queryLanguage; + + /* + * A value that specifies the type of the speller to use to spell-correct individual search query terms. + */ + @Generated + private QuerySpellerType querySpeller; + + /* + * A value that specifies whether query rewrites should be generated to augment the search query. + */ + @Generated + private QueryRewritesType queryRewrites; + + /* + * The comma-separated list of field names used for semantic ranking. + */ + @Generated + private List semanticFields; + + /* + * The query parameters to configure hybrid search behaviors. + */ + @Generated + private HybridSearch hybridSearch; + + /** + * Get the queryLanguage property: A value that specifies the language of the search query. + * + * @return the queryLanguage value. + */ + @Generated + public QueryLanguage getQueryLanguage() { + return this.queryLanguage; + } + + /** + * Set the queryLanguage property: A value that specifies the language of the search query. + * + * @param queryLanguage the queryLanguage value to set. + * @return the SearchPostRequest object itself. + */ + @Generated + public SearchPostRequest setQueryLanguage(QueryLanguage queryLanguage) { + this.queryLanguage = queryLanguage; + return this; + } + + /** + * Get the querySpeller property: A value that specifies the type of the speller to use to spell-correct individual + * search query terms. + * + * @return the querySpeller value. + */ + @Generated + public QuerySpellerType getQuerySpeller() { + return this.querySpeller; + } + + /** + * Set the querySpeller property: A value that specifies the type of the speller to use to spell-correct individual + * search query terms. + * + * @param querySpeller the querySpeller value to set. + * @return the SearchPostRequest object itself. + */ + @Generated + public SearchPostRequest setQuerySpeller(QuerySpellerType querySpeller) { + this.querySpeller = querySpeller; + return this; + } + + /** + * Get the queryRewrites property: A value that specifies whether query rewrites should be generated to augment the + * search query. + * + * @return the queryRewrites value. + */ + @Generated + public QueryRewritesType getQueryRewrites() { + return this.queryRewrites; + } + + /** + * Set the queryRewrites property: A value that specifies whether query rewrites should be generated to augment the + * search query. + * + * @param queryRewrites the queryRewrites value to set. + * @return the SearchPostRequest object itself. + */ + @Generated + public SearchPostRequest setQueryRewrites(QueryRewritesType queryRewrites) { + this.queryRewrites = queryRewrites; + return this; + } + + /** + * Get the semanticFields property: The comma-separated list of field names used for semantic ranking. + * + * @return the semanticFields value. + */ + @Generated + public List getSemanticFields() { + return this.semanticFields; + } + + /** + * Set the semanticFields property: The comma-separated list of field names used for semantic ranking. + * + * @param semanticFields the semanticFields value to set. + * @return the SearchPostRequest object itself. + */ + @Generated + public SearchPostRequest setSemanticFields(List semanticFields) { + this.semanticFields = semanticFields; + return this; + } + + /** + * Get the hybridSearch property: The query parameters to configure hybrid search behaviors. + * + * @return the hybridSearch value. + */ + @Generated + public HybridSearch getHybridSearch() { + return this.hybridSearch; + } + + /** + * Set the hybridSearch property: The query parameters to configure hybrid search behaviors. + * + * @param hybridSearch the hybridSearch value to set. + * @return the SearchPostRequest object itself. + */ + @Generated + public SearchPostRequest setHybridSearch(HybridSearch hybridSearch) { + this.hybridSearch = hybridSearch; + return this; + } + /* * The key of the document to use as the basis for finding similar documents. This parameter cannot be used together * with search text. @@ -1108,6 +1286,13 @@ public static SearchPostRequest fromJson(JsonReader jsonReader) throws IOExcepti @Generated private String moreLikeThis; + /* + * Request-scoped runtime options when queryType is set to 'agentic'. Not supported with other query modes. Use the + * existing debug selector for diagnostics. + */ + @Generated + private AgenticSearchOptions agenticOptions; + /** * Get the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This * parameter cannot be used together with search text. @@ -1131,4 +1316,28 @@ public SearchPostRequest setMoreLikeThis(String moreLikeThis) { this.moreLikeThis = moreLikeThis; return this; } + + /** + * Get the agenticOptions property: Request-scoped runtime options when queryType is set to 'agentic'. Not supported + * with other query modes. Use the existing debug selector for diagnostics. + * + * @return the agenticOptions value. + */ + @Generated + public AgenticSearchOptions getAgenticOptions() { + return this.agenticOptions; + } + + /** + * Set the agenticOptions property: Request-scoped runtime options when queryType is set to 'agentic'. Not supported + * with other query modes. Use the existing debug selector for diagnostics. + * + * @param agenticOptions the agenticOptions value to set. + * @return the SearchPostRequest object itself. + */ + @Generated + public SearchPostRequest setAgenticOptions(AgenticSearchOptions agenticOptions) { + this.agenticOptions = agenticOptions; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java index 15c0d40474785..b49f17a46290f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java @@ -23,6 +23,7 @@ import com.azure.core.models.GeoPoint; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; import com.azure.search.documents.SearchAsyncClient; import com.azure.search.documents.SearchClientBuilder; import com.azure.search.documents.SearchServiceVersion; @@ -36,6 +37,7 @@ import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSource; import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; import com.azure.search.documents.indexes.models.ListingSearchType; import com.azure.search.documents.indexes.models.SearchAlias; import com.azure.search.documents.indexes.models.SearchField; @@ -243,6 +245,7 @@ public SearchAsyncClient getSearchAsyncClient(String indexName) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -270,6 +273,7 @@ public SearchAsyncClient getSearchAsyncClient(String indexName) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -386,8 +390,11 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -395,6 +402,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -404,6 +412,34 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -415,8 +451,6 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -480,6 +514,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -501,6 +536,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -521,7 +557,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -537,13 +573,27 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -567,8 +617,11 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -576,6 +629,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -585,6 +639,34 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -596,8 +678,6 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -661,6 +741,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -682,6 +763,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -702,7 +784,7 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -718,13 +800,27 @@ public Mono> deleteSynonymMapWithResponse(String name, RequestOpt * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -948,16 +1044,40 @@ public Mono> deleteAliasWithResponse(String name, RequestOptions * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -971,8 +1091,12 @@ public Mono> deleteAliasWithResponse(String name, RequestOptions * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -981,6 +1105,7 @@ public Mono> deleteAliasWithResponse(String name, RequestOptions * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -994,16 +1119,40 @@ public Mono> deleteAliasWithResponse(String name, RequestOptions * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -1017,8 +1166,12 @@ public Mono> deleteAliasWithResponse(String name, RequestOptions * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -1027,6 +1180,7 @@ public Mono> deleteAliasWithResponse(String name, RequestOptions * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -1091,9 +1245,10 @@ public Mono> deleteKnowledgeBaseWithResponse(String name, Request *
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -1106,6 +1261,7 @@ public Mono> deleteKnowledgeBaseWithResponse(String name, Request
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -1116,9 +1272,10 @@ public Mono> deleteKnowledgeBaseWithResponse(String name, Request
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -1131,6 +1288,7 @@ public Mono> deleteKnowledgeBaseWithResponse(String name, Request
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -1331,20 +1489,7 @@ public Mono getSynonymMap(String name) {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listSynonymMaps() {
-        return listSynonymMaps(new RequestOptions());
-    }
-
-    /**
-     * Lists all matching synonym maps, following service-provided continuation links.
-     *
-     * @param requestOptions The options to configure the HTTP request, including listing filters.
-     * @throws HttpResponseException if the service rejects the request.
-     * @return the matching synonym maps as a paginated response.
-     */
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedFlux listSynonymMaps(RequestOptions requestOptions) {
-        return this.serviceClient.listSynonymMapsAsync(requestOptions)
-            .mapPage(binaryData -> binaryData.toObject(SynonymMap.class));
+        return getSynonymMaps(null, null, null, null);
     }
 
     /**
@@ -1354,7 +1499,7 @@ public PagedFlux listSynonymMaps(RequestOptions requestOptions) {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listSynonymMapNames() {
-        return listSynonymMaps(new RequestOptions().addQueryParam("$select", "name", false))
+        return getSynonymMaps(java.util.Collections.singletonList("name"), null, null, null)
             .mapPage(SynonymMap::getName);
     }
 
@@ -2694,6 +2839,7 @@ public PagedFlux listKnowledgeSources(RequestOptions requestOpt
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     @odata.etag: String (Optional)
      * }
@@ -2737,6 +2883,7 @@ Mono> hiddenGeneratedGetSynonymMapWithResponse(String name,
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     @odata.etag: String (Optional)
      * }
@@ -2764,6 +2911,7 @@ Mono> hiddenGeneratedGetSynonymMapWithResponse(String name,
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     @odata.etag: String (Optional)
      * }
@@ -2805,8 +2953,11 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -2814,6 +2965,7 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -2823,6 +2975,34 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -2834,8 +3014,6 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -2899,6 +3077,7 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -2920,6 +3099,7 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -2940,7 +3120,7 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -2956,13 +3136,27 @@ Mono> hiddenGeneratedCreateSynonymMapWithResponse(BinaryDat
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3015,8 +3209,11 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -3024,6 +3221,7 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -3033,6 +3231,34 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -3044,8 +3270,6 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -3109,6 +3333,7 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -3130,6 +3355,7 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -3150,7 +3376,7 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -3166,13 +3392,27 @@ Mono> hiddenGeneratedGetIndexWithResponse(String name, Requ
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3211,8 +3451,11 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -3220,6 +3463,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -3229,6 +3473,34 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -3240,8 +3512,6 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -3305,6 +3575,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -3326,6 +3597,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -3346,7 +3618,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -3362,13 +3634,27 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3392,8 +3678,11 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -3401,6 +3690,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -3410,6 +3700,34 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -3421,8 +3739,6 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -3486,6 +3802,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -3507,6 +3824,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -3527,7 +3845,7 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -3543,13 +3861,27 @@ PagedFlux hiddenGeneratedListIndexes(RequestOptions requestOptions)
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3782,16 +4114,40 @@ Mono> hiddenGeneratedCreateAliasWithResponse(BinaryData ali
      *     knowledgeSources (Required): [
      *          (Required){
      *             name: String (Required)
+     *             enableImageServing: Boolean (Optional)
+     *             enableFreshness: Boolean (Optional)
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             name: String (Required)
+     *             description: String (Required)
+     *             knowledgeSources (Required): [
+     *                  (Required){
+     *                     name: String (Required)
+     *                     alwaysQuerySource: Boolean (Optional)
+     *                     rerankerThreshold: Float (Optional)
+     *                     filterAddOn: String (Optional)
+     *                     maxOutputDocuments: Integer (Optional)
+     *                     failOnError: Boolean (Optional)
+     *                 }
+     *             ]
+     *             retrievalReasoningEffort (Optional): {
+     *                 kind: String(minimal/low/medium/auto) (Required)
+     *             }
+     *             retrieveDefaults (Optional): {
+     *                 maxRuntimeInSeconds: Integer (Optional)
+     *                 maxOutputDocuments: Integer (Optional)
+     *                 maxOutputSizeInTokens: Integer (Optional)
+     *             }
      *         }
      *     ]
      *     models (Optional): [
      *          (Optional){
-     *             kind: String(azureOpenAI) (Required)
+     *             kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required)
      *         }
      *     ]
-     *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
-     *     }
+     *     retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above)
      *     outputMode: String(extractiveData/answerSynthesis) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
@@ -3805,8 +4161,12 @@ Mono> hiddenGeneratedCreateAliasWithResponse(BinaryData ali
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
      *     retrievalInstructions: String (Optional)
      *     answerInstructions: String (Optional)
      *     corsOptions (Optional): {
@@ -3815,6 +4175,7 @@ Mono> hiddenGeneratedCreateAliasWithResponse(BinaryData ali
      *         ]
      *         maxAgeInSeconds: Long (Optional)
      *     }
+     *     retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above)
      * }
      * }
      * 
@@ -3857,16 +4218,40 @@ Mono> hiddenGeneratedGetKnowledgeBaseWithResponse(String na * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -3880,8 +4265,12 @@ Mono> hiddenGeneratedGetKnowledgeBaseWithResponse(String na * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -3890,6 +4279,7 @@ Mono> hiddenGeneratedGetKnowledgeBaseWithResponse(String na * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -3918,16 +4308,40 @@ PagedFlux hiddenGeneratedListKnowledgeBases(RequestOptions requestOp * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -3941,8 +4355,12 @@ PagedFlux hiddenGeneratedListKnowledgeBases(RequestOptions requestOp * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -3951,6 +4369,7 @@ PagedFlux hiddenGeneratedListKnowledgeBases(RequestOptions requestOp * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -3964,16 +4383,40 @@ PagedFlux hiddenGeneratedListKnowledgeBases(RequestOptions requestOp * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -3987,8 +4430,12 @@ PagedFlux hiddenGeneratedListKnowledgeBases(RequestOptions requestOp * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -3997,6 +4444,7 @@ PagedFlux hiddenGeneratedListKnowledgeBases(RequestOptions requestOp * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } * @@ -4024,9 +4472,10 @@ Mono> hiddenGeneratedCreateKnowledgeBaseWithResponse(Binary *
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -4039,6 +4488,7 @@ Mono> hiddenGeneratedCreateKnowledgeBaseWithResponse(Binary
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4079,9 +4529,10 @@ Mono> hiddenGeneratedGetKnowledgeSourceWithResponse(String
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -4094,6 +4545,7 @@ Mono> hiddenGeneratedGetKnowledgeSourceWithResponse(String
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4119,9 +4571,10 @@ PagedFlux hiddenGeneratedListKnowledgeSources(RequestOptions request
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -4134,6 +4587,7 @@ PagedFlux hiddenGeneratedListKnowledgeSources(RequestOptions request
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4144,9 +4598,10 @@ PagedFlux hiddenGeneratedListKnowledgeSources(RequestOptions request
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -4159,6 +4614,7 @@ PagedFlux hiddenGeneratedListKnowledgeSources(RequestOptions request
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4187,10 +4643,14 @@ Mono> hiddenGeneratedCreateKnowledgeSourceWithResponse(Bina
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Optional)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Optional)
      *     synchronizationStatus: String(creating/active/deleting) (Required)
      *     synchronizationInterval: Duration (Optional)
      *     currentSynchronizationState (Optional): {
+     *         graphStatistics (Optional): {
+     *             ontologyName: String (Optional)
+     *             triplesWritten: long (Required)
+     *         }
      *         startTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
      *         itemsUpdatesFailed: int (Required)
@@ -4207,6 +4667,7 @@ Mono> hiddenGeneratedCreateKnowledgeSourceWithResponse(Bina
      *         ]
      *     }
      *     lastSynchronizationState (Optional): {
+     *         graphStatistics (Optional): (recursive schema, see graphStatistics above)
      *         startTime: OffsetDateTime (Required)
      *         endTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
@@ -4263,6 +4724,8 @@ Mono> hiddenGeneratedGetKnowledgeSourceStatusWithResponse(S
      *         synonymMaps (Required): (recursive schema, see synonymMaps above)
      *         skillsetCount (Required): (recursive schema, see skillsetCount above)
      *         vectorIndexSize (Required): (recursive schema, see vectorIndexSize above)
+     *         knowledgeBasesCount (Required): (recursive schema, see knowledgeBasesCount above)
+     *         knowledgeSourcesCount (Required): (recursive schema, see knowledgeSourcesCount above)
      *     }
      *     limits (Required): {
      *         maxFieldsPerIndex: Integer (Optional)
@@ -4271,6 +4734,7 @@ Mono> hiddenGeneratedGetKnowledgeSourceStatusWithResponse(S
      *         maxComplexObjectsInCollectionsPerDocument: Integer (Optional)
      *         maxStoragePerIndex: Long (Optional)
      *         maxCumulativeIndexerRuntimeSeconds: Long (Optional)
+     *         maxVectorIndexSizePerIndexInBytes: Long (Optional)
      *     }
      *     indexersRuntime (Optional): {
      *         usedSeconds: long (Required)
@@ -4331,8 +4795,11 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -4340,6 +4807,7 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -4349,6 +4817,34 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -4360,8 +4856,6 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -4425,6 +4919,7 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -4446,6 +4941,7 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -4466,7 +4962,7 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -4482,13 +4978,27 @@ Mono> hiddenGeneratedGetServiceStatisticsWithResponse(Reque
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -4562,23 +5072,43 @@ public PagedFlux listIndexesWithSelectedProperties() {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listIndexesWithSelectedProperties(List select) {
-        return listIndexesWithSelectedProperties(select, new RequestOptions());
+        RequestOptions requestOptions = new RequestOptions();
+        if (select != null) {
+            requestOptions.addQueryParam("$select",
+                select.stream()
+                    .map(paramItemValue -> Objects.toString(paramItemValue, ""))
+                    .collect(Collectors.joining(",")),
+                false);
+        }
+        PagedFlux pagedFluxResponse = hiddenGeneratedListIndexesWithSelectedProperties(requestOptions);
+        return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+            Flux> flux = (continuationTokenParam == null)
+                ? pagedFluxResponse.byPage().take(1)
+                : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+            return flux
+                .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+                    pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+                    pagedResponse.getValue()
+                        .stream()
+                        .map(protocolMethodData -> protocolMethodData.toObject(SearchIndexResponse.class))
+                        .collect(Collectors.toList()),
+                    pagedResponse.getContinuationToken(), null));
+        });
     }
 
     /**
-     * Lists matching indexes with selected properties, following service-provided continuation links.
+     * Lists all synonym maps available for a search service.
      *
-     * @param select The top-level properties to retrieve, or {@code null} to use the service default.
-     * @param requestOptions The options to configure the HTTP request, including listing filters.
-     * @throws HttpResponseException if the service rejects the request.
-     * @return the matching indexes as a paginated response.
+     * @param select Selects which top-level properties to retrieve.
+     * @param search A string used to narrow down the listing.
+     * @param pageSize The maximum number of items to return in a single page.
+     * @param searchType Specifies how the search parameter is interpreted.
+     * @return all matching synonym maps as paginated response with {@link PagedFlux}.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedFlux listIndexesWithSelectedProperties(List select,
-        RequestOptions requestOptions) {
-        if (requestOptions == null) {
-            requestOptions = new RequestOptions();
-        }
+    PagedFlux getSynonymMaps(List select, String search, Integer pageSize,
+        ListingSearchType searchType) {
+        RequestOptions requestOptions = new RequestOptions();
         if (select != null) {
             requestOptions.addQueryParam("$select",
                 select.stream()
@@ -4586,8 +5116,17 @@ public PagedFlux listIndexesWithSelectedProperties(List binaryData.toObject(SearchIndexResponse.class));
+        if (search != null) {
+            requestOptions.addQueryParam("search", search, false);
+        }
+        if (pageSize != null) {
+            requestOptions.addQueryParam("pageSize", String.valueOf(pageSize), false);
+        }
+        if (searchType != null) {
+            requestOptions.addQueryParam("searchType", searchType.toString(), false);
+        }
+        return serviceClient.listSynonymMapsAsync(requestOptions)
+            .mapPage(bodyItemValue -> bodyItemValue.toObject(SynonymMap.class));
     }
 
     /**
@@ -4734,7 +5273,7 @@ PagedFlux hiddenGeneratedListKnowledgeSourceFiles(String name, Reque
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono> deleteKnowledgeSourceFileWithResponse(String name, String fileId,
+    public Mono> deleteKnowledgeSourceFileWithResponse(String fileId, String name,
         RequestOptions requestOptions) {
         return this.serviceClient.deleteKnowledgeSourceFileWithResponseAsync(name, fileId, requestOptions);
     }
@@ -4793,10 +5332,10 @@ public PagedFlux listKnowledgeSourceFiles(String name) {
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono deleteKnowledgeSourceFile(String name, String fileId) {
+    public Mono deleteKnowledgeSourceFile(String fileId, String name) {
         // Generated convenience method for deleteKnowledgeSourceFileWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        return deleteKnowledgeSourceFileWithResponse(name, fileId, requestOptions).flatMap(FluxUtil::toMono);
+        return deleteKnowledgeSourceFileWithResponse(fileId, name, requestOptions).flatMap(FluxUtil::toMono);
     }
 
     /**
@@ -4945,7 +5484,7 @@ public PagedFlux listKnowledgeSourceFiles(String name, Stri
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono updateKnowledgeSourceFile(String name, String fileId,
+    public Mono updateKnowledgeSourceFile(String fileId, String name,
         UpdateKnowledgeSourceFileRequest body) {
         // Generated convenience method for updateKnowledgeSourceFileWithResponseInternal
         RequestOptions requestOptions = new RequestOptions();
@@ -5014,6 +5553,85 @@ public PagedFlux listIndexStatsSummary(String search, In
         });
     }
 
+    /**
+     * Uploads a file to a File knowledge source for processing and indexing.
+     * 

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. + * Must follow the format: `attachment; filename="<filename>"`. + * For example: `attachment; filename="installation-guide.pdf"`. + * @param file The file content to upload. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metadata for a file uploaded to a File knowledge source along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> hiddenGeneratedUploadKnowledgeSourceFileWithResponse(String name, + String contentDisposition, BinaryData file, RequestOptions requestOptions) { + return this.serviceClient.uploadKnowledgeSourceFileWithResponseAsync(name, contentDisposition, file, + requestOptions); + } + + /** + * Uploads a file to a File knowledge source for processing and indexing. + * + * @param name The name of the knowledge source. + * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. + * Must follow the format: `attachment; filename="<filename>"`. + * For example: `attachment; filename="installation-guide.pdf"`. + * @param file The file content to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata for a file uploaded to a File knowledge source on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono uploadKnowledgeSourceFile(String contentDisposition, String name, + BinaryData file) { + // Generated convenience method for hiddenGeneratedUploadKnowledgeSourceFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return hiddenGeneratedUploadKnowledgeSourceFileWithResponse(name, contentDisposition, file, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeSourceFile.class)); + } + /** * Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom * metadata) and a 'content' part with the raw file bytes. @@ -5142,6 +5760,7 @@ Mono> updateKnowledgeSourceFileWithResponseInternal(String * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -5162,31 +5781,400 @@ PagedFlux hiddenGeneratedListSynonymMaps(RequestOptions requestOptio } /** - * Lists matching resources as typed, lazily retrieved pages. + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux beginIngestKnowledgeSourceFileMultipartInternal(String name, BinaryData body, + RequestOptions requestOptions) { + // Operation 'ingestKnowledgeSourceFileMultipart' is of content-type 'multipart/form-data'. Protocol API is not + // usable and hence not generated. + return this.serviceClient.beginIngestKnowledgeSourceFileMultipartInternalAsync(name, body, requestOptions); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux beginIngestKnowledgeSourceFileReplacementInternal(String name, String fileId, + BinaryData body, RequestOptions requestOptions) { + // Operation 'ingestKnowledgeSourceFileReplacement' is of content-type 'multipart/form-data'. Protocol API is + // not usable and hence not generated. + return this.serviceClient.beginIngestKnowledgeSourceFileReplacementInternalAsync(name, fileId, body, + requestOptions); + } + + /** + * Gets the status and, when successful, the result of a file ingestion operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Headers

+ *
Header Parameters
+ * + * + * + *
Response Headers
NameTypeDescription
Retry-AfterintThe suggested delay in seconds before polling a nonterminal operation + * again.
+ * + * @param name The name of the knowledge source. + * @param operationId The server-generated identifier returned when ingestion was accepted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status and, when successful, the result of a file ingestion operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> hiddenGeneratedGetKnowledgeSourceFileIngestionOperationWithResponse(String name, + String operationId, RequestOptions requestOptions) { + return this.serviceClient.getKnowledgeSourceFileIngestionOperationWithResponseAsync(name, operationId, + requestOptions); + } + + /** + * Lists retained file ingestion operations for this knowledge source. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pageSizeIntegerNoThe maximum number of operations to return.
continuationTokenStringNoAn opaque continuation token returned by the + * service.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux hiddenGeneratedListKnowledgeSourceFileIngestionOperations(String name, + RequestOptions requestOptions) { + return this.serviceClient.listKnowledgeSourceFileIngestionOperationsAsync(name, requestOptions); + } + + /** + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginIngestKnowledgeSourceFileMultipart(String name, UploadKnowledgeSourceFileMultipartRequest body) { + // Generated convenience method for beginIngestKnowledgeSourceFileMultipartWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginIngestKnowledgeSourceFileMultipartWithModelAsync(name, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", body.getMetadata()) + .serializeFileField("content", body.getContent().getContent(), body.getContent().getContentType(), + body.getContent().getFilename()) + .end() + .getRequestBody(), + requestOptions); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginIngestKnowledgeSourceFileReplacement(String name, String fileId, UpdateKnowledgeSourceFileRequest body) { + // Generated convenience method for beginIngestKnowledgeSourceFileReplacementWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginIngestKnowledgeSourceFileReplacementWithModelAsync(name, fileId, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", body.getMetadata()) + .serializeFileField("content", body.getContent().getContent(), body.getContent().getContentType(), + body.getContent().getFilename()) + .end() + .getRequestBody(), + requestOptions); + } + + /** + * Gets the status and, when successful, the result of a file ingestion operation. * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return The matching resources as a paginated response with {@link PagedFlux}. + * @param name The name of the knowledge source. + * @param operationId The server-generated identifier returned when ingestion was accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status and, when successful, the result of a file ingestion operation on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getKnowledgeSourceFileIngestionOperation(String name, + String operationId) { + // Generated convenience method for hiddenGeneratedGetKnowledgeSourceFileIngestionOperationWithResponse + RequestOptions requestOptions = new RequestOptions(); + return hiddenGeneratedGetKnowledgeSourceFileIngestionOperationWithResponse(name, operationId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeSourceFileIngestionOperation.class)); + } + + /** + * Lists retained file ingestion operations for this knowledge source. + * + * @param name The name of the knowledge source. + * @param pageSize The maximum number of operations to return. + * @param continuationToken An opaque continuation token returned by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listIndexStatsSummary(RequestOptions requestOptions) { - return this.serviceClient.listIndexStatsSummaryAsync(requestOptions) - .mapPage(binaryData -> binaryData.toObject(IndexStatisticsSummary.class)); + public PagedFlux listKnowledgeSourceFileIngestionOperations(String name, + Integer pageSize, String continuationToken) { + // Generated convenience method for hiddenGeneratedListKnowledgeSourceFileIngestionOperations + RequestOptions requestOptions = new RequestOptions(); + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", String.valueOf(pageSize), false); + } + if (continuationToken != null) { + requestOptions.addQueryParam("continuationToken", continuationToken, false); + } + PagedFlux pagedFluxResponse + = hiddenGeneratedListKnowledgeSourceFileIngestionOperations(name, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux; + if (pageSizeParam == null) { + flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + } else { + flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage(pageSizeParam).take(1) + : pagedFluxResponse.byPage(continuationTokenParam, pageSizeParam).take(1); + } + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeSourceFileIngestionOperation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); } /** - * Lists matching resources as typed, lazily retrieved pages. + * Lists retained file ingestion operations for this knowledge source. * * @param name The name of the knowledge source. - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return The matching resources as a paginated response with {@link PagedFlux}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listKnowledgeSourceFiles(String name, RequestOptions requestOptions) { - return this.serviceClient.listKnowledgeSourceFilesAsync(name, requestOptions) - .mapPage(binaryData -> binaryData.toObject(KnowledgeSourceFile.class)); + public PagedFlux listKnowledgeSourceFileIngestionOperations(String name) { + // Generated convenience method for hiddenGeneratedListKnowledgeSourceFileIngestionOperations + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse + = hiddenGeneratedListKnowledgeSourceFileIngestionOperations(name, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux; + if (pageSizeParam == null) { + flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + } else { + flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage(pageSizeParam).take(1) + : pagedFluxResponse.byPage(continuationTokenParam, pageSizeParam).take(1); + } + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeSourceFileIngestionOperation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java index f3c3d19ff91b1..4b0b23cd018ab 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java @@ -20,6 +20,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.models.GeoPoint; import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; import com.azure.search.documents.SearchClient; import com.azure.search.documents.SearchClientBuilder; import com.azure.search.documents.SearchServiceVersion; @@ -33,6 +34,7 @@ import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSource; import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; import com.azure.search.documents.indexes.models.ListingSearchType; import com.azure.search.documents.indexes.models.SearchAlias; import com.azure.search.documents.indexes.models.SearchField; @@ -238,6 +240,7 @@ public SearchClient getSearchClient(String indexName) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -265,6 +268,7 @@ public SearchClient getSearchClient(String indexName) { * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -381,8 +385,11 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -390,6 +397,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -399,6 +407,34 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -410,8 +446,6 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -475,6 +509,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -496,6 +531,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -516,7 +552,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -532,13 +568,27 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -562,8 +612,11 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * filterable: Boolean (Optional) * sortable: Boolean (Optional) * facetable: Boolean (Optional) - * permissionFilter: String(userIds/groupIds/rbacScope) (Optional) + * permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * organizationAccessExpiration: Boolean (Optional) + * sensitivityLabelId: Boolean (Optional) + * sensitivityLabelName: Boolean (Optional) + * sourceDocumentId: Boolean (Optional) * sharepointSiteUrl: Boolean (Optional) * analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) * searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional) @@ -571,6 +624,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional) * dimensions: Integer (Optional) * vectorSearchProfile: String (Optional) + * topicGraphProfile: String (Optional) * vectorEncoding: String(packedBit) (Optional) * synonymMaps (Optional): [ * String (Optional) @@ -580,6 +634,34 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * ] * } * ] + * graphProfile (Optional): { + * kind: String(edgeList) (Required) + * fields (Required): { + * assertionIdField: String (Required) + * factIdField: String (Required) + * subjectField: String (Required) + * predicateField: String (Required) + * objectField: String (Required) + * objectStringField: String (Required) + * objectDoubleField: String (Required) + * objectBoolField: String (Required) + * objectDateTimeField: String (Required) + * subjectTypeField: String (Required) + * subjectIdField: String (Required) + * objectTypeField: String (Required) + * objectIdField: String (Required) + * confidenceField: String (Required) + * subjectConfidenceField: String (Required) + * predicateConfidenceField: String (Required) + * objectConfidenceField: String (Required) + * sourceChunkIdField: String (Required) + * sourceParentIdField: String (Required) + * graphNameField: String (Required) + * subjectIdDisplayNameField: String (Required) + * objectIdDisplayNameField: String (Required) + * } + * provenanceIndexName: String (Optional) + * } * scoringProfiles (Optional): [ * (Optional){ * name: String (Required) @@ -591,8 +673,6 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * functions (Optional): [ * (Optional){ * type: String (Required) - * fieldName: String (Required) - * boost: double (Required) * interpolation: String(linear/constant/quadratic/logarithmic) (Optional) * } * ] @@ -656,6 +736,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * similarity (Optional): { * @odata.type: String (Required) @@ -677,6 +758,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * ] * } * rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional) + * flightingOptIn: Boolean (Optional) * } * ] * } @@ -697,7 +779,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * ] * vectorizers (Optional): [ * (Optional){ - * kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required) + * kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required) * name: String (Required) * } * ] @@ -713,13 +795,27 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * truncationDimension: Integer (Optional) * } * ] + * topicGraphProfiles (Optional): [ + * (Optional){ + * name: String (Required) + * indexName: String (Required) + * defaultKind: String(none/diverse/balanced) (Required) + * defaultDiversityFactor: Float (Optional) + * defaultMinDiversityPoolSize: Integer (Optional) + * } + * ] * } * permissionFilterOption: String(enabled/disabled) (Optional) + * purviewEnabled: Boolean (Optional) * sharePointConnectorAppRegistration (Optional): { * applicationId: String (Required) * federatedCredentialId: String (Required) * tenantId: String (Optional) * } + * oneLakeSecuritySource (Optional): { + * fabricWorkspaceId: String (Required) + * lakehouseId: String (Required) + * } * @odata.etag: String (Optional) * } * } @@ -939,16 +1035,40 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -962,8 +1082,12 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -972,6 +1096,7 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -985,16 +1110,40 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -1008,8 +1157,12 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -1018,6 +1171,7 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -1109,9 +1263,10 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption *
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -1124,6 +1279,7 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -1134,9 +1290,10 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -1149,6 +1306,7 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -1371,20 +1529,7 @@ public SynonymMap getSynonymMap(String name) {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listSynonymMaps() {
-        return listSynonymMaps(new RequestOptions());
-    }
-
-    /**
-     * Lists all matching synonym maps, following service-provided continuation links.
-     *
-     * @param requestOptions The options to configure the HTTP request, including listing filters.
-     * @throws HttpResponseException if the service rejects the request.
-     * @return the matching synonym maps as a paginated response.
-     */
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedIterable listSynonymMaps(RequestOptions requestOptions) {
-        return this.serviceClient.listSynonymMaps(requestOptions)
-            .mapPage(binaryData -> binaryData.toObject(SynonymMap.class));
+        return getSynonymMaps(null, null, null, null);
     }
 
     /**
@@ -1394,7 +1539,7 @@ public PagedIterable listSynonymMaps(RequestOptions requestOptions)
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listSynonymMapNames() {
-        return listSynonymMaps(new RequestOptions().addQueryParam("$select", "name", false))
+        return getSynonymMaps(java.util.Collections.singletonList("name"), null, null, null)
             .mapPage(SynonymMap::getName);
     }
 
@@ -2585,6 +2730,7 @@ public PagedIterable listKnowledgeSources(RequestOptions reques
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     @odata.etag: String (Optional)
      * }
@@ -2628,6 +2774,7 @@ Response hiddenGeneratedGetSynonymMapWithResponse(String name, Reque
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     @odata.etag: String (Optional)
      * }
@@ -2655,6 +2802,7 @@ Response hiddenGeneratedGetSynonymMapWithResponse(String name, Reque
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     @odata.etag: String (Optional)
      * }
@@ -2696,8 +2844,11 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -2705,6 +2856,7 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -2714,6 +2866,34 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -2725,8 +2905,6 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -2790,6 +2968,7 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -2811,6 +2990,7 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -2831,7 +3011,7 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -2847,13 +3027,27 @@ Response hiddenGeneratedCreateSynonymMapWithResponse(BinaryData syno
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -2906,8 +3100,11 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -2915,6 +3112,7 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -2924,6 +3122,34 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -2935,8 +3161,6 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -3000,6 +3224,7 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -3021,6 +3246,7 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -3041,7 +3267,7 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -3057,13 +3283,27 @@ Response hiddenGeneratedGetIndexWithResponse(String name, RequestOpt
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3102,8 +3342,11 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -3111,6 +3354,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -3120,6 +3364,34 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -3131,8 +3403,6 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -3196,6 +3466,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -3217,6 +3488,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -3237,7 +3509,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -3253,13 +3525,27 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3283,8 +3569,11 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -3292,6 +3581,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -3301,6 +3591,34 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -3312,8 +3630,6 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -3377,6 +3693,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -3398,6 +3715,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -3418,7 +3736,7 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -3434,13 +3752,27 @@ PagedIterable hiddenGeneratedListIndexes(RequestOptions requestOptio
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -3671,16 +4003,40 @@ Response hiddenGeneratedCreateAliasWithResponse(BinaryData alias, Re
      *     knowledgeSources (Required): [
      *          (Required){
      *             name: String (Required)
+     *             enableImageServing: Boolean (Optional)
+     *             enableFreshness: Boolean (Optional)
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             name: String (Required)
+     *             description: String (Required)
+     *             knowledgeSources (Required): [
+     *                  (Required){
+     *                     name: String (Required)
+     *                     alwaysQuerySource: Boolean (Optional)
+     *                     rerankerThreshold: Float (Optional)
+     *                     filterAddOn: String (Optional)
+     *                     maxOutputDocuments: Integer (Optional)
+     *                     failOnError: Boolean (Optional)
+     *                 }
+     *             ]
+     *             retrievalReasoningEffort (Optional): {
+     *                 kind: String(minimal/low/medium/auto) (Required)
+     *             }
+     *             retrieveDefaults (Optional): {
+     *                 maxRuntimeInSeconds: Integer (Optional)
+     *                 maxOutputDocuments: Integer (Optional)
+     *                 maxOutputSizeInTokens: Integer (Optional)
+     *             }
      *         }
      *     ]
      *     models (Optional): [
      *          (Optional){
-     *             kind: String(azureOpenAI) (Required)
+     *             kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required)
      *         }
      *     ]
-     *     retrievalReasoningEffort (Optional): {
-     *         kind: String(minimal/low/medium) (Required)
-     *     }
+     *     retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above)
      *     outputMode: String(extractiveData/answerSynthesis) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
@@ -3694,8 +4050,12 @@ Response hiddenGeneratedCreateAliasWithResponse(BinaryData alias, Re
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
      *     retrievalInstructions: String (Optional)
      *     answerInstructions: String (Optional)
      *     corsOptions (Optional): {
@@ -3704,6 +4064,7 @@ Response hiddenGeneratedCreateAliasWithResponse(BinaryData alias, Re
      *         ]
      *         maxAgeInSeconds: Long (Optional)
      *     }
+     *     retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above)
      * }
      * }
      * 
@@ -3745,16 +4106,40 @@ Response hiddenGeneratedGetKnowledgeBaseWithResponse(String name, Re * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -3768,8 +4153,12 @@ Response hiddenGeneratedGetKnowledgeBaseWithResponse(String name, Re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -3778,6 +4167,7 @@ Response hiddenGeneratedGetKnowledgeBaseWithResponse(String name, Re * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -3806,16 +4196,40 @@ PagedIterable hiddenGeneratedListKnowledgeBases(RequestOptions reque * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -3829,8 +4243,12 @@ PagedIterable hiddenGeneratedListKnowledgeBases(RequestOptions reque * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -3839,6 +4257,7 @@ PagedIterable hiddenGeneratedListKnowledgeBases(RequestOptions reque * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -3852,16 +4271,40 @@ PagedIterable hiddenGeneratedListKnowledgeBases(RequestOptions reque * knowledgeSources (Required): [ * (Required){ * name: String (Required) + * enableImageServing: Boolean (Optional) + * enableFreshness: Boolean (Optional) + * } + * ] + * tools (Optional): [ + * (Optional){ + * name: String (Required) + * description: String (Required) + * knowledgeSources (Required): [ + * (Required){ + * name: String (Required) + * alwaysQuerySource: Boolean (Optional) + * rerankerThreshold: Float (Optional) + * filterAddOn: String (Optional) + * maxOutputDocuments: Integer (Optional) + * failOnError: Boolean (Optional) + * } + * ] + * retrievalReasoningEffort (Optional): { + * kind: String(minimal/low/medium/auto) (Required) + * } + * retrieveDefaults (Optional): { + * maxRuntimeInSeconds: Integer (Optional) + * maxOutputDocuments: Integer (Optional) + * maxOutputSizeInTokens: Integer (Optional) + * } * } * ] * models (Optional): [ * (Optional){ - * kind: String(azureOpenAI) (Required) + * kind: String(azureOpenAI/openAICompatible/microsoftRetriever1) (Required) * } * ] - * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) - * } + * retrievalReasoningEffort (Optional): (recursive schema, see retrievalReasoningEffort above) * outputMode: String(extractiveData/answerSynthesis) (Optional) * @odata.etag: String (Optional) * encryptionKey (Optional): { @@ -3875,8 +4318,12 @@ PagedIterable hiddenGeneratedListKnowledgeBases(RequestOptions reque * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * description: String (Optional) + * tags (Optional): { + * String: String (Required) + * } * retrievalInstructions: String (Optional) * answerInstructions: String (Optional) * corsOptions (Optional): { @@ -3885,6 +4332,7 @@ PagedIterable hiddenGeneratedListKnowledgeBases(RequestOptions reque * ] * maxAgeInSeconds: Long (Optional) * } + * retrieveDefaults (Optional): (recursive schema, see retrieveDefaults above) * } * } *
@@ -3911,9 +4359,10 @@ Response hiddenGeneratedCreateKnowledgeBaseWithResponse(BinaryData k *
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -3926,6 +4375,7 @@ Response hiddenGeneratedCreateKnowledgeBaseWithResponse(BinaryData k
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -3964,9 +4414,10 @@ Response hiddenGeneratedGetKnowledgeSourceWithResponse(String name,
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -3979,6 +4430,7 @@ Response hiddenGeneratedGetKnowledgeSourceWithResponse(String name,
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4004,9 +4456,10 @@ PagedIterable hiddenGeneratedListKnowledgeSources(RequestOptions req
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -4019,6 +4472,7 @@ PagedIterable hiddenGeneratedListKnowledgeSources(RequestOptions req
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4029,9 +4483,10 @@ PagedIterable hiddenGeneratedListKnowledgeSources(RequestOptions req
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required)
      *     name: String (Required)
      *     description: String (Optional)
+     *     resultsProcessing: String(rerank/none) (Optional)
      *     @odata.etag: String (Optional)
      *     encryptionKey (Optional): {
      *         keyVaultKeyName: String (Required)
@@ -4044,6 +4499,7 @@ PagedIterable hiddenGeneratedListKnowledgeSources(RequestOptions req
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      * }
      * }
@@ -4071,10 +4527,14 @@ Response hiddenGeneratedCreateKnowledgeSourceWithResponse(BinaryData
      * 
      * {@code
      * {
-     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Optional)
+     *     kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Optional)
      *     synchronizationStatus: String(creating/active/deleting) (Required)
      *     synchronizationInterval: Duration (Optional)
      *     currentSynchronizationState (Optional): {
+     *         graphStatistics (Optional): {
+     *             ontologyName: String (Optional)
+     *             triplesWritten: long (Required)
+     *         }
      *         startTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
      *         itemsUpdatesFailed: int (Required)
@@ -4091,6 +4551,7 @@ Response hiddenGeneratedCreateKnowledgeSourceWithResponse(BinaryData
      *         ]
      *     }
      *     lastSynchronizationState (Optional): {
+     *         graphStatistics (Optional): (recursive schema, see graphStatistics above)
      *         startTime: OffsetDateTime (Required)
      *         endTime: OffsetDateTime (Required)
      *         itemsUpdatesProcessed: int (Required)
@@ -4146,6 +4607,8 @@ Response hiddenGeneratedGetKnowledgeSourceStatusWithResponse(String
      *         synonymMaps (Required): (recursive schema, see synonymMaps above)
      *         skillsetCount (Required): (recursive schema, see skillsetCount above)
      *         vectorIndexSize (Required): (recursive schema, see vectorIndexSize above)
+     *         knowledgeBasesCount (Required): (recursive schema, see knowledgeBasesCount above)
+     *         knowledgeSourcesCount (Required): (recursive schema, see knowledgeSourcesCount above)
      *     }
      *     limits (Required): {
      *         maxFieldsPerIndex: Integer (Optional)
@@ -4154,6 +4617,7 @@ Response hiddenGeneratedGetKnowledgeSourceStatusWithResponse(String
      *         maxComplexObjectsInCollectionsPerDocument: Integer (Optional)
      *         maxStoragePerIndex: Long (Optional)
      *         maxCumulativeIndexerRuntimeSeconds: Long (Optional)
+     *         maxVectorIndexSizePerIndexInBytes: Long (Optional)
      *     }
      *     indexersRuntime (Optional): {
      *         usedSeconds: long (Required)
@@ -4213,8 +4677,11 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *             filterable: Boolean (Optional)
      *             sortable: Boolean (Optional)
      *             facetable: Boolean (Optional)
-     *             permissionFilter: String(userIds/groupIds/rbacScope) (Optional)
+     *             permissionFilter: String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional)
      *             organizationAccessExpiration: Boolean (Optional)
+     *             sensitivityLabelId: Boolean (Optional)
+     *             sensitivityLabelName: Boolean (Optional)
+     *             sourceDocumentId: Boolean (Optional)
      *             sharepointSiteUrl: Boolean (Optional)
      *             analyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
      *             searchAnalyzer: String(ar.microsoft/ar.lucene/hy.lucene/bn.microsoft/eu.lucene/bg.microsoft/bg.lucene/ca.microsoft/ca.lucene/zh-Hans.microsoft/zh-Hans.lucene/zh-Hant.microsoft/zh-Hant.lucene/hr.microsoft/cs.microsoft/cs.lucene/da.microsoft/da.lucene/nl.microsoft/nl.lucene/en.microsoft/en.lucene/et.microsoft/fi.microsoft/fi.lucene/fr.microsoft/fr.lucene/gl.lucene/de.microsoft/de.lucene/el.microsoft/el.lucene/gu.microsoft/he.microsoft/hi.microsoft/hi.lucene/hu.microsoft/hu.lucene/is.microsoft/id.microsoft/id.lucene/ga.lucene/it.microsoft/it.lucene/ja.microsoft/ja.lucene/kn.microsoft/ko.microsoft/ko.lucene/lv.microsoft/lv.lucene/lt.microsoft/ml.microsoft/ms.microsoft/mr.microsoft/nb.microsoft/no.lucene/fa.lucene/pl.microsoft/pl.lucene/pt-BR.microsoft/pt-BR.lucene/pt-PT.microsoft/pt-PT.lucene/pa.microsoft/ro.microsoft/ro.lucene/ru.microsoft/ru.lucene/sr-cyrillic.microsoft/sr-latin.microsoft/sk.microsoft/sl.microsoft/es.microsoft/es.lucene/sv.microsoft/sv.lucene/ta.microsoft/te.microsoft/th.microsoft/th.lucene/tr.microsoft/tr.lucene/uk.microsoft/ur.microsoft/vi.microsoft/standard.lucene/standardasciifolding.lucene/keyword/pattern/simple/stop/whitespace) (Optional)
@@ -4222,6 +4689,7 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *             normalizer: String(asciifolding/elision/lowercase/standard/uppercase) (Optional)
      *             dimensions: Integer (Optional)
      *             vectorSearchProfile: String (Optional)
+     *             topicGraphProfile: String (Optional)
      *             vectorEncoding: String(packedBit) (Optional)
      *             synonymMaps (Optional): [
      *                 String (Optional)
@@ -4231,6 +4699,34 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *             ]
      *         }
      *     ]
+     *     graphProfile (Optional): {
+     *         kind: String(edgeList) (Required)
+     *         fields (Required): {
+     *             assertionIdField: String (Required)
+     *             factIdField: String (Required)
+     *             subjectField: String (Required)
+     *             predicateField: String (Required)
+     *             objectField: String (Required)
+     *             objectStringField: String (Required)
+     *             objectDoubleField: String (Required)
+     *             objectBoolField: String (Required)
+     *             objectDateTimeField: String (Required)
+     *             subjectTypeField: String (Required)
+     *             subjectIdField: String (Required)
+     *             objectTypeField: String (Required)
+     *             objectIdField: String (Required)
+     *             confidenceField: String (Required)
+     *             subjectConfidenceField: String (Required)
+     *             predicateConfidenceField: String (Required)
+     *             objectConfidenceField: String (Required)
+     *             sourceChunkIdField: String (Required)
+     *             sourceParentIdField: String (Required)
+     *             graphNameField: String (Required)
+     *             subjectIdDisplayNameField: String (Required)
+     *             objectIdDisplayNameField: String (Required)
+     *         }
+     *         provenanceIndexName: String (Optional)
+     *     }
      *     scoringProfiles (Optional): [
      *          (Optional){
      *             name: String (Required)
@@ -4242,8 +4738,6 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *             functions (Optional): [
      *                  (Optional){
      *                     type: String (Required)
-     *                     fieldName: String (Required)
-     *                     boost: double (Required)
      *                     interpolation: String(linear/constant/quadratic/logarithmic) (Optional)
      *                 }
      *             ]
@@ -4307,6 +4801,7 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *         identity (Optional): {
      *             @odata.type: String (Required)
      *         }
+     *         isServiceLevelKey: Boolean (Optional)
      *     }
      *     similarity (Optional): {
      *         @odata.type: String (Required)
@@ -4328,6 +4823,7 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *                     ]
      *                 }
      *                 rankingOrder: String(BoostedRerankerScore/RerankerScore) (Optional)
+     *                 flightingOptIn: Boolean (Optional)
      *             }
      *         ]
      *     }
@@ -4348,7 +4844,7 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *         ]
      *         vectorizers (Optional): [
      *              (Optional){
-     *                 kind: String(azureOpenAI/customWebApi/aiServicesVision/aml) (Required)
+     *                 kind: String(azureOpenAI/openAICompatible/customWebApi/aiServicesVision/aml) (Required)
      *                 name: String (Required)
      *             }
      *         ]
@@ -4364,13 +4860,27 @@ Response hiddenGeneratedGetServiceStatisticsWithResponse(RequestOpti
      *                 truncationDimension: Integer (Optional)
      *             }
      *         ]
+     *         topicGraphProfiles (Optional): [
+     *              (Optional){
+     *                 name: String (Required)
+     *                 indexName: String (Required)
+     *                 defaultKind: String(none/diverse/balanced) (Required)
+     *                 defaultDiversityFactor: Float (Optional)
+     *                 defaultMinDiversityPoolSize: Integer (Optional)
+     *             }
+     *         ]
      *     }
      *     permissionFilterOption: String(enabled/disabled) (Optional)
+     *     purviewEnabled: Boolean (Optional)
      *     sharePointConnectorAppRegistration (Optional): {
      *         applicationId: String (Required)
      *         federatedCredentialId: String (Required)
      *         tenantId: String (Optional)
      *     }
+     *     oneLakeSecuritySource (Optional): {
+     *         fabricWorkspaceId: String (Required)
+     *         lakehouseId: String (Required)
+     *     }
      *     @odata.etag: String (Optional)
      * }
      * }
@@ -4425,23 +4935,7 @@ public PagedIterable listIndexesWithSelectedProperties() {
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listIndexesWithSelectedProperties(List select) {
-        return listIndexesWithSelectedProperties(select, new RequestOptions());
-    }
-
-    /**
-     * Lists matching indexes with selected properties, following service-provided continuation links.
-     *
-     * @param select The top-level properties to retrieve, or {@code null} to use the service default.
-     * @param requestOptions The options to configure the HTTP request, including listing filters.
-     * @throws HttpResponseException if the service rejects the request.
-     * @return the matching indexes as a paginated response.
-     */
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedIterable listIndexesWithSelectedProperties(List select,
-        RequestOptions requestOptions) {
-        if (requestOptions == null) {
-            requestOptions = new RequestOptions();
-        }
+        RequestOptions requestOptions = new RequestOptions();
         if (select != null) {
             requestOptions.addQueryParam("$select",
                 select.stream()
@@ -4578,7 +5072,7 @@ PagedIterable hiddenGeneratedListKnowledgeSourceFiles(String name, R
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Response deleteKnowledgeSourceFileWithResponse(String name, String fileId,
+    public Response deleteKnowledgeSourceFileWithResponse(String fileId, String name,
         RequestOptions requestOptions) {
         return this.serviceClient.deleteKnowledgeSourceFileWithResponse(name, fileId, requestOptions);
     }
@@ -4617,10 +5111,10 @@ public PagedIterable listKnowledgeSourceFiles(String name)
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public void deleteKnowledgeSourceFile(String name, String fileId) {
+    public void deleteKnowledgeSourceFile(String fileId, String name) {
         // Generated convenience method for deleteKnowledgeSourceFileWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        deleteKnowledgeSourceFileWithResponse(name, fileId, requestOptions).getValue();
+        deleteKnowledgeSourceFileWithResponse(fileId, name, requestOptions).getValue();
     }
 
     /**
@@ -4710,7 +5204,7 @@ public PagedIterable listKnowledgeSourceFiles(String name,
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public KnowledgeSourceFile updateKnowledgeSourceFile(String name, String fileId,
+    public KnowledgeSourceFile updateKnowledgeSourceFile(String fileId, String name,
         UpdateKnowledgeSourceFileRequest body) {
         // Generated convenience method for updateKnowledgeSourceFileWithResponseInternal
         RequestOptions requestOptions = new RequestOptions();
@@ -4759,6 +5253,82 @@ public PagedIterable listIndexStatsSummary(String search
             .mapPage(bodyItemValue -> bodyItemValue.toObject(IndexStatisticsSummary.class));
     }
 
+    /**
+     * Uploads a file to a File knowledge source for processing and indexing.
+     * 

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileId: String (Optional)
+     *     fileName: String (Optional)
+     *     fileSizeBytes: Long (Optional)
+     *     createdAt: OffsetDateTime (Optional)
+     *     lastUpdatedAt: OffsetDateTime (Optional)
+     *     errorMessage: String (Optional)
+     *     prefix: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *     extractionMode: String(minimal/standard) (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. + * Must follow the format: `attachment; filename="<filename>"`. + * For example: `attachment; filename="installation-guide.pdf"`. + * @param file The file content to upload. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metadata for a file uploaded to a File knowledge source along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response hiddenGeneratedUploadKnowledgeSourceFileWithResponse(String name, String contentDisposition, + BinaryData file, RequestOptions requestOptions) { + return this.serviceClient.uploadKnowledgeSourceFileWithResponse(name, contentDisposition, file, requestOptions); + } + + /** + * Uploads a file to a File knowledge source for processing and indexing. + * + * @param name The name of the knowledge source. + * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. + * Must follow the format: `attachment; filename="<filename>"`. + * For example: `attachment; filename="installation-guide.pdf"`. + * @param file The file content to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metadata for a file uploaded to a File knowledge source. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public KnowledgeSourceFile uploadKnowledgeSourceFile(String contentDisposition, String name, BinaryData file) { + // Generated convenience method for hiddenGeneratedUploadKnowledgeSourceFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return hiddenGeneratedUploadKnowledgeSourceFileWithResponse(name, contentDisposition, file, requestOptions) + .getValue() + .toObject(KnowledgeSourceFile.class); + } + /** * Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom * metadata) and a 'content' part with the raw file bytes. @@ -4883,6 +5453,7 @@ Response updateKnowledgeSourceFileWithResponseInternal(String name, * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) * } * @odata.etag: String (Optional) * } @@ -4903,31 +5474,378 @@ PagedIterable hiddenGeneratedListSynonymMaps(RequestOptions requestO } /** - * Lists matching resources as typed, lazily retrieved pages. + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller beginIngestKnowledgeSourceFileMultipartInternal(String name, BinaryData body, + RequestOptions requestOptions) { + // Operation 'ingestKnowledgeSourceFileMultipart' is of content-type 'multipart/form-data'. Protocol API is not + // usable and hence not generated. + return this.serviceClient.beginIngestKnowledgeSourceFileMultipartInternal(name, body, requestOptions); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller beginIngestKnowledgeSourceFileReplacementInternal(String name, String fileId, + BinaryData body, RequestOptions requestOptions) { + // Operation 'ingestKnowledgeSourceFileReplacement' is of content-type 'multipart/form-data'. Protocol API is + // not usable and hence not generated. + return this.serviceClient.beginIngestKnowledgeSourceFileReplacementInternal(name, fileId, body, requestOptions); + } + + /** + * Gets the status and, when successful, the result of a file ingestion operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Headers

+ * + * + * + * + *
Response Headers
NameTypeDescription
Retry-AfterintThe suggested delay in seconds before polling a nonterminal operation + * again.
* - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return The matching resources as a paginated response with {@link PagedIterable}. + * @param name The name of the knowledge source. + * @param operationId The server-generated identifier returned when ingestion was accepted. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status and, when successful, the result of a file ingestion operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response hiddenGeneratedGetKnowledgeSourceFileIngestionOperationWithResponse(String name, + String operationId, RequestOptions requestOptions) { + return this.serviceClient.getKnowledgeSourceFileIngestionOperationWithResponse(name, operationId, + requestOptions); + } + + /** + * Lists retained file ingestion operations for this knowledge source. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pageSizeIntegerNoThe maximum number of operations to return.
continuationTokenStringNoAn opaque continuation token returned by the + * service.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     kind: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     result (Optional): {
+     *         fileId: String (Optional)
+     *         fileName: String (Optional)
+     *         fileSizeBytes: Long (Optional)
+     *         createdAt: OffsetDateTime (Optional)
+     *         lastUpdatedAt: OffsetDateTime (Optional)
+     *         errorMessage: String (Optional)
+     *         prefix: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         parsingMode: String(default/text/delimitedText/json/jsonArray/jsonLines/markdown) (Optional)
+     *         extractionMode: String(minimal/standard) (Optional)
+     *     }
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listIndexStatsSummary(RequestOptions requestOptions) { - return this.serviceClient.listIndexStatsSummary(requestOptions) - .mapPage(binaryData -> binaryData.toObject(IndexStatisticsSummary.class)); + PagedIterable hiddenGeneratedListKnowledgeSourceFileIngestionOperations(String name, + RequestOptions requestOptions) { + return this.serviceClient.listKnowledgeSourceFileIngestionOperations(name, requestOptions); } /** - * Lists matching resources as typed, lazily retrieved pages. + * Starts asynchronous ingestion of a new file into a File knowledge source, processed on a Content Processor. Poll + * the returned operation to retrieve the created file. * * @param name The name of the knowledge source. - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return The matching resources as a paginated response with {@link PagedIterable}. + * @param body The multipart/form-data body containing the metadata and content parts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginIngestKnowledgeSourceFileMultipart(String name, UploadKnowledgeSourceFileMultipartRequest body) { + // Generated convenience method for beginIngestKnowledgeSourceFileMultipartWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginIngestKnowledgeSourceFileMultipartWithModel(name, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", body.getMetadata()) + .serializeFileField("content", body.getContent().getContent(), body.getContent().getContentType(), + body.getContent().getFilename()) + .end() + .getRequestBody(), + requestOptions); + } + + /** + * Starts asynchronous ingestion that replaces an existing file in a File knowledge source, processed on a Content + * Processor. Poll the returned operation to retrieve the updated file. + * + * @param name The name of the knowledge source. + * @param fileId The unique identifier of the file to update. + * @param body The multipart/form-data body containing the metadata and content parts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of tracks asynchronous upload or replacement of a file in a knowledge + * source. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginIngestKnowledgeSourceFileReplacement(String name, String fileId, UpdateKnowledgeSourceFileRequest body) { + // Generated convenience method for beginIngestKnowledgeSourceFileReplacementWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginIngestKnowledgeSourceFileReplacementWithModel(name, fileId, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", body.getMetadata()) + .serializeFileField("content", body.getContent().getContent(), body.getContent().getContentType(), + body.getContent().getFilename()) + .end() + .getRequestBody(), + requestOptions); + } + + /** + * Gets the status and, when successful, the result of a file ingestion operation. + * + * @param name The name of the knowledge source. + * @param operationId The server-generated identifier returned when ingestion was accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status and, when successful, the result of a file ingestion operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public KnowledgeSourceFileIngestionOperation getKnowledgeSourceFileIngestionOperation(String name, + String operationId) { + // Generated convenience method for hiddenGeneratedGetKnowledgeSourceFileIngestionOperationWithResponse + RequestOptions requestOptions = new RequestOptions(); + return hiddenGeneratedGetKnowledgeSourceFileIngestionOperationWithResponse(name, operationId, requestOptions) + .getValue() + .toObject(KnowledgeSourceFileIngestionOperation.class); + } + + /** + * Lists retained file ingestion operations for this knowledge source. + * + * @param name The name of the knowledge source. + * @param pageSize The maximum number of operations to return. + * @param continuationToken An opaque continuation token returned by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listKnowledgeSourceFileIngestionOperations(String name, + Integer pageSize, String continuationToken) { + // Generated convenience method for listKnowledgeSourceFileIngestionOperations + RequestOptions requestOptions = new RequestOptions(); + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", String.valueOf(pageSize), false); + } + if (continuationToken != null) { + requestOptions.addQueryParam("continuationToken", continuationToken, false); + } + return serviceClient.listKnowledgeSourceFileIngestionOperations(name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(KnowledgeSourceFileIngestionOperation.class)); + } + + /** + * Lists retained file ingestion operations for this knowledge source. + * + * @param name The name of the knowledge source. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a page of retained ingestion operations belonging to a knowledge source as paginated response with + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKnowledgeSourceFiles(String name, RequestOptions requestOptions) { - return this.serviceClient.listKnowledgeSourceFiles(name, requestOptions) - .mapPage(binaryData -> binaryData.toObject(KnowledgeSourceFile.class)); + public PagedIterable + listKnowledgeSourceFileIngestionOperations(String name) { + // Generated convenience method for listKnowledgeSourceFileIngestionOperations + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listKnowledgeSourceFileIngestionOperations(name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(KnowledgeSourceFileIngestionOperation.class)); + } + + PagedIterable getSynonymMaps(List select, String search, Integer pageSize, + ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listSynonymMaps(requestOptions).mapPage(value -> value.toObject(SynonymMap.class)); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java index a8eb7ddfc33e8..34dc920e485e3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java @@ -22,11 +22,15 @@ import com.azure.core.util.FluxUtil; import com.azure.search.documents.SearchServiceVersion; import com.azure.search.documents.implementation.SearchIndexerClientImpl; +import com.azure.search.documents.indexes.models.DocumentKeysOrIds; import com.azure.search.documents.indexes.models.IndexerResyncBody; +import com.azure.search.documents.indexes.models.ListingSearchType; import com.azure.search.documents.indexes.models.SearchIndexer; import com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection; import com.azure.search.documents.indexes.models.SearchIndexerSkillset; import com.azure.search.documents.indexes.models.SearchIndexerStatus; +import com.azure.search.documents.indexes.models.SkillNames; +import java.util.List; import reactor.core.publisher.Mono; /** @@ -77,6 +81,13 @@ public SearchServiceVersion getServiceVersion() { /** * Creates a new datasource or updates a datasource if it already exists. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -95,6 +106,7 @@ public SearchServiceVersion getServiceVersion() { * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -106,7 +118,7 @@ public SearchServiceVersion getServiceVersion() { * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -124,6 +136,7 @@ public SearchServiceVersion getServiceVersion() { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -137,6 +150,7 @@ public SearchServiceVersion getServiceVersion() { * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -148,7 +162,7 @@ public SearchServiceVersion getServiceVersion() { * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -166,6 +180,7 @@ public SearchServiceVersion getServiceVersion() { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -292,6 +307,15 @@ public Mono> runIndexerWithResponse(String name, RequestOptions r /** * Creates a new indexer or updates an indexer if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -373,6 +397,13 @@ public Mono> runIndexerWithResponse(String name, RequestOptions r * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -449,6 +480,13 @@ public Mono> runIndexerWithResponse(String name, RequestOptions r * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -539,6 +577,15 @@ public Mono> deleteIndexerWithResponse(String name, RequestOption /** * Creates a new skillset in a search service or updates the skillset if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -629,6 +676,12 @@ public Mono> deleteIndexerWithResponse(String name, RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -658,6 +711,7 @@ public Mono> deleteIndexerWithResponse(String name, RequestOption * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -743,6 +797,12 @@ public Mono> deleteIndexerWithResponse(String name, RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -772,6 +832,7 @@ public Mono> deleteIndexerWithResponse(String name, RequestOption * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -989,20 +1050,7 @@ public Mono getDataSourceConnection(String na */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDataSourceConnections() { - return listDataSourceConnections(new RequestOptions()); - } - - /** - * Lists all matching datasources, following service-provided continuation links. - * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return the matching datasources as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDataSourceConnections(RequestOptions requestOptions) { - return this.serviceClient.listDataSourceConnectionsAsync(requestOptions) - .mapPage(binaryData -> binaryData.toObject(SearchIndexerDataSourceConnection.class)); + return getDataSourceConnections(null, null, null, null); } /** @@ -1012,20 +1060,10 @@ public PagedFlux listDataSourceConnections(Re */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDataSourceConnectionNames() { - return listDataSourceConnections(new RequestOptions().addQueryParam("$select", "name", false)) + return getDataSourceConnections(java.util.Collections.singletonList("name"), null, null, null) .mapPage(SearchIndexerDataSourceConnection::getName); } - /** - * Lists all datasources available for a search service. - * - * @return the datasources as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getDataSourceConnections() { - return listDataSourceConnections(); - } - /** * Creates a new datasource. * @@ -1214,30 +1252,7 @@ public Mono getIndexer(String name) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listIndexers() { - return listIndexers(new RequestOptions()); - } - - /** - * Lists all matching indexers, following service-provided continuation links. - * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return the matching indexers as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listIndexers(RequestOptions requestOptions) { - return this.serviceClient.listIndexersAsync(requestOptions) - .mapPage(binaryData -> binaryData.toObject(SearchIndexer.class)); - } - - /** - * Lists the names of all indexers available for a search service. - * - * @return the names of all indexers as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getIndexers() { - return listIndexers(); + return getIndexers(null, null, null, null); } /** @@ -1247,7 +1262,7 @@ PagedFlux getIndexers() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listIndexerNames() { - return listIndexers(new RequestOptions().addQueryParam("$select", "name", false)) + return getIndexers(java.util.Collections.singletonList("name"), null, null, null) .mapPage(SearchIndexer::getName); } @@ -1418,32 +1433,8 @@ public Mono getSkillset(String name) { * @return all skillsets as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux getSkillsets() { - return listSkillsets(null); - } - - /** - * Lists all skillsets available for a search service. - * - * @throws HttpResponseException if the service rejects the request. - * @return the matching skillsets as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSkillsets() { - return listSkillsets(null); - } - - /** - * List all skillsets in a search service. - * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return the matching skillsets as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkillsets(RequestOptions requestOptions) { - return this.serviceClient.listSkillsetsAsync(requestOptions) - .mapPage(binaryData -> binaryData.toObject(SearchIndexerSkillset.class)); + return getSkillsets(null, null, null, null); } /** @@ -1453,7 +1444,7 @@ public PagedFlux listSkillsets(RequestOptions requestOpti */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSkillsetNames() { - return listSkillsets(new RequestOptions().addQueryParam("$select", "name", false)) + return getSkillsets(java.util.Collections.singletonList("name"), null, null, null) .mapPage(SearchIndexerSkillset::getName); } @@ -1617,6 +1608,7 @@ public Mono> createSkillsetWithResponse(SearchIn * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1628,7 +1620,7 @@ public Mono> createSkillsetWithResponse(SearchIn * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1646,6 +1638,7 @@ public Mono> createSkillsetWithResponse(SearchIn * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1677,6 +1670,7 @@ Mono> hiddenGeneratedGetDataSourceConnectionWithResponse(St * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1688,7 +1682,7 @@ Mono> hiddenGeneratedGetDataSourceConnectionWithResponse(St * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1706,6 +1700,7 @@ Mono> hiddenGeneratedGetDataSourceConnectionWithResponse(St * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1719,6 +1714,7 @@ Mono> hiddenGeneratedGetDataSourceConnectionWithResponse(St * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1730,7 +1726,7 @@ Mono> hiddenGeneratedGetDataSourceConnectionWithResponse(St * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1748,6 +1744,7 @@ Mono> hiddenGeneratedGetDataSourceConnectionWithResponse(St * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1842,6 +1839,13 @@ Mono> hiddenGeneratedCreateDataSourceConnectionWithResponse * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -1934,6 +1938,13 @@ Mono> hiddenGeneratedGetIndexerWithResponse(String name, Re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2010,6 +2021,13 @@ Mono> hiddenGeneratedGetIndexerWithResponse(String name, Re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2047,6 +2065,8 @@ Mono> hiddenGeneratedCreateIndexerWithResponse(BinaryData i * } * lastResult (Optional): { * status: String(transientFailure/success/inProgress/reset) (Required) + * statusDetail: String(resetDocs/resync) (Optional) + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) * errorMessage: String (Optional) * startTime: OffsetDateTime (Optional) * endTime: OffsetDateTime (Optional) @@ -2082,6 +2102,21 @@ Mono> hiddenGeneratedCreateIndexerWithResponse(BinaryData i * maxDocumentExtractionSize: Long (Optional) * maxDocumentContentCharactersToExtract: Long (Optional) * } + * currentState (Optional): { + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) + * allDocsInitialTrackingState: String (Optional) + * allDocsFinalTrackingState: String (Optional) + * resetDocsInitialTrackingState: String (Optional) + * resetDocsFinalTrackingState: String (Optional) + * resyncInitialTrackingState: String (Optional) + * resyncFinalTrackingState: String (Optional) + * resetDocumentKeys (Optional): [ + * String (Optional) + * ] + * resetDatasourceDocumentIds (Optional): [ + * String (Optional) + * ] + * } * } * } * @@ -2183,6 +2218,12 @@ Mono> hiddenGeneratedGetIndexerStatusWithResponse(String na * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2212,6 +2253,7 @@ Mono> hiddenGeneratedGetIndexerStatusWithResponse(String na * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2313,6 +2355,12 @@ Mono> hiddenGeneratedGetSkillsetWithResponse(String name, R * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2342,6 +2390,7 @@ Mono> hiddenGeneratedGetSkillsetWithResponse(String name, R * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2427,6 +2476,12 @@ Mono> hiddenGeneratedGetSkillsetWithResponse(String name, R * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2456,6 +2511,7 @@ Mono> hiddenGeneratedGetSkillsetWithResponse(String name, R * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2506,6 +2562,83 @@ Mono> hiddenGeneratedResyncWithResponse(String name, BinaryData i return this.serviceClient.resyncWithResponseAsync(name, indexerResync, requestOptions); } + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
overwriteBooleanNoIf false, keys or ids will be appended to existing ones. If + * true, only the keys or ids in this payload will be queued to be re-ingested.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     documentKeys (Optional): [
+     *         String (Optional)
+     *     ]
+     *     datasourceDocumentIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the indexer. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resetDocumentsWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.resetDocumentsWithResponseAsync(name, requestOptions); + } + + /** + * Reset an existing skillset in a search service. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     skillNames (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the skillset. + * @param skillNames The names of the skills to reset. If not specified, all skills in the skillset will be reset. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> hiddenGeneratedResetSkillsWithResponse(String name, BinaryData skillNames, + RequestOptions requestOptions) { + return this.serviceClient.resetSkillsWithResponseAsync(name, skillNames, requestOptions); + } + /** * Resync selective options from the datasource to be re-ingested by the indexer.". * @@ -2528,6 +2661,78 @@ public Mono resync(String name, IndexerResyncBody indexerResync) { .flatMap(FluxUtil::toMono); } + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + * + * @param name The name of the indexer. + * @param overwrite If false, keys or ids will be appended to existing ones. If true, only the keys or ids in this + * payload will be queued to be re-ingested. + * @param keysOrIds The keys or ids of the documents to be re-ingested. If keys are provided, the document key field + * must be specified in the indexer configuration. If ids are provided, the document key field is ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resetDocuments(String name, Boolean overwrite, DocumentKeysOrIds keysOrIds) { + // Generated convenience method for resetDocumentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (overwrite != null) { + requestOptions.addQueryParam("overwrite", String.valueOf(overwrite), false); + } + if (keysOrIds != null) { + requestOptions.setBody(BinaryData.fromObject(keysOrIds)); + } + return resetDocumentsWithResponse(name, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + * + * @param name The name of the indexer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resetDocuments(String name) { + // Generated convenience method for resetDocumentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return resetDocumentsWithResponse(name, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Reset an existing skillset in a search service. + * + * @param name The name of the skillset. + * @param skillNames The names of the skills to reset. If not specified, all skills in the skillset will be reset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resetSkills(String name, SkillNames skillNames) { + // Generated convenience method for hiddenGeneratedResetSkillsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return hiddenGeneratedResetSkillsWithResponse(name, BinaryData.fromObject(skillNames), requestOptions) + .flatMap(FluxUtil::toMono); + } + /** * Lists all datasources available for a search service. *

Query Parameters

@@ -2553,6 +2758,7 @@ public Mono resync(String name, IndexerResyncBody indexerResync) { * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -2564,7 +2770,7 @@ public Mono resync(String name, IndexerResyncBody indexerResync) { * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -2582,6 +2788,7 @@ public Mono resync(String name, IndexerResyncBody indexerResync) { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2688,6 +2895,13 @@ PagedFlux hiddenGeneratedListDataSourceConnections(RequestOptions re * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2803,6 +3017,12 @@ PagedFlux hiddenGeneratedListIndexers(RequestOptions requestOptions) * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2832,6 +3052,7 @@ PagedFlux hiddenGeneratedListIndexers(RequestOptions requestOptions) * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2849,4 +3070,60 @@ PagedFlux hiddenGeneratedListIndexers(RequestOptions requestOptions) PagedFlux hiddenGeneratedListSkillsets(RequestOptions requestOptions) { return this.serviceClient.listSkillsetsAsync(requestOptions); } + + PagedFlux getDataSourceConnections(List select, String search, + Integer pageSize, ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listDataSourceConnectionsAsync(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerDataSourceConnection.class)); + } + + PagedFlux getIndexers(List select, String search, Integer pageSize, + ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listIndexersAsync(requestOptions).mapPage(value -> value.toObject(SearchIndexer.class)); + } + + PagedFlux getSkillsets(List select, String search, Integer pageSize, + ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listSkillsetsAsync(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerSkillset.class)); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java index 1b1f6d66d23ea..9d37df8a64ebc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java @@ -21,11 +21,15 @@ import com.azure.core.util.BinaryData; import com.azure.search.documents.SearchServiceVersion; import com.azure.search.documents.implementation.SearchIndexerClientImpl; +import com.azure.search.documents.indexes.models.DocumentKeysOrIds; import com.azure.search.documents.indexes.models.IndexerResyncBody; +import com.azure.search.documents.indexes.models.ListingSearchType; import com.azure.search.documents.indexes.models.SearchIndexer; import com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection; import com.azure.search.documents.indexes.models.SearchIndexerSkillset; import com.azure.search.documents.indexes.models.SearchIndexerStatus; +import com.azure.search.documents.indexes.models.SkillNames; +import java.util.List; /** * Initializes a new instance of the synchronous SearchIndexerClient type. @@ -75,6 +79,13 @@ public SearchServiceVersion getServiceVersion() { /** * Creates a new datasource or updates a datasource if it already exists. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -93,6 +104,7 @@ public SearchServiceVersion getServiceVersion() { * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -104,7 +116,7 @@ public SearchServiceVersion getServiceVersion() { * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -122,6 +134,7 @@ public SearchServiceVersion getServiceVersion() { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -135,6 +148,7 @@ public SearchServiceVersion getServiceVersion() { * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -146,7 +160,7 @@ public SearchServiceVersion getServiceVersion() { * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -164,6 +178,7 @@ public SearchServiceVersion getServiceVersion() { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -284,6 +299,15 @@ public Response runIndexerWithResponse(String name, RequestOptions request /** * Creates a new indexer or updates an indexer if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -365,6 +389,13 @@ public Response runIndexerWithResponse(String name, RequestOptions request * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -441,6 +472,13 @@ public Response runIndexerWithResponse(String name, RequestOptions request * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -527,6 +565,15 @@ public Response deleteIndexerWithResponse(String name, RequestOptions requ /** * Creates a new skillset in a search service or updates the skillset if it already exists. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
ignoreResetRequirementsBooleanNoIgnores cache reset requirements.
disableCacheReprocessingChangeDetectionBooleanNoDisables cache reprocessing + * change detection.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * @@ -617,6 +664,12 @@ public Response deleteIndexerWithResponse(String name, RequestOptions requ * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -646,6 +699,7 @@ public Response deleteIndexerWithResponse(String name, RequestOptions requ * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -731,6 +785,12 @@ public Response deleteIndexerWithResponse(String name, RequestOptions requ * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -760,6 +820,7 @@ public Response deleteIndexerWithResponse(String name, RequestOptions requ * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -964,20 +1025,7 @@ public SearchIndexerDataSourceConnection getDataSourceConnection(String name) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDataSourceConnections() { - return listDataSourceConnections(new RequestOptions()); - } - - /** - * Lists all matching datasources, following service-provided continuation links. - * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return the matching datasources as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDataSourceConnections(RequestOptions requestOptions) { - return this.serviceClient.listDataSourceConnections(requestOptions) - .mapPage(binaryData -> binaryData.toObject(SearchIndexerDataSourceConnection.class)); + return getDataSourceConnections(null, null, null, null); } /** @@ -987,7 +1035,7 @@ public PagedIterable listDataSourceConnection */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDataSourceConnectionNames() { - return listDataSourceConnections(new RequestOptions().addQueryParam("$select", "name", false)) + return getDataSourceConnections(java.util.Collections.singletonList("name"), null, null, null) .mapPage(SearchIndexerDataSourceConnection::getName); } @@ -1167,20 +1215,7 @@ public SearchIndexer getIndexer(String name) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listIndexers() { - return listIndexers(new RequestOptions()); - } - - /** - * Lists all matching indexers, following service-provided continuation links. - * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return the matching indexers as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listIndexers(RequestOptions requestOptions) { - return this.serviceClient.listIndexers(requestOptions) - .mapPage(binaryData -> binaryData.toObject(SearchIndexer.class)); + return getIndexers(null, null, null, null); } /** @@ -1190,7 +1225,7 @@ public PagedIterable listIndexers(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listIndexerNames() { - return listIndexers(new RequestOptions().addQueryParam("$select", "name", false)) + return getIndexers(java.util.Collections.singletonList("name"), null, null, null) .mapPage(SearchIndexer::getName); } @@ -1353,20 +1388,7 @@ public SearchIndexerSkillset getSkillset(String name) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSkillsets() { - return listSkillsets(new RequestOptions()); - } - - /** - * Lists all matching skillsets, following service-provided continuation links. - * - * @param requestOptions The options to configure the HTTP request, including listing filters. - * @throws HttpResponseException if the service rejects the request. - * @return the matching skillsets as a paginated response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkillsets(RequestOptions requestOptions) { - return this.serviceClient.listSkillsets(requestOptions) - .mapPage(binaryData -> binaryData.toObject(SearchIndexerSkillset.class)); + return getSkillsets(null, null, null, null); } /** @@ -1376,7 +1398,7 @@ public PagedIterable listSkillsets(RequestOptions request */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSkillsetNames() { - return listSkillsets(new RequestOptions().addQueryParam("$select", "name", false)) + return getSkillsets(java.util.Collections.singletonList("name"), null, null, null) .mapPage(SearchIndexerSkillset::getName); } @@ -1536,6 +1558,7 @@ public Response createSkillsetWithResponse(SearchIndexerS * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1547,7 +1570,7 @@ public Response createSkillsetWithResponse(SearchIndexerS * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1565,6 +1588,7 @@ public Response createSkillsetWithResponse(SearchIndexerS * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1596,6 +1620,7 @@ Response hiddenGeneratedGetDataSourceConnectionWithResponse(String n * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1607,7 +1632,7 @@ Response hiddenGeneratedGetDataSourceConnectionWithResponse(String n * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1625,6 +1650,7 @@ Response hiddenGeneratedGetDataSourceConnectionWithResponse(String n * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1638,6 +1664,7 @@ Response hiddenGeneratedGetDataSourceConnectionWithResponse(String n * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -1649,7 +1676,7 @@ Response hiddenGeneratedGetDataSourceConnectionWithResponse(String n * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -1667,6 +1694,7 @@ Response hiddenGeneratedGetDataSourceConnectionWithResponse(String n * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -1761,6 +1789,13 @@ Response hiddenGeneratedCreateDataSourceConnectionWithResponse(Binar * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -1853,6 +1888,13 @@ Response hiddenGeneratedGetIndexerWithResponse(String name, RequestO * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -1929,6 +1971,13 @@ Response hiddenGeneratedGetIndexerWithResponse(String name, RequestO * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -1965,6 +2014,8 @@ Response hiddenGeneratedCreateIndexerWithResponse(BinaryData indexer * } * lastResult (Optional): { * status: String(transientFailure/success/inProgress/reset) (Required) + * statusDetail: String(resetDocs/resync) (Optional) + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) * errorMessage: String (Optional) * startTime: OffsetDateTime (Optional) * endTime: OffsetDateTime (Optional) @@ -2000,6 +2051,21 @@ Response hiddenGeneratedCreateIndexerWithResponse(BinaryData indexer * maxDocumentExtractionSize: Long (Optional) * maxDocumentContentCharactersToExtract: Long (Optional) * } + * currentState (Optional): { + * mode: String(indexingAllDocs/indexingResetDocs/indexingResync) (Optional) + * allDocsInitialTrackingState: String (Optional) + * allDocsFinalTrackingState: String (Optional) + * resetDocsInitialTrackingState: String (Optional) + * resetDocsFinalTrackingState: String (Optional) + * resyncInitialTrackingState: String (Optional) + * resyncFinalTrackingState: String (Optional) + * resetDocumentKeys (Optional): [ + * String (Optional) + * ] + * resetDatasourceDocumentIds (Optional): [ + * String (Optional) + * ] + * } * } * } * @@ -2100,6 +2166,12 @@ Response hiddenGeneratedGetIndexerStatusWithResponse(String name, Re * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2129,6 +2201,7 @@ Response hiddenGeneratedGetIndexerStatusWithResponse(String name, Re * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2230,6 +2303,12 @@ Response hiddenGeneratedGetSkillsetWithResponse(String name, Request * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2259,6 +2338,7 @@ Response hiddenGeneratedGetSkillsetWithResponse(String name, Request * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2344,6 +2424,12 @@ Response hiddenGeneratedGetSkillsetWithResponse(String name, Request * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2373,6 +2459,7 @@ Response hiddenGeneratedGetSkillsetWithResponse(String name, Request * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2422,6 +2509,83 @@ Response hiddenGeneratedResyncWithResponse(String name, BinaryData indexer return this.serviceClient.resyncWithResponse(name, indexerResync, requestOptions); } + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + *

Query Parameters

+ *
Header Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
overwriteBooleanNoIf false, keys or ids will be appended to existing ones. If + * true, only the keys or ids in this payload will be queued to be re-ingested.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     documentKeys (Optional): [
+     *         String (Optional)
+     *     ]
+     *     datasourceDocumentIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the indexer. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetDocumentsWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.resetDocumentsWithResponse(name, requestOptions); + } + + /** + * Reset an existing skillset in a search service. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     skillNames (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param name The name of the skillset. + * @param skillNames The names of the skills to reset. If not specified, all skills in the skillset will be reset. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response hiddenGeneratedResetSkillsWithResponse(String name, BinaryData skillNames, + RequestOptions requestOptions) { + return this.serviceClient.resetSkillsWithResponse(name, skillNames, requestOptions); + } + /** * Resync selective options from the datasource to be re-ingested by the indexer.". * @@ -2442,6 +2606,74 @@ public void resync(String name, IndexerResyncBody indexerResync) { hiddenGeneratedResyncWithResponse(name, BinaryData.fromObject(indexerResync), requestOptions).getValue(); } + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + * + * @param name The name of the indexer. + * @param overwrite If false, keys or ids will be appended to existing ones. If true, only the keys or ids in this + * payload will be queued to be re-ingested. + * @param keysOrIds The keys or ids of the documents to be re-ingested. If keys are provided, the document key field + * must be specified in the indexer configuration. If ids are provided, the document key field is ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetDocuments(String name, Boolean overwrite, DocumentKeysOrIds keysOrIds) { + // Generated convenience method for resetDocumentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (overwrite != null) { + requestOptions.addQueryParam("overwrite", String.valueOf(overwrite), false); + } + if (keysOrIds != null) { + requestOptions.setBody(BinaryData.fromObject(keysOrIds)); + } + resetDocumentsWithResponse(name, requestOptions).getValue(); + } + + /** + * Resets specific documents in the datasource to be selectively re-ingested by the indexer. + * + * @param name The name of the indexer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetDocuments(String name) { + // Generated convenience method for resetDocumentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + resetDocumentsWithResponse(name, requestOptions).getValue(); + } + + /** + * Reset an existing skillset in a search service. + * + * @param name The name of the skillset. + * @param skillNames The names of the skills to reset. If not specified, all skills in the skillset will be reset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetSkills(String name, SkillNames skillNames) { + // Generated convenience method for hiddenGeneratedResetSkillsWithResponse + RequestOptions requestOptions = new RequestOptions(); + hiddenGeneratedResetSkillsWithResponse(name, BinaryData.fromObject(skillNames), requestOptions).getValue(); + } + /** * Lists all datasources available for a search service. *

Query Parameters

@@ -2467,6 +2699,7 @@ public void resync(String name, IndexerResyncBody indexerResync) { * name: String (Required) * description: String (Optional) * type: String(azuresql/cosmosdb/azureblob/azuretable/mysql/adlsgen2/onelake/sharepoint) (Required) + * subType: String (Optional) * credentials (Required): { * connectionString: String (Optional) * } @@ -2478,7 +2711,7 @@ public void resync(String name, IndexerResyncBody indexerResync) { * @odata.type: String (Required) * } * indexerPermissionOptions (Optional): [ - * String(userIds/groupIds/rbacScope) (Optional) + * String(userIds/groupIds/rbacScope/oneLakeParentFolders/oneLakeLakehouseId) (Optional) * ] * dataChangeDetectionPolicy (Optional): { * @odata.type: String (Required) @@ -2496,6 +2729,7 @@ public void resync(String name, IndexerResyncBody indexerResync) { * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2602,6 +2836,13 @@ PagedIterable hiddenGeneratedListDataSourceConnections(RequestOption * identity (Optional): { * @odata.type: String (Required) * } + * isServiceLevelKey: Boolean (Optional) + * } + * cache (Optional): { + * id: String (Optional) + * storageConnectionString: String (Optional) + * enableReprocessing: Boolean (Optional) + * identity (Optional): (recursive schema, see identity above) * } * } * } @@ -2717,6 +2958,12 @@ PagedIterable hiddenGeneratedListIndexers(RequestOptions requestOpti * identity (Optional): { * @odata.type: String (Required) * } + * parameters (Optional): { + * synthesizeGeneratedKeyName: Boolean (Optional) + * (Optional): { + * String: Object (Required) + * } + * } * } * indexProjections (Optional): { * selectors (Required): [ @@ -2746,6 +2993,7 @@ PagedIterable hiddenGeneratedListIndexers(RequestOptions requestOpti * applicationSecret: String (Optional) * } * identity (Optional): (recursive schema, see identity above) + * isServiceLevelKey: Boolean (Optional) * } * } * } @@ -2763,4 +3011,60 @@ PagedIterable hiddenGeneratedListIndexers(RequestOptions requestOpti PagedIterable hiddenGeneratedListSkillsets(RequestOptions requestOptions) { return this.serviceClient.listSkillsets(requestOptions); } + + PagedIterable getDataSourceConnections(List select, String search, + Integer pageSize, ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listDataSourceConnections(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerDataSourceConnection.class)); + } + + PagedIterable getIndexers(List select, String search, Integer pageSize, + ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listIndexers(requestOptions).mapPage(value -> value.toObject(SearchIndexer.class)); + } + + PagedIterable getSkillsets(List select, String search, Integer pageSize, + ListingSearchType searchType) { + RequestOptions requestOptions = new RequestOptions(); + if (select != null) { + requestOptions.addQueryParam("$select", String.join(",", select), false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (pageSize != null) { + requestOptions.addQueryParam("pageSize", pageSize.toString(), false); + } + if (searchType != null) { + requestOptions.addQueryParam("searchType", searchType.toString(), false); + } + return serviceClient.listSkillsets(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerSkillset.class)); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSourceParameters.java index bed96f50dec30..855a399eb5d5d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSourceParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSourceParameters.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; +import com.azure.search.documents.models.VectorQueryTopicGraph; import java.io.IOException; /** @@ -148,6 +149,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("folderPath", this.folderPath); jsonWriter.writeBooleanField("isADLSGen2", this.adlsGen2); jsonWriter.writeJsonField("ingestionParameters", this.ingestionParameters); + jsonWriter.writeJsonField("graphExtraction", this.graphExtraction); + jsonWriter.writeJsonField("topicGraph", this.topicGraph); return jsonWriter.writeEndObject(); } @@ -168,6 +171,8 @@ public static AzureBlobKnowledgeSourceParameters fromJson(JsonReader jsonReader) String folderPath = null; Boolean adlsGen2 = null; KnowledgeSourceIngestionParameters ingestionParameters = null; + KnowledgeSourceGraphExtractionParameters graphExtraction = null; + VectorQueryTopicGraph topicGraph = null; CreatedResources createdResources = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -182,6 +187,10 @@ public static AzureBlobKnowledgeSourceParameters fromJson(JsonReader jsonReader) adlsGen2 = reader.getNullable(JsonReader::getBoolean); } else if ("ingestionParameters".equals(fieldName)) { ingestionParameters = KnowledgeSourceIngestionParameters.fromJson(reader); + } else if ("graphExtraction".equals(fieldName)) { + graphExtraction = KnowledgeSourceGraphExtractionParameters.fromJson(reader); + } else if ("topicGraph".equals(fieldName)) { + topicGraph = VectorQueryTopicGraph.fromJson(reader); } else if ("createdResources".equals(fieldName)) { createdResources = CreatedResources.fromJson(reader); } else { @@ -193,6 +202,8 @@ public static AzureBlobKnowledgeSourceParameters fromJson(JsonReader jsonReader) deserializedAzureBlobKnowledgeSourceParameters.folderPath = folderPath; deserializedAzureBlobKnowledgeSourceParameters.adlsGen2 = adlsGen2; deserializedAzureBlobKnowledgeSourceParameters.ingestionParameters = ingestionParameters; + deserializedAzureBlobKnowledgeSourceParameters.graphExtraction = graphExtraction; + deserializedAzureBlobKnowledgeSourceParameters.topicGraph = topicGraph; deserializedAzureBlobKnowledgeSourceParameters.createdResources = createdResources; return deserializedAzureBlobKnowledgeSourceParameters; }); @@ -225,4 +236,67 @@ public AzureBlobKnowledgeSourceParameters setAdlsGen2(Boolean adlsGen2) { this.adlsGen2 = adlsGen2; return this; } + + /* + * Graph extraction configuration for Azure Blob knowledge sources. Configure native Blob soft delete on the source + * before the first indexing run. ADLS Gen2, ACL ingestion, and sensitivity-label ingestion are not supported for + * this workflow. + */ + @Generated + private KnowledgeSourceGraphExtractionParameters graphExtraction; + + /* + * Default topic graph vector search options for this Azure Blob knowledge source. + */ + @Generated + private VectorQueryTopicGraph topicGraph; + + /** + * Get the graphExtraction property: Graph extraction configuration for Azure Blob knowledge sources. Configure + * native Blob soft delete on the source before the first indexing run. ADLS Gen2, ACL ingestion, and + * sensitivity-label ingestion are not supported for this workflow. + * + * @return the graphExtraction value. + */ + @Generated + public KnowledgeSourceGraphExtractionParameters getGraphExtraction() { + return this.graphExtraction; + } + + /** + * Set the graphExtraction property: Graph extraction configuration for Azure Blob knowledge sources. Configure + * native Blob soft delete on the source before the first indexing run. ADLS Gen2, ACL ingestion, and + * sensitivity-label ingestion are not supported for this workflow. + * + * @param graphExtraction the graphExtraction value to set. + * @return the AzureBlobKnowledgeSourceParameters object itself. + */ + @Generated + public AzureBlobKnowledgeSourceParameters + setGraphExtraction(KnowledgeSourceGraphExtractionParameters graphExtraction) { + this.graphExtraction = graphExtraction; + return this; + } + + /** + * Get the topicGraph property: Default topic graph vector search options for this Azure Blob knowledge source. + * + * @return the topicGraph value. + */ + @Generated + public VectorQueryTopicGraph getTopicGraph() { + return this.topicGraph; + } + + /** + * Set the topicGraph property: Default topic graph vector search options for this Azure Blob knowledge source. + * + * @param topicGraph the topicGraph value to set. + * @return the AzureBlobKnowledgeSourceParameters object itself. + */ + @Generated + public AzureBlobKnowledgeSourceParameters setTopicGraph(VectorQueryTopicGraph topicGraph) { + this.topicGraph = topicGraph; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java index 94bbc60ecf2fc..85c0ae98292a2 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java @@ -114,4 +114,28 @@ public static Collection values() { */ @Generated public static final AzureOpenAIModelName GPT56LUNA = fromString("gpt-5.6-luna"); + + /** + * Gpt6Astra model. + */ + @Generated + public static final AzureOpenAIModelName GPT6ASTRA = fromString("gpt-6-astra"); + + /** + * Gpt6Sol model. + */ + @Generated + public static final AzureOpenAIModelName GPT6SOL = fromString("gpt-6-sol"); + + /** + * Gpt6Luna model. + */ + @Generated + public static final AzureOpenAIModelName GPT6LUNA = fromString("gpt-6-luna"); + + /** + * Gpt61Sol model. + */ + @Generated + public static final AzureOpenAIModelName GPT61SOL = fromString("gpt-6.1-sol"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/DistanceScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/DistanceScoringFunction.java index 96ce75990dd80..908354ac22f55 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/DistanceScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/DistanceScoringFunction.java @@ -28,19 +28,6 @@ public final class DistanceScoringFunction extends ScoringFunction { @Generated private final DistanceScoringParameters parameters; - /** - * Creates an instance of DistanceScoringFunction class. - * - * @param fieldName the fieldName value to set. - * @param boost the boost value to set. - * @param parameters the parameters value to set. - */ - @Generated - public DistanceScoringFunction(String fieldName, double boost, DistanceScoringParameters parameters) { - super(fieldName, boost); - this.parameters = parameters; - } - /** * Get the type property: Type of ScoringFunction. * @@ -79,9 +66,9 @@ public DistanceScoringFunction setInterpolation(ScoringFunctionInterpolation int @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fieldName", getFieldName()); - jsonWriter.writeDoubleField("boost", getBoost()); jsonWriter.writeStringField("interpolation", getInterpolation() == null ? null : getInterpolation().toString()); + jsonWriter.writeDoubleField("boost", this.boost); + jsonWriter.writeStringField("fieldName", this.fieldName); jsonWriter.writeJsonField("distance", this.parameters); jsonWriter.writeStringField("type", this.type); return jsonWriter.writeEndObject(); @@ -99,20 +86,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static DistanceScoringFunction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String fieldName = null; - double boost = 0.0; ScoringFunctionInterpolation interpolation = null; + double boost = 0.0; + String fieldName = null; DistanceScoringParameters parameters = null; String type = "distance"; while (reader.nextToken() != JsonToken.END_OBJECT) { String jsonFieldName = reader.getFieldName(); reader.nextToken(); - if ("fieldName".equals(jsonFieldName)) { - fieldName = reader.getString(); + if ("interpolation".equals(jsonFieldName)) { + interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); } else if ("boost".equals(jsonFieldName)) { boost = reader.getDouble(); - } else if ("interpolation".equals(jsonFieldName)) { - interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); + } else if ("fieldName".equals(jsonFieldName)) { + fieldName = reader.getString(); } else if ("distance".equals(jsonFieldName)) { parameters = DistanceScoringParameters.fromJson(reader); } else if ("type".equals(jsonFieldName)) { @@ -122,10 +109,67 @@ public static DistanceScoringFunction fromJson(JsonReader jsonReader) throws IOE } } DistanceScoringFunction deserializedDistanceScoringFunction - = new DistanceScoringFunction(fieldName, boost, parameters); + = new DistanceScoringFunction(boost, fieldName, parameters); deserializedDistanceScoringFunction.setInterpolation(interpolation); deserializedDistanceScoringFunction.type = type; return deserializedDistanceScoringFunction; }); } + + /* + * A multiplier for the raw score. Must be a positive number not equal to 1.0. + */ + @Generated + private final double boost; + + /* + * The name of the field used as input to the scoring function. + */ + @Generated + private final String fieldName; + + /** + * Creates an instance of DistanceScoringFunction class. + * + * @param boost the boost value to set. + * @param fieldName the fieldName value to set. + * @param parameters the parameters value to set. + */ + @Generated + public DistanceScoringFunction(double boost, String fieldName, DistanceScoringParameters parameters) { + this.boost = boost; + this.fieldName = fieldName; + this.parameters = parameters; + } + + /** + * Get the boost property: A multiplier for the raw score. Must be a positive number not equal to 1.0. + * + * @return the boost value. + */ + @Generated + public double getBoost() { + return this.boost; + } + + /** + * Get the fieldName property: The name of the field used as input to the scoring function. + * + * @return the fieldName value. + */ + @Generated + public String getFieldName() { + return this.fieldName; + } + + /** + * Creates a field-based scoring function. + * + * @param fieldName the field used as input. + * @param boost the score multiplier. + * @param parameters the scoring parameters. + */ + public DistanceScoringFunction(String fieldName, double boost, DistanceScoringParameters parameters) { + this(boost, fieldName, parameters); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringFunction.java index dc9af5eca4de7..bff7dd49154ab 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringFunction.java @@ -28,19 +28,6 @@ public final class FreshnessScoringFunction extends ScoringFunction { @Generated private final FreshnessScoringParameters parameters; - /** - * Creates an instance of FreshnessScoringFunction class. - * - * @param fieldName the fieldName value to set. - * @param boost the boost value to set. - * @param parameters the parameters value to set. - */ - @Generated - public FreshnessScoringFunction(String fieldName, double boost, FreshnessScoringParameters parameters) { - super(fieldName, boost); - this.parameters = parameters; - } - /** * Get the type property: Type of ScoringFunction. * @@ -79,9 +66,9 @@ public FreshnessScoringFunction setInterpolation(ScoringFunctionInterpolation in @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fieldName", getFieldName()); - jsonWriter.writeDoubleField("boost", getBoost()); jsonWriter.writeStringField("interpolation", getInterpolation() == null ? null : getInterpolation().toString()); + jsonWriter.writeDoubleField("boost", this.boost); + jsonWriter.writeStringField("fieldName", this.fieldName); jsonWriter.writeJsonField("freshness", this.parameters); jsonWriter.writeStringField("type", this.type); return jsonWriter.writeEndObject(); @@ -99,20 +86,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static FreshnessScoringFunction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String fieldName = null; - double boost = 0.0; ScoringFunctionInterpolation interpolation = null; + double boost = 0.0; + String fieldName = null; FreshnessScoringParameters parameters = null; String type = "freshness"; while (reader.nextToken() != JsonToken.END_OBJECT) { String jsonFieldName = reader.getFieldName(); reader.nextToken(); - if ("fieldName".equals(jsonFieldName)) { - fieldName = reader.getString(); + if ("interpolation".equals(jsonFieldName)) { + interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); } else if ("boost".equals(jsonFieldName)) { boost = reader.getDouble(); - } else if ("interpolation".equals(jsonFieldName)) { - interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); + } else if ("fieldName".equals(jsonFieldName)) { + fieldName = reader.getString(); } else if ("freshness".equals(jsonFieldName)) { parameters = FreshnessScoringParameters.fromJson(reader); } else if ("type".equals(jsonFieldName)) { @@ -122,10 +109,67 @@ public static FreshnessScoringFunction fromJson(JsonReader jsonReader) throws IO } } FreshnessScoringFunction deserializedFreshnessScoringFunction - = new FreshnessScoringFunction(fieldName, boost, parameters); + = new FreshnessScoringFunction(boost, fieldName, parameters); deserializedFreshnessScoringFunction.setInterpolation(interpolation); deserializedFreshnessScoringFunction.type = type; return deserializedFreshnessScoringFunction; }); } + + /* + * A multiplier for the raw score. Must be a positive number not equal to 1.0. + */ + @Generated + private final double boost; + + /* + * The name of the field used as input to the scoring function. + */ + @Generated + private final String fieldName; + + /** + * Creates an instance of FreshnessScoringFunction class. + * + * @param boost the boost value to set. + * @param fieldName the fieldName value to set. + * @param parameters the parameters value to set. + */ + @Generated + public FreshnessScoringFunction(double boost, String fieldName, FreshnessScoringParameters parameters) { + this.boost = boost; + this.fieldName = fieldName; + this.parameters = parameters; + } + + /** + * Get the boost property: A multiplier for the raw score. Must be a positive number not equal to 1.0. + * + * @return the boost value. + */ + @Generated + public double getBoost() { + return this.boost; + } + + /** + * Get the fieldName property: The name of the field used as input to the scoring function. + * + * @return the fieldName value. + */ + @Generated + public String getFieldName() { + return this.fieldName; + } + + /** + * Creates a field-based scoring function. + * + * @param fieldName the field used as input. + * @param boost the score multiplier. + * @param parameters the scoring parameters. + */ + public FreshnessScoringFunction(String fieldName, double boost, FreshnessScoringParameters parameters) { + this(boost, fieldName, parameters); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphFieldMappings.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphFieldMappings.java new file mode 100644 index 0000000000000..54850964ce4fc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphFieldMappings.java @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Required mappings for graph identities, values, types, and evidence. Only assertionIdField and factIdField may share + * a field, and only when one assertion represents each fact. + */ +@Immutable +public final class GraphFieldMappings implements JsonSerializable { + + /* + * String index key identifying an independently managed assertion; must be filterable and sortable. + */ + @Generated + private final String assertionIdField; + + /* + * Filterable string field identifying the semantic fact. Multiple assertions can support the same fact. + */ + @Generated + private final String factIdField; + + /* + * Subject display-value string field; must be filterable, facetable, and sortable. + */ + @Generated + private final String subjectField; + + /* + * Predicate string field; must be filterable and facetable. + */ + @Generated + private final String predicateField; + + /* + * Object display-value string field; must be filterable, facetable, and sortable. + */ + @Generated + private final String objectField; + + /* + * Object string-value field; must be filterable and facetable. + */ + @Generated + private final String objectStringField; + + /* + * Object numeric-value Edm.Double field; must be filterable, facetable, and sortable. + */ + @Generated + private final String objectDoubleField; + + /* + * Object Boolean-value Edm.Boolean field; must be filterable. + */ + @Generated + private final String objectBoolField; + + /* + * Object date-value Edm.DateTimeOffset field; must be filterable. + */ + @Generated + private final String objectDateTimeField; + + /* + * Subject type string field; must be filterable and facetable. + */ + @Generated + private final String subjectTypeField; + + /* + * Canonical subject ID string field; must be filterable, facetable, and sortable. + */ + @Generated + private final String subjectIdField; + + /* + * Object type string field; must be filterable and facetable. + */ + @Generated + private final String objectTypeField; + + /* + * Canonical object ID string field; must be filterable, facetable, and sortable. + */ + @Generated + private final String objectIdField; + + /* + * Overall relationship confidence Edm.Double field. + */ + @Generated + private final String confidenceField; + + /* + * Subject grounding confidence Edm.Double field. + */ + @Generated + private final String subjectConfidenceField; + + /* + * Predicate alignment confidence Edm.Double field. + */ + @Generated + private final String predicateConfidenceField; + + /* + * Object grounding confidence Edm.Double field. + */ + @Generated + private final String objectConfidenceField; + + /* + * Source chunk identifier string field used for provenance joins. + */ + @Generated + private final String sourceChunkIdField; + + /* + * Parent source document identifier string field. + */ + @Generated + private final String sourceParentIdField; + + /* + * Graph-name string field qualifying canonical identities; must be filterable, facetable, and sortable. + */ + @Generated + private final String graphNameField; + + /* + * Canonical subject display-name string field. + */ + @Generated + private final String subjectIdDisplayNameField; + + /* + * Canonical object display-name string field. + */ + @Generated + private final String objectIdDisplayNameField; + + /** + * Creates an instance of GraphFieldMappings class. + * + * @param assertionIdField the assertionIdField value to set. + * @param factIdField the factIdField value to set. + * @param subjectField the subjectField value to set. + * @param predicateField the predicateField value to set. + * @param objectField the objectField value to set. + * @param objectStringField the objectStringField value to set. + * @param objectDoubleField the objectDoubleField value to set. + * @param objectBoolField the objectBoolField value to set. + * @param objectDateTimeField the objectDateTimeField value to set. + * @param subjectTypeField the subjectTypeField value to set. + * @param subjectIdField the subjectIdField value to set. + * @param objectTypeField the objectTypeField value to set. + * @param objectIdField the objectIdField value to set. + * @param confidenceField the confidenceField value to set. + * @param subjectConfidenceField the subjectConfidenceField value to set. + * @param predicateConfidenceField the predicateConfidenceField value to set. + * @param objectConfidenceField the objectConfidenceField value to set. + * @param sourceChunkIdField the sourceChunkIdField value to set. + * @param sourceParentIdField the sourceParentIdField value to set. + * @param graphNameField the graphNameField value to set. + * @param subjectIdDisplayNameField the subjectIdDisplayNameField value to set. + * @param objectIdDisplayNameField the objectIdDisplayNameField value to set. + */ + @Generated + public GraphFieldMappings(String assertionIdField, String factIdField, String subjectField, String predicateField, + String objectField, String objectStringField, String objectDoubleField, String objectBoolField, + String objectDateTimeField, String subjectTypeField, String subjectIdField, String objectTypeField, + String objectIdField, String confidenceField, String subjectConfidenceField, String predicateConfidenceField, + String objectConfidenceField, String sourceChunkIdField, String sourceParentIdField, String graphNameField, + String subjectIdDisplayNameField, String objectIdDisplayNameField) { + this.assertionIdField = assertionIdField; + this.factIdField = factIdField; + this.subjectField = subjectField; + this.predicateField = predicateField; + this.objectField = objectField; + this.objectStringField = objectStringField; + this.objectDoubleField = objectDoubleField; + this.objectBoolField = objectBoolField; + this.objectDateTimeField = objectDateTimeField; + this.subjectTypeField = subjectTypeField; + this.subjectIdField = subjectIdField; + this.objectTypeField = objectTypeField; + this.objectIdField = objectIdField; + this.confidenceField = confidenceField; + this.subjectConfidenceField = subjectConfidenceField; + this.predicateConfidenceField = predicateConfidenceField; + this.objectConfidenceField = objectConfidenceField; + this.sourceChunkIdField = sourceChunkIdField; + this.sourceParentIdField = sourceParentIdField; + this.graphNameField = graphNameField; + this.subjectIdDisplayNameField = subjectIdDisplayNameField; + this.objectIdDisplayNameField = objectIdDisplayNameField; + } + + /** + * Get the assertionIdField property: String index key identifying an independently managed assertion; must be + * filterable and sortable. + * + * @return the assertionIdField value. + */ + @Generated + public String getAssertionIdField() { + return this.assertionIdField; + } + + /** + * Get the factIdField property: Filterable string field identifying the semantic fact. Multiple assertions can + * support the same fact. + * + * @return the factIdField value. + */ + @Generated + public String getFactIdField() { + return this.factIdField; + } + + /** + * Get the subjectField property: Subject display-value string field; must be filterable, facetable, and sortable. + * + * @return the subjectField value. + */ + @Generated + public String getSubjectField() { + return this.subjectField; + } + + /** + * Get the predicateField property: Predicate string field; must be filterable and facetable. + * + * @return the predicateField value. + */ + @Generated + public String getPredicateField() { + return this.predicateField; + } + + /** + * Get the objectField property: Object display-value string field; must be filterable, facetable, and sortable. + * + * @return the objectField value. + */ + @Generated + public String getObjectField() { + return this.objectField; + } + + /** + * Get the objectStringField property: Object string-value field; must be filterable and facetable. + * + * @return the objectStringField value. + */ + @Generated + public String getObjectStringField() { + return this.objectStringField; + } + + /** + * Get the objectDoubleField property: Object numeric-value Edm.Double field; must be filterable, facetable, and + * sortable. + * + * @return the objectDoubleField value. + */ + @Generated + public String getObjectDoubleField() { + return this.objectDoubleField; + } + + /** + * Get the objectBoolField property: Object Boolean-value Edm.Boolean field; must be filterable. + * + * @return the objectBoolField value. + */ + @Generated + public String getObjectBoolField() { + return this.objectBoolField; + } + + /** + * Get the objectDateTimeField property: Object date-value Edm.DateTimeOffset field; must be filterable. + * + * @return the objectDateTimeField value. + */ + @Generated + public String getObjectDateTimeField() { + return this.objectDateTimeField; + } + + /** + * Get the subjectTypeField property: Subject type string field; must be filterable and facetable. + * + * @return the subjectTypeField value. + */ + @Generated + public String getSubjectTypeField() { + return this.subjectTypeField; + } + + /** + * Get the subjectIdField property: Canonical subject ID string field; must be filterable, facetable, and sortable. + * + * @return the subjectIdField value. + */ + @Generated + public String getSubjectIdField() { + return this.subjectIdField; + } + + /** + * Get the objectTypeField property: Object type string field; must be filterable and facetable. + * + * @return the objectTypeField value. + */ + @Generated + public String getObjectTypeField() { + return this.objectTypeField; + } + + /** + * Get the objectIdField property: Canonical object ID string field; must be filterable, facetable, and sortable. + * + * @return the objectIdField value. + */ + @Generated + public String getObjectIdField() { + return this.objectIdField; + } + + /** + * Get the confidenceField property: Overall relationship confidence Edm.Double field. + * + * @return the confidenceField value. + */ + @Generated + public String getConfidenceField() { + return this.confidenceField; + } + + /** + * Get the subjectConfidenceField property: Subject grounding confidence Edm.Double field. + * + * @return the subjectConfidenceField value. + */ + @Generated + public String getSubjectConfidenceField() { + return this.subjectConfidenceField; + } + + /** + * Get the predicateConfidenceField property: Predicate alignment confidence Edm.Double field. + * + * @return the predicateConfidenceField value. + */ + @Generated + public String getPredicateConfidenceField() { + return this.predicateConfidenceField; + } + + /** + * Get the objectConfidenceField property: Object grounding confidence Edm.Double field. + * + * @return the objectConfidenceField value. + */ + @Generated + public String getObjectConfidenceField() { + return this.objectConfidenceField; + } + + /** + * Get the sourceChunkIdField property: Source chunk identifier string field used for provenance joins. + * + * @return the sourceChunkIdField value. + */ + @Generated + public String getSourceChunkIdField() { + return this.sourceChunkIdField; + } + + /** + * Get the sourceParentIdField property: Parent source document identifier string field. + * + * @return the sourceParentIdField value. + */ + @Generated + public String getSourceParentIdField() { + return this.sourceParentIdField; + } + + /** + * Get the graphNameField property: Graph-name string field qualifying canonical identities; must be filterable, + * facetable, and sortable. + * + * @return the graphNameField value. + */ + @Generated + public String getGraphNameField() { + return this.graphNameField; + } + + /** + * Get the subjectIdDisplayNameField property: Canonical subject display-name string field. + * + * @return the subjectIdDisplayNameField value. + */ + @Generated + public String getSubjectIdDisplayNameField() { + return this.subjectIdDisplayNameField; + } + + /** + * Get the objectIdDisplayNameField property: Canonical object display-name string field. + * + * @return the objectIdDisplayNameField value. + */ + @Generated + public String getObjectIdDisplayNameField() { + return this.objectIdDisplayNameField; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assertionIdField", this.assertionIdField); + jsonWriter.writeStringField("factIdField", this.factIdField); + jsonWriter.writeStringField("subjectField", this.subjectField); + jsonWriter.writeStringField("predicateField", this.predicateField); + jsonWriter.writeStringField("objectField", this.objectField); + jsonWriter.writeStringField("objectStringField", this.objectStringField); + jsonWriter.writeStringField("objectDoubleField", this.objectDoubleField); + jsonWriter.writeStringField("objectBoolField", this.objectBoolField); + jsonWriter.writeStringField("objectDateTimeField", this.objectDateTimeField); + jsonWriter.writeStringField("subjectTypeField", this.subjectTypeField); + jsonWriter.writeStringField("subjectIdField", this.subjectIdField); + jsonWriter.writeStringField("objectTypeField", this.objectTypeField); + jsonWriter.writeStringField("objectIdField", this.objectIdField); + jsonWriter.writeStringField("confidenceField", this.confidenceField); + jsonWriter.writeStringField("subjectConfidenceField", this.subjectConfidenceField); + jsonWriter.writeStringField("predicateConfidenceField", this.predicateConfidenceField); + jsonWriter.writeStringField("objectConfidenceField", this.objectConfidenceField); + jsonWriter.writeStringField("sourceChunkIdField", this.sourceChunkIdField); + jsonWriter.writeStringField("sourceParentIdField", this.sourceParentIdField); + jsonWriter.writeStringField("graphNameField", this.graphNameField); + jsonWriter.writeStringField("subjectIdDisplayNameField", this.subjectIdDisplayNameField); + jsonWriter.writeStringField("objectIdDisplayNameField", this.objectIdDisplayNameField); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphFieldMappings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphFieldMappings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphFieldMappings. + */ + @Generated + public static GraphFieldMappings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String assertionIdField = null; + String factIdField = null; + String subjectField = null; + String predicateField = null; + String objectField = null; + String objectStringField = null; + String objectDoubleField = null; + String objectBoolField = null; + String objectDateTimeField = null; + String subjectTypeField = null; + String subjectIdField = null; + String objectTypeField = null; + String objectIdField = null; + String confidenceField = null; + String subjectConfidenceField = null; + String predicateConfidenceField = null; + String objectConfidenceField = null; + String sourceChunkIdField = null; + String sourceParentIdField = null; + String graphNameField = null; + String subjectIdDisplayNameField = null; + String objectIdDisplayNameField = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("assertionIdField".equals(fieldName)) { + assertionIdField = reader.getString(); + } else if ("factIdField".equals(fieldName)) { + factIdField = reader.getString(); + } else if ("subjectField".equals(fieldName)) { + subjectField = reader.getString(); + } else if ("predicateField".equals(fieldName)) { + predicateField = reader.getString(); + } else if ("objectField".equals(fieldName)) { + objectField = reader.getString(); + } else if ("objectStringField".equals(fieldName)) { + objectStringField = reader.getString(); + } else if ("objectDoubleField".equals(fieldName)) { + objectDoubleField = reader.getString(); + } else if ("objectBoolField".equals(fieldName)) { + objectBoolField = reader.getString(); + } else if ("objectDateTimeField".equals(fieldName)) { + objectDateTimeField = reader.getString(); + } else if ("subjectTypeField".equals(fieldName)) { + subjectTypeField = reader.getString(); + } else if ("subjectIdField".equals(fieldName)) { + subjectIdField = reader.getString(); + } else if ("objectTypeField".equals(fieldName)) { + objectTypeField = reader.getString(); + } else if ("objectIdField".equals(fieldName)) { + objectIdField = reader.getString(); + } else if ("confidenceField".equals(fieldName)) { + confidenceField = reader.getString(); + } else if ("subjectConfidenceField".equals(fieldName)) { + subjectConfidenceField = reader.getString(); + } else if ("predicateConfidenceField".equals(fieldName)) { + predicateConfidenceField = reader.getString(); + } else if ("objectConfidenceField".equals(fieldName)) { + objectConfidenceField = reader.getString(); + } else if ("sourceChunkIdField".equals(fieldName)) { + sourceChunkIdField = reader.getString(); + } else if ("sourceParentIdField".equals(fieldName)) { + sourceParentIdField = reader.getString(); + } else if ("graphNameField".equals(fieldName)) { + graphNameField = reader.getString(); + } else if ("subjectIdDisplayNameField".equals(fieldName)) { + subjectIdDisplayNameField = reader.getString(); + } else if ("objectIdDisplayNameField".equals(fieldName)) { + objectIdDisplayNameField = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new GraphFieldMappings(assertionIdField, factIdField, subjectField, predicateField, objectField, + objectStringField, objectDoubleField, objectBoolField, objectDateTimeField, subjectTypeField, + subjectIdField, objectTypeField, objectIdField, confidenceField, subjectConfidenceField, + predicateConfidenceField, objectConfidenceField, sourceChunkIdField, sourceParentIdField, + graphNameField, subjectIdDisplayNameField, objectIdDisplayNameField); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfile.java new file mode 100644 index 0000000000000..1b0170c743ac3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfile.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the edge-list graph stored in a search index. Required role mappings are validated against field types and + * capabilities before execution. + */ +@Fluent +public final class GraphProfile implements JsonSerializable { + + /* + * Storage representation used by the graph index. + */ + @Generated + private final GraphProfileKind kind; + + /* + * Logical graph roles mapped to physical, primitive, single-valued fields. All mapped fields must be retrievable, + * and mapped string fields must not use a normalizer. + */ + @Generated + private final GraphFieldMappings fields; + + /* + * Name of the source index from which graph provenance documents may be hydrated. Configured by the index + * administrator, not by query callers. + */ + @Generated + private String provenanceIndexName; + + /** + * Creates an instance of GraphProfile class. + * + * @param kind the kind value to set. + * @param fields the fields value to set. + */ + @Generated + public GraphProfile(GraphProfileKind kind, GraphFieldMappings fields) { + this.kind = kind; + this.fields = fields; + } + + /** + * Get the kind property: Storage representation used by the graph index. + * + * @return the kind value. + */ + @Generated + public GraphProfileKind getKind() { + return this.kind; + } + + /** + * Get the fields property: Logical graph roles mapped to physical, primitive, single-valued fields. All mapped + * fields must be retrievable, and mapped string fields must not use a normalizer. + * + * @return the fields value. + */ + @Generated + public GraphFieldMappings getFields() { + return this.fields; + } + + /** + * Get the provenanceIndexName property: Name of the source index from which graph provenance documents may be + * hydrated. Configured by the index administrator, not by query callers. + * + * @return the provenanceIndexName value. + */ + @Generated + public String getProvenanceIndexName() { + return this.provenanceIndexName; + } + + /** + * Set the provenanceIndexName property: Name of the source index from which graph provenance documents may be + * hydrated. Configured by the index administrator, not by query callers. + * + * @param provenanceIndexName the provenanceIndexName value to set. + * @return the GraphProfile object itself. + */ + @Generated + public GraphProfile setProvenanceIndexName(String provenanceIndexName) { + this.provenanceIndexName = provenanceIndexName; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("fields", this.fields); + jsonWriter.writeStringField("provenanceIndexName", this.provenanceIndexName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphProfile. + */ + @Generated + public static GraphProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphProfileKind kind = null; + GraphFieldMappings fields = null; + String provenanceIndexName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + kind = GraphProfileKind.fromString(reader.getString()); + } else if ("fields".equals(fieldName)) { + fields = GraphFieldMappings.fromJson(reader); + } else if ("provenanceIndexName".equals(fieldName)) { + provenanceIndexName = reader.getString(); + } else { + reader.skipChildren(); + } + } + GraphProfile deserializedGraphProfile = new GraphProfile(kind, fields); + deserializedGraphProfile.provenanceIndexName = provenanceIndexName; + return deserializedGraphProfile; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfileKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfileKind.java new file mode 100644 index 0000000000000..0d7449ce73a97 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/GraphProfileKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported graph storage representations. + */ +public final class GraphProfileKind extends ExpandableStringEnum { + + /** + * Each index document stores one source assertion about a graph fact. + */ + @Generated + public static final GraphProfileKind EDGE_LIST = fromString("edgeList"); + + /** + * Creates a new instance of GraphProfileKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphProfileKind() { + } + + /** + * Creates or finds a GraphProfileKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphProfileKind. + */ + @Generated + public static GraphProfileKind fromString(String name) { + return fromString(name, GraphProfileKind.class); + } + + /** + * Gets known GraphProfileKind values. + * + * @return known GraphProfileKind values. + */ + @Generated + public static Collection values() { + return values(GraphProfileKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerPermissionOption.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerPermissionOption.java index 65e13adccf1f9..906ad2de90347 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerPermissionOption.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerPermissionOption.java @@ -60,4 +60,21 @@ public static IndexerPermissionOption fromString(String name) { public static Collection values() { return values(IndexerPermissionOption.class); } + + /** + * For OneLake data sources only, ingest all ancestor folder paths from '/Files' through the immediate parent, + * excluding the file name, as the string collection 'metadata_onelake_parent_folders'. Use indexer fieldMappings to + * map this source metadata to a filterable Collection(Edm.String) field with permissionFilter + * 'oneLakeParentFolders'; index projections use source '/document/metadata_onelake_parent_folders'. The index must + * also specify 'oneLakeSecuritySource'. + */ + @Generated + public static final IndexerPermissionOption ONE_LAKE_PARENT_FOLDERS = fromString("oneLakeParentFolders"); + + /** + * For OneLake data sources only, ingest the source item's lakehouse ID for mapping to an index field with + * permissionFilter 'oneLakeLakehouseId'. The index must also specify 'oneLakeSecuritySource'. + */ + @Generated + public static final IndexerPermissionOption ONE_LAKE_LAKEHOUSE_ID = fromString("oneLakeLakehouseId"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBase.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBase.java index b355d98e3ebec..436bc0d1a031d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBase.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBase.java @@ -14,6 +14,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; +import java.util.Map; /** * Represents a knowledge base definition. @@ -209,15 +210,18 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeArrayField("knowledgeSources", this.knowledgeSources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("models", this.models, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("retrievalReasoningEffort", this.retrievalReasoningEffort); jsonWriter.writeStringField("outputMode", this.outputMode == null ? null : this.outputMode.toString()); jsonWriter.writeStringField("@odata.etag", this.eTag); jsonWriter.writeJsonField("encryptionKey", this.encryptionKey); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("retrievalInstructions", this.retrievalInstructions); jsonWriter.writeStringField("answerInstructions", this.answerInstructions); jsonWriter.writeJsonField("corsOptions", this.corsOptions); + jsonWriter.writeJsonField("retrieveDefaults", this.retrieveDefaults); return jsonWriter.writeEndObject(); } @@ -235,15 +239,18 @@ public static KnowledgeBase fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String name = null; List knowledgeSources = null; + List tools = null; List models = null; KnowledgeRetrievalReasoningEffort retrievalReasoningEffort = null; KnowledgeRetrievalOutputMode outputMode = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; String description = null; + Map tags = null; String retrievalInstructions = null; String answerInstructions = null; CorsOptions corsOptions = null; + KnowledgeBaseRetrieveDefaults retrieveDefaults = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -251,6 +258,8 @@ public static KnowledgeBase fromJson(JsonReader jsonReader) throws IOException { name = reader.getString(); } else if ("knowledgeSources".equals(fieldName)) { knowledgeSources = reader.readArray(reader1 -> KnowledgeSourceReference.fromJson(reader1)); + } else if ("tools".equals(fieldName)) { + tools = reader.readArray(reader1 -> KnowledgeBaseTool.fromJson(reader1)); } else if ("models".equals(fieldName)) { models = reader.readArray(reader1 -> KnowledgeBaseModel.fromJson(reader1)); } else if ("retrievalReasoningEffort".equals(fieldName)) { @@ -263,26 +272,33 @@ public static KnowledgeBase fromJson(JsonReader jsonReader) throws IOException { encryptionKey = SearchResourceEncryptionKey.fromJson(reader); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("tags".equals(fieldName)) { + tags = reader.readMap(reader1 -> reader1.getString()); } else if ("retrievalInstructions".equals(fieldName)) { retrievalInstructions = reader.getString(); } else if ("answerInstructions".equals(fieldName)) { answerInstructions = reader.getString(); } else if ("corsOptions".equals(fieldName)) { corsOptions = CorsOptions.fromJson(reader); + } else if ("retrieveDefaults".equals(fieldName)) { + retrieveDefaults = KnowledgeBaseRetrieveDefaults.fromJson(reader); } else { reader.skipChildren(); } } KnowledgeBase deserializedKnowledgeBase = new KnowledgeBase(name, knowledgeSources); + deserializedKnowledgeBase.tools = tools; deserializedKnowledgeBase.models = models; deserializedKnowledgeBase.retrievalReasoningEffort = retrievalReasoningEffort; deserializedKnowledgeBase.outputMode = outputMode; deserializedKnowledgeBase.eTag = eTag; deserializedKnowledgeBase.encryptionKey = encryptionKey; deserializedKnowledgeBase.description = description; + deserializedKnowledgeBase.tags = tags; deserializedKnowledgeBase.retrievalInstructions = retrievalInstructions; deserializedKnowledgeBase.answerInstructions = answerInstructions; deserializedKnowledgeBase.corsOptions = corsOptions; + deserializedKnowledgeBase.retrieveDefaults = retrieveDefaults; return deserializedKnowledgeBase; }); } @@ -426,4 +442,101 @@ public KnowledgeBase setCorsOptions(CorsOptions corsOptions) { this.corsOptions = corsOptions; return this; } + + /* + * User-defined key-value pairs for categorizing the knowledge base and attributing its usage and costs. + */ + @Generated + private Map tags; + + /* + * Persisted request-wide retrieve defaults for this knowledge base. These values apply to retrieve requests that + * omit the corresponding fields; request-time values take precedence when present. + */ + @Generated + private KnowledgeBaseRetrieveDefaults retrieveDefaults; + + /** + * Get the tags property: User-defined key-value pairs for categorizing the knowledge base and attributing its usage + * and costs. + * + * @return the tags value. + */ + @Generated + public Map getTags() { + return this.tags; + } + + /** + * Set the tags property: User-defined key-value pairs for categorizing the knowledge base and attributing its usage + * and costs. + * + * @param tags the tags value to set. + * @return the KnowledgeBase object itself. + */ + @Generated + public KnowledgeBase setTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the retrieveDefaults property: Persisted request-wide retrieve defaults for this knowledge base. These values + * apply to retrieve requests that omit the corresponding fields; request-time values take precedence when present. + * + * @return the retrieveDefaults value. + */ + @Generated + public KnowledgeBaseRetrieveDefaults getRetrieveDefaults() { + return this.retrieveDefaults; + } + + /** + * Set the retrieveDefaults property: Persisted request-wide retrieve defaults for this knowledge base. These values + * apply to retrieve requests that omit the corresponding fields; request-time values take precedence when present. + * + * @param retrieveDefaults the retrieveDefaults value to set. + * @return the KnowledgeBase object itself. + */ + @Generated + public KnowledgeBase setRetrieveDefaults(KnowledgeBaseRetrieveDefaults retrieveDefaults) { + this.retrieveDefaults = retrieveDefaults; + return this; + } + + /* + * Named retrieval tools, each limited to a subset of this knowledge base's sources. When configured, MCP advertises + * these tools in addition to the built-in knowledge_base_retrieve tool, which retrieves from the full knowledge + * base. Omitting tools or supplying an empty array in this API version clears existing tools. + */ + @Generated + private List tools; + + /** + * Get the tools property: Named retrieval tools, each limited to a subset of this knowledge base's sources. When + * configured, MCP advertises these tools in addition to the built-in knowledge_base_retrieve tool, which retrieves + * from the full knowledge base. Omitting tools or supplying an empty array in this API version clears existing + * tools. + * + * @return the tools value. + */ + @Generated + public List getTools() { + return this.tools; + } + + /** + * Set the tools property: Named retrieval tools, each limited to a subset of this knowledge base's sources. When + * configured, MCP advertises these tools in addition to the built-in knowledge_base_retrieve tool, which retrieves + * from the full knowledge base. Omitting tools or supplying an empty array in this API version clears existing + * tools. + * + * @param tools the tools value to set. + * @return the KnowledgeBase object itself. + */ + @Generated + public KnowledgeBase setTools(List tools) { + this.tools = tools; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseMicrosoftRetriever1Model.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseMicrosoftRetriever1Model.java new file mode 100644 index 0000000000000..7f6f1a62471e2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseMicrosoftRetriever1Model.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies Microsoft Retriever 1 used for query planning and retrieval. + */ +@Immutable +public final class KnowledgeBaseMicrosoftRetriever1Model extends KnowledgeBaseModel { + + /* + * The AI model to be used for query planning. + */ + @Generated + private KnowledgeBaseModelKind kind = KnowledgeBaseModelKind.MICROSOFT_RETRIEVER1; + + /** + * Creates an instance of KnowledgeBaseMicrosoftRetriever1Model class. + */ + @Generated + public KnowledgeBaseMicrosoftRetriever1Model() { + } + + /** + * Get the kind property: The AI model to be used for query planning. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeBaseModelKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseMicrosoftRetriever1Model from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseMicrosoftRetriever1Model if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseMicrosoftRetriever1Model. + */ + @Generated + public static KnowledgeBaseMicrosoftRetriever1Model fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseMicrosoftRetriever1Model deserializedKnowledgeBaseMicrosoftRetriever1Model + = new KnowledgeBaseMicrosoftRetriever1Model(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedKnowledgeBaseMicrosoftRetriever1Model.kind + = KnowledgeBaseModelKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseMicrosoftRetriever1Model; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModel.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModel.java index 433fda62327f3..cf2eafa4ab03b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModel.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModel.java @@ -79,6 +79,10 @@ public static KnowledgeBaseModel fromJson(JsonReader jsonReader) throws IOExcept // Use the discriminator value to determine which subtype should be deserialized. if ("azureOpenAI".equals(discriminatorValue)) { return KnowledgeBaseAzureOpenAIModel.fromJson(readerToUse.reset()); + } else if ("openAICompatible".equals(discriminatorValue)) { + return KnowledgeBaseOpenAICompatibleModel.fromJson(readerToUse.reset()); + } else if ("microsoftRetriever1".equals(discriminatorValue)) { + return KnowledgeBaseMicrosoftRetriever1Model.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModelKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModelKind.java index c47446a0b2051..287a8aa5fadc6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModelKind.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModelKind.java @@ -48,4 +48,17 @@ public static KnowledgeBaseModelKind fromString(String name) { public static Collection values() { return values(KnowledgeBaseModelKind.class); } + + /** + * Use a customer-controlled OpenAI-compatible endpoint for knowledge base retrieval or knowledge source image + * verbalization. + */ + @Generated + public static final KnowledgeBaseModelKind OPEN_AICOMPATIBLE = fromString("openAICompatible"); + + /** + * Use Microsoft Retriever 1 for query planning and retrieval. + */ + @Generated + public static final KnowledgeBaseModelKind MICROSOFT_RETRIEVER1 = fromString("microsoftRetriever1"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleModel.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleModel.java new file mode 100644 index 0000000000000..5785766357d69 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleModel.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies a customer-controlled OpenAI-compatible model for knowledge base retrieval or Minimal-mode knowledge source + * image verbalization. For retrieval, the model profile selects Chat Completions or Responses. Not supported for + * Standard/CU extraction or knowledge bases with Web knowledge sources. + */ +@Immutable +public final class KnowledgeBaseOpenAICompatibleModel extends KnowledgeBaseModel { + + /* + * The AI model to be used for query planning. + */ + @Generated + private KnowledgeBaseModelKind kind = KnowledgeBaseModelKind.OPEN_AICOMPATIBLE; + + /* + * Connection and authentication parameters for the OpenAI-compatible endpoint. + */ + @Generated + private final KnowledgeBaseOpenAICompatibleParameters openAICompatibleParameters; + + /** + * Creates an instance of KnowledgeBaseOpenAICompatibleModel class. + * + * @param openAICompatibleParameters the openAICompatibleParameters value to set. + */ + @Generated + public KnowledgeBaseOpenAICompatibleModel(KnowledgeBaseOpenAICompatibleParameters openAICompatibleParameters) { + this.openAICompatibleParameters = openAICompatibleParameters; + } + + /** + * Get the kind property: The AI model to be used for query planning. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeBaseModelKind getKind() { + return this.kind; + } + + /** + * Get the openAICompatibleParameters property: Connection and authentication parameters for the OpenAI-compatible + * endpoint. + * + * @return the openAICompatibleParameters value. + */ + @Generated + public KnowledgeBaseOpenAICompatibleParameters getOpenAICompatibleParameters() { + return this.openAICompatibleParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("openAICompatibleParameters", this.openAICompatibleParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseOpenAICompatibleModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseOpenAICompatibleModel if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseOpenAICompatibleModel. + */ + @Generated + public static KnowledgeBaseOpenAICompatibleModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseOpenAICompatibleParameters openAICompatibleParameters = null; + KnowledgeBaseModelKind kind = KnowledgeBaseModelKind.OPEN_AICOMPATIBLE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("openAICompatibleParameters".equals(fieldName)) { + openAICompatibleParameters = KnowledgeBaseOpenAICompatibleParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeBaseModelKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseOpenAICompatibleModel deserializedKnowledgeBaseOpenAICompatibleModel + = new KnowledgeBaseOpenAICompatibleModel(openAICompatibleParameters); + deserializedKnowledgeBaseOpenAICompatibleModel.kind = kind; + return deserializedKnowledgeBaseOpenAICompatibleModel; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleParameters.java new file mode 100644 index 0000000000000..5209d7e79624f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleParameters.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Connection parameters for an OpenAI-compatible Chat Completions or Responses endpoint. Creation requires exactly one + * of nonempty headers or managedIdentityAudience. Updates can omit headers to preserve credentials for an unchanged + * connection and model profile. + */ +@Fluent +public final class KnowledgeBaseOpenAICompatibleParameters + implements JsonSerializable { + + /* + * The complete HTTPS POST URL, including path and query parameters. Sent unchanged without appending a path or API + * version; redirects are not followed. For knowledge base retrieval, the endpoint must accept the model profile's + * Chat Completions or Responses protocol. For knowledge source image verbalization, the URI path must end in + * /chat/completions or /responses; query parameters do not select the protocol. + */ + @Generated + private final String uri; + + /* + * A supported chat model name that determines Search's capabilities and limits. For knowledge source image + * verbalization, this is sent as the model selector in the request body; the URI path selects Chat Completions or + * Responses independently of this name. For knowledge base retrieval, GPT-6 model profiles use Responses and + * existing model profiles use Chat Completions; the endpoint must support the selected protocol, including + * stateless tool continuation for Responses. The retrieval request body omits model; the URI or gateway selects the + * actual model and supplies any required provider model identifier. Embedding models and arbitrary provider + * protocols are not supported. + */ + @Generated + private final AzureOpenAIModelName modelName; + + /* + * Nonempty stored HTTP headers for endpoint authentication. Both names and values are secret and are never returned + * in responses. Empty maps are invalid. Mutually exclusive with managedIdentityAudience and authIdentity. On + * update, omitted headers are preserved only on the same resource and model binding when the exact endpoint, model + * profile, and authentication identity are unchanged; otherwise, supply fresh credentials. + */ + @Generated + private Map headers; + + /* + * The bare canonical application GUID of the customer's third-party Microsoft Entra application for managed + * identity authentication. Do not include an api:// prefix or /.default suffix. Mutually exclusive with headers. + */ + @Generated + private String managedIdentityAudience; + + /* + * The user-assigned managed identity used to acquire a token for managedIdentityAudience. Omit to use the search + * service's system-assigned identity. Allowed only with managedIdentityAudience. + */ + @Generated + private SearchIndexerDataIdentity authIdentity; + + /** + * Creates an instance of KnowledgeBaseOpenAICompatibleParameters class. + * + * @param uri the uri value to set. + * @param modelName the modelName value to set. + */ + @Generated + public KnowledgeBaseOpenAICompatibleParameters(String uri, AzureOpenAIModelName modelName) { + this.uri = uri; + this.modelName = modelName; + } + + /** + * Get the uri property: The complete HTTPS POST URL, including path and query parameters. Sent unchanged without + * appending a path or API version; redirects are not followed. For knowledge base retrieval, the endpoint must + * accept the model profile's Chat Completions or Responses protocol. For knowledge source image verbalization, the + * URI path must end in /chat/completions or /responses; query parameters do not select the protocol. + * + * @return the uri value. + */ + @Generated + public String getUri() { + return this.uri; + } + + /** + * Get the modelName property: A supported chat model name that determines Search's capabilities and limits. For + * knowledge source image verbalization, this is sent as the model selector in the request body; the URI path + * selects Chat Completions or Responses independently of this name. For knowledge base retrieval, GPT-6 model + * profiles use Responses and existing model profiles use Chat Completions; the endpoint must support the selected + * protocol, including stateless tool continuation for Responses. The retrieval request body omits model; the URI or + * gateway selects the actual model and supplies any required provider model identifier. Embedding models and + * arbitrary provider protocols are not supported. + * + * @return the modelName value. + */ + @Generated + public AzureOpenAIModelName getModelName() { + return this.modelName; + } + + /** + * Get the headers property: Nonempty stored HTTP headers for endpoint authentication. Both names and values are + * secret and are never returned in responses. Empty maps are invalid. Mutually exclusive with + * managedIdentityAudience and authIdentity. On update, omitted headers are preserved only on the same resource and + * model binding when the exact endpoint, model profile, and authentication identity are unchanged; otherwise, + * supply fresh credentials. + * + * @return the headers value. + */ + @Generated + public Map getHeaders() { + return this.headers; + } + + /** + * Set the headers property: Nonempty stored HTTP headers for endpoint authentication. Both names and values are + * secret and are never returned in responses. Empty maps are invalid. Mutually exclusive with + * managedIdentityAudience and authIdentity. On update, omitted headers are preserved only on the same resource and + * model binding when the exact endpoint, model profile, and authentication identity are unchanged; otherwise, + * supply fresh credentials. + * + * @param headers the headers value to set. + * @return the KnowledgeBaseOpenAICompatibleParameters object itself. + */ + @Generated + public KnowledgeBaseOpenAICompatibleParameters setHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the managedIdentityAudience property: The bare canonical application GUID of the customer's third-party + * Microsoft Entra application for managed identity authentication. Do not include an api:// prefix or /.default + * suffix. Mutually exclusive with headers. + * + * @return the managedIdentityAudience value. + */ + @Generated + public String getManagedIdentityAudience() { + return this.managedIdentityAudience; + } + + /** + * Set the managedIdentityAudience property: The bare canonical application GUID of the customer's third-party + * Microsoft Entra application for managed identity authentication. Do not include an api:// prefix or /.default + * suffix. Mutually exclusive with headers. + * + * @param managedIdentityAudience the managedIdentityAudience value to set. + * @return the KnowledgeBaseOpenAICompatibleParameters object itself. + */ + @Generated + public KnowledgeBaseOpenAICompatibleParameters setManagedIdentityAudience(String managedIdentityAudience) { + this.managedIdentityAudience = managedIdentityAudience; + return this; + } + + /** + * Get the authIdentity property: The user-assigned managed identity used to acquire a token for + * managedIdentityAudience. Omit to use the search service's system-assigned identity. Allowed only with + * managedIdentityAudience. + * + * @return the authIdentity value. + */ + @Generated + public SearchIndexerDataIdentity getAuthIdentity() { + return this.authIdentity; + } + + /** + * Set the authIdentity property: The user-assigned managed identity used to acquire a token for + * managedIdentityAudience. Omit to use the search service's system-assigned identity. Allowed only with + * managedIdentityAudience. + * + * @param authIdentity the authIdentity value to set. + * @return the KnowledgeBaseOpenAICompatibleParameters object itself. + */ + @Generated + public KnowledgeBaseOpenAICompatibleParameters setAuthIdentity(SearchIndexerDataIdentity authIdentity) { + this.authIdentity = authIdentity; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("modelName", this.modelName == null ? null : this.modelName.toString()); + jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedIdentityAudience", this.managedIdentityAudience); + jsonWriter.writeJsonField("authIdentity", this.authIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseOpenAICompatibleParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseOpenAICompatibleParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseOpenAICompatibleParameters. + */ + @Generated + public static KnowledgeBaseOpenAICompatibleParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String uri = null; + AzureOpenAIModelName modelName = null; + Map headers = null; + String managedIdentityAudience = null; + SearchIndexerDataIdentity authIdentity = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("uri".equals(fieldName)) { + uri = reader.getString(); + } else if ("modelName".equals(fieldName)) { + modelName = AzureOpenAIModelName.fromString(reader.getString()); + } else if ("headers".equals(fieldName)) { + headers = reader.readMap(reader1 -> reader1.getString()); + } else if ("managedIdentityAudience".equals(fieldName)) { + managedIdentityAudience = reader.getString(); + } else if ("authIdentity".equals(fieldName)) { + authIdentity = SearchIndexerDataIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseOpenAICompatibleParameters deserializedKnowledgeBaseOpenAICompatibleParameters + = new KnowledgeBaseOpenAICompatibleParameters(uri, modelName); + deserializedKnowledgeBaseOpenAICompatibleParameters.headers = headers; + deserializedKnowledgeBaseOpenAICompatibleParameters.managedIdentityAudience = managedIdentityAudience; + deserializedKnowledgeBaseOpenAICompatibleParameters.authIdentity = authIdentity; + return deserializedKnowledgeBaseOpenAICompatibleParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseTool.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseTool.java new file mode 100644 index 0000000000000..0f5a444f5304f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseTool.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort; +import java.io.IOException; +import java.util.List; + +/** + * A named retrieval tool with a customer-provided description and a subset of its knowledge base's sources. + */ +@Fluent +public final class KnowledgeBaseTool implements JsonSerializable { + + /* + * The unique, case-sensitive tool name. Contains 2 to 64 lowercase ASCII letters, digits, or hyphens, with no + * leading or trailing hyphen. + */ + @Generated + private final String name; + + /* + * A nonempty description of when to use the tool, at most 1024 characters. Advertised verbatim in the MCP catalog. + */ + @Generated + private final String description; + + /* + * A nonempty list of unique source references. Each source must belong to the knowledge base. Different tools may + * reference the same source. + */ + @Generated + private final List knowledgeSources; + + /* + * Overrides the knowledge base's reasoning effort for this tool. Explicit retrieve-request values take precedence. + */ + @Generated + private KnowledgeRetrievalReasoningEffort retrievalReasoningEffort; + + /* + * Retrieve defaults that override the knowledge base's defaults for this tool. Explicit retrieve-request values + * take precedence. + */ + @Generated + private KnowledgeBaseRetrieveDefaults retrieveDefaults; + + /** + * Creates an instance of KnowledgeBaseTool class. + * + * @param name the name value to set. + * @param description the description value to set. + * @param knowledgeSources the knowledgeSources value to set. + */ + @Generated + public KnowledgeBaseTool(String name, String description, + List knowledgeSources) { + this.name = name; + this.description = description; + this.knowledgeSources = knowledgeSources; + } + + /** + * Get the name property: The unique, case-sensitive tool name. Contains 2 to 64 lowercase ASCII letters, digits, or + * hyphens, with no leading or trailing hyphen. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the description property: A nonempty description of when to use the tool, at most 1024 characters. Advertised + * verbatim in the MCP catalog. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the knowledgeSources property: A nonempty list of unique source references. Each source must belong to the + * knowledge base. Different tools may reference the same source. + * + * @return the knowledgeSources value. + */ + @Generated + public List getKnowledgeSources() { + return this.knowledgeSources; + } + + /** + * Get the retrievalReasoningEffort property: Overrides the knowledge base's reasoning effort for this tool. + * Explicit retrieve-request values take precedence. + * + * @return the retrievalReasoningEffort value. + */ + @Generated + public KnowledgeRetrievalReasoningEffort getRetrievalReasoningEffort() { + return this.retrievalReasoningEffort; + } + + /** + * Set the retrievalReasoningEffort property: Overrides the knowledge base's reasoning effort for this tool. + * Explicit retrieve-request values take precedence. + * + * @param retrievalReasoningEffort the retrievalReasoningEffort value to set. + * @return the KnowledgeBaseTool object itself. + */ + @Generated + public KnowledgeBaseTool setRetrievalReasoningEffort(KnowledgeRetrievalReasoningEffort retrievalReasoningEffort) { + this.retrievalReasoningEffort = retrievalReasoningEffort; + return this; + } + + /** + * Get the retrieveDefaults property: Retrieve defaults that override the knowledge base's defaults for this tool. + * Explicit retrieve-request values take precedence. + * + * @return the retrieveDefaults value. + */ + @Generated + public KnowledgeBaseRetrieveDefaults getRetrieveDefaults() { + return this.retrieveDefaults; + } + + /** + * Set the retrieveDefaults property: Retrieve defaults that override the knowledge base's defaults for this tool. + * Explicit retrieve-request values take precedence. + * + * @param retrieveDefaults the retrieveDefaults value to set. + * @return the KnowledgeBaseTool object itself. + */ + @Generated + public KnowledgeBaseTool setRetrieveDefaults(KnowledgeBaseRetrieveDefaults retrieveDefaults) { + this.retrieveDefaults = retrieveDefaults; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("knowledgeSources", this.knowledgeSources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("retrievalReasoningEffort", this.retrievalReasoningEffort); + jsonWriter.writeJsonField("retrieveDefaults", this.retrieveDefaults); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseTool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseTool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseTool. + */ + @Generated + public static KnowledgeBaseTool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + List knowledgeSources = null; + KnowledgeRetrievalReasoningEffort retrievalReasoningEffort = null; + KnowledgeBaseRetrieveDefaults retrieveDefaults = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("knowledgeSources".equals(fieldName)) { + knowledgeSources + = reader.readArray(reader1 -> KnowledgeBaseToolKnowledgeSourceReference.fromJson(reader1)); + } else if ("retrievalReasoningEffort".equals(fieldName)) { + retrievalReasoningEffort = KnowledgeRetrievalReasoningEffort.fromJson(reader); + } else if ("retrieveDefaults".equals(fieldName)) { + retrieveDefaults = KnowledgeBaseRetrieveDefaults.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseTool deserializedKnowledgeBaseTool + = new KnowledgeBaseTool(name, description, knowledgeSources); + deserializedKnowledgeBaseTool.retrievalReasoningEffort = retrievalReasoningEffort; + deserializedKnowledgeBaseTool.retrieveDefaults = retrieveDefaults; + return deserializedKnowledgeBaseTool; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseToolKnowledgeSourceReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseToolKnowledgeSourceReference.java new file mode 100644 index 0000000000000..8b26c9bb2a2b6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseToolKnowledgeSourceReference.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A reference to an existing knowledge source and a selected subset of persisted retrieval defaults, not the complete + * request-time parameter model. The referenced source determines the kind; incompatible defaults are rejected when the + * knowledge base is saved. Explicit retrieve-request values take precedence, except filters are combined with AND. + */ +@Fluent +public final class KnowledgeBaseToolKnowledgeSourceReference + implements JsonSerializable { + + /* + * The name of a knowledge source in the knowledge base. + */ + @Generated + private final String name; + + /* + * Whether the source must be queried. Not supported for MCP server sources. An explicit request exclusion takes + * precedence. + */ + @Generated + private Boolean alwaysQuerySource; + + /* + * The minimum reranker score for returned documents. Requires reranking to be enabled. + */ + @Generated + private Float rerankerThreshold; + + /* + * An additional OData filter for search index sources. Rejected for unsupported source kinds when the knowledge + * base is saved. Combined with source and request filters using AND. + */ + @Generated + private String filterAddOn; + + /* + * The maximum number of documents retrieved from this source, between 50 and 200. + */ + @Generated + private Integer maxOutputDocuments; + + /* + * Whether retrieval should fail if this source encounters an error. + */ + @Generated + private Boolean failOnError; + + /** + * Creates an instance of KnowledgeBaseToolKnowledgeSourceReference class. + * + * @param name the name value to set. + */ + @Generated + public KnowledgeBaseToolKnowledgeSourceReference(String name) { + this.name = name; + } + + /** + * Get the name property: The name of a knowledge source in the knowledge base. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the alwaysQuerySource property: Whether the source must be queried. Not supported for MCP server sources. An + * explicit request exclusion takes precedence. + * + * @return the alwaysQuerySource value. + */ + @Generated + public Boolean isAlwaysQuerySource() { + return this.alwaysQuerySource; + } + + /** + * Set the alwaysQuerySource property: Whether the source must be queried. Not supported for MCP server sources. An + * explicit request exclusion takes precedence. + * + * @param alwaysQuerySource the alwaysQuerySource value to set. + * @return the KnowledgeBaseToolKnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeBaseToolKnowledgeSourceReference setAlwaysQuerySource(Boolean alwaysQuerySource) { + this.alwaysQuerySource = alwaysQuerySource; + return this; + } + + /** + * Get the rerankerThreshold property: The minimum reranker score for returned documents. Requires reranking to be + * enabled. + * + * @return the rerankerThreshold value. + */ + @Generated + public Float getRerankerThreshold() { + return this.rerankerThreshold; + } + + /** + * Set the rerankerThreshold property: The minimum reranker score for returned documents. Requires reranking to be + * enabled. + * + * @param rerankerThreshold the rerankerThreshold value to set. + * @return the KnowledgeBaseToolKnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeBaseToolKnowledgeSourceReference setRerankerThreshold(Float rerankerThreshold) { + this.rerankerThreshold = rerankerThreshold; + return this; + } + + /** + * Get the filterAddOn property: An additional OData filter for search index sources. Rejected for unsupported + * source kinds when the knowledge base is saved. Combined with source and request filters using AND. + * + * @return the filterAddOn value. + */ + @Generated + public String getFilterAddOn() { + return this.filterAddOn; + } + + /** + * Set the filterAddOn property: An additional OData filter for search index sources. Rejected for unsupported + * source kinds when the knowledge base is saved. Combined with source and request filters using AND. + * + * @param filterAddOn the filterAddOn value to set. + * @return the KnowledgeBaseToolKnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeBaseToolKnowledgeSourceReference setFilterAddOn(String filterAddOn) { + this.filterAddOn = filterAddOn; + return this; + } + + /** + * Get the maxOutputDocuments property: The maximum number of documents retrieved from this source, between 50 and + * 200. + * + * @return the maxOutputDocuments value. + */ + @Generated + public Integer getMaxOutputDocuments() { + return this.maxOutputDocuments; + } + + /** + * Set the maxOutputDocuments property: The maximum number of documents retrieved from this source, between 50 and + * 200. + * + * @param maxOutputDocuments the maxOutputDocuments value to set. + * @return the KnowledgeBaseToolKnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeBaseToolKnowledgeSourceReference setMaxOutputDocuments(Integer maxOutputDocuments) { + this.maxOutputDocuments = maxOutputDocuments; + return this; + } + + /** + * Get the failOnError property: Whether retrieval should fail if this source encounters an error. + * + * @return the failOnError value. + */ + @Generated + public Boolean isFailOnError() { + return this.failOnError; + } + + /** + * Set the failOnError property: Whether retrieval should fail if this source encounters an error. + * + * @param failOnError the failOnError value to set. + * @return the KnowledgeBaseToolKnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeBaseToolKnowledgeSourceReference setFailOnError(Boolean failOnError) { + this.failOnError = failOnError; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("alwaysQuerySource", this.alwaysQuerySource); + jsonWriter.writeNumberField("rerankerThreshold", this.rerankerThreshold); + jsonWriter.writeStringField("filterAddOn", this.filterAddOn); + jsonWriter.writeNumberField("maxOutputDocuments", this.maxOutputDocuments); + jsonWriter.writeBooleanField("failOnError", this.failOnError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseToolKnowledgeSourceReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseToolKnowledgeSourceReference if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseToolKnowledgeSourceReference. + */ + @Generated + public static KnowledgeBaseToolKnowledgeSourceReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + Boolean alwaysQuerySource = null; + Float rerankerThreshold = null; + String filterAddOn = null; + Integer maxOutputDocuments = null; + Boolean failOnError = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("alwaysQuerySource".equals(fieldName)) { + alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("rerankerThreshold".equals(fieldName)) { + rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("filterAddOn".equals(fieldName)) { + filterAddOn = reader.getString(); + } else if ("maxOutputDocuments".equals(fieldName)) { + maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("failOnError".equals(fieldName)) { + failOnError = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseToolKnowledgeSourceReference deserializedKnowledgeBaseToolKnowledgeSourceReference + = new KnowledgeBaseToolKnowledgeSourceReference(name); + deserializedKnowledgeBaseToolKnowledgeSourceReference.alwaysQuerySource = alwaysQuerySource; + deserializedKnowledgeBaseToolKnowledgeSourceReference.rerankerThreshold = rerankerThreshold; + deserializedKnowledgeBaseToolKnowledgeSourceReference.filterAddOn = filterAddOn; + deserializedKnowledgeBaseToolKnowledgeSourceReference.maxOutputDocuments = maxOutputDocuments; + deserializedKnowledgeBaseToolKnowledgeSourceReference.failOnError = failOnError; + return deserializedKnowledgeBaseToolKnowledgeSourceReference; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionError.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionError.java new file mode 100644 index 0000000000000..4981e02764424 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionError.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The error returned by a failed file ingestion operation. + */ +@Immutable +public final class KnowledgeSourceFileIngestionError implements JsonSerializable { + + /* + * A machine-readable error code. + */ + @Generated + private final String code; + + /* + * A description of the failure. + */ + @Generated + private final String message; + + /** + * Creates an instance of KnowledgeSourceFileIngestionError class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private KnowledgeSourceFileIngestionError(String code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: A machine-readable error code. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: A description of the failure. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceFileIngestionError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceFileIngestionError if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceFileIngestionError. + */ + @Generated + public static KnowledgeSourceFileIngestionError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new KnowledgeSourceFileIngestionError(code, message); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionOperation.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionOperation.java new file mode 100644 index 0000000000000..11d72485cbf40 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionOperation.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.models.OperationState; +import java.io.IOException; + +/** + * Tracks asynchronous upload or replacement of a file in a knowledge source. + */ +@Immutable +public final class KnowledgeSourceFileIngestionOperation + implements JsonSerializable { + + /* + * The server-generated operation identifier. + */ + @Generated + private final String id; + + /* + * The current state. Poll until the operation succeeds or fails. + */ + @Generated + private final OperationState status; + + /* + * The file metadata, present only when ingestion succeeds. + */ + @Generated + private KnowledgeSourceFile result; + + /* + * The failure details, present only when ingestion fails. + */ + @Generated + private KnowledgeSourceFileIngestionError error; + + /** + * Creates an instance of KnowledgeSourceFileIngestionOperation class. + * + * @param id the id value to set. + * @param status the status value to set. + */ + @Generated + private KnowledgeSourceFileIngestionOperation(String id, OperationState status) { + this.id = id; + this.status = status; + } + + /** + * Get the id property: The server-generated operation identifier. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the kind property: The kind of operation. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return KnowledgeSourceFileIngestionOperation.KIND; + } + + /** + * Get the status property: The current state. Poll until the operation succeeds or fails. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the result property: The file metadata, present only when ingestion succeeds. + * + * @return the result value. + */ + @Generated + public KnowledgeSourceFile getResult() { + return this.result; + } + + /** + * Get the error property: The failure details, present only when ingestion fails. + * + * @return the error value. + */ + @Generated + public KnowledgeSourceFileIngestionError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("kind", KnowledgeSourceFileIngestionOperation.KIND); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceFileIngestionOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceFileIngestionOperation if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceFileIngestionOperation. + */ + @Generated + public static KnowledgeSourceFileIngestionOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + OperationState status = null; + KnowledgeSourceFile result = null; + KnowledgeSourceFileIngestionError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("result".equals(fieldName)) { + result = KnowledgeSourceFile.fromJson(reader); + } else if ("error".equals(fieldName)) { + error = KnowledgeSourceFileIngestionError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeSourceFileIngestionOperation deserializedKnowledgeSourceFileIngestionOperation + = new KnowledgeSourceFileIngestionOperation(id, status); + deserializedKnowledgeSourceFileIngestionOperation.result = result; + deserializedKnowledgeSourceFileIngestionOperation.error = error; + return deserializedKnowledgeSourceFileIngestionOperation; + }); + } + + /* + * The kind of operation. + */ + @Generated + private static final String KIND = "knowledgeSourceFileIngestion"; +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphExtractionParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphExtractionParameters.java new file mode 100644 index 0000000000000..bd5e203620454 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphExtractionParameters.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configures graph extraction from an Azure Blob knowledge source with native Blob soft delete enabled before indexing. + * ADLS Gen2, ACL ingestion, and sensitivity-label ingestion are not supported. Distinct ontology changes must wait + * until no synchronization is active. + */ +@Fluent +public final class KnowledgeSourceGraphExtractionParameters + implements JsonSerializable { + + /* + * The name of the graph to create. + */ + @Generated + private final String graphName; + + /* + * The ontology used to extract triples. If absent or null at creation, a configured enrichment cache allows + * ingestion to produce searchable chunks and cached enrichment without extracting triples. Once an ontology is + * attached, it cannot be removed. Distinct ontology changes must wait until no synchronization is active. + */ + @Generated + private KnowledgeSourceGraphOntology ontology; + + /* + * Optional grounding source used to resolve extracted entities. + */ + @Generated + private KnowledgeSourceGraphGrounding grounding; + + /* + * Maximum number of pages processed in parallel for graph extraction. + */ + @Generated + private Integer pageDegreeOfParallelism; + + /** + * Creates an instance of KnowledgeSourceGraphExtractionParameters class. + * + * @param graphName the graphName value to set. + */ + @Generated + public KnowledgeSourceGraphExtractionParameters(String graphName) { + this.graphName = graphName; + } + + /** + * Get the graphName property: The name of the graph to create. + * + * @return the graphName value. + */ + @Generated + public String getGraphName() { + return this.graphName; + } + + /** + * Get the ontology property: The ontology used to extract triples. If absent or null at creation, a configured + * enrichment cache allows ingestion to produce searchable chunks and cached enrichment without extracting triples. + * Once an ontology is attached, it cannot be removed. Distinct ontology changes must wait until no synchronization + * is active. + * + * @return the ontology value. + */ + @Generated + public KnowledgeSourceGraphOntology getOntology() { + return this.ontology; + } + + /** + * Set the ontology property: The ontology used to extract triples. If absent or null at creation, a configured + * enrichment cache allows ingestion to produce searchable chunks and cached enrichment without extracting triples. + * Once an ontology is attached, it cannot be removed. Distinct ontology changes must wait until no synchronization + * is active. + * + * @param ontology the ontology value to set. + * @return the KnowledgeSourceGraphExtractionParameters object itself. + */ + @Generated + public KnowledgeSourceGraphExtractionParameters setOntology(KnowledgeSourceGraphOntology ontology) { + this.ontology = ontology; + return this; + } + + /** + * Get the grounding property: Optional grounding source used to resolve extracted entities. + * + * @return the grounding value. + */ + @Generated + public KnowledgeSourceGraphGrounding getGrounding() { + return this.grounding; + } + + /** + * Set the grounding property: Optional grounding source used to resolve extracted entities. + * + * @param grounding the grounding value to set. + * @return the KnowledgeSourceGraphExtractionParameters object itself. + */ + @Generated + public KnowledgeSourceGraphExtractionParameters setGrounding(KnowledgeSourceGraphGrounding grounding) { + this.grounding = grounding; + return this; + } + + /** + * Get the pageDegreeOfParallelism property: Maximum number of pages processed in parallel for graph extraction. + * + * @return the pageDegreeOfParallelism value. + */ + @Generated + public Integer getPageDegreeOfParallelism() { + return this.pageDegreeOfParallelism; + } + + /** + * Set the pageDegreeOfParallelism property: Maximum number of pages processed in parallel for graph extraction. + * + * @param pageDegreeOfParallelism the pageDegreeOfParallelism value to set. + * @return the KnowledgeSourceGraphExtractionParameters object itself. + */ + @Generated + public KnowledgeSourceGraphExtractionParameters setPageDegreeOfParallelism(Integer pageDegreeOfParallelism) { + this.pageDegreeOfParallelism = pageDegreeOfParallelism; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("graphName", this.graphName); + jsonWriter.writeJsonField("ontology", this.ontology); + jsonWriter.writeJsonField("grounding", this.grounding); + jsonWriter.writeNumberField("pageDegreeOfParallelism", this.pageDegreeOfParallelism); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceGraphExtractionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceGraphExtractionParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceGraphExtractionParameters. + */ + @Generated + public static KnowledgeSourceGraphExtractionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String graphName = null; + KnowledgeSourceGraphOntology ontology = null; + KnowledgeSourceGraphGrounding grounding = null; + Integer pageDegreeOfParallelism = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("graphName".equals(fieldName)) { + graphName = reader.getString(); + } else if ("ontology".equals(fieldName)) { + ontology = KnowledgeSourceGraphOntology.fromJson(reader); + } else if ("grounding".equals(fieldName)) { + grounding = KnowledgeSourceGraphGrounding.fromJson(reader); + } else if ("pageDegreeOfParallelism".equals(fieldName)) { + pageDegreeOfParallelism = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + KnowledgeSourceGraphExtractionParameters deserializedKnowledgeSourceGraphExtractionParameters + = new KnowledgeSourceGraphExtractionParameters(graphName); + deserializedKnowledgeSourceGraphExtractionParameters.ontology = ontology; + deserializedKnowledgeSourceGraphExtractionParameters.grounding = grounding; + deserializedKnowledgeSourceGraphExtractionParameters.pageDegreeOfParallelism = pageDegreeOfParallelism; + return deserializedKnowledgeSourceGraphExtractionParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGrounding.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGrounding.java new file mode 100644 index 0000000000000..2d788e7dd0c40 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGrounding.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A grounding source for graph extraction. Only same-service search indexes are supported. + */ +@Fluent +public final class KnowledgeSourceGraphGrounding implements JsonSerializable { + + /* + * The source kind. If omitted, searchIndex is assumed. Other kinds are rejected. + */ + @Generated + private KnowledgeSourceGraphGroundingSourceKind kind; + + /* + * The same-service search index used for grounding. Required for searchIndex sources. + */ + @Generated + private KnowledgeSourceGraphGroundingIndex index; + + /** + * Creates an instance of KnowledgeSourceGraphGrounding class. + */ + @Generated + public KnowledgeSourceGraphGrounding() { + } + + /** + * Get the kind property: The source kind. If omitted, searchIndex is assumed. Other kinds are rejected. + * + * @return the kind value. + */ + @Generated + public KnowledgeSourceGraphGroundingSourceKind getKind() { + return this.kind; + } + + /** + * Set the kind property: The source kind. If omitted, searchIndex is assumed. Other kinds are rejected. + * + * @param kind the kind value to set. + * @return the KnowledgeSourceGraphGrounding object itself. + */ + @Generated + public KnowledgeSourceGraphGrounding setKind(KnowledgeSourceGraphGroundingSourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the index property: The same-service search index used for grounding. Required for searchIndex sources. + * + * @return the index value. + */ + @Generated + public KnowledgeSourceGraphGroundingIndex getIndex() { + return this.index; + } + + /** + * Set the index property: The same-service search index used for grounding. Required for searchIndex sources. + * + * @param index the index value to set. + * @return the KnowledgeSourceGraphGrounding object itself. + */ + @Generated + public KnowledgeSourceGraphGrounding setIndex(KnowledgeSourceGraphGroundingIndex index) { + this.index = index; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("index", this.index); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceGraphGrounding from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceGraphGrounding if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeSourceGraphGrounding. + */ + @Generated + public static KnowledgeSourceGraphGrounding fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeSourceGraphGrounding deserializedKnowledgeSourceGraphGrounding + = new KnowledgeSourceGraphGrounding(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedKnowledgeSourceGraphGrounding.kind + = KnowledgeSourceGraphGroundingSourceKind.fromString(reader.getString()); + } else if ("index".equals(fieldName)) { + deserializedKnowledgeSourceGraphGrounding.index + = KnowledgeSourceGraphGroundingIndex.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeSourceGraphGrounding; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingIndex.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingIndex.java new file mode 100644 index 0000000000000..e043b602db6cb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingIndex.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Identifies a search index used to ground extracted entities. + */ +@Fluent +public final class KnowledgeSourceGraphGroundingIndex implements JsonSerializable { + + /* + * The name of the grounding search index. + */ + @Generated + private final String indexName; + + /* + * The name of the vector field used for grounding, when vector lookup is configured. + */ + @Generated + private String vectorFieldName; + + /** + * Creates an instance of KnowledgeSourceGraphGroundingIndex class. + * + * @param indexName the indexName value to set. + */ + @Generated + public KnowledgeSourceGraphGroundingIndex(String indexName) { + this.indexName = indexName; + } + + /** + * Get the indexName property: The name of the grounding search index. + * + * @return the indexName value. + */ + @Generated + public String getIndexName() { + return this.indexName; + } + + /** + * Get the vectorFieldName property: The name of the vector field used for grounding, when vector lookup is + * configured. + * + * @return the vectorFieldName value. + */ + @Generated + public String getVectorFieldName() { + return this.vectorFieldName; + } + + /** + * Set the vectorFieldName property: The name of the vector field used for grounding, when vector lookup is + * configured. + * + * @param vectorFieldName the vectorFieldName value to set. + * @return the KnowledgeSourceGraphGroundingIndex object itself. + */ + @Generated + public KnowledgeSourceGraphGroundingIndex setVectorFieldName(String vectorFieldName) { + this.vectorFieldName = vectorFieldName; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("indexName", this.indexName); + jsonWriter.writeStringField("vectorFieldName", this.vectorFieldName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceGraphGroundingIndex from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceGraphGroundingIndex if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceGraphGroundingIndex. + */ + @Generated + public static KnowledgeSourceGraphGroundingIndex fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String indexName = null; + String vectorFieldName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("indexName".equals(fieldName)) { + indexName = reader.getString(); + } else if ("vectorFieldName".equals(fieldName)) { + vectorFieldName = reader.getString(); + } else { + reader.skipChildren(); + } + } + KnowledgeSourceGraphGroundingIndex deserializedKnowledgeSourceGraphGroundingIndex + = new KnowledgeSourceGraphGroundingIndex(indexName); + deserializedKnowledgeSourceGraphGroundingIndex.vectorFieldName = vectorFieldName; + return deserializedKnowledgeSourceGraphGroundingIndex; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingSourceKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingSourceKind.java new file mode 100644 index 0000000000000..64166b6c1662b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingSourceKind.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The explicit source kind for a grounding reference. Only searchIndex is supported. + */ +public final class KnowledgeSourceGraphGroundingSourceKind + extends ExpandableStringEnum { + + /** + * A search index in the same search service. + */ + @Generated + public static final KnowledgeSourceGraphGroundingSourceKind SEARCH_INDEX = fromString("searchIndex"); + + /** + * Creates a new instance of KnowledgeSourceGraphGroundingSourceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public KnowledgeSourceGraphGroundingSourceKind() { + } + + /** + * Creates or finds a KnowledgeSourceGraphGroundingSourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnowledgeSourceGraphGroundingSourceKind. + */ + @Generated + public static KnowledgeSourceGraphGroundingSourceKind fromString(String name) { + return fromString(name, KnowledgeSourceGraphGroundingSourceKind.class); + } + + /** + * Gets known KnowledgeSourceGraphGroundingSourceKind values. + * + * @return known KnowledgeSourceGraphGroundingSourceKind values. + */ + @Generated + public static Collection values() { + return values(KnowledgeSourceGraphGroundingSourceKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntology.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntology.java new file mode 100644 index 0000000000000..ddb81a99d7511 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntology.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An inline ontology for graph extraction. The only supported source is a constrained JSON-LD document supplied + * directly in the request. + */ +@Fluent +public final class KnowledgeSourceGraphOntology implements JsonSerializable { + + /* + * The source kind. Only "inline" is supported. + */ + @Generated + private final KnowledgeSourceGraphOntologySourceKind kind; + + /* + * An optional customer-supplied name for the ontology, echoed back on `graphStatistics.ontologyName`. + */ + @Generated + private String name; + + /* + * A constrained JSON-LD 1.1 ontology document (flat classes and object/datatype properties), supplied as a + * JSON-encoded string. + */ + @Generated + private final String value; + + /** + * Creates an instance of KnowledgeSourceGraphOntology class. + * + * @param kind the kind value to set. + * @param value the value value to set. + */ + @Generated + public KnowledgeSourceGraphOntology(KnowledgeSourceGraphOntologySourceKind kind, String value) { + this.kind = kind; + this.value = value; + } + + /** + * Get the kind property: The source kind. Only "inline" is supported. + * + * @return the kind value. + */ + @Generated + public KnowledgeSourceGraphOntologySourceKind getKind() { + return this.kind; + } + + /** + * Get the name property: An optional customer-supplied name for the ontology, echoed back on + * `graphStatistics.ontologyName`. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: An optional customer-supplied name for the ontology, echoed back on + * `graphStatistics.ontologyName`. + * + * @param name the name value to set. + * @return the KnowledgeSourceGraphOntology object itself. + */ + @Generated + public KnowledgeSourceGraphOntology setName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: A constrained JSON-LD 1.1 ontology document (flat classes and object/datatype + * properties), supplied as a JSON-encoded string. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceGraphOntology from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceGraphOntology if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceGraphOntology. + */ + @Generated + public static KnowledgeSourceGraphOntology fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeSourceGraphOntologySourceKind kind = null; + String value = null; + String name = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + kind = KnowledgeSourceGraphOntologySourceKind.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else { + reader.skipChildren(); + } + } + KnowledgeSourceGraphOntology deserializedKnowledgeSourceGraphOntology + = new KnowledgeSourceGraphOntology(kind, value); + deserializedKnowledgeSourceGraphOntology.name = name; + return deserializedKnowledgeSourceGraphOntology; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntologySourceKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntologySourceKind.java new file mode 100644 index 0000000000000..c8841c4c2f51b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntologySourceKind.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The explicit source kind for an ontology reference. Only "inline" is supported. + */ +public final class KnowledgeSourceGraphOntologySourceKind + extends ExpandableStringEnum { + + /** + * Ontology content provided inline in the request as a constrained JSON-LD document. + */ + @Generated + public static final KnowledgeSourceGraphOntologySourceKind INLINE = fromString("inline"); + + /** + * Creates a new instance of KnowledgeSourceGraphOntologySourceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public KnowledgeSourceGraphOntologySourceKind() { + } + + /** + * Creates or finds a KnowledgeSourceGraphOntologySourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnowledgeSourceGraphOntologySourceKind. + */ + @Generated + public static KnowledgeSourceGraphOntologySourceKind fromString(String name) { + return fromString(name, KnowledgeSourceGraphOntologySourceKind.class); + } + + /** + * Gets known KnowledgeSourceGraphOntologySourceKind values. + * + * @return known KnowledgeSourceGraphOntologySourceKind values. + */ + @Generated + public static Collection values() { + return values(KnowledgeSourceGraphOntologySourceKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java index 9ae769dcebbcc..cf86c5fd4bb3e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java @@ -61,4 +61,20 @@ public static KnowledgeSourceIngestionPermissionOption fromString(String name) { public static Collection values() { return values(KnowledgeSourceIngestionPermissionOption.class); } + + /** + * Ingest OneLake parent folder paths and enable OneLake permission filtering on the generated index. Only supported + * for indexed OneLake knowledge sources. + */ + @Generated + public static final KnowledgeSourceIngestionPermissionOption ONE_LAKE_PARENT_FOLDERS + = fromString("oneLakeParentFolders"); + + /** + * Ingest the source item's OneLake lakehouse ID and enable OneLake permission filtering on the generated index. + * Only supported for indexed OneLake knowledge sources. + */ + @Generated + public static final KnowledgeSourceIngestionPermissionOption ONE_LAKE_LAKEHOUSE_ID + = fromString("oneLakeLakehouseId"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringFunction.java index cfef95eaa0ee8..0a66d78453ecd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringFunction.java @@ -28,19 +28,6 @@ public final class MagnitudeScoringFunction extends ScoringFunction { @Generated private final MagnitudeScoringParameters parameters; - /** - * Creates an instance of MagnitudeScoringFunction class. - * - * @param fieldName the fieldName value to set. - * @param boost the boost value to set. - * @param parameters the parameters value to set. - */ - @Generated - public MagnitudeScoringFunction(String fieldName, double boost, MagnitudeScoringParameters parameters) { - super(fieldName, boost); - this.parameters = parameters; - } - /** * Get the type property: Type of ScoringFunction. * @@ -79,9 +66,9 @@ public MagnitudeScoringFunction setInterpolation(ScoringFunctionInterpolation in @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fieldName", getFieldName()); - jsonWriter.writeDoubleField("boost", getBoost()); jsonWriter.writeStringField("interpolation", getInterpolation() == null ? null : getInterpolation().toString()); + jsonWriter.writeDoubleField("boost", this.boost); + jsonWriter.writeStringField("fieldName", this.fieldName); jsonWriter.writeJsonField("magnitude", this.parameters); jsonWriter.writeStringField("type", this.type); return jsonWriter.writeEndObject(); @@ -99,20 +86,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static MagnitudeScoringFunction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String fieldName = null; - double boost = 0.0; ScoringFunctionInterpolation interpolation = null; + double boost = 0.0; + String fieldName = null; MagnitudeScoringParameters parameters = null; String type = "magnitude"; while (reader.nextToken() != JsonToken.END_OBJECT) { String jsonFieldName = reader.getFieldName(); reader.nextToken(); - if ("fieldName".equals(jsonFieldName)) { - fieldName = reader.getString(); + if ("interpolation".equals(jsonFieldName)) { + interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); } else if ("boost".equals(jsonFieldName)) { boost = reader.getDouble(); - } else if ("interpolation".equals(jsonFieldName)) { - interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); + } else if ("fieldName".equals(jsonFieldName)) { + fieldName = reader.getString(); } else if ("magnitude".equals(jsonFieldName)) { parameters = MagnitudeScoringParameters.fromJson(reader); } else if ("type".equals(jsonFieldName)) { @@ -122,10 +109,67 @@ public static MagnitudeScoringFunction fromJson(JsonReader jsonReader) throws IO } } MagnitudeScoringFunction deserializedMagnitudeScoringFunction - = new MagnitudeScoringFunction(fieldName, boost, parameters); + = new MagnitudeScoringFunction(boost, fieldName, parameters); deserializedMagnitudeScoringFunction.setInterpolation(interpolation); deserializedMagnitudeScoringFunction.type = type; return deserializedMagnitudeScoringFunction; }); } + + /* + * A multiplier for the raw score. Must be a positive number not equal to 1.0. + */ + @Generated + private final double boost; + + /* + * The name of the field used as input to the scoring function. + */ + @Generated + private final String fieldName; + + /** + * Creates an instance of MagnitudeScoringFunction class. + * + * @param boost the boost value to set. + * @param fieldName the fieldName value to set. + * @param parameters the parameters value to set. + */ + @Generated + public MagnitudeScoringFunction(double boost, String fieldName, MagnitudeScoringParameters parameters) { + this.boost = boost; + this.fieldName = fieldName; + this.parameters = parameters; + } + + /** + * Get the boost property: A multiplier for the raw score. Must be a positive number not equal to 1.0. + * + * @return the boost value. + */ + @Generated + public double getBoost() { + return this.boost; + } + + /** + * Get the fieldName property: The name of the field used as input to the scoring function. + * + * @return the fieldName value. + */ + @Generated + public String getFieldName() { + return this.fieldName; + } + + /** + * Creates a field-based scoring function. + * + * @param fieldName the field used as input. + * @param boost the score multiplier. + * @param parameters the scoring parameters. + */ + public MagnitudeScoringFunction(String fieldName, double boost, MagnitudeScoringParameters parameters) { + this(boost, fieldName, parameters); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OneLakeSecuritySource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OneLakeSecuritySource.java new file mode 100644 index 0000000000000..6f605d8ebccd7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OneLakeSecuritySource.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Identifies the Microsoft Fabric OneLake lakehouse that an index's documents originate from, enabling OneLake + * document-level permissions for the index. + */ +@Immutable +public final class OneLakeSecuritySource implements JsonSerializable { + + /* + * The ID of the Microsoft Fabric workspace that contains the lakehouse. + */ + @Generated + private final String fabricWorkspaceId; + + /* + * The ID of the OneLake lakehouse that the index's documents originate from. + */ + @Generated + private final String lakehouseId; + + /** + * Creates an instance of OneLakeSecuritySource class. + * + * @param fabricWorkspaceId the fabricWorkspaceId value to set. + * @param lakehouseId the lakehouseId value to set. + */ + @Generated + public OneLakeSecuritySource(String fabricWorkspaceId, String lakehouseId) { + this.fabricWorkspaceId = fabricWorkspaceId; + this.lakehouseId = lakehouseId; + } + + /** + * Get the fabricWorkspaceId property: The ID of the Microsoft Fabric workspace that contains the lakehouse. + * + * @return the fabricWorkspaceId value. + */ + @Generated + public String getFabricWorkspaceId() { + return this.fabricWorkspaceId; + } + + /** + * Get the lakehouseId property: The ID of the OneLake lakehouse that the index's documents originate from. + * + * @return the lakehouseId value. + */ + @Generated + public String getLakehouseId() { + return this.lakehouseId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fabricWorkspaceId", this.fabricWorkspaceId); + jsonWriter.writeStringField("lakehouseId", this.lakehouseId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OneLakeSecuritySource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OneLakeSecuritySource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OneLakeSecuritySource. + */ + @Generated + public static OneLakeSecuritySource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fabricWorkspaceId = null; + String lakehouseId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("fabricWorkspaceId".equals(fieldName)) { + fabricWorkspaceId = reader.getString(); + } else if ("lakehouseId".equals(fieldName)) { + lakehouseId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new OneLakeSecuritySource(fabricWorkspaceId, lakehouseId); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizer.java new file mode 100644 index 0000000000000..fe3e5b2a44f5f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizer.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Generates query embeddings directly using an OpenAI-compatible embeddings endpoint, rather than the custom Web API + * skill envelope. + */ +@Immutable +public final class OpenAICompatibleVectorizer extends VectorSearchVectorizer { + + /* + * Type of VectorSearchVectorizer. + */ + @Generated + private VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.OPEN_AICOMPATIBLE; + + /* + * Connection, authentication, and embedding profile parameters. + */ + @Generated + private final OpenAICompatibleVectorizerParameters openAICompatibleParameters; + + /** + * Creates an instance of OpenAICompatibleVectorizer class. + * + * @param vectorizerName the vectorizerName value to set. + * @param openAICompatibleParameters the openAICompatibleParameters value to set. + */ + @Generated + public OpenAICompatibleVectorizer(String vectorizerName, + OpenAICompatibleVectorizerParameters openAICompatibleParameters) { + super(vectorizerName); + this.openAICompatibleParameters = openAICompatibleParameters; + } + + /** + * Get the kind property: Type of VectorSearchVectorizer. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchVectorizerKind getKind() { + return this.kind; + } + + /** + * Get the openAICompatibleParameters property: Connection, authentication, and embedding profile parameters. + * + * @return the openAICompatibleParameters value. + */ + @Generated + public OpenAICompatibleVectorizerParameters getOpenAICompatibleParameters() { + return this.openAICompatibleParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getVectorizerName()); + jsonWriter.writeJsonField("openAICompatibleParameters", this.openAICompatibleParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAICompatibleVectorizer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAICompatibleVectorizer if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenAICompatibleVectorizer. + */ + @Generated + public static OpenAICompatibleVectorizer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String vectorizerName = null; + OpenAICompatibleVectorizerParameters openAICompatibleParameters = null; + VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.OPEN_AICOMPATIBLE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + vectorizerName = reader.getString(); + } else if ("openAICompatibleParameters".equals(fieldName)) { + openAICompatibleParameters = OpenAICompatibleVectorizerParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = VectorSearchVectorizerKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + OpenAICompatibleVectorizer deserializedOpenAICompatibleVectorizer + = new OpenAICompatibleVectorizer(vectorizerName, openAICompatibleParameters); + deserializedOpenAICompatibleVectorizer.kind = kind; + return deserializedOpenAICompatibleVectorizer; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizerParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizerParameters.java new file mode 100644 index 0000000000000..7ccecbf8dd261 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizerParameters.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Connection parameters for a direct OpenAI-compatible embeddings endpoint. Creation requires exactly one of nonempty + * headers or managedIdentityAudience. Updates can omit headers to preserve credentials for an unchanged connection and + * embedding profile. + */ +@Fluent +public final class OpenAICompatibleVectorizerParameters + implements JsonSerializable { + + /* + * The complete HTTPS embeddings POST URL, including any path and query parameters. Sent unchanged without appending + * a path or API version. Redirects are not followed. + */ + @Generated + private final String uri; + + /* + * The embedding profile, using the same model-name enum as native Azure OpenAI vectorizers. Only + * text-embedding-ada-002, text-embedding-3-small, and text-embedding-3-large are supported at runtime; chat names + * in the shared enum are rejected. Controls Search's limits and default dimensions; the outbound body omits model, + * so the URI or gateway must select the actual model. Arbitrary provider protocols are not supported. + */ + @Generated + private final AzureOpenAIModelName modelName; + + /* + * The output dimensions, which must match the target vector field. Defaults to 1536 for text-embedding-ada-002 and + * text-embedding-3-small, or 3072 for text-embedding-3-large. Ada requires 1536; text-embedding-3-small supports 1 + * through 1536, and text-embedding-3-large supports 1 through 3072. Preserving omitted headers on update requires + * the configured dimensions to remain unchanged; omitting dimensions is distinct from specifying the default + * explicitly. + */ + @Generated + private Integer dimensions; + + /* + * Nonempty stored HTTP headers for endpoint authentication. Both names and values are secret and are never returned + * in responses. Empty maps are invalid. Mutually exclusive with managedIdentityAudience and authIdentity. On + * update, omitted headers are preserved only on the same resource and vectorizer binding when the exact endpoint, + * embedding profile including configured dimensions, and authentication identity are unchanged; otherwise, supply + * fresh credentials. + */ + @Generated + private Map headers; + + /* + * The bare canonical application GUID of the customer's third-party Microsoft Entra application for managed + * identity authentication. Do not include an api:// prefix or /.default suffix. Mutually exclusive with headers. + */ + @Generated + private String managedIdentityAudience; + + /* + * The user-assigned managed identity used to acquire a token for managedIdentityAudience. Omit to use the search + * service's system-assigned identity. Allowed only with managedIdentityAudience. + */ + @Generated + private SearchIndexerDataIdentity authIdentity; + + /** + * Creates an instance of OpenAICompatibleVectorizerParameters class. + * + * @param uri the uri value to set. + * @param modelName the modelName value to set. + */ + @Generated + public OpenAICompatibleVectorizerParameters(String uri, AzureOpenAIModelName modelName) { + this.uri = uri; + this.modelName = modelName; + } + + /** + * Get the uri property: The complete HTTPS embeddings POST URL, including any path and query parameters. Sent + * unchanged without appending a path or API version. Redirects are not followed. + * + * @return the uri value. + */ + @Generated + public String getUri() { + return this.uri; + } + + /** + * Get the modelName property: The embedding profile, using the same model-name enum as native Azure OpenAI + * vectorizers. Only text-embedding-ada-002, text-embedding-3-small, and text-embedding-3-large are supported at + * runtime; chat names in the shared enum are rejected. Controls Search's limits and default dimensions; the + * outbound body omits model, so the URI or gateway must select the actual model. Arbitrary provider protocols are + * not supported. + * + * @return the modelName value. + */ + @Generated + public AzureOpenAIModelName getModelName() { + return this.modelName; + } + + /** + * Get the dimensions property: The output dimensions, which must match the target vector field. Defaults to 1536 + * for text-embedding-ada-002 and text-embedding-3-small, or 3072 for text-embedding-3-large. Ada requires 1536; + * text-embedding-3-small supports 1 through 1536, and text-embedding-3-large supports 1 through 3072. Preserving + * omitted headers on update requires the configured dimensions to remain unchanged; omitting dimensions is distinct + * from specifying the default explicitly. + * + * @return the dimensions value. + */ + @Generated + public Integer getDimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The output dimensions, which must match the target vector field. Defaults to 1536 + * for text-embedding-ada-002 and text-embedding-3-small, or 3072 for text-embedding-3-large. Ada requires 1536; + * text-embedding-3-small supports 1 through 1536, and text-embedding-3-large supports 1 through 3072. Preserving + * omitted headers on update requires the configured dimensions to remain unchanged; omitting dimensions is distinct + * from specifying the default explicitly. + * + * @param dimensions the dimensions value to set. + * @return the OpenAICompatibleVectorizerParameters object itself. + */ + @Generated + public OpenAICompatibleVectorizerParameters setDimensions(Integer dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the headers property: Nonempty stored HTTP headers for endpoint authentication. Both names and values are + * secret and are never returned in responses. Empty maps are invalid. Mutually exclusive with + * managedIdentityAudience and authIdentity. On update, omitted headers are preserved only on the same resource and + * vectorizer binding when the exact endpoint, embedding profile including configured dimensions, and authentication + * identity are unchanged; otherwise, supply fresh credentials. + * + * @return the headers value. + */ + @Generated + public Map getHeaders() { + return this.headers; + } + + /** + * Set the headers property: Nonempty stored HTTP headers for endpoint authentication. Both names and values are + * secret and are never returned in responses. Empty maps are invalid. Mutually exclusive with + * managedIdentityAudience and authIdentity. On update, omitted headers are preserved only on the same resource and + * vectorizer binding when the exact endpoint, embedding profile including configured dimensions, and authentication + * identity are unchanged; otherwise, supply fresh credentials. + * + * @param headers the headers value to set. + * @return the OpenAICompatibleVectorizerParameters object itself. + */ + @Generated + public OpenAICompatibleVectorizerParameters setHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the managedIdentityAudience property: The bare canonical application GUID of the customer's third-party + * Microsoft Entra application for managed identity authentication. Do not include an api:// prefix or /.default + * suffix. Mutually exclusive with headers. + * + * @return the managedIdentityAudience value. + */ + @Generated + public String getManagedIdentityAudience() { + return this.managedIdentityAudience; + } + + /** + * Set the managedIdentityAudience property: The bare canonical application GUID of the customer's third-party + * Microsoft Entra application for managed identity authentication. Do not include an api:// prefix or /.default + * suffix. Mutually exclusive with headers. + * + * @param managedIdentityAudience the managedIdentityAudience value to set. + * @return the OpenAICompatibleVectorizerParameters object itself. + */ + @Generated + public OpenAICompatibleVectorizerParameters setManagedIdentityAudience(String managedIdentityAudience) { + this.managedIdentityAudience = managedIdentityAudience; + return this; + } + + /** + * Get the authIdentity property: The user-assigned managed identity used to acquire a token for + * managedIdentityAudience. Omit to use the search service's system-assigned identity. Allowed only with + * managedIdentityAudience. + * + * @return the authIdentity value. + */ + @Generated + public SearchIndexerDataIdentity getAuthIdentity() { + return this.authIdentity; + } + + /** + * Set the authIdentity property: The user-assigned managed identity used to acquire a token for + * managedIdentityAudience. Omit to use the search service's system-assigned identity. Allowed only with + * managedIdentityAudience. + * + * @param authIdentity the authIdentity value to set. + * @return the OpenAICompatibleVectorizerParameters object itself. + */ + @Generated + public OpenAICompatibleVectorizerParameters setAuthIdentity(SearchIndexerDataIdentity authIdentity) { + this.authIdentity = authIdentity; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("modelName", this.modelName == null ? null : this.modelName.toString()); + jsonWriter.writeNumberField("dimensions", this.dimensions); + jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedIdentityAudience", this.managedIdentityAudience); + jsonWriter.writeJsonField("authIdentity", this.authIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAICompatibleVectorizerParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAICompatibleVectorizerParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenAICompatibleVectorizerParameters. + */ + @Generated + public static OpenAICompatibleVectorizerParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String uri = null; + AzureOpenAIModelName modelName = null; + Integer dimensions = null; + Map headers = null; + String managedIdentityAudience = null; + SearchIndexerDataIdentity authIdentity = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("uri".equals(fieldName)) { + uri = reader.getString(); + } else if ("modelName".equals(fieldName)) { + modelName = AzureOpenAIModelName.fromString(reader.getString()); + } else if ("dimensions".equals(fieldName)) { + dimensions = reader.getNullable(JsonReader::getInt); + } else if ("headers".equals(fieldName)) { + headers = reader.readMap(reader1 -> reader1.getString()); + } else if ("managedIdentityAudience".equals(fieldName)) { + managedIdentityAudience = reader.getString(); + } else if ("authIdentity".equals(fieldName)) { + authIdentity = SearchIndexerDataIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + OpenAICompatibleVectorizerParameters deserializedOpenAICompatibleVectorizerParameters + = new OpenAICompatibleVectorizerParameters(uri, modelName); + deserializedOpenAICompatibleVectorizerParameters.dimensions = dimensions; + deserializedOpenAICompatibleVectorizerParameters.headers = headers; + deserializedOpenAICompatibleVectorizerParameters.managedIdentityAudience = managedIdentityAudience; + deserializedOpenAICompatibleVectorizerParameters.authIdentity = authIdentity; + return deserializedOpenAICompatibleVectorizerParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PermissionFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PermissionFilter.java index 01483dcea834f..0079e58e810bd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PermissionFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PermissionFilter.java @@ -60,4 +60,18 @@ public static PermissionFilter fromString(String name) { public static Collection values() { return values(PermissionFilter.class); } + + /** + * Field represents the OneLake parent folder paths of the source item that should be used to filter document access + * on queries. The index must also specify 'oneLakeSecuritySource'. + */ + @Generated + public static final PermissionFilter ONE_LAKE_PARENT_FOLDERS = fromString("oneLakeParentFolders"); + + /** + * Field represents a OneLake lakehouse ID that should be used to filter document access on queries. The index must + * also specify 'oneLakeSecuritySource'. + */ + @Generated + public static final PermissionFilter ONE_LAKE_LAKEHOUSE_ID = fromString("oneLakeLakehouseId"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringFunction.java new file mode 100644 index 0000000000000..5674b6741562e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringFunction.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines a function that assigns pseudo-random scores to documents for randomized ordering. + * Random scoring functions do not take a boost. A scoring profile with a random function + * cannot define text weights or other function types, and can contain only one random function. + * Random scoring replaces the query and vector similarity scores, including for hybrid queries, + * so results are returned in random order. + */ +@Fluent +public final class RandomScoringFunction extends ScoringFunction { + + /* + * Type of ScoringFunction. + */ + @Generated + private String type = "random"; + + /* + * Optional parameters for seeded random scoring. Omit this property for request-scoped random ordering. + */ + @Generated + private RandomScoringParameters parameters; + + /** + * Creates an instance of RandomScoringFunction class. + */ + @Generated + public RandomScoringFunction() { + } + + /** + * Get the type property: Type of ScoringFunction. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the parameters property: Optional parameters for seeded random scoring. Omit this property for request-scoped + * random ordering. + * + * @return the parameters value. + */ + @Generated + public RandomScoringParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Optional parameters for seeded random scoring. Omit this property for request-scoped + * random ordering. + * + * @param parameters the parameters value to set. + * @return the RandomScoringFunction object itself. + */ + @Generated + public RandomScoringFunction setParameters(RandomScoringParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RandomScoringFunction setInterpolation(ScoringFunctionInterpolation interpolation) { + super.setInterpolation(interpolation); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("interpolation", getInterpolation() == null ? null : getInterpolation().toString()); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("random", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RandomScoringFunction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RandomScoringFunction if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RandomScoringFunction. + */ + @Generated + public static RandomScoringFunction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RandomScoringFunction deserializedRandomScoringFunction = new RandomScoringFunction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("interpolation".equals(fieldName)) { + deserializedRandomScoringFunction + .setInterpolation(ScoringFunctionInterpolation.fromString(reader.getString())); + } else if ("type".equals(fieldName)) { + deserializedRandomScoringFunction.type = reader.getString(); + } else if ("random".equals(fieldName)) { + deserializedRandomScoringFunction.parameters = RandomScoringParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedRandomScoringFunction; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringParameters.java new file mode 100644 index 0000000000000..c0165511de24d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RandomScoringParameters.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Provides parameter values to a random scoring function. + */ +@Immutable +public final class RandomScoringParameters implements JsonSerializable { + + /* + * The name of the scoring parameter that supplies a signed 64-bit seed at query time. + */ + @Generated + private final String seedParameter; + + /** + * Creates an instance of RandomScoringParameters class. + * + * @param seedParameter the seedParameter value to set. + */ + @Generated + public RandomScoringParameters(String seedParameter) { + this.seedParameter = seedParameter; + } + + /** + * Get the seedParameter property: The name of the scoring parameter that supplies a signed 64-bit seed at query + * time. + * + * @return the seedParameter value. + */ + @Generated + public String getSeedParameter() { + return this.seedParameter; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("seedParameter", this.seedParameter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RandomScoringParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RandomScoringParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RandomScoringParameters. + */ + @Generated + public static RandomScoringParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String seedParameter = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("seedParameter".equals(fieldName)) { + seedParameter = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new RandomScoringParameters(seedParameter); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringFunction.java index 53bf0191005a9..d3f3e7769410d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringFunction.java @@ -23,36 +23,12 @@ public class ScoringFunction implements JsonSerializable { @Generated private String type = "ScoringFunction"; - /* - * The name of the field used as input to the scoring function. - */ - @Generated - private final String fieldName; - - /* - * A multiplier for the raw score. Must be a positive number not equal to 1.0. - */ - @Generated - private final double boost; - /* * A value indicating how boosting will be interpolated across document scores; defaults to "Linear". */ @Generated private ScoringFunctionInterpolation interpolation; - /** - * Creates an instance of ScoringFunction class. - * - * @param fieldName the fieldName value to set. - * @param boost the boost value to set. - */ - @Generated - public ScoringFunction(String fieldName, double boost) { - this.fieldName = fieldName; - this.boost = boost; - } - /** * Get the type property: Type of ScoringFunction. * @@ -63,26 +39,6 @@ public String getType() { return this.type; } - /** - * Get the fieldName property: The name of the field used as input to the scoring function. - * - * @return the fieldName value. - */ - @Generated - public String getFieldName() { - return this.fieldName; - } - - /** - * Get the boost property: A multiplier for the raw score. Must be a positive number not equal to 1.0. - * - * @return the boost value. - */ - @Generated - public double getBoost() { - return this.boost; - } - /** * Get the interpolation property: A value indicating how boosting will be interpolated across document scores; * defaults to "Linear". @@ -114,8 +70,10 @@ public ScoringFunction setInterpolation(ScoringFunctionInterpolation interpolati @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fieldName", this.fieldName); - jsonWriter.writeDoubleField("boost", this.boost); + if (this.fieldName != null) { + jsonWriter.writeStringField("fieldName", this.fieldName); + jsonWriter.writeDoubleField("boost", this.boost); + } jsonWriter.writeStringField("type", this.type); jsonWriter.writeStringField("interpolation", this.interpolation == null ? null : this.interpolation.toString()); return jsonWriter.writeEndObject(); @@ -127,7 +85,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ScoringFunction if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ScoringFunction. */ @Generated @@ -138,9 +95,9 @@ public static ScoringFunction fromJson(JsonReader jsonReader) throws IOException // Prepare for reading readerToUse.nextToken(); while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String jsonFieldName = readerToUse.getFieldName(); + String fieldName = readerToUse.getFieldName(); readerToUse.nextToken(); - if ("type".equals(jsonFieldName)) { + if ("type".equals(fieldName)) { discriminatorValue = readerToUse.getString(); break; } else { @@ -148,7 +105,9 @@ public static ScoringFunction fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("distance".equals(discriminatorValue)) { + if ("random".equals(discriminatorValue)) { + return RandomScoringFunction.fromJson(readerToUse.reset()); + } else if ("distance".equals(discriminatorValue)) { return DistanceScoringFunction.fromJson(readerToUse.reset()); } else if ("freshness".equals(discriminatorValue)) { return FreshnessScoringFunction.fromJson(readerToUse.reset()); @@ -166,29 +125,64 @@ public static ScoringFunction fromJson(JsonReader jsonReader) throws IOException @Generated static ScoringFunction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String fieldName = null; - double boost = 0.0; - String type = null; - ScoringFunctionInterpolation interpolation = null; + ScoringFunction deserializedScoringFunction = new ScoringFunction(); while (reader.nextToken() != JsonToken.END_OBJECT) { - String jsonFieldName = reader.getFieldName(); + String fieldName = reader.getFieldName(); reader.nextToken(); - if ("fieldName".equals(jsonFieldName)) { - fieldName = reader.getString(); - } else if ("boost".equals(jsonFieldName)) { - boost = reader.getDouble(); - } else if ("type".equals(jsonFieldName)) { - type = reader.getString(); - } else if ("interpolation".equals(jsonFieldName)) { - interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); + if ("fieldName".equals(fieldName)) { + deserializedScoringFunction.fieldName = reader.getString(); + } else if ("boost".equals(fieldName)) { + deserializedScoringFunction.boost = reader.getDouble(); + } else if ("type".equals(fieldName)) { + deserializedScoringFunction.type = reader.getString(); + } else if ("interpolation".equals(fieldName)) { + deserializedScoringFunction.interpolation + = ScoringFunctionInterpolation.fromString(reader.getString()); } else { reader.skipChildren(); } } - ScoringFunction deserializedScoringFunction = new ScoringFunction(fieldName, boost); - deserializedScoringFunction.type = type; - deserializedScoringFunction.interpolation = interpolation; return deserializedScoringFunction; }); } + + /** + * Creates an instance of ScoringFunction class. + */ + @Generated + public ScoringFunction() { + } + + private String fieldName; + + private double boost; + + /** + * Creates a field-based scoring function. + * + * @param fieldName the field used as input. + * @param boost the score multiplier. + */ + public ScoringFunction(String fieldName, double boost) { + this.fieldName = fieldName; + this.boost = boost; + } + + /** + * Gets the field used as input. + * + * @return the field name. + */ + public String getFieldName() { + return this.fieldName; + } + + /** + * Gets the score multiplier. + * + * @return the boost. + */ + public double getBoost() { + return this.boost; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java index 3401439a8503f..28b4fe52163ca 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java @@ -751,6 +751,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("permissionFilter", this.permissionFilter == null ? null : this.permissionFilter.toString()); jsonWriter.writeBooleanField("organizationAccessExpiration", this.organizationAccessExpiration); + jsonWriter.writeBooleanField("sensitivityLabelId", this.sensitivityLabelId); + jsonWriter.writeBooleanField("sensitivityLabelName", this.sensitivityLabelName); + jsonWriter.writeBooleanField("sourceDocumentId", this.sourceDocumentId); jsonWriter.writeBooleanField("sharepointSiteUrl", this.sharepointSiteUrl); jsonWriter.writeStringField("analyzer", this.analyzerName == null ? null : this.analyzerName.toString()); jsonWriter.writeStringField("searchAnalyzer", @@ -760,6 +763,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("normalizer", this.normalizerName == null ? null : this.normalizerName.toString()); jsonWriter.writeNumberField("dimensions", this.vectorSearchDimensions); jsonWriter.writeStringField("vectorSearchProfile", this.vectorSearchProfileName); + jsonWriter.writeStringField("topicGraphProfile", this.topicGraphProfile); jsonWriter.writeStringField("vectorEncoding", this.vectorEncodingFormat == null ? null : this.vectorEncodingFormat.toString()); jsonWriter.writeArrayField("synonymMaps", this.synonymMapNames, @@ -791,6 +795,9 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { Boolean facetable = null; PermissionFilter permissionFilter = null; Boolean organizationAccessExpiration = null; + Boolean sensitivityLabelId = null; + Boolean sensitivityLabelName = null; + Boolean sourceDocumentId = null; Boolean sharepointSiteUrl = null; LexicalAnalyzerName analyzerName = null; LexicalAnalyzerName searchAnalyzerName = null; @@ -798,6 +805,7 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { LexicalNormalizerName normalizerName = null; Integer vectorSearchDimensions = null; String vectorSearchProfileName = null; + String topicGraphProfile = null; VectorEncodingFormat vectorEncodingFormat = null; List synonymMapNames = null; List fields = null; @@ -826,6 +834,12 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { permissionFilter = PermissionFilter.fromString(reader.getString()); } else if ("organizationAccessExpiration".equals(fieldName)) { organizationAccessExpiration = reader.getNullable(JsonReader::getBoolean); + } else if ("sensitivityLabelId".equals(fieldName)) { + sensitivityLabelId = reader.getNullable(JsonReader::getBoolean); + } else if ("sensitivityLabelName".equals(fieldName)) { + sensitivityLabelName = reader.getNullable(JsonReader::getBoolean); + } else if ("sourceDocumentId".equals(fieldName)) { + sourceDocumentId = reader.getNullable(JsonReader::getBoolean); } else if ("sharepointSiteUrl".equals(fieldName)) { sharepointSiteUrl = reader.getNullable(JsonReader::getBoolean); } else if ("analyzer".equals(fieldName)) { @@ -840,6 +854,8 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { vectorSearchDimensions = reader.getNullable(JsonReader::getInt); } else if ("vectorSearchProfile".equals(fieldName)) { vectorSearchProfileName = reader.getString(); + } else if ("topicGraphProfile".equals(fieldName)) { + topicGraphProfile = reader.getString(); } else if ("vectorEncoding".equals(fieldName)) { vectorEncodingFormat = VectorEncodingFormat.fromString(reader.getString()); } else if ("synonymMaps".equals(fieldName)) { @@ -860,6 +876,9 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { deserializedSearchField.facetable = facetable; deserializedSearchField.permissionFilter = permissionFilter; deserializedSearchField.organizationAccessExpiration = organizationAccessExpiration; + deserializedSearchField.sensitivityLabelId = sensitivityLabelId; + deserializedSearchField.sensitivityLabelName = sensitivityLabelName; + deserializedSearchField.sourceDocumentId = sourceDocumentId; deserializedSearchField.sharepointSiteUrl = sharepointSiteUrl; deserializedSearchField.analyzerName = analyzerName; deserializedSearchField.searchAnalyzerName = searchAnalyzerName; @@ -867,6 +886,7 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { deserializedSearchField.normalizerName = normalizerName; deserializedSearchField.vectorSearchDimensions = vectorSearchDimensions; deserializedSearchField.vectorSearchProfileName = vectorSearchProfileName; + deserializedSearchField.topicGraphProfile = topicGraphProfile; deserializedSearchField.vectorEncodingFormat = vectorEncodingFormat; deserializedSearchField.synonymMapNames = synonymMapNames; deserializedSearchField.fields = fields; @@ -880,6 +900,26 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { @Generated private PermissionFilter permissionFilter; + /* + * A value indicating whether the field should be used for sensitivity label ID filtering. This enables + * document-level filtering based on Microsoft Purview sensitivity label IDs. + */ + @Generated + private Boolean sensitivityLabelId; + + /* + * A value indicating whether the field contains the name of a Microsoft Purview sensitivity label applied to the + * document. + */ + @Generated + private Boolean sensitivityLabelName; + + /* + * A value indicating whether the field contains the source document identifier used for Purview audit tracking. + */ + @Generated + private Boolean sourceDocumentId; + /* * A value indicating whether the field contains a SharePoint site URL used for SharePoint group-based filtering. */ @@ -908,6 +948,78 @@ public SearchField setPermissionFilter(PermissionFilter permissionFilter) { return this; } + /** + * Get the sensitivityLabelId property: A value indicating whether the field should be used for sensitivity label ID + * filtering. This enables document-level filtering based on Microsoft Purview sensitivity label IDs. + * + * @return the sensitivityLabelId value. + */ + @Generated + public Boolean isSensitivityLabelId() { + return this.sensitivityLabelId; + } + + /** + * Set the sensitivityLabelId property: A value indicating whether the field should be used for sensitivity label ID + * filtering. This enables document-level filtering based on Microsoft Purview sensitivity label IDs. + * + * @param sensitivityLabelId the sensitivityLabelId value to set. + * @return the SearchField object itself. + */ + @Generated + public SearchField setSensitivityLabelId(Boolean sensitivityLabelId) { + this.sensitivityLabelId = sensitivityLabelId; + return this; + } + + /** + * Get the sensitivityLabelName property: A value indicating whether the field contains the name of a Microsoft + * Purview sensitivity label applied to the document. + * + * @return the sensitivityLabelName value. + */ + @Generated + public Boolean isSensitivityLabelName() { + return this.sensitivityLabelName; + } + + /** + * Set the sensitivityLabelName property: A value indicating whether the field contains the name of a Microsoft + * Purview sensitivity label applied to the document. + * + * @param sensitivityLabelName the sensitivityLabelName value to set. + * @return the SearchField object itself. + */ + @Generated + public SearchField setSensitivityLabelName(Boolean sensitivityLabelName) { + this.sensitivityLabelName = sensitivityLabelName; + return this; + } + + /** + * Get the sourceDocumentId property: A value indicating whether the field contains the source document identifier + * used for Purview audit tracking. + * + * @return the sourceDocumentId value. + */ + @Generated + public Boolean isSourceDocumentId() { + return this.sourceDocumentId; + } + + /** + * Set the sourceDocumentId property: A value indicating whether the field contains the source document identifier + * used for Purview audit tracking. + * + * @param sourceDocumentId the sourceDocumentId value to set. + * @return the SearchField object itself. + */ + @Generated + public SearchField setSourceDocumentId(Boolean sourceDocumentId) { + this.sourceDocumentId = sourceDocumentId; + return this; + } + /** * Get the sharepointSiteUrl property: A value indicating whether the field contains a SharePoint site URL used for * SharePoint group-based filtering. @@ -944,6 +1056,12 @@ public SearchField setSharepointSiteUrl(Boolean sharepointSiteUrl) { @Generated private Boolean organizationAccessExpiration; + /* + * The name of the topic graph profile linked to this vector field. + */ + @Generated + private String topicGraphProfile; + /** * Get the organizationAccessExpiration property: A value indicating whether the field contains the expiration * timestamp for organization-scoped SharePoint sharing links. At most one top-level field of type @@ -977,4 +1095,26 @@ public SearchField setOrganizationAccessExpiration(Boolean organizationAccessExp this.organizationAccessExpiration = organizationAccessExpiration; return this; } + + /** + * Get the topicGraphProfile property: The name of the topic graph profile linked to this vector field. + * + * @return the topicGraphProfile value. + */ + @Generated + public String getTopicGraphProfile() { + return this.topicGraphProfile; + } + + /** + * Set the topicGraphProfile property: The name of the topic graph profile linked to this vector field. + * + * @param topicGraphProfile the topicGraphProfile value to set. + * @return the SearchField object itself. + */ + @Generated + public SearchField setTopicGraphProfile(String topicGraphProfile) { + this.topicGraphProfile = topicGraphProfile; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java index 3e4770f27254f..a162b73e2ab67 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java @@ -610,6 +610,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeArrayField("fields", this.fields, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("graphProfile", this.graphProfile); jsonWriter.writeArrayField("scoringProfiles", this.scoringProfiles, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("defaultScoringProfile", this.defaultScoringProfile); @@ -627,6 +628,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("permissionFilterOption", this.permissionFilterOption == null ? null : this.permissionFilterOption.toString()); jsonWriter.writeJsonField("sharePointConnectorAppRegistration", this.sharePointConnectorAppRegistration); + jsonWriter.writeJsonField("oneLakeSecuritySource", this.oneLakeSecuritySource); jsonWriter.writeStringField("@odata.etag", this.eTag); return jsonWriter.writeEndObject(); } @@ -646,6 +648,7 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { String name = null; List fields = null; String description = null; + GraphProfile graphProfile = null; List scoringProfiles = null; String defaultScoringProfile = null; CorsOptions corsOptions = null; @@ -661,6 +664,7 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { VectorSearch vectorSearch = null; SearchIndexPermissionFilterOption permissionFilterOption = null; SharePointConnectorAppRegistration sharePointConnectorAppRegistration = null; + OneLakeSecuritySource oneLakeSecuritySource = null; String eTag = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -671,6 +675,8 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { fields = reader.readArray(reader1 -> SearchField.fromJson(reader1)); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("graphProfile".equals(fieldName)) { + graphProfile = GraphProfile.fromJson(reader); } else if ("scoringProfiles".equals(fieldName)) { scoringProfiles = reader.readArray(reader1 -> ScoringProfile.fromJson(reader1)); } else if ("defaultScoringProfile".equals(fieldName)) { @@ -701,6 +707,8 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { permissionFilterOption = SearchIndexPermissionFilterOption.fromString(reader.getString()); } else if ("sharePointConnectorAppRegistration".equals(fieldName)) { sharePointConnectorAppRegistration = SharePointConnectorAppRegistration.fromJson(reader); + } else if ("oneLakeSecuritySource".equals(fieldName)) { + oneLakeSecuritySource = OneLakeSecuritySource.fromJson(reader); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else { @@ -709,6 +717,7 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { } SearchIndex deserializedSearchIndex = new SearchIndex(name, fields); deserializedSearchIndex.description = description; + deserializedSearchIndex.graphProfile = graphProfile; deserializedSearchIndex.scoringProfiles = scoringProfiles; deserializedSearchIndex.defaultScoringProfile = defaultScoringProfile; deserializedSearchIndex.corsOptions = corsOptions; @@ -724,6 +733,7 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { deserializedSearchIndex.vectorSearch = vectorSearch; deserializedSearchIndex.permissionFilterOption = permissionFilterOption; deserializedSearchIndex.sharePointConnectorAppRegistration = sharePointConnectorAppRegistration; + deserializedSearchIndex.oneLakeSecuritySource = oneLakeSecuritySource; deserializedSearchIndex.eTag = eTag; return deserializedSearchIndex; }); @@ -792,4 +802,68 @@ public SharePointConnectorAppRegistration getSharePointConnectorAppRegistration( this.sharePointConnectorAppRegistration = sharePointConnectorAppRegistration; return this; } + + /* + * Maps edge-list graph roles to this index's fields. Required for search.graph; omitted on ordinary document + * indexes. + */ + @Generated + private GraphProfile graphProfile; + + /* + * Identifies the Microsoft Fabric OneLake lakehouse that the index's documents originate from. Required when any + * field uses the 'oneLakeParentFolders' or 'oneLakeLakehouseId' permission filter. + */ + @Generated + private OneLakeSecuritySource oneLakeSecuritySource; + + /** + * Get the graphProfile property: Maps edge-list graph roles to this index's fields. Required for search.graph; + * omitted on ordinary document indexes. + * + * @return the graphProfile value. + */ + @Generated + public GraphProfile getGraphProfile() { + return this.graphProfile; + } + + /** + * Set the graphProfile property: Maps edge-list graph roles to this index's fields. Required for search.graph; + * omitted on ordinary document indexes. + * + * @param graphProfile the graphProfile value to set. + * @return the SearchIndex object itself. + */ + @Generated + public SearchIndex setGraphProfile(GraphProfile graphProfile) { + this.graphProfile = graphProfile; + return this; + } + + /** + * Get the oneLakeSecuritySource property: Identifies the Microsoft Fabric OneLake lakehouse that the index's + * documents originate from. Required when any field uses the 'oneLakeParentFolders' or 'oneLakeLakehouseId' + * permission filter. + * + * @return the oneLakeSecuritySource value. + */ + @Generated + public OneLakeSecuritySource getOneLakeSecuritySource() { + return this.oneLakeSecuritySource; + } + + /** + * Set the oneLakeSecuritySource property: Identifies the Microsoft Fabric OneLake lakehouse that the index's + * documents originate from. Required when any field uses the 'oneLakeParentFolders' or 'oneLakeLakehouseId' + * permission filter. + * + * @param oneLakeSecuritySource the oneLakeSecuritySource value to set. + * @return the SearchIndex object itself. + */ + @Generated + public SearchIndex setOneLakeSecuritySource(OneLakeSecuritySource oneLakeSecuritySource) { + this.oneLakeSecuritySource = oneLakeSecuritySource; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHint.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHint.java new file mode 100644 index 0000000000000..99385807008cc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHint.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A hint that identifies a field and exhaustive grounding values the query planner can use when constructing a filter. + */ +@Fluent +public final class SearchIndexKnowledgeSourceFilterHint + implements JsonSerializable { + + /* + * The name of the filterable search index field. + */ + @Generated + private final String field; + + /* + * The exhaustive set of values for the field. At most 160 values, with a maximum of 128 characters per value and + * 2048 characters combined. In versions supporting `autoConfiguration`, required unless `autoConfiguration` is + * specified, and mutually exclusive with it. + */ + @Generated + private List fieldValues; + + /* + * Natural-language instructions that explain when and how to filter on the field. + */ + @Generated + private String filterInstructions; + + /** + * Get the field property: The name of the filterable search index field. + * + * @return the field value. + */ + @Generated + public String getField() { + return this.field; + } + + /** + * Get the fieldValues property: The exhaustive set of values for the field. At most 160 values, with a maximum of + * 128 characters per value and 2048 characters combined. In versions supporting `autoConfiguration`, required + * unless `autoConfiguration` is specified, and mutually exclusive with it. + * + * @return the fieldValues value. + */ + @Generated + public List getFieldValues() { + return this.fieldValues; + } + + /** + * Get the filterInstructions property: Natural-language instructions that explain when and how to filter on the + * field. + * + * @return the filterInstructions value. + */ + @Generated + public String getFilterInstructions() { + return this.filterInstructions; + } + + /** + * Set the filterInstructions property: Natural-language instructions that explain when and how to filter on the + * field. + * + * @param filterInstructions the filterInstructions value to set. + * @return the SearchIndexKnowledgeSourceFilterHint object itself. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHint setFilterInstructions(String filterInstructions) { + this.filterInstructions = filterInstructions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeArrayField("fieldValues", this.fieldValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("autoConfiguration", this.autoConfiguration); + jsonWriter.writeStringField("filterInstructions", this.filterInstructions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexKnowledgeSourceFilterHint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexKnowledgeSourceFilterHint if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SearchIndexKnowledgeSourceFilterHint. + */ + @Generated + public static SearchIndexKnowledgeSourceFilterHint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String field = null; + List fieldValues = null; + SearchIndexKnowledgeSourceFilterHintAutoConfiguration autoConfiguration = null; + String filterInstructions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("field".equals(fieldName)) { + field = reader.getString(); + } else if ("fieldValues".equals(fieldName)) { + fieldValues = reader.readArray(reader1 -> reader1.getString()); + } else if ("autoConfiguration".equals(fieldName)) { + autoConfiguration = SearchIndexKnowledgeSourceFilterHintAutoConfiguration.fromJson(reader); + } else if ("filterInstructions".equals(fieldName)) { + filterInstructions = reader.getString(); + } else { + reader.skipChildren(); + } + } + SearchIndexKnowledgeSourceFilterHint deserializedSearchIndexKnowledgeSourceFilterHint + = new SearchIndexKnowledgeSourceFilterHint(field); + deserializedSearchIndexKnowledgeSourceFilterHint.fieldValues = fieldValues; + deserializedSearchIndexKnowledgeSourceFilterHint.autoConfiguration = autoConfiguration; + deserializedSearchIndexKnowledgeSourceFilterHint.filterInstructions = filterInstructions; + return deserializedSearchIndexKnowledgeSourceFilterHint; + }); + } + + /* + * Configures the service to resolve grounding values from the field's facets. Its presence enables + * auto-configuration. The field must be filterable and facetable. Not supported when the target index has + * document-level permissions or Purview sensitivity labels enabled; this restriction is validated at knowledge + * source create/update and knowledge base retrieval time. Mutually exclusive with `fieldValues`. Supported only in + * a knowledge source's stored `queryHints`, not in request-time `queryHintOverrides`. + */ + @Generated + private SearchIndexKnowledgeSourceFilterHintAutoConfiguration autoConfiguration; + + /** + * Creates an instance of SearchIndexKnowledgeSourceFilterHint class. + * + * @param field the field value to set. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHint(String field) { + this.field = field; + } + + /** + * Set the fieldValues property: The exhaustive set of values for the field. At most 160 values, with a maximum of + * 128 characters per value and 2048 characters combined. In versions supporting `autoConfiguration`, required + * unless `autoConfiguration` is specified, and mutually exclusive with it. + * + * @param fieldValues the fieldValues value to set. + * @return the SearchIndexKnowledgeSourceFilterHint object itself. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHint setFieldValues(List fieldValues) { + this.fieldValues = fieldValues; + return this; + } + + /** + * Get the autoConfiguration property: Configures the service to resolve grounding values from the field's facets. + * Its presence enables auto-configuration. The field must be filterable and facetable. Not supported when the + * target index has document-level permissions or Purview sensitivity labels enabled; this restriction is validated + * at knowledge source create/update and knowledge base retrieval time. Mutually exclusive with `fieldValues`. + * Supported only in a knowledge source's stored `queryHints`, not in request-time `queryHintOverrides`. + * + * @return the autoConfiguration value. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHintAutoConfiguration getAutoConfiguration() { + return this.autoConfiguration; + } + + /** + * Set the autoConfiguration property: Configures the service to resolve grounding values from the field's facets. + * Its presence enables auto-configuration. The field must be filterable and facetable. Not supported when the + * target index has document-level permissions or Purview sensitivity labels enabled; this restriction is validated + * at knowledge source create/update and knowledge base retrieval time. Mutually exclusive with `fieldValues`. + * Supported only in a knowledge source's stored `queryHints`, not in request-time `queryHintOverrides`. + * + * @param autoConfiguration the autoConfiguration value to set. + * @return the SearchIndexKnowledgeSourceFilterHint object itself. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHint + setAutoConfiguration(SearchIndexKnowledgeSourceFilterHintAutoConfiguration autoConfiguration) { + this.autoConfiguration = autoConfiguration; + return this; + } + + /** + * Creates a filter hint with explicit values. + * + * @param field the field to filter. + * @param fieldValues the allowed filter values. + */ + public SearchIndexKnowledgeSourceFilterHint(String field, List fieldValues) { + this(field); + setFieldValues(fieldValues); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHintAutoConfiguration.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHintAutoConfiguration.java new file mode 100644 index 0000000000000..c2202f857c322 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHintAutoConfiguration.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configures automatic resolution of a filter hint's grounding values from the target index facets. + */ +@Fluent +public final class SearchIndexKnowledgeSourceFilterHintAutoConfiguration + implements JsonSerializable { + + /* + * The number of seconds resolved facet values are cached. The allowed range is 60 through 3600 on dedicated + * services and 60 through 900 on serverless services. When omitted, defaults to 3600 seconds on dedicated services + * and 900 seconds on serverless services. + */ + @Generated + private Integer cacheTtl; + + /* + * The maximum number of facet values to use as grounding. Defaults to 64; allowed range is 1 through 64. Values are + * selected in descending facet-count order, subject to the same 2048-character combined-length limit and + * 128-character per-value limit as manually specified filter values. + */ + @Generated + private Integer maxFacetValueCount; + + /** + * Creates an instance of SearchIndexKnowledgeSourceFilterHintAutoConfiguration class. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHintAutoConfiguration() { + } + + /** + * Get the cacheTtl property: The number of seconds resolved facet values are cached. The allowed range is 60 + * through 3600 on dedicated services and 60 through 900 on serverless services. When omitted, defaults to 3600 + * seconds on dedicated services and 900 seconds on serverless services. + * + * @return the cacheTtl value. + */ + @Generated + public Integer getCacheTtl() { + return this.cacheTtl; + } + + /** + * Set the cacheTtl property: The number of seconds resolved facet values are cached. The allowed range is 60 + * through 3600 on dedicated services and 60 through 900 on serverless services. When omitted, defaults to 3600 + * seconds on dedicated services and 900 seconds on serverless services. + * + * @param cacheTtl the cacheTtl value to set. + * @return the SearchIndexKnowledgeSourceFilterHintAutoConfiguration object itself. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHintAutoConfiguration setCacheTtl(Integer cacheTtl) { + this.cacheTtl = cacheTtl; + return this; + } + + /** + * Get the maxFacetValueCount property: The maximum number of facet values to use as grounding. Defaults to 64; + * allowed range is 1 through 64. Values are selected in descending facet-count order, subject to the same + * 2048-character combined-length limit and 128-character per-value limit as manually specified filter values. + * + * @return the maxFacetValueCount value. + */ + @Generated + public Integer getMaxFacetValueCount() { + return this.maxFacetValueCount; + } + + /** + * Set the maxFacetValueCount property: The maximum number of facet values to use as grounding. Defaults to 64; + * allowed range is 1 through 64. Values are selected in descending facet-count order, subject to the same + * 2048-character combined-length limit and 128-character per-value limit as manually specified filter values. + * + * @param maxFacetValueCount the maxFacetValueCount value to set. + * @return the SearchIndexKnowledgeSourceFilterHintAutoConfiguration object itself. + */ + @Generated + public SearchIndexKnowledgeSourceFilterHintAutoConfiguration setMaxFacetValueCount(Integer maxFacetValueCount) { + this.maxFacetValueCount = maxFacetValueCount; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("cacheTtl", this.cacheTtl); + jsonWriter.writeNumberField("maxFacetValueCount", this.maxFacetValueCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexKnowledgeSourceFilterHintAutoConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexKnowledgeSourceFilterHintAutoConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SearchIndexKnowledgeSourceFilterHintAutoConfiguration. + */ + @Generated + public static SearchIndexKnowledgeSourceFilterHintAutoConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + SearchIndexKnowledgeSourceFilterHintAutoConfiguration deserializedSearchIndexKnowledgeSourceFilterHintAutoConfiguration + = new SearchIndexKnowledgeSourceFilterHintAutoConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("cacheTtl".equals(fieldName)) { + deserializedSearchIndexKnowledgeSourceFilterHintAutoConfiguration.cacheTtl + = reader.getNullable(JsonReader::getInt); + } else if ("maxFacetValueCount".equals(fieldName)) { + deserializedSearchIndexKnowledgeSourceFilterHintAutoConfiguration.maxFacetValueCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedSearchIndexKnowledgeSourceFilterHintAutoConfiguration; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceParameters.java index 092a5471826e5..2a09cb30b67cb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceParameters.java @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.search.documents.models.VectorQueryTopicGraph; import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -167,6 +168,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("searchFields", this.searchFields, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("semanticConfigurationName", this.semanticConfigurationName); jsonWriter.writeStringField("baseFilter", this.baseFilter); + jsonWriter.writeJsonField("queryHints", this.queryHints); + jsonWriter.writeJsonField("topicGraph", this.topicGraph); return jsonWriter.writeEndObject(); } @@ -187,6 +190,8 @@ public static SearchIndexKnowledgeSourceParameters fromJson(JsonReader jsonReade List searchFields = null; String semanticConfigurationName = null; String baseFilter = null; + SearchIndexKnowledgeSourceQueryHints queryHints = null; + VectorQueryTopicGraph topicGraph = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -200,6 +205,10 @@ public static SearchIndexKnowledgeSourceParameters fromJson(JsonReader jsonReade semanticConfigurationName = reader.getString(); } else if ("baseFilter".equals(fieldName)) { baseFilter = reader.getString(); + } else if ("queryHints".equals(fieldName)) { + queryHints = SearchIndexKnowledgeSourceQueryHints.fromJson(reader); + } else if ("topicGraph".equals(fieldName)) { + topicGraph = VectorQueryTopicGraph.fromJson(reader); } else { reader.skipChildren(); } @@ -210,6 +219,8 @@ public static SearchIndexKnowledgeSourceParameters fromJson(JsonReader jsonReade deserializedSearchIndexKnowledgeSourceParameters.searchFields = searchFields; deserializedSearchIndexKnowledgeSourceParameters.semanticConfigurationName = semanticConfigurationName; deserializedSearchIndexKnowledgeSourceParameters.baseFilter = baseFilter; + deserializedSearchIndexKnowledgeSourceParameters.queryHints = queryHints; + deserializedSearchIndexKnowledgeSourceParameters.topicGraph = topicGraph; return deserializedSearchIndexKnowledgeSourceParameters; }); } @@ -244,4 +255,63 @@ public SearchIndexKnowledgeSourceParameters setBaseFilter(String baseFilter) { this.baseFilter = baseFilter; return this; } + + /* + * Default hints that guide query planning toward useful filters and boosts for this search index knowledge source. + * Request-time query hints replace these defaults as a complete object. + */ + @Generated + private SearchIndexKnowledgeSourceQueryHints queryHints; + + /** + * Get the queryHints property: Default hints that guide query planning toward useful filters and boosts for this + * search index knowledge source. Request-time query hints replace these defaults as a complete object. + * + * @return the queryHints value. + */ + @Generated + public SearchIndexKnowledgeSourceQueryHints getQueryHints() { + return this.queryHints; + } + + /** + * Set the queryHints property: Default hints that guide query planning toward useful filters and boosts for this + * search index knowledge source. Request-time query hints replace these defaults as a complete object. + * + * @param queryHints the queryHints value to set. + * @return the SearchIndexKnowledgeSourceParameters object itself. + */ + @Generated + public SearchIndexKnowledgeSourceParameters setQueryHints(SearchIndexKnowledgeSourceQueryHints queryHints) { + this.queryHints = queryHints; + return this; + } + + /* + * Default topic graph vector search options for this search index knowledge source. + */ + @Generated + private VectorQueryTopicGraph topicGraph; + + /** + * Get the topicGraph property: Default topic graph vector search options for this search index knowledge source. + * + * @return the topicGraph value. + */ + @Generated + public VectorQueryTopicGraph getTopicGraph() { + return this.topicGraph; + } + + /** + * Set the topicGraph property: Default topic graph vector search options for this search index knowledge source. + * + * @param topicGraph the topicGraph value to set. + * @return the SearchIndexKnowledgeSourceParameters object itself. + */ + @Generated + public SearchIndexKnowledgeSourceParameters setTopicGraph(VectorQueryTopicGraph topicGraph) { + this.topicGraph = topicGraph; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexResponse.java index 19443d421a456..59b33a993bc14 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexResponse.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexResponse.java @@ -313,6 +313,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); jsonWriter.writeArrayField("fields", this.fields, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("graphProfile", this.graphProfile); jsonWriter.writeArrayField("scoringProfiles", this.scoringProfiles, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("defaultScoringProfile", this.defaultScoringProfile); @@ -329,7 +330,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("vectorSearch", this.vectorSearch); jsonWriter.writeStringField("permissionFilterOption", this.permissionFilterOption == null ? null : this.permissionFilterOption.toString()); + jsonWriter.writeBooleanField("purviewEnabled", this.purviewEnabled); jsonWriter.writeJsonField("sharePointConnectorAppRegistration", this.sharePointConnectorAppRegistration); + jsonWriter.writeJsonField("oneLakeSecuritySource", this.oneLakeSecuritySource); jsonWriter.writeStringField("@odata.etag", this.eTag); return jsonWriter.writeEndObject(); } @@ -349,6 +352,7 @@ public static SearchIndexResponse fromJson(JsonReader jsonReader) throws IOExcep String name = null; String description = null; List fields = null; + GraphProfile graphProfile = null; List scoringProfiles = null; String defaultScoringProfile = null; CorsOptions corsOptions = null; @@ -363,7 +367,9 @@ public static SearchIndexResponse fromJson(JsonReader jsonReader) throws IOExcep SemanticSearch semanticSearch = null; VectorSearch vectorSearch = null; SearchIndexPermissionFilterOption permissionFilterOption = null; + Boolean purviewEnabled = null; SharePointConnectorAppRegistration sharePointConnectorAppRegistration = null; + OneLakeSecuritySource oneLakeSecuritySource = null; String eTag = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -374,6 +380,8 @@ public static SearchIndexResponse fromJson(JsonReader jsonReader) throws IOExcep description = reader.getString(); } else if ("fields".equals(fieldName)) { fields = reader.readArray(reader1 -> SearchField.fromJson(reader1)); + } else if ("graphProfile".equals(fieldName)) { + graphProfile = GraphProfile.fromJson(reader); } else if ("scoringProfiles".equals(fieldName)) { scoringProfiles = reader.readArray(reader1 -> ScoringProfile.fromJson(reader1)); } else if ("defaultScoringProfile".equals(fieldName)) { @@ -402,8 +410,12 @@ public static SearchIndexResponse fromJson(JsonReader jsonReader) throws IOExcep vectorSearch = VectorSearch.fromJson(reader); } else if ("permissionFilterOption".equals(fieldName)) { permissionFilterOption = SearchIndexPermissionFilterOption.fromString(reader.getString()); + } else if ("purviewEnabled".equals(fieldName)) { + purviewEnabled = reader.getNullable(JsonReader::getBoolean); } else if ("sharePointConnectorAppRegistration".equals(fieldName)) { sharePointConnectorAppRegistration = SharePointConnectorAppRegistration.fromJson(reader); + } else if ("oneLakeSecuritySource".equals(fieldName)) { + oneLakeSecuritySource = OneLakeSecuritySource.fromJson(reader); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else { @@ -413,6 +425,7 @@ public static SearchIndexResponse fromJson(JsonReader jsonReader) throws IOExcep SearchIndexResponse deserializedSearchIndexResponse = new SearchIndexResponse(name); deserializedSearchIndexResponse.description = description; deserializedSearchIndexResponse.fields = fields; + deserializedSearchIndexResponse.graphProfile = graphProfile; deserializedSearchIndexResponse.scoringProfiles = scoringProfiles; deserializedSearchIndexResponse.defaultScoringProfile = defaultScoringProfile; deserializedSearchIndexResponse.corsOptions = corsOptions; @@ -427,7 +440,9 @@ public static SearchIndexResponse fromJson(JsonReader jsonReader) throws IOExcep deserializedSearchIndexResponse.semanticSearch = semanticSearch; deserializedSearchIndexResponse.vectorSearch = vectorSearch; deserializedSearchIndexResponse.permissionFilterOption = permissionFilterOption; + deserializedSearchIndexResponse.purviewEnabled = purviewEnabled; deserializedSearchIndexResponse.sharePointConnectorAppRegistration = sharePointConnectorAppRegistration; + deserializedSearchIndexResponse.oneLakeSecuritySource = oneLakeSecuritySource; deserializedSearchIndexResponse.eTag = eTag; return deserializedSearchIndexResponse; }); @@ -455,6 +470,12 @@ public SemanticSearch getSemanticSearch() { @Generated private SearchIndexPermissionFilterOption permissionFilterOption; + /* + * A value indicating whether Purview is enabled for the index. + */ + @Generated + private Boolean purviewEnabled; + /** * Get the permissionFilterOption property: A value indicating whether permission filtering is enabled for the * index. @@ -466,6 +487,22 @@ public SearchIndexPermissionFilterOption getPermissionFilterOption() { return this.permissionFilterOption; } + /** + * Get the purviewEnabled property: A value indicating whether Purview is enabled for the index. + * + * @return the purviewEnabled value. + */ + @Generated + public Boolean isPurviewEnabled() { + return this.purviewEnabled; + } + + /* + * The persisted edge-list graph mapping, when the index supports graph queries. + */ + @Generated + private GraphProfile graphProfile; + /* * Configures a SharePoint connector app registration for the index, enabling document-level permissions from * SharePoint. If provided, the applicationId and federatedCredentialId properties are required. @@ -473,6 +510,23 @@ public SearchIndexPermissionFilterOption getPermissionFilterOption() { @Generated private SharePointConnectorAppRegistration sharePointConnectorAppRegistration; + /* + * Identifies the Microsoft Fabric OneLake lakehouse that the index's documents originate from. Required when any + * field uses the 'oneLakeParentFolders' or 'oneLakeLakehouseId' permission filter. + */ + @Generated + private OneLakeSecuritySource oneLakeSecuritySource; + + /** + * Get the graphProfile property: The persisted edge-list graph mapping, when the index supports graph queries. + * + * @return the graphProfile value. + */ + @Generated + public GraphProfile getGraphProfile() { + return this.graphProfile; + } + /** * Get the sharePointConnectorAppRegistration property: Configures a SharePoint connector app registration for the * index, enabling document-level permissions from SharePoint. If provided, the applicationId and @@ -484,4 +538,16 @@ public SearchIndexPermissionFilterOption getPermissionFilterOption() { public SharePointConnectorAppRegistration getSharePointConnectorAppRegistration() { return this.sharePointConnectorAppRegistration; } + + /** + * Get the oneLakeSecuritySource property: Identifies the Microsoft Fabric OneLake lakehouse that the index's + * documents originate from. Required when any field uses the 'oneLakeParentFolders' or 'oneLakeLakehouseId' + * permission filter. + * + * @return the oneLakeSecuritySource value. + */ + @Generated + public OneLakeSecuritySource getOneLakeSecuritySource() { + return this.oneLakeSecuritySource; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/TagScoringFunction.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/TagScoringFunction.java index a7b2a3e0aaa49..4718b3070d8a1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/TagScoringFunction.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/TagScoringFunction.java @@ -28,19 +28,6 @@ public final class TagScoringFunction extends ScoringFunction { @Generated private final TagScoringParameters parameters; - /** - * Creates an instance of TagScoringFunction class. - * - * @param fieldName the fieldName value to set. - * @param boost the boost value to set. - * @param parameters the parameters value to set. - */ - @Generated - public TagScoringFunction(String fieldName, double boost, TagScoringParameters parameters) { - super(fieldName, boost); - this.parameters = parameters; - } - /** * Get the type property: Type of ScoringFunction. * @@ -79,9 +66,9 @@ public TagScoringFunction setInterpolation(ScoringFunctionInterpolation interpol @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fieldName", getFieldName()); - jsonWriter.writeDoubleField("boost", getBoost()); jsonWriter.writeStringField("interpolation", getInterpolation() == null ? null : getInterpolation().toString()); + jsonWriter.writeDoubleField("boost", this.boost); + jsonWriter.writeStringField("fieldName", this.fieldName); jsonWriter.writeJsonField("tag", this.parameters); jsonWriter.writeStringField("type", this.type); return jsonWriter.writeEndObject(); @@ -99,20 +86,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static TagScoringFunction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String fieldName = null; - double boost = 0.0; ScoringFunctionInterpolation interpolation = null; + double boost = 0.0; + String fieldName = null; TagScoringParameters parameters = null; String type = "tag"; while (reader.nextToken() != JsonToken.END_OBJECT) { String jsonFieldName = reader.getFieldName(); reader.nextToken(); - if ("fieldName".equals(jsonFieldName)) { - fieldName = reader.getString(); + if ("interpolation".equals(jsonFieldName)) { + interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); } else if ("boost".equals(jsonFieldName)) { boost = reader.getDouble(); - } else if ("interpolation".equals(jsonFieldName)) { - interpolation = ScoringFunctionInterpolation.fromString(reader.getString()); + } else if ("fieldName".equals(jsonFieldName)) { + fieldName = reader.getString(); } else if ("tag".equals(jsonFieldName)) { parameters = TagScoringParameters.fromJson(reader); } else if ("type".equals(jsonFieldName)) { @@ -121,10 +108,67 @@ public static TagScoringFunction fromJson(JsonReader jsonReader) throws IOExcept reader.skipChildren(); } } - TagScoringFunction deserializedTagScoringFunction = new TagScoringFunction(fieldName, boost, parameters); + TagScoringFunction deserializedTagScoringFunction = new TagScoringFunction(boost, fieldName, parameters); deserializedTagScoringFunction.setInterpolation(interpolation); deserializedTagScoringFunction.type = type; return deserializedTagScoringFunction; }); } + + /* + * A multiplier for the raw score. Must be a positive number not equal to 1.0. + */ + @Generated + private final double boost; + + /* + * The name of the field used as input to the scoring function. + */ + @Generated + private final String fieldName; + + /** + * Creates an instance of TagScoringFunction class. + * + * @param boost the boost value to set. + * @param fieldName the fieldName value to set. + * @param parameters the parameters value to set. + */ + @Generated + public TagScoringFunction(double boost, String fieldName, TagScoringParameters parameters) { + this.boost = boost; + this.fieldName = fieldName; + this.parameters = parameters; + } + + /** + * Get the boost property: A multiplier for the raw score. Must be a positive number not equal to 1.0. + * + * @return the boost value. + */ + @Generated + public double getBoost() { + return this.boost; + } + + /** + * Get the fieldName property: The name of the field used as input to the scoring function. + * + * @return the fieldName value. + */ + @Generated + public String getFieldName() { + return this.fieldName; + } + + /** + * Creates a field-based scoring function. + * + * @param fieldName the field used as input. + * @param boost the score multiplier. + * @param parameters the scoring parameters. + */ + public TagScoringFunction(String fieldName, double boost, TagScoringParameters parameters) { + this(boost, fieldName, parameters); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearch.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearch.java index 73a72583a7081..1cb825311661e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearch.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearch.java @@ -199,6 +199,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("algorithms", this.algorithms, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("vectorizers", this.vectorizers, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("compressions", this.compressions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("topicGraphProfiles", this.topicGraphProfiles, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -233,6 +235,10 @@ public static VectorSearch fromJson(JsonReader jsonReader) throws IOException { List compressions = reader.readArray(reader1 -> VectorSearchCompression.fromJson(reader1)); deserializedVectorSearch.compressions = compressions; + } else if ("topicGraphProfiles".equals(fieldName)) { + List topicGraphProfiles + = reader.readArray(reader1 -> VectorSearchTopicGraphProfile.fromJson(reader1)); + deserializedVectorSearch.topicGraphProfiles = topicGraphProfiles; } else { reader.skipChildren(); } @@ -240,4 +246,32 @@ public static VectorSearch fromJson(JsonReader jsonReader) throws IOException { return deserializedVectorSearch; }); } + + /* + * Contains profiles for topic graph vector search. + */ + @Generated + private List topicGraphProfiles; + + /** + * Get the topicGraphProfiles property: Contains profiles for topic graph vector search. + * + * @return the topicGraphProfiles value. + */ + @Generated + public List getTopicGraphProfiles() { + return this.topicGraphProfiles; + } + + /** + * Set the topicGraphProfiles property: Contains profiles for topic graph vector search. + * + * @param topicGraphProfiles the topicGraphProfiles value to set. + * @return the VectorSearch object itself. + */ + @Generated + public VectorSearch setTopicGraphProfiles(List topicGraphProfiles) { + this.topicGraphProfiles = topicGraphProfiles; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java new file mode 100644 index 0000000000000..30c9e5331c216 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.models.VectorSearchTopicGraphKind; +import java.io.IOException; + +/** + * Defines a topic graph profile for a single vector field. + */ +@Fluent +public final class VectorSearchTopicGraphProfile implements JsonSerializable { + + /* + * The name to associate with this topic graph profile. + */ + @Generated + private final String name; + + /* + * The name of the index that stores the topics for the associated vector field. + */ + @Generated + private final String indexName; + + /* + * Default kind of topic graph vector search to use. + */ + @Generated + private final VectorSearchTopicGraphKind defaultKind; + + /* + * Default diversity factor for topic graph vector searches. This property can only be used when `defaultKind` is + * `diverse`. Default is 0.2. + */ + @Generated + private Float defaultDiversityFactor; + + /* + * Default minimum number of vector candidates to retrieve before topic graph sampling. This property can only be + * used when `defaultKind` is `diverse` or `balanced`. The default is 1,000 for classic services and 500 for + * serverless services. + */ + @Generated + private Integer defaultMinDiversityPoolSize; + + /** + * Creates an instance of VectorSearchTopicGraphProfile class. + * + * @param name the name value to set. + * @param indexName the indexName value to set. + * @param defaultKind the defaultKind value to set. + */ + @Generated + public VectorSearchTopicGraphProfile(String name, String indexName, VectorSearchTopicGraphKind defaultKind) { + this.name = name; + this.indexName = indexName; + this.defaultKind = defaultKind; + } + + /** + * Get the name property: The name to associate with this topic graph profile. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the indexName property: The name of the index that stores the topics for the associated vector field. + * + * @return the indexName value. + */ + @Generated + public String getIndexName() { + return this.indexName; + } + + /** + * Get the defaultKind property: Default kind of topic graph vector search to use. + * + * @return the defaultKind value. + */ + @Generated + public VectorSearchTopicGraphKind getDefaultKind() { + return this.defaultKind; + } + + /** + * Get the defaultDiversityFactor property: Default diversity factor for topic graph vector searches. This property + * can only be used when `defaultKind` is `diverse`. Default is 0.2. + * + * @return the defaultDiversityFactor value. + */ + @Generated + public Float getDefaultDiversityFactor() { + return this.defaultDiversityFactor; + } + + /** + * Set the defaultDiversityFactor property: Default diversity factor for topic graph vector searches. This property + * can only be used when `defaultKind` is `diverse`. Default is 0.2. + * + * @param defaultDiversityFactor the defaultDiversityFactor value to set. + * @return the VectorSearchTopicGraphProfile object itself. + */ + @Generated + public VectorSearchTopicGraphProfile setDefaultDiversityFactor(Float defaultDiversityFactor) { + this.defaultDiversityFactor = defaultDiversityFactor; + return this; + } + + /** + * Get the defaultMinDiversityPoolSize property: Default minimum number of vector candidates to retrieve before + * topic graph sampling. This property can only be used when `defaultKind` is `diverse` or `balanced`. The default + * is 1,000 for classic services and 500 for serverless services. + * + * @return the defaultMinDiversityPoolSize value. + */ + @Generated + public Integer getDefaultMinDiversityPoolSize() { + return this.defaultMinDiversityPoolSize; + } + + /** + * Set the defaultMinDiversityPoolSize property: Default minimum number of vector candidates to retrieve before + * topic graph sampling. This property can only be used when `defaultKind` is `diverse` or `balanced`. The default + * is 1,000 for classic services and 500 for serverless services. + * + * @param defaultMinDiversityPoolSize the defaultMinDiversityPoolSize value to set. + * @return the VectorSearchTopicGraphProfile object itself. + */ + @Generated + public VectorSearchTopicGraphProfile setDefaultMinDiversityPoolSize(Integer defaultMinDiversityPoolSize) { + this.defaultMinDiversityPoolSize = defaultMinDiversityPoolSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("indexName", this.indexName); + jsonWriter.writeStringField("defaultKind", this.defaultKind == null ? null : this.defaultKind.toString()); + jsonWriter.writeNumberField("defaultDiversityFactor", this.defaultDiversityFactor); + jsonWriter.writeNumberField("defaultMinDiversityPoolSize", this.defaultMinDiversityPoolSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorSearchTopicGraphProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorSearchTopicGraphProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorSearchTopicGraphProfile. + */ + @Generated + public static VectorSearchTopicGraphProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String indexName = null; + VectorSearchTopicGraphKind defaultKind = null; + Float defaultDiversityFactor = null; + Integer defaultMinDiversityPoolSize = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("indexName".equals(fieldName)) { + indexName = reader.getString(); + } else if ("defaultKind".equals(fieldName)) { + defaultKind = VectorSearchTopicGraphKind.fromString(reader.getString()); + } else if ("defaultDiversityFactor".equals(fieldName)) { + defaultDiversityFactor = reader.getNullable(JsonReader::getFloat); + } else if ("defaultMinDiversityPoolSize".equals(fieldName)) { + defaultMinDiversityPoolSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + VectorSearchTopicGraphProfile deserializedVectorSearchTopicGraphProfile + = new VectorSearchTopicGraphProfile(name, indexName, defaultKind); + deserializedVectorSearchTopicGraphProfile.defaultDiversityFactor = defaultDiversityFactor; + deserializedVectorSearchTopicGraphProfile.defaultMinDiversityPoolSize = defaultMinDiversityPoolSize; + return deserializedVectorSearchTopicGraphProfile; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java index ec533f59ae3c9..59ab5dae09404 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java @@ -100,6 +100,8 @@ public static VectorSearchVectorizer fromJson(JsonReader jsonReader) throws IOEx // Use the discriminator value to determine which subtype should be deserialized. if ("azureOpenAI".equals(discriminatorValue)) { return AzureOpenAIVectorizer.fromJson(readerToUse.reset()); + } else if ("openAICompatible".equals(discriminatorValue)) { + return OpenAICompatibleVectorizer.fromJson(readerToUse.reset()); } else if ("customWebApi".equals(discriminatorValue)) { return WebApiVectorizer.fromJson(readerToUse.reset()); } else { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizerKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizerKind.java index efb652e99b7e9..3f97ec3a26ce7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizerKind.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizerKind.java @@ -67,4 +67,10 @@ public static VectorSearchVectorizerKind fromString(String name) { public static Collection values() { return values(VectorSearchVectorizerKind.class); } + + /** + * Generate embeddings using a customer-controlled OpenAI-compatible embeddings endpoint. + */ + @Generated + public static final VectorSearchVectorizerKind OPEN_AICOMPATIBLE = fromString("openAICompatible"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java index 0cf6917efb498..59b36b124a7b3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java @@ -24,6 +24,7 @@ import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; +import com.azure.search.documents.models.ServerSentEvent; import com.azure.search.documents.models.implementation.sse.ServerSentEventStreams; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -85,10 +86,8 @@ public SearchServiceVersion getServiceVersion() { * * You can add these to a request with {@link RequestOptions#addHeader} * - * @param retrievalRequest The retrieval request to process. Its query-source authorization is sent only as the - * x-ms-query-source-authorization header, not in the request body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. An authorization - * header set through these options overrides the authorization in retrievalRequest. + * @param retrievalRequest The retrieval request to process. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -100,8 +99,7 @@ public SearchServiceVersion getServiceVersion() { public Mono> retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) { return mapResponse( - this.serviceClient.retrieveWithResponseAsync(BinaryData.fromObject(retrievalRequest), - retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization(), requestOptions), + this.serviceClient.retrieveWithResponseAsync(BinaryData.fromObject(retrievalRequest), requestOptions), KnowledgeBaseRetrievalResult.class); } @@ -113,6 +111,9 @@ public SearchServiceVersion getServiceVersion() { * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -136,25 +137,30 @@ public SearchServiceVersion getServiceVersion() { * } * ] * maxRuntimeInSeconds: Integer (Optional) + * maxOutputSize: Integer (Optional) * maxOutputDocuments: Integer (Optional) * maxOutputSizeInTokens: Integer (Optional) * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) + * kind: String(minimal/low/medium/auto) (Required) * } * includeActivity: Boolean (Optional) * outputMode: String(extractiveData/answerSynthesis) (Optional) * knowledgeSourceParams (Optional): [ * (Optional){ - * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required) + * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required) * knowledgeSourceName: String (Required) * includeReferences: Boolean (Optional) * includeReferenceSourceData: Boolean (Optional) * alwaysQuerySource: Boolean (Optional) + * neverQuerySource: Boolean (Optional) * failOnError: Boolean (Optional) * rerankerThreshold: Float (Optional) + * resultsProcessing: String(rerank/none) (Optional) * maxOutputDocuments: Integer (Optional) + * enableImageServing: Boolean (Optional) * } * ] + * toolName: String (Optional) * } * } *
@@ -176,7 +182,7 @@ public SearchServiceVersion getServiceVersion() { * ] * activity (Optional): [ * (Optional){ - * type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required) + * type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required) * id: int (Required) * startedAt: OffsetDateTime (Optional) * completedAt: OffsetDateTime (Optional) @@ -202,7 +208,7 @@ public SearchServiceVersion getServiceVersion() { * ] * references (Optional): [ * (Optional){ - * type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql) (Required) + * type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql) (Required) * id: String (Required) * activitySource: int (Required) * sourceData (Optional): { @@ -211,6 +217,14 @@ public SearchServiceVersion getServiceVersion() { * rerankerScore: Float (Optional) * } * ] + * responseSensitivityLabelInfo (Optional): { + * displayName: String (Optional) + * sensitivityLabelId: String (Optional) + * toolTip: String (Optional) + * priority: Integer (Optional) + * color: String (Optional) + * isEncrypted: Boolean (Optional) + * } * } * } *
@@ -234,9 +248,7 @@ Mono> hiddenGeneratedRetrieveWithResponse(BinaryData retrie /** * KnowledgeBase retrieves relevant data from backing stores. * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. + * @param retrievalRequest The retrieval request to process. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -248,7 +260,8 @@ Mono> hiddenGeneratedRetrieveWithResponse(BinaryData retrie @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono retrieve(KnowledgeBaseRetrievalOptions retrievalRequest) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); + // Generated convenience method for hiddenGeneratedRetrieveWithResponse + RequestOptions requestOptions = new RequestOptions(); return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeBaseRetrievalResult.class)); @@ -269,6 +282,9 @@ public Mono retrieve(KnowledgeBaseRetrievalOptions * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -292,25 +308,30 @@ public Mono retrieve(KnowledgeBaseRetrievalOptions * } * ] * maxRuntimeInSeconds: Integer (Optional) + * maxOutputSize: Integer (Optional) * maxOutputDocuments: Integer (Optional) * maxOutputSizeInTokens: Integer (Optional) * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) + * kind: String(minimal/low/medium/auto) (Required) * } * includeActivity: Boolean (Optional) * outputMode: String(extractiveData/answerSynthesis) (Optional) * knowledgeSourceParams (Optional): [ * (Optional){ - * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required) + * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required) * knowledgeSourceName: String (Required) * includeReferences: Boolean (Optional) * includeReferenceSourceData: Boolean (Optional) * alwaysQuerySource: Boolean (Optional) + * neverQuerySource: Boolean (Optional) * failOnError: Boolean (Optional) * rerankerThreshold: Float (Optional) + * resultsProcessing: String(rerank/none) (Optional) * maxOutputDocuments: Integer (Optional) + * enableImageServing: Boolean (Optional) * } * ] + * toolName: String (Optional) * } * } *
@@ -338,6 +359,41 @@ Mono> hiddenGeneratedRetrieveStreamWithResponse(BinaryData return this.serviceClient.retrieveStreamWithResponseAsync(retrievalRequest, requestOptions); } + /** + * KnowledgeBase retrieves relevant data from backing stores. + * + * @param retrievalRequest The retrieval request to process. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. + * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured + * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the output contract for the retrieval response on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization, String queryWorkIQSourceAuthorization) { + // Generated convenience method for hiddenGeneratedRetrieveWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (queryWorkIQSourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), + queryWorkIQSourceAuthorization); + } + return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeBaseRetrievalResult.class)); + } + /** * Retrieves relevant data from backing stores and streams progress and results as server-sent * events. @@ -349,6 +405,10 @@ Mono> hiddenGeneratedRetrieveStreamWithResponse(BinaryData * complete response body as a single JSON document. * * @param retrievalRequest The retrieval request to process. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. + * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured + * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -359,142 +419,98 @@ Mono> hiddenGeneratedRetrieveStreamWithResponse(BinaryData */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { + Mono hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization, String queryWorkIQSourceAuthorization) { // Generated convenience method for hiddenGeneratedRetrieveStreamWithResponse RequestOptions requestOptions = new RequestOptions(); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (queryWorkIQSourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), + queryWorkIQSourceAuthorization); + } return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .flatMap(FluxUtil::toMono); } /** - * Retrieves relevant data from backing stores and streams progress and results as server-sent events. - * - * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known - * subtype's {@code getValue()} to access its typed payload, for example - * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. - * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; - * their payloads are not available. + * Retrieves relevant data from backing stores and streams progress and results as server-sent + * events. * - * If received, the terminal {@code error} or {@code response.completed} event is emitted before the stream - * completes. End-of-stream without a terminal event completes normally. Transport and decoding failures are - * propagated through the reactive error path. The client does not reconnect automatically. + * Process the response incrementally using server-sent event framing. Each event contains an + * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` + * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated + * clients may expose the raw response without typed event parsing. Do not deserialize the + * complete response body as a single JSON document. * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. - * @return A stream of typed knowledge base retrieval events. + * @param retrievalRequest The retrieval request to process. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. */ @Generated - public Flux retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { + // Generated convenience method for hiddenGeneratedRetrieveStreamWithResponse + RequestOptions requestOptions = new RequestOptions(); return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) - .flatMapMany(response -> ServerSentEventStreams.toFlux(response, - KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal)); + .flatMap(FluxUtil::toMono); } /** * Retrieves relevant data from backing stores and streams progress and results as server-sent events. * - * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known - * subtype's {@code getValue()} to access its typed payload, for example - * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. - * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; - * their payloads are not available. - * * If received, the terminal {@code error} or {@code response.completed} event is emitted before the stream * completes. End-of-stream without a terminal event completes normally. Transport and decoding failures are * propagated through the reactive error path. The client does not reconnect automatically. * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. - * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. A non-null value overrides - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string - * is treated as an explicit value. + * @param retrievalRequest The retrieval request to process. * @return A stream of typed knowledge base retrieval events. */ @Generated - public Flux retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); + public Flux> + retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { + RequestOptions requestOptions = new RequestOptions(); return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .flatMapMany(response -> ServerSentEventStreams.toFlux(response, - KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal)); + KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal())); } /** - * KnowledgeBase retrieves relevant data from backing stores. - * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. - * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. A non-null value overrides - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string - * is treated as an explicit value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the output contract for the retrieval response on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); - return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeBaseRetrievalResult.class)); - } - - /** - * Retrieves relevant data from backing stores and streams progress and results as server-sent - * events. + * Retrieves relevant data from backing stores and streams progress and results as server-sent events. * - * Process the response incrementally using server-sent event framing. Each event contains an - * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` - * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated - * clients may expose the raw response without typed event parsing. Do not deserialize the - * complete response body as a single JSON document. + * If received, the terminal {@code error} or {@code response.completed} event is emitted before the stream + * completes. End-of-stream without a terminal event completes normally. Transport and decoding failures are + * propagated through the reactive error path. The client does not reconnect automatically. * * @param retrievalRequest The retrieval request to process. * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is * used to enforce security restrictions on documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured + * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. + * @return A stream of typed knowledge base retrieval events. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Mono hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { - // Generated convenience method for hiddenGeneratedRetrieveStreamWithResponse + public Flux> retrieveStream( + KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, + String queryWorkIQSourceAuthorization) { RequestOptions requestOptions = new RequestOptions(); if (querySourceAuthorization != null) { requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), querySourceAuthorization); } - return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) - .flatMap(FluxUtil::toMono); - } - - private static RequestOptions createRetrieveRequestOptions(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { - RequestOptions requestOptions = new RequestOptions(); - String authorization = querySourceAuthorization != null - ? querySourceAuthorization - : (retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization()); - if (authorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), authorization); + if (queryWorkIQSourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), + queryWorkIQSourceAuthorization); } - return requestOptions; + return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) + .flatMapMany(response -> ServerSentEventStreams.toFlux(response, + KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal())); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java index 8ec6623b63479..6f1a741e10a69 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java @@ -17,13 +17,13 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.azure.core.util.CloseableIterableStream; import com.azure.search.documents.SearchServiceVersion; import com.azure.search.documents.implementation.KnowledgeBaseRetrievalClientImpl; import com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; +import com.azure.search.documents.models.ServerSentEventListener; import com.azure.search.documents.models.implementation.sse.ServerSentEventStreams; /** @@ -83,10 +83,8 @@ public SearchServiceVersion getServiceVersion() { * * You can add these to a request with {@link RequestOptions#addHeader} * - * @param retrievalRequest The retrieval request to process. Its query-source authorization is sent only as the - * x-ms-query-source-authorization header, not in the request body. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. An authorization - * header set through these options overrides the authorization in retrievalRequest. + * @param retrievalRequest The retrieval request to process. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -97,8 +95,7 @@ public SearchServiceVersion getServiceVersion() { public Response retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) { return convertResponse( - this.serviceClient.retrieveWithResponse(BinaryData.fromObject(retrievalRequest), - retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization(), requestOptions), + this.serviceClient.retrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), KnowledgeBaseRetrievalResult.class); } @@ -110,6 +107,9 @@ public Response retrieveWithResponse(KnowledgeBase * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -133,25 +133,30 @@ public Response retrieveWithResponse(KnowledgeBase * } * ] * maxRuntimeInSeconds: Integer (Optional) + * maxOutputSize: Integer (Optional) * maxOutputDocuments: Integer (Optional) * maxOutputSizeInTokens: Integer (Optional) * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) + * kind: String(minimal/low/medium/auto) (Required) * } * includeActivity: Boolean (Optional) * outputMode: String(extractiveData/answerSynthesis) (Optional) * knowledgeSourceParams (Optional): [ * (Optional){ - * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required) + * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required) * knowledgeSourceName: String (Required) * includeReferences: Boolean (Optional) * includeReferenceSourceData: Boolean (Optional) * alwaysQuerySource: Boolean (Optional) + * neverQuerySource: Boolean (Optional) * failOnError: Boolean (Optional) * rerankerThreshold: Float (Optional) + * resultsProcessing: String(rerank/none) (Optional) * maxOutputDocuments: Integer (Optional) + * enableImageServing: Boolean (Optional) * } * ] + * toolName: String (Optional) * } * } *
@@ -173,7 +178,7 @@ public Response retrieveWithResponse(KnowledgeBase * ] * activity (Optional): [ * (Optional){ - * type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required) + * type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql/modelQueryPlanning/modelAnswerSynthesis/modelWebSummarization/agenticReasoning) (Required) * id: int (Required) * startedAt: OffsetDateTime (Optional) * completedAt: OffsetDateTime (Optional) @@ -199,7 +204,7 @@ public Response retrieveWithResponse(KnowledgeBase * ] * references (Optional): [ * (Optional){ - * type: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/file/indexedSql) (Required) + * type: String(graphSearch/searchIndex/azureBlob/indexedSharePoint/indexedOneLake/web/remoteSharePoint/workIQ/fabricDataAgent/fabricOntology/mcpServer/file/indexedSql) (Required) * id: String (Required) * activitySource: int (Required) * sourceData (Optional): { @@ -208,6 +213,14 @@ public Response retrieveWithResponse(KnowledgeBase * rerankerScore: Float (Optional) * } * ] + * responseSensitivityLabelInfo (Optional): { + * displayName: String (Optional) + * sensitivityLabelId: String (Optional) + * toolTip: String (Optional) + * priority: Integer (Optional) + * color: String (Optional) + * isEncrypted: Boolean (Optional) + * } * } * } *
@@ -230,9 +243,7 @@ Response hiddenGeneratedRetrieveWithResponse(BinaryData retrievalReq /** * KnowledgeBase retrieves relevant data from backing stores. * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. + * @param retrievalRequest The retrieval request to process. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -244,7 +255,8 @@ Response hiddenGeneratedRetrieveWithResponse(BinaryData retrievalReq @Generated @ServiceMethod(returns = ReturnType.SINGLE) public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); + // Generated convenience method for hiddenGeneratedRetrieveWithResponse + RequestOptions requestOptions = new RequestOptions(); return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions).getValue() .toObject(KnowledgeBaseRetrievalResult.class); } @@ -264,6 +276,9 @@ public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retri * NameTypeRequiredDescription * x-ms-query-source-authorizationStringNoToken identifying the user for which * the query is being executed. This token is used to enforce security restrictions on documents. + * x-ms-query-work-iq-source-authorizationStringNoUser assertion token for a + * customer-owned Entra app registration configured on a Work IQ knowledge source. Used for on-behalf-of + * authentication to the Work IQ API. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -287,25 +302,30 @@ public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retri * } * ] * maxRuntimeInSeconds: Integer (Optional) + * maxOutputSize: Integer (Optional) * maxOutputDocuments: Integer (Optional) * maxOutputSizeInTokens: Integer (Optional) * retrievalReasoningEffort (Optional): { - * kind: String(minimal/low/medium) (Required) + * kind: String(minimal/low/medium/auto) (Required) * } * includeActivity: Boolean (Optional) * outputMode: String(extractiveData/answerSynthesis) (Optional) * knowledgeSourceParams (Optional): [ * (Optional){ - * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/file) (Required) + * kind: String(searchIndex/azureBlob/indexedSharePoint/indexedOneLake/indexedSql/web/remoteSharePoint/workIQ/file/mcpServer/fabricDataAgent/fabricOntology) (Required) * knowledgeSourceName: String (Required) * includeReferences: Boolean (Optional) * includeReferenceSourceData: Boolean (Optional) * alwaysQuerySource: Boolean (Optional) + * neverQuerySource: Boolean (Optional) * failOnError: Boolean (Optional) * rerankerThreshold: Float (Optional) + * resultsProcessing: String(rerank/none) (Optional) * maxOutputDocuments: Integer (Optional) + * enableImageServing: Boolean (Optional) * } * ] + * toolName: String (Optional) * } * } *
@@ -334,126 +354,78 @@ Response hiddenGeneratedRetrieveStreamWithResponse(BinaryData retrie } /** - * Retrieves relevant data from backing stores and streams progress and results as server-sent - * events. - * - * Process the response incrementally using server-sent event framing. Each event contains an - * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` - * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated - * clients may expose the raw response without typed event parsing. Do not deserialize the - * complete response body as a single JSON document. + * KnowledgeBase retrieves relevant data from backing stores. * * @param retrievalRequest The retrieval request to process. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. + * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured + * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the output contract for the retrieval response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - BinaryData hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { - // Generated convenience method for hiddenGeneratedRetrieveStreamWithResponse + public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization, String queryWorkIQSourceAuthorization) { + // Generated convenience method for hiddenGeneratedRetrieveWithResponse RequestOptions requestOptions = new RequestOptions(); - return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) - .getValue(); - } - - /** - * Retrieves relevant data from backing stores and streams progress and results as server-sent events. - * - * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known - * subtype's {@code getValue()} to access its typed payload, for example - * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. - * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; - * their payloads are not available. - * - * Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends - * early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the - * stream is idempotent and may throw {@link java.io.IOException}. - * - * If received, the terminal {@code error} or {@code response.completed} event is emitted before iteration ends. A - * failure while closing after a terminal event is reported by the next iterator access or explicit close, after the - * terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding - * failures are thrown during iteration. The client does not reconnect automatically. - * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. - * @return A closeable stream of typed knowledge base retrieval events. - */ - @Generated - public CloseableIterableStream - retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); - return ServerSentEventStreams.toIterableStream( - hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), - KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (queryWorkIQSourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), + queryWorkIQSourceAuthorization); + } + return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions).getValue() + .toObject(KnowledgeBaseRetrievalResult.class); } /** - * Retrieves relevant data from backing stores and streams progress and results as server-sent events. - * - * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known - * subtype's {@code getValue()} to access its typed payload, for example - * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. - * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; - * their payloads are not available. - * - * Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends - * early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the - * stream is idempotent and may throw {@link java.io.IOException}. - * - * If received, the terminal {@code error} or {@code response.completed} event is emitted before iteration ends. A - * failure while closing after a terminal event is reported by the next iterator access or explicit close, after the - * terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding - * failures are thrown during iteration. The client does not reconnect automatically. + * Retrieves relevant data from backing stores and streams progress and results as server-sent + * events. * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. - * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. A non-null value overrides - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string - * is treated as an explicit value. - * @return A closeable stream of typed knowledge base retrieval events. - */ - @Generated - public CloseableIterableStream - retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); - return ServerSentEventStreams.toIterableStream( - hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), - KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal); - } - - /** - * KnowledgeBase retrieves relevant data from backing stores. + * Process the response incrementally using server-sent event framing. Each event contains an + * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` + * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated + * clients may expose the raw response without typed event parsing. Do not deserialize the + * complete response body as a single JSON document. * - * @param retrievalRequest The retrieval request to process. If its - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the - * x-ms-query-source-authorization header and is never serialized into the request body. + * @param retrievalRequest The retrieval request to process. * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. A non-null value overrides - * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string - * is treated as an explicit value. + * used to enforce security restrictions on documents. + * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured + * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the output contract for the retrieval response. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { - RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); - return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions).getValue() - .toObject(KnowledgeBaseRetrievalResult.class); + BinaryData hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization, String queryWorkIQSourceAuthorization) { + // Generated convenience method for hiddenGeneratedRetrieveStreamWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (queryWorkIQSourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), + queryWorkIQSourceAuthorization); + } + return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) + .getValue(); } /** @@ -467,8 +439,6 @@ public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retri * complete response body as a single JSON document. * * @param retrievalRequest The retrieval request to process. - * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -479,27 +449,62 @@ public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retri */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - BinaryData hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { + BinaryData hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { // Generated convenience method for hiddenGeneratedRetrieveStreamWithResponse RequestOptions requestOptions = new RequestOptions(); - if (querySourceAuthorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), - querySourceAuthorization); - } return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .getValue(); } - private static RequestOptions createRetrieveRequestOptions(KnowledgeBaseRetrievalOptions retrievalRequest, - String querySourceAuthorization) { + /** + * Retrieves relevant data from backing stores and streams progress and results as server-sent events. + * + * If received, the terminal {@code error} or {@code response.completed} event is delivered before + * {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a terminal event closes normally. + * Transport and decoding failures are reported through {@link ServerSentEventListener#onError(Throwable)}. The + * client does not reconnect automatically. + * + * @param retrievalRequest The retrieval request to process. + * @param listener The listener that receives events and lifecycle notifications. + */ + @Generated + public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, + ServerSentEventListener listener) { RequestOptions requestOptions = new RequestOptions(); - String authorization = querySourceAuthorization != null - ? querySourceAuthorization - : (retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization()); - if (authorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), authorization); + ServerSentEventStreams.listen( + hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), + KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal(), listener); + } + + /** + * Retrieves relevant data from backing stores and streams progress and results as server-sent events. + * + * If received, the terminal {@code error} or {@code response.completed} event is delivered before + * {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a terminal event closes normally. + * Transport and decoding failures are reported through {@link ServerSentEventListener#onError(Throwable)}. The + * client does not reconnect automatically. + * + * @param retrievalRequest The retrieval request to process. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. + * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured + * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. + * @param listener The listener that receives events and lifecycle notifications. + */ + @Generated + public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, + String queryWorkIQSourceAuthorization, ServerSentEventListener listener) { + RequestOptions requestOptions = new RequestOptions(); + if (querySourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), + querySourceAuthorization); + } + if (queryWorkIQSourceAuthorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), + queryWorkIQSourceAuthorization); } - return requestOptions; + ServerSentEventStreams.listen( + hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), + KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal(), listener); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphHydrateDocumentsParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphHydrateDocumentsParams.java new file mode 100644 index 0000000000000..36a29c140d048 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphHydrateDocumentsParams.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Selection and count limits for hydrated source documents returned by knowledge retrieval. + */ +@Fluent +public final class AgentRuntimeGraphHydrateDocumentsParams + implements JsonSerializable { + + /* + * Comma-separated retrievable source fields to include. + */ + @Generated + private String select; + + /* + * Maximum hydrated documents to return. Defaults to 50; this is independent of graph-row count. + */ + @Generated + private Integer top; + + /** + * Creates an instance of AgentRuntimeGraphHydrateDocumentsParams class. + */ + @Generated + public AgentRuntimeGraphHydrateDocumentsParams() { + } + + /** + * Get the select property: Comma-separated retrievable source fields to include. + * + * @return the select value. + */ + @Generated + public String getSelect() { + return this.select; + } + + /** + * Set the select property: Comma-separated retrievable source fields to include. + * + * @param select the select value to set. + * @return the AgentRuntimeGraphHydrateDocumentsParams object itself. + */ + @Generated + public AgentRuntimeGraphHydrateDocumentsParams setSelect(String select) { + this.select = select; + return this; + } + + /** + * Get the top property: Maximum hydrated documents to return. Defaults to 50; this is independent of graph-row + * count. + * + * @return the top value. + */ + @Generated + public Integer getTop() { + return this.top; + } + + /** + * Set the top property: Maximum hydrated documents to return. Defaults to 50; this is independent of graph-row + * count. + * + * @param top the top value to set. + * @return the AgentRuntimeGraphHydrateDocumentsParams object itself. + */ + @Generated + public AgentRuntimeGraphHydrateDocumentsParams setTop(Integer top) { + this.top = top; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("select", this.select); + jsonWriter.writeNumberField("top", this.top); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentRuntimeGraphHydrateDocumentsParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentRuntimeGraphHydrateDocumentsParams if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentRuntimeGraphHydrateDocumentsParams. + */ + @Generated + public static AgentRuntimeGraphHydrateDocumentsParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentRuntimeGraphHydrateDocumentsParams deserializedAgentRuntimeGraphHydrateDocumentsParams + = new AgentRuntimeGraphHydrateDocumentsParams(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("select".equals(fieldName)) { + deserializedAgentRuntimeGraphHydrateDocumentsParams.select = reader.getString(); + } else if ("top".equals(fieldName)) { + deserializedAgentRuntimeGraphHydrateDocumentsParams.top = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedAgentRuntimeGraphHydrateDocumentsParams; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphParams.java new file mode 100644 index 0000000000000..3192edbf8163d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphParams.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Graph-specific overrides for a graph-enabled Azure Blob knowledge source during retrieval. + */ +@Fluent +public final class AgentRuntimeGraphParams implements JsonSerializable { + + /* + * Controls whether source documents supporting graph results are also returned. + */ + @Generated + private AgentRuntimeGraphProvenanceParams provenance; + + /* + * Include generated GQL in graphSearchArguments.gql. Omitted or false does not expose generated query text. + */ + @Generated + private Boolean includeQuery; + + /** + * Creates an instance of AgentRuntimeGraphParams class. + */ + @Generated + public AgentRuntimeGraphParams() { + } + + /** + * Get the provenance property: Controls whether source documents supporting graph results are also returned. + * + * @return the provenance value. + */ + @Generated + public AgentRuntimeGraphProvenanceParams getProvenance() { + return this.provenance; + } + + /** + * Set the provenance property: Controls whether source documents supporting graph results are also returned. + * + * @param provenance the provenance value to set. + * @return the AgentRuntimeGraphParams object itself. + */ + @Generated + public AgentRuntimeGraphParams setProvenance(AgentRuntimeGraphProvenanceParams provenance) { + this.provenance = provenance; + return this; + } + + /** + * Get the includeQuery property: Include generated GQL in graphSearchArguments.gql. Omitted or false does not + * expose generated query text. + * + * @return the includeQuery value. + */ + @Generated + public Boolean isIncludeQuery() { + return this.includeQuery; + } + + /** + * Set the includeQuery property: Include generated GQL in graphSearchArguments.gql. Omitted or false does not + * expose generated query text. + * + * @param includeQuery the includeQuery value to set. + * @return the AgentRuntimeGraphParams object itself. + */ + @Generated + public AgentRuntimeGraphParams setIncludeQuery(Boolean includeQuery) { + this.includeQuery = includeQuery; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("provenance", this.provenance); + jsonWriter.writeBooleanField("includeQuery", this.includeQuery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentRuntimeGraphParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentRuntimeGraphParams if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentRuntimeGraphParams. + */ + @Generated + public static AgentRuntimeGraphParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentRuntimeGraphParams deserializedAgentRuntimeGraphParams = new AgentRuntimeGraphParams(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("provenance".equals(fieldName)) { + deserializedAgentRuntimeGraphParams.provenance = AgentRuntimeGraphProvenanceParams.fromJson(reader); + } else if ("includeQuery".equals(fieldName)) { + deserializedAgentRuntimeGraphParams.includeQuery = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedAgentRuntimeGraphParams; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphProvenanceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphProvenanceParams.java new file mode 100644 index 0000000000000..2b1e75462e11b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphProvenanceParams.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Source-document hydration policy for knowledge retrieval graph results. + */ +@Fluent +public final class AgentRuntimeGraphProvenanceParams implements JsonSerializable { + + /* + * Whether graph retrieval returns graph rows only or also hydrates source documents. + */ + @Generated + private KnowledgeSourceGraphProvenanceKind kind; + + /* + * Source-document options; only valid when kind is hydrate. + */ + @Generated + private AgentRuntimeGraphHydrateDocumentsParams hydrateDocuments; + + /** + * Creates an instance of AgentRuntimeGraphProvenanceParams class. + */ + @Generated + public AgentRuntimeGraphProvenanceParams() { + } + + /** + * Get the kind property: Whether graph retrieval returns graph rows only or also hydrates source documents. + * + * @return the kind value. + */ + @Generated + public KnowledgeSourceGraphProvenanceKind getKind() { + return this.kind; + } + + /** + * Set the kind property: Whether graph retrieval returns graph rows only or also hydrates source documents. + * + * @param kind the kind value to set. + * @return the AgentRuntimeGraphProvenanceParams object itself. + */ + @Generated + public AgentRuntimeGraphProvenanceParams setKind(KnowledgeSourceGraphProvenanceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the hydrateDocuments property: Source-document options; only valid when kind is hydrate. + * + * @return the hydrateDocuments value. + */ + @Generated + public AgentRuntimeGraphHydrateDocumentsParams getHydrateDocuments() { + return this.hydrateDocuments; + } + + /** + * Set the hydrateDocuments property: Source-document options; only valid when kind is hydrate. + * + * @param hydrateDocuments the hydrateDocuments value to set. + * @return the AgentRuntimeGraphProvenanceParams object itself. + */ + @Generated + public AgentRuntimeGraphProvenanceParams + setHydrateDocuments(AgentRuntimeGraphHydrateDocumentsParams hydrateDocuments) { + this.hydrateDocuments = hydrateDocuments; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("hydrateDocuments", this.hydrateDocuments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentRuntimeGraphProvenanceParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentRuntimeGraphProvenanceParams if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentRuntimeGraphProvenanceParams. + */ + @Generated + public static AgentRuntimeGraphProvenanceParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentRuntimeGraphProvenanceParams deserializedAgentRuntimeGraphProvenanceParams + = new AgentRuntimeGraphProvenanceParams(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedAgentRuntimeGraphProvenanceParams.kind + = KnowledgeSourceGraphProvenanceKind.fromString(reader.getString()); + } else if ("hydrateDocuments".equals(fieldName)) { + deserializedAgentRuntimeGraphProvenanceParams.hydrateDocuments + = AgentRuntimeGraphHydrateDocumentsParams.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedAgentRuntimeGraphProvenanceParams; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AzureBlobKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AzureBlobKnowledgeSourceParams.java index e37e68be37a0e..e9c761c1d8ada 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AzureBlobKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AzureBlobKnowledgeSourceParams.java @@ -9,6 +9,8 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import com.azure.search.documents.models.VectorQueryTopicGraph; import java.io.IOException; /** @@ -85,10 +87,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("graphParameters", this.graphParameters); + jsonWriter.writeJsonField("topicGraph", this.topicGraph); return jsonWriter.writeEndObject(); } @@ -108,10 +116,15 @@ public static AzureBlobKnowledgeSourceParams fromJson(JsonReader jsonReader) thr Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.AZURE_BLOB; + AgentRuntimeGraphParams graphParameters = null; + VectorQueryTopicGraph topicGraph = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -123,14 +136,24 @@ public static AzureBlobKnowledgeSourceParams fromJson(JsonReader jsonReader) thr includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); + } else if ("graphParameters".equals(fieldName)) { + graphParameters = AgentRuntimeGraphParams.fromJson(reader); + } else if ("topicGraph".equals(fieldName)) { + topicGraph = VectorQueryTopicGraph.fromJson(reader); } else { reader.skipChildren(); } @@ -140,10 +163,15 @@ public static AzureBlobKnowledgeSourceParams fromJson(JsonReader jsonReader) thr deserializedAzureBlobKnowledgeSourceParams.setIncludeReferences(includeReferences); deserializedAzureBlobKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); deserializedAzureBlobKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedAzureBlobKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedAzureBlobKnowledgeSourceParams.setFailOnError(failOnError); deserializedAzureBlobKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedAzureBlobKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedAzureBlobKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedAzureBlobKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedAzureBlobKnowledgeSourceParams.kind = kind; + deserializedAzureBlobKnowledgeSourceParams.graphParameters = graphParameters; + deserializedAzureBlobKnowledgeSourceParams.topicGraph = topicGraph; return deserializedAzureBlobKnowledgeSourceParams; }); } @@ -177,4 +205,95 @@ public AzureBlobKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDoc super.setMaxOutputDocuments(maxOutputDocuments); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureBlobKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureBlobKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureBlobKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } + + /* + * Graph-query visibility and source-document hydration options for a graph-enabled source. + */ + @Generated + private AgentRuntimeGraphParams graphParameters; + + /* + * Overrides the knowledge source's stored topicGraph for this retrieval. When omitted, the stored knowledge source + * value applies. + */ + @Generated + private VectorQueryTopicGraph topicGraph; + + /** + * Get the graphParameters property: Graph-query visibility and source-document hydration options for a + * graph-enabled source. + * + * @return the graphParameters value. + */ + @Generated + public AgentRuntimeGraphParams getGraphParameters() { + return this.graphParameters; + } + + /** + * Set the graphParameters property: Graph-query visibility and source-document hydration options for a + * graph-enabled source. + * + * @param graphParameters the graphParameters value to set. + * @return the AzureBlobKnowledgeSourceParams object itself. + */ + @Generated + public AzureBlobKnowledgeSourceParams setGraphParameters(AgentRuntimeGraphParams graphParameters) { + this.graphParameters = graphParameters; + return this; + } + + /** + * Get the topicGraph property: Overrides the knowledge source's stored topicGraph for this retrieval. When omitted, + * the stored knowledge source value applies. + * + * @return the topicGraph value. + */ + @Generated + public VectorQueryTopicGraph getTopicGraph() { + return this.topicGraph; + } + + /** + * Set the topicGraph property: Overrides the knowledge source's stored topicGraph for this retrieval. When omitted, + * the stored knowledge source value applies. + * + * @param topicGraph the topicGraph value to set. + * @return the AzureBlobKnowledgeSourceParams object itself. + */ + @Generated + public AzureBlobKnowledgeSourceParams setTopicGraph(VectorQueryTopicGraph topicGraph) { + this.topicGraph = topicGraph; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/CompletedSynchronizationState.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/CompletedSynchronizationState.java index c53509143c7f7..74817216ea74a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/CompletedSynchronizationState.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/CompletedSynchronizationState.java @@ -154,6 +154,7 @@ public static CompletedSynchronizationState fromJson(JsonReader jsonReader) thro int itemsUpdatesProcessed = 0; int itemsUpdatesFailed = 0; int itemsSkipped = 0; + KnowledgeSourceGraphStatistics graphStatistics = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -169,12 +170,33 @@ public static CompletedSynchronizationState fromJson(JsonReader jsonReader) thro itemsUpdatesFailed = reader.getInt(); } else if ("itemsSkipped".equals(fieldName)) { itemsSkipped = reader.getInt(); + } else if ("graphStatistics".equals(fieldName)) { + graphStatistics = KnowledgeSourceGraphStatistics.fromJson(reader); } else { reader.skipChildren(); } } - return new CompletedSynchronizationState(startTime, endTime, itemsUpdatesProcessed, itemsUpdatesFailed, - itemsSkipped); + CompletedSynchronizationState deserializedCompletedSynchronizationState = new CompletedSynchronizationState( + startTime, endTime, itemsUpdatesProcessed, itemsUpdatesFailed, itemsSkipped); + deserializedCompletedSynchronizationState.graphStatistics = graphStatistics; + return deserializedCompletedSynchronizationState; }); } + + /* + * Graph extraction statistics for this synchronization. Omitted when no graph extraction took place. + */ + @Generated + private KnowledgeSourceGraphStatistics graphStatistics; + + /** + * Get the graphStatistics property: Graph extraction statistics for this synchronization. Omitted when no graph + * extraction took place. + * + * @return the graphStatistics value. + */ + @Generated + public KnowledgeSourceGraphStatistics getGraphStatistics() { + return this.graphStatistics; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FileKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FileKnowledgeSourceParams.java index 9d01c0a6e6b85..bba81a1fc2652 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FileKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FileKnowledgeSourceParams.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import java.io.IOException; /** @@ -104,6 +105,16 @@ public FileKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocument return this; } + /** + * {@inheritDoc} + */ + @Generated + @Override + public FileKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + /** * {@inheritDoc} */ @@ -115,9 +126,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -138,9 +153,12 @@ public static FileKnowledgeSourceParams fromJson(JsonReader jsonReader) throws I Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.FILE; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -153,12 +171,18 @@ public static FileKnowledgeSourceParams fromJson(JsonReader jsonReader) throws I includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); } else { @@ -170,11 +194,34 @@ public static FileKnowledgeSourceParams fromJson(JsonReader jsonReader) throws I deserializedFileKnowledgeSourceParams.setIncludeReferences(includeReferences); deserializedFileKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); deserializedFileKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedFileKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedFileKnowledgeSourceParams.setFailOnError(failOnError); deserializedFileKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedFileKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedFileKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedFileKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedFileKnowledgeSourceParams.kind = kind; return deserializedFileKnowledgeSourceParams; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FileKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FileKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedOneLakeKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedOneLakeKnowledgeSourceParams.java index 00e337bd0957d..2a94f1ee7ef79 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedOneLakeKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedOneLakeKnowledgeSourceParams.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import java.io.IOException; /** @@ -85,9 +86,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -108,9 +113,12 @@ public static IndexedOneLakeKnowledgeSourceParams fromJson(JsonReader jsonReader Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.INDEXED_ONE_LAKE; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -123,12 +131,18 @@ public static IndexedOneLakeKnowledgeSourceParams fromJson(JsonReader jsonReader includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); } else { @@ -140,9 +154,12 @@ public static IndexedOneLakeKnowledgeSourceParams fromJson(JsonReader jsonReader deserializedIndexedOneLakeKnowledgeSourceParams.setIncludeReferences(includeReferences); deserializedIndexedOneLakeKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); deserializedIndexedOneLakeKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedIndexedOneLakeKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedIndexedOneLakeKnowledgeSourceParams.setFailOnError(failOnError); deserializedIndexedOneLakeKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedIndexedOneLakeKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedIndexedOneLakeKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedIndexedOneLakeKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedIndexedOneLakeKnowledgeSourceParams.kind = kind; return deserializedIndexedOneLakeKnowledgeSourceParams; }); @@ -177,4 +194,35 @@ public IndexedOneLakeKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutp super.setMaxOutputDocuments(maxOutputDocuments); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedOneLakeKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedOneLakeKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedOneLakeKnowledgeSourceParams + setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSharePointKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSharePointKnowledgeSourceParams.java index 71c6e0255cdc7..efc3588465869 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSharePointKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSharePointKnowledgeSourceParams.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import java.io.IOException; /** @@ -104,6 +105,16 @@ public IndexedSharePointKnowledgeSourceParams setMaxOutputDocuments(Integer maxO return this; } + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSharePointKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + /** * {@inheritDoc} */ @@ -115,9 +126,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -138,9 +153,12 @@ public static IndexedSharePointKnowledgeSourceParams fromJson(JsonReader jsonRea Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.INDEXED_SHARE_POINT; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -153,12 +171,18 @@ public static IndexedSharePointKnowledgeSourceParams fromJson(JsonReader jsonRea includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); } else { @@ -171,11 +195,35 @@ public static IndexedSharePointKnowledgeSourceParams fromJson(JsonReader jsonRea deserializedIndexedSharePointKnowledgeSourceParams .setIncludeReferenceSourceData(includeReferenceSourceData); deserializedIndexedSharePointKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedIndexedSharePointKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedIndexedSharePointKnowledgeSourceParams.setFailOnError(failOnError); deserializedIndexedSharePointKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedIndexedSharePointKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedIndexedSharePointKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedIndexedSharePointKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedIndexedSharePointKnowledgeSourceParams.kind = kind; return deserializedIndexedSharePointKnowledgeSourceParams; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSharePointKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSharePointKnowledgeSourceParams + setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSqlKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSqlKnowledgeSourceParams.java index cad3933b26c7b..8b1c635cbd8bc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSqlKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSqlKnowledgeSourceParams.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import java.io.IOException; /** @@ -104,6 +105,16 @@ public IndexedSqlKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDo return this; } + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSqlKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + /** * {@inheritDoc} */ @@ -115,9 +126,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -138,9 +153,12 @@ public static IndexedSqlKnowledgeSourceParams fromJson(JsonReader jsonReader) th Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.INDEXED_SQL; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -153,12 +171,18 @@ public static IndexedSqlKnowledgeSourceParams fromJson(JsonReader jsonReader) th includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); } else { @@ -170,11 +194,34 @@ public static IndexedSqlKnowledgeSourceParams fromJson(JsonReader jsonReader) th deserializedIndexedSqlKnowledgeSourceParams.setIncludeReferences(includeReferences); deserializedIndexedSqlKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); deserializedIndexedSqlKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedIndexedSqlKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedIndexedSqlKnowledgeSourceParams.setFailOnError(failOnError); deserializedIndexedSqlKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedIndexedSqlKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedIndexedSqlKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedIndexedSqlKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedIndexedSqlKnowledgeSourceParams.kind = kind; return deserializedIndexedSqlKnowledgeSourceParams; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSqlKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSqlKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityCompletedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityCompletedStreamEvent.java index 6094ad98ac9cb..e14d2d3b6354c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityCompletedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityCompletedStreamEvent.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java index 7b5f32046f94e..8cd8a2057a049 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java @@ -168,7 +168,9 @@ public static KnowledgeBaseActivityRecord fromJson(JsonReader jsonReader) throws } } // Use the discriminator value to determine which subtype should be deserialized. - if ("searchIndex".equals(discriminatorValue)) { + if ("graphSearch".equals(discriminatorValue)) { + return KnowledgeBaseGraphSearchActivityRecord.fromJson(readerToUse.reset()); + } else if ("searchIndex".equals(discriminatorValue)) { return KnowledgeBaseSearchIndexActivityRecord.fromJson(readerToUse.reset()); } else if ("azureBlob".equals(discriminatorValue)) { return KnowledgeBaseAzureBlobActivityRecord.fromJson(readerToUse.reset()); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java index 689780f447b26..4a10e7db42ede 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java @@ -108,4 +108,10 @@ public static Collection values() { */ @Generated public static final KnowledgeBaseActivityRecordType INDEXED_SQL = fromString("indexedSql"); + + /** + * Graph retrieval over a graph-enabled knowledge source. + */ + @Generated + public static final KnowledgeBaseActivityRecordType GRAPH_SEARCH = fromString("graphSearch"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedStreamEvent.java index fb8e412e16db2..b833357b45650 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedStreamEvent.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedStreamEvent.java index 936804251290c..cfa2df3704a8b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedStreamEvent.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java index 4f552b8681fac..efc0394f15c75 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java @@ -1,18 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents the {@code error} knowledge base retrieval stream event. - * Access the typed payload with {@link #getValue()}. - * - * @see KnowledgeBaseRetrievalStreamEvent */ @Immutable -public final class KnowledgeBaseErrorStreamEvent extends KnowledgeBaseRetrievalStreamEvent { +public final class KnowledgeBaseErrorStreamEvent extends KnowledgeBaseRetrievalStreamEvent + implements JsonSerializable { @Generated private final KnowledgeBaseStreamErrorEvent value; @@ -23,7 +26,7 @@ public final class KnowledgeBaseErrorStreamEvent extends KnowledgeBaseRetrievalS * @param value The event payload. */ @Generated - KnowledgeBaseErrorStreamEvent(KnowledgeBaseStreamErrorEvent value) { + public KnowledgeBaseErrorStreamEvent(KnowledgeBaseStreamErrorEvent value) { super("error"); this.value = value; } @@ -38,6 +41,24 @@ public KnowledgeBaseStreamErrorEvent getValue() { return value; } + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return value.toJson(jsonWriter); + } + + /** + * Reads an event wrapper from JSON. + * + * @param jsonReader The reader to read from. + * @return The parsed event wrapper. + * @throws IOException If the event payload cannot be read. + */ + @Generated + public static KnowledgeBaseErrorStreamEvent fromJson(JsonReader jsonReader) throws IOException { + return new KnowledgeBaseErrorStreamEvent(KnowledgeBaseStreamErrorEvent.fromJson(jsonReader)); + } + @Generated @Override public boolean isTerminal() { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityArguments.java new file mode 100644 index 0000000000000..a327215f1040d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityArguments.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Natural-language graph request, generated-query visibility, and model usage for an activity. + */ +@Immutable +public final class KnowledgeBaseGraphSearchActivityArguments + implements JsonSerializable { + + /* + * Natural-language query submitted to graph retrieval for this activity. + */ + @Generated + private String naturalLanguageQuery; + + /* + * Graph index queried by this activity. + */ + @Generated + private String graphIndexName; + + /* + * Generated GQL, returned only when graphParameters.includeQuery is true. + */ + @Generated + private String gql; + + /* + * Reported outcome of the graph query loop, such as Success. + */ + @Generated + private String outcome; + + /* + * Query generation/execution attempts made by the graph loop. + */ + @Generated + private Integer attempts; + + /* + * Input tokens consumed by graph query generation. + */ + @Generated + private Integer inputTokens; + + /* + * Output tokens consumed by graph query generation. + */ + @Generated + private Integer outputTokens; + + /* + * Elapsed graph model-call time in milliseconds. + */ + @Generated + private Long modelElapsedMs; + + /* + * Model name reported for graph query generation. + */ + @Generated + private String modelName; + + /** + * Creates an instance of KnowledgeBaseGraphSearchActivityArguments class. + */ + @Generated + private KnowledgeBaseGraphSearchActivityArguments() { + } + + /** + * Get the naturalLanguageQuery property: Natural-language query submitted to graph retrieval for this activity. + * + * @return the naturalLanguageQuery value. + */ + @Generated + public String getNaturalLanguageQuery() { + return this.naturalLanguageQuery; + } + + /** + * Get the graphIndexName property: Graph index queried by this activity. + * + * @return the graphIndexName value. + */ + @Generated + public String getGraphIndexName() { + return this.graphIndexName; + } + + /** + * Get the gql property: Generated GQL, returned only when graphParameters.includeQuery is true. + * + * @return the gql value. + */ + @Generated + public String getGql() { + return this.gql; + } + + /** + * Get the outcome property: Reported outcome of the graph query loop, such as Success. + * + * @return the outcome value. + */ + @Generated + public String getOutcome() { + return this.outcome; + } + + /** + * Get the attempts property: Query generation/execution attempts made by the graph loop. + * + * @return the attempts value. + */ + @Generated + public Integer getAttempts() { + return this.attempts; + } + + /** + * Get the inputTokens property: Input tokens consumed by graph query generation. + * + * @return the inputTokens value. + */ + @Generated + public Integer getInputTokens() { + return this.inputTokens; + } + + /** + * Get the outputTokens property: Output tokens consumed by graph query generation. + * + * @return the outputTokens value. + */ + @Generated + public Integer getOutputTokens() { + return this.outputTokens; + } + + /** + * Get the modelElapsedMs property: Elapsed graph model-call time in milliseconds. + * + * @return the modelElapsedMs value. + */ + @Generated + public Long getModelElapsedMs() { + return this.modelElapsedMs; + } + + /** + * Get the modelName property: Model name reported for graph query generation. + * + * @return the modelName value. + */ + @Generated + public String getModelName() { + return this.modelName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("naturalLanguageQuery", this.naturalLanguageQuery); + jsonWriter.writeStringField("graphIndexName", this.graphIndexName); + jsonWriter.writeStringField("gql", this.gql); + jsonWriter.writeStringField("outcome", this.outcome); + jsonWriter.writeNumberField("attempts", this.attempts); + jsonWriter.writeNumberField("inputTokens", this.inputTokens); + jsonWriter.writeNumberField("outputTokens", this.outputTokens); + jsonWriter.writeNumberField("modelElapsedMs", this.modelElapsedMs); + jsonWriter.writeStringField("modelName", this.modelName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseGraphSearchActivityArguments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseGraphSearchActivityArguments if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseGraphSearchActivityArguments. + */ + @Generated + public static KnowledgeBaseGraphSearchActivityArguments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseGraphSearchActivityArguments deserializedKnowledgeBaseGraphSearchActivityArguments + = new KnowledgeBaseGraphSearchActivityArguments(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("naturalLanguageQuery".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.naturalLanguageQuery = reader.getString(); + } else if ("graphIndexName".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.graphIndexName = reader.getString(); + } else if ("gql".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.gql = reader.getString(); + } else if ("outcome".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.outcome = reader.getString(); + } else if ("attempts".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.attempts + = reader.getNullable(JsonReader::getInt); + } else if ("inputTokens".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.inputTokens + = reader.getNullable(JsonReader::getInt); + } else if ("outputTokens".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.outputTokens + = reader.getNullable(JsonReader::getInt); + } else if ("modelElapsedMs".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.modelElapsedMs + = reader.getNullable(JsonReader::getLong); + } else if ("modelName".equals(fieldName)) { + deserializedKnowledgeBaseGraphSearchActivityArguments.modelName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseGraphSearchActivityArguments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityRecord.java new file mode 100644 index 0000000000000..22eea26e1f820 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityRecord.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * A graph retrieval activity over an existing graph-enabled knowledge source. + */ +@Immutable +public final class KnowledgeBaseGraphSearchActivityRecord extends KnowledgeBaseActivityRecord { + + /* + * The type of the activity record. + */ + @Generated + private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.GRAPH_SEARCH; + + /* + * The knowledge source for the retrieval activity. + */ + @Generated + private String knowledgeSourceName; + + /* + * The query time for this retrieval activity. + */ + @Generated + private OffsetDateTime queryTime; + + /* + * The count of documents retrieved that were sufficiently relevant to pass the reranker threshold. + */ + @Generated + private Integer count; + + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + + /* + * Graph query generation and execution details for this activity. + */ + @Generated + private KnowledgeBaseGraphSearchActivityArguments graphSearchArguments; + + /** + * Creates an instance of KnowledgeBaseGraphSearchActivityRecord class. + * + * @param id the id value to set. + */ + @Generated + private KnowledgeBaseGraphSearchActivityRecord(int id) { + super(id); + } + + /** + * Get the type property: The type of the activity record. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseActivityRecordType getType() { + return this.type; + } + + /** + * Get the knowledgeSourceName property: The knowledge source for the retrieval activity. + * + * @return the knowledgeSourceName value. + */ + @Generated + public String getKnowledgeSourceName() { + return this.knowledgeSourceName; + } + + /** + * Get the queryTime property: The query time for this retrieval activity. + * + * @return the queryTime value. + */ + @Generated + public OffsetDateTime getQueryTime() { + return this.queryTime; + } + + /** + * Get the count property: The count of documents retrieved that were sufficiently relevant to pass the reranker + * threshold. + * + * @return the count value. + */ + @Generated + public Integer getCount() { + return this.count; + } + + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + + /** + * Get the graphSearchArguments property: Graph query generation and execution details for this activity. + * + * @return the graphSearchArguments value. + */ + @Generated + public KnowledgeBaseGraphSearchActivityArguments getGraphSearchArguments() { + return this.graphSearchArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", getId()); + jsonWriter.writeStringField("startedAt", + getStartedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getStartedAt())); + jsonWriter.writeStringField("completedAt", + getCompletedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCompletedAt())); + jsonWriter.writeNumberField("elapsedMs", getElapsedMs()); + jsonWriter.writeJsonField("error", getError()); + jsonWriter.writeStringField("warning", getWarning()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("knowledgeSourceName", this.knowledgeSourceName); + jsonWriter.writeStringField("queryTime", + this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); + jsonWriter.writeJsonField("graphSearchArguments", this.graphSearchArguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseGraphSearchActivityRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseGraphSearchActivityRecord if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseGraphSearchActivityRecord. + */ + @Generated + public static KnowledgeBaseGraphSearchActivityRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int id = 0; + OffsetDateTime startedAt = null; + OffsetDateTime completedAt = null; + Integer elapsedMs = null; + KnowledgeBaseErrorDetail error = null; + String warning = null; + KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.GRAPH_SEARCH; + String knowledgeSourceName = null; + OffsetDateTime queryTime = null; + Integer count = null; + ImageServingStatistics imageServing = null; + KnowledgeBaseGraphSearchActivityArguments graphSearchArguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getInt(); + } else if ("startedAt".equals(fieldName)) { + startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("elapsedMs".equals(fieldName)) { + elapsedMs = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + error = KnowledgeBaseErrorDetail.fromJson(reader); + } else if ("warning".equals(fieldName)) { + warning = reader.getString(); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); + } else if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("queryTime".equals(fieldName)) { + queryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); + } else if ("graphSearchArguments".equals(fieldName)) { + graphSearchArguments = KnowledgeBaseGraphSearchActivityArguments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseGraphSearchActivityRecord deserializedKnowledgeBaseGraphSearchActivityRecord + = new KnowledgeBaseGraphSearchActivityRecord(id); + deserializedKnowledgeBaseGraphSearchActivityRecord.setStartedAt(startedAt); + deserializedKnowledgeBaseGraphSearchActivityRecord.setCompletedAt(completedAt); + deserializedKnowledgeBaseGraphSearchActivityRecord.setElapsedMs(elapsedMs); + deserializedKnowledgeBaseGraphSearchActivityRecord.setError(error); + deserializedKnowledgeBaseGraphSearchActivityRecord.setWarning(warning); + deserializedKnowledgeBaseGraphSearchActivityRecord.type = type; + deserializedKnowledgeBaseGraphSearchActivityRecord.knowledgeSourceName = knowledgeSourceName; + deserializedKnowledgeBaseGraphSearchActivityRecord.queryTime = queryTime; + deserializedKnowledgeBaseGraphSearchActivityRecord.count = count; + deserializedKnowledgeBaseGraphSearchActivityRecord.imageServing = imageServing; + deserializedKnowledgeBaseGraphSearchActivityRecord.graphSearchArguments = graphSearchArguments; + return deserializedKnowledgeBaseGraphSearchActivityRecord; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchReference.java new file mode 100644 index 0000000000000..e79d1f97f8225 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchReference.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A graph result or a hydrated source document returned by graph-based knowledge retrieval. + */ +@Immutable +public final class KnowledgeBaseGraphSearchReference extends KnowledgeBaseReference { + + /* + * The type of the reference. + */ + @Generated + private KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.GRAPH_SEARCH; + + /* + * Graph index that produced the result or source-document evidence. + */ + @Generated + private String graphIndexName; + + /** + * Creates an instance of KnowledgeBaseGraphSearchReference class. + * + * @param id the id value to set. + * @param activitySource the activitySource value to set. + */ + @Generated + private KnowledgeBaseGraphSearchReference(String id, int activitySource) { + super(id, activitySource); + } + + /** + * Get the type property: The type of the reference. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseReferenceType getType() { + return this.type; + } + + /** + * Get the graphIndexName property: Graph index that produced the result or source-document evidence. + * + * @return the graphIndexName value. + */ + @Generated + public String getGraphIndexName() { + return this.graphIndexName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeIntField("activitySource", getActivitySource()); + jsonWriter.writeMapField("sourceData", getSourceData(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("graphIndexName", this.graphIndexName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseGraphSearchReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseGraphSearchReference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseGraphSearchReference. + */ + @Generated + public static KnowledgeBaseGraphSearchReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int activitySource = 0; + Map sourceData = null; + Float rerankerScore = null; + KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.GRAPH_SEARCH; + String graphIndexName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("activitySource".equals(fieldName)) { + activitySource = reader.getInt(); + } else if ("sourceData".equals(fieldName)) { + sourceData = reader.readMap(reader1 -> reader1.readUntyped()); + } else if ("rerankerScore".equals(fieldName)) { + rerankerScore = reader.getNullable(JsonReader::getFloat); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseReferenceType.fromString(reader.getString()); + } else if ("graphIndexName".equals(fieldName)) { + graphIndexName = reader.getString(); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseGraphSearchReference deserializedKnowledgeBaseGraphSearchReference + = new KnowledgeBaseGraphSearchReference(id, activitySource); + deserializedKnowledgeBaseGraphSearchReference.setSourceData(sourceData); + deserializedKnowledgeBaseGraphSearchReference.setRerankerScore(rerankerScore); + deserializedKnowledgeBaseGraphSearchReference.type = type; + deserializedKnowledgeBaseGraphSearchReference.graphIndexName = graphIndexName; + return deserializedKnowledgeBaseGraphSearchReference; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java index aeec88f3710af..eb0d338156d2c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java @@ -176,7 +176,9 @@ public static KnowledgeBaseReference fromJson(JsonReader jsonReader) throws IOEx } } // Use the discriminator value to determine which subtype should be deserialized. - if ("searchIndex".equals(discriminatorValue)) { + if ("graphSearch".equals(discriminatorValue)) { + return KnowledgeBaseGraphSearchReference.fromJson(readerToUse.reset()); + } else if ("searchIndex".equals(discriminatorValue)) { return KnowledgeBaseSearchIndexReference.fromJson(readerToUse.reset()); } else if ("azureBlob".equals(discriminatorValue)) { return KnowledgeBaseAzureBlobReference.fromJson(readerToUse.reset()); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java index cb00d087b21bf..f79b3b582b7e4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java @@ -84,4 +84,10 @@ public static Collection values() { */ @Generated public static final KnowledgeBaseReferenceType INDEXED_SQL = fromString("indexedSql"); + + /** + * Graph result or hydrated graph-source document reference. + */ + @Generated + public static final KnowledgeBaseReferenceType GRAPH_SEARCH = fromString("graphSearch"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferencesCompletedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferencesCompletedStreamEvent.java index 4ba6e51a0815c..cdf707ac044f0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferencesCompletedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferencesCompletedStreamEvent.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java index 438c3bc039694..89fc3d5d820fd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java @@ -1,18 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Represents the {@code response.completed} knowledge base retrieval stream event. - * Access the typed payload with {@link #getValue()}. - * - * @see KnowledgeBaseRetrievalStreamEvent */ @Immutable -public final class KnowledgeBaseResponseCompletedStreamEvent extends KnowledgeBaseRetrievalStreamEvent { +public final class KnowledgeBaseResponseCompletedStreamEvent extends KnowledgeBaseRetrievalStreamEvent + implements JsonSerializable { @Generated private final KnowledgeBaseResponseCompletedEvent value; @@ -23,7 +26,7 @@ public final class KnowledgeBaseResponseCompletedStreamEvent extends KnowledgeBa * @param value The event payload. */ @Generated - KnowledgeBaseResponseCompletedStreamEvent(KnowledgeBaseResponseCompletedEvent value) { + public KnowledgeBaseResponseCompletedStreamEvent(KnowledgeBaseResponseCompletedEvent value) { super("response.completed"); this.value = value; } @@ -38,6 +41,24 @@ public KnowledgeBaseResponseCompletedEvent getValue() { return value; } + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return value.toJson(jsonWriter); + } + + /** + * Reads an event wrapper from JSON. + * + * @param jsonReader The reader to read from. + * @return The parsed event wrapper. + * @throws IOException If the event payload cannot be read. + */ + @Generated + public static KnowledgeBaseResponseCompletedStreamEvent fromJson(JsonReader jsonReader) throws IOException { + return new KnowledgeBaseResponseCompletedStreamEvent(KnowledgeBaseResponseCompletedEvent.fromJson(jsonReader)); + } + @Generated @Override public boolean isTerminal() { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java index 36dd9d6a66606..d4d0be44922bd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java @@ -187,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("messages", this.messages, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("intents", this.intents, (writer, element) -> writer.writeJson(element)); jsonWriter.writeNumberField("maxRuntimeInSeconds", this.maxRuntimeInSeconds); + jsonWriter.writeNumberField("maxOutputSize", this.maxOutputSize); jsonWriter.writeNumberField("maxOutputDocuments", this.maxOutputDocuments); jsonWriter.writeNumberField("maxOutputSizeInTokens", this.maxOutputSizeInTokens); jsonWriter.writeJsonField("retrievalReasoningEffort", this.retrievalReasoningEffort); @@ -194,6 +195,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("outputMode", this.outputMode == null ? null : this.outputMode.toString()); jsonWriter.writeArrayField("knowledgeSourceParams", this.knowledgeSourceParams, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("toolName", this.toolName); return jsonWriter.writeEndObject(); } @@ -224,6 +226,8 @@ public static KnowledgeBaseRetrievalOptions fromJson(JsonReader jsonReader) thro } else if ("maxRuntimeInSeconds".equals(fieldName)) { deserializedKnowledgeBaseRetrievalOptions.maxRuntimeInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("maxOutputSize".equals(fieldName)) { + deserializedKnowledgeBaseRetrievalOptions.maxOutputSize = reader.getNullable(JsonReader::getInt); } else if ("maxOutputDocuments".equals(fieldName)) { deserializedKnowledgeBaseRetrievalOptions.maxOutputDocuments = reader.getNullable(JsonReader::getInt); @@ -243,6 +247,8 @@ public static KnowledgeBaseRetrievalOptions fromJson(JsonReader jsonReader) thro List knowledgeSourceParams = reader.readArray(reader1 -> KnowledgeSourceParams.fromJson(reader1)); deserializedKnowledgeBaseRetrievalOptions.knowledgeSourceParams = knowledgeSourceParams; + } else if ("toolName".equals(fieldName)) { + deserializedKnowledgeBaseRetrievalOptions.toolName = reader.getString(); } else { reader.skipChildren(); } @@ -257,6 +263,12 @@ public static KnowledgeBaseRetrievalOptions fromJson(JsonReader jsonReader) thro @Generated private List messages; + /* + * Limits the maximum size of the content in the output. + */ + @Generated + private Integer maxOutputSize; + /* * Limits the maximum number of documents in the output. */ @@ -297,6 +309,28 @@ public KnowledgeBaseRetrievalOptions setMessages(List mess return this; } + /** + * Get the maxOutputSize property: Limits the maximum size of the content in the output. + * + * @return the maxOutputSize value. + */ + @Generated + public Integer getMaxOutputSize() { + return this.maxOutputSize; + } + + /** + * Set the maxOutputSize property: Limits the maximum size of the content in the output. + * + * @param maxOutputSize the maxOutputSize value to set. + * @return the KnowledgeBaseRetrievalOptions object itself. + */ + @Generated + public KnowledgeBaseRetrievalOptions setMaxOutputSize(Integer maxOutputSize) { + this.maxOutputSize = maxOutputSize; + return this; + } + /** * Get the maxOutputDocuments property: Limits the maximum number of documents in the output. * @@ -364,36 +398,31 @@ public KnowledgeBaseRetrievalOptions setOutputMode(KnowledgeRetrievalOutputMode return this; } - /** - * Token identifying the user for which the query is being executed. Client-only value that is sent as the - * x-ms-query-source-authorization header and is never serialized into the request body. + /* + * The tool to select. Omit for KB-wide retrieval. */ - private String querySourceAuthorization; + @Generated + private String toolName; /** - * Get the querySourceAuthorization property: Token identifying the user for which the query is being executed. This - * token is used to enforce security restrictions on documents. It is only sent as the - * x-ms-query-source-authorization request header and is never part of the request body. A non-null authorization - * passed explicitly to a retrieve method overrides this value; a null explicit authorization falls back to it. + * Get the toolName property: The tool to select. Omit for KB-wide retrieval. * - * @return the querySourceAuthorization value. + * @return the toolName value. */ - public String getQuerySourceAuthorization() { - return this.querySourceAuthorization; + @Generated + public String getToolName() { + return this.toolName; } /** - * Set the querySourceAuthorization property: Token identifying the user for which the query is being executed. This - * token is used to enforce security restrictions on documents. It is only sent as the - * x-ms-query-source-authorization request header and is never part of the request body. A non-null authorization - * passed explicitly to a retrieve method overrides this value; a null explicit authorization falls back to it. An - * empty string is treated as a value. + * Set the toolName property: The tool to select. Omit for KB-wide retrieval. * - * @param querySourceAuthorization the querySourceAuthorization value to set. + * @param toolName the toolName value to set. * @return the KnowledgeBaseRetrievalOptions object itself. */ - public KnowledgeBaseRetrievalOptions setQuerySourceAuthorization(String querySourceAuthorization) { - this.querySourceAuthorization = querySourceAuthorization; + @Generated + public KnowledgeBaseRetrievalOptions setToolName(String toolName) { + this.toolName = toolName; return this; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedStreamEvent.java index a47db8de65ebf..0f37eba65b071 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedStreamEvent.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStreamEvent.java index 41a8838398b71..36d1b265de354 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStreamEvent.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.knowledgebases.models; import com.azure.core.annotation.Generated; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceCache.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceCache.java new file mode 100644 index 0000000000000..2c6dc2eeebd91 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceCache.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.SearchIndexerDataIdentity; +import java.io.IOException; + +/** + * Configures storage for cached knowledge source enrichment results. Requires a GPv2 storage account with Blob and + * Table endpoints. The cache storage binding and identity cannot be changed after creation, and the cache cannot be + * removed while using the graph extraction workflow. + */ +@Fluent +public final class KnowledgeSourceCache implements JsonSerializable { + + /* + * The connection string to the storage account where cached enrichment results are persisted. + */ + @Generated + private final String storageConnectionString; + + /* + * Whether cached enrichment results can be reprocessed when the enrichment configuration changes. Must be true for + * graph extraction cache replay. + */ + @Generated + private Boolean enableReprocessing; + + /* + * The managed identity used to connect to the enrichment cache. If omitted for a ResourceId connection string, the + * system-assigned managed identity is used. The identity cannot be changed after the cache is configured. + */ + @Generated + private SearchIndexerDataIdentity identity; + + /** + * Creates an instance of KnowledgeSourceCache class. + * + * @param storageConnectionString the storageConnectionString value to set. + */ + @Generated + public KnowledgeSourceCache(String storageConnectionString) { + this.storageConnectionString = storageConnectionString; + } + + /** + * Get the storageConnectionString property: The connection string to the storage account where cached enrichment + * results are persisted. + * + * @return the storageConnectionString value. + */ + @Generated + public String getStorageConnectionString() { + return this.storageConnectionString; + } + + /** + * Get the enableReprocessing property: Whether cached enrichment results can be reprocessed when the enrichment + * configuration changes. Must be true for graph extraction cache replay. + * + * @return the enableReprocessing value. + */ + @Generated + public Boolean isEnableReprocessing() { + return this.enableReprocessing; + } + + /** + * Set the enableReprocessing property: Whether cached enrichment results can be reprocessed when the enrichment + * configuration changes. Must be true for graph extraction cache replay. + * + * @param enableReprocessing the enableReprocessing value to set. + * @return the KnowledgeSourceCache object itself. + */ + @Generated + public KnowledgeSourceCache setEnableReprocessing(Boolean enableReprocessing) { + this.enableReprocessing = enableReprocessing; + return this; + } + + /** + * Get the identity property: The managed identity used to connect to the enrichment cache. If omitted for a + * ResourceId connection string, the system-assigned managed identity is used. The identity cannot be changed after + * the cache is configured. + * + * @return the identity value. + */ + @Generated + public SearchIndexerDataIdentity getIdentity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity used to connect to the enrichment cache. If omitted for a + * ResourceId connection string, the system-assigned managed identity is used. The identity cannot be changed after + * the cache is configured. + * + * @param identity the identity value to set. + * @return the KnowledgeSourceCache object itself. + */ + @Generated + public KnowledgeSourceCache setIdentity(SearchIndexerDataIdentity identity) { + this.identity = identity; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageConnectionString", this.storageConnectionString); + jsonWriter.writeBooleanField("enableReprocessing", this.enableReprocessing); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceCache from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceCache if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceCache. + */ + @Generated + public static KnowledgeSourceCache fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String storageConnectionString = null; + Boolean enableReprocessing = null; + SearchIndexerDataIdentity identity = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("storageConnectionString".equals(fieldName)) { + storageConnectionString = reader.getString(); + } else if ("enableReprocessing".equals(fieldName)) { + enableReprocessing = reader.getNullable(JsonReader::getBoolean); + } else if ("identity".equals(fieldName)) { + identity = SearchIndexerDataIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeSourceCache deserializedKnowledgeSourceCache = new KnowledgeSourceCache(storageConnectionString); + deserializedKnowledgeSourceCache.enableReprocessing = enableReprocessing; + deserializedKnowledgeSourceCache.identity = identity; + return deserializedKnowledgeSourceCache; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphProvenanceKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphProvenanceKind.java new file mode 100644 index 0000000000000..999f3b247b18e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphProvenanceKind.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Source-document behavior for graph-based knowledge retrieval. + */ +public final class KnowledgeSourceGraphProvenanceKind extends ExpandableStringEnum { + + /** + * Return graph results without hydrating their source documents. + */ + @Generated + public static final KnowledgeSourceGraphProvenanceKind NONE = fromString("none"); + + /** + * Also return selected source documents from the configured provenance index. + */ + @Generated + public static final KnowledgeSourceGraphProvenanceKind HYDRATE = fromString("hydrate"); + + /** + * Creates a new instance of KnowledgeSourceGraphProvenanceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public KnowledgeSourceGraphProvenanceKind() { + } + + /** + * Creates or finds a KnowledgeSourceGraphProvenanceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnowledgeSourceGraphProvenanceKind. + */ + @Generated + public static KnowledgeSourceGraphProvenanceKind fromString(String name) { + return fromString(name, KnowledgeSourceGraphProvenanceKind.class); + } + + /** + * Gets known KnowledgeSourceGraphProvenanceKind values. + * + * @return known KnowledgeSourceGraphProvenanceKind values. + */ + @Generated + public static Collection values() { + return values(KnowledgeSourceGraphProvenanceKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphStatistics.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphStatistics.java new file mode 100644 index 0000000000000..e672756ed3a8b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphStatistics.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Graph extraction statistics for a knowledge source synchronization. + */ +@Immutable +public final class KnowledgeSourceGraphStatistics implements JsonSerializable { + + /* + * The ontology name, when applicable. + */ + @Generated + private String ontologyName; + + /* + * The number of graph records successfully written during this synchronization, excluding repeated delivery of the + * same logical output. This is not the total graph index size. + */ + @Generated + private long triplesWritten; + + /** + * Creates an instance of KnowledgeSourceGraphStatistics class. + */ + @Generated + private KnowledgeSourceGraphStatistics() { + } + + /** + * Get the ontologyName property: The ontology name, when applicable. + * + * @return the ontologyName value. + */ + @Generated + public String getOntologyName() { + return this.ontologyName; + } + + /** + * Get the triplesWritten property: The number of graph records successfully written during this synchronization, + * excluding repeated delivery of the same logical output. This is not the total graph index size. + * + * @return the triplesWritten value. + */ + @Generated + public long getTriplesWritten() { + return this.triplesWritten; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceGraphStatistics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceGraphStatistics if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceGraphStatistics. + */ + @Generated + public static KnowledgeSourceGraphStatistics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeSourceGraphStatistics deserializedKnowledgeSourceGraphStatistics + = new KnowledgeSourceGraphStatistics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("triplesWritten".equals(fieldName)) { + deserializedKnowledgeSourceGraphStatistics.triplesWritten = reader.getLong(); + } else if ("ontologyName".equals(fieldName)) { + deserializedKnowledgeSourceGraphStatistics.ontologyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeSourceGraphStatistics; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java index 5b061fa0c9c20..46b26dd7456eb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java @@ -269,6 +269,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("aiServices", this.aiServices); jsonWriter.writeStringField("networkAccessMode", this.networkAccessMode == null ? null : this.networkAccessMode.toString()); + jsonWriter.writeJsonField("cache", this.cache); return jsonWriter.writeEndObject(); } @@ -316,6 +317,8 @@ public static KnowledgeSourceIngestionParameters fromJson(JsonReader jsonReader) } else if ("networkAccessMode".equals(fieldName)) { deserializedKnowledgeSourceIngestionParameters.networkAccessMode = KnowledgeSourceNetworkAccessMode.fromString(reader.getString()); + } else if ("cache".equals(fieldName)) { + deserializedKnowledgeSourceIngestionParameters.cache = KnowledgeSourceCache.fromJson(reader); } else { reader.skipChildren(); } @@ -385,4 +388,38 @@ public KnowledgeSourceIngestionParameters setNetworkAccessMode(KnowledgeSourceNe this.networkAccessMode = networkAccessMode; return this; } + + /* + * Enrichment cache configuration for Azure Blob graph extraction. Requires a GPv2 storage account with Blob and + * Table endpoints and reprocessing enabled. Once configured, the cache cannot be removed or its storage binding or + * identity changed. + */ + @Generated + private KnowledgeSourceCache cache; + + /** + * Get the cache property: Enrichment cache configuration for Azure Blob graph extraction. Requires a GPv2 storage + * account with Blob and Table endpoints and reprocessing enabled. Once configured, the cache cannot be removed or + * its storage binding or identity changed. + * + * @return the cache value. + */ + @Generated + public KnowledgeSourceCache getCache() { + return this.cache; + } + + /** + * Set the cache property: Enrichment cache configuration for Azure Blob graph extraction. Requires a GPv2 storage + * account with Blob and Table endpoints and reprocessing enabled. Once configured, the cache cannot be removed or + * its storage binding or identity changed. + * + * @param cache the cache value to set. + * @return the KnowledgeSourceIngestionParameters object itself. + */ + @Generated + public KnowledgeSourceIngestionParameters setCache(KnowledgeSourceCache cache) { + this.cache = cache; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceOpenAICompatibleVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceOpenAICompatibleVectorizer.java new file mode 100644 index 0000000000000..d22f04020b06a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceOpenAICompatibleVectorizer.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.OpenAICompatibleVectorizerParameters; +import com.azure.search.documents.indexes.models.VectorSearchVectorizerKind; +import java.io.IOException; + +/** + * An OpenAI-compatible embeddings endpoint used for managed knowledge source ingestion and generated query + * vectorization. Changing from a native embedding model requires recreating the knowledge source and indexing it again. + * The URI, modelName, and dimensions cannot be changed after creation. + */ +@Immutable +public final class KnowledgeSourceOpenAICompatibleVectorizer extends KnowledgeSourceVectorizer { + + /* + * The name of the kind of vectorization method being configured for use with vector search. + */ + @Generated + private VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.OPEN_AICOMPATIBLE; + + /* + * Connection, authentication, and embedding profile parameters. + */ + @Generated + private final OpenAICompatibleVectorizerParameters openAICompatibleParameters; + + /** + * Creates an instance of KnowledgeSourceOpenAICompatibleVectorizer class. + * + * @param openAICompatibleParameters the openAICompatibleParameters value to set. + */ + @Generated + public KnowledgeSourceOpenAICompatibleVectorizer(OpenAICompatibleVectorizerParameters openAICompatibleParameters) { + this.openAICompatibleParameters = openAICompatibleParameters; + } + + /** + * Get the kind property: The name of the kind of vectorization method being configured for use with vector search. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchVectorizerKind getKind() { + return this.kind; + } + + /** + * Get the openAICompatibleParameters property: Connection, authentication, and embedding profile parameters. + * + * @return the openAICompatibleParameters value. + */ + @Generated + public OpenAICompatibleVectorizerParameters getOpenAICompatibleParameters() { + return this.openAICompatibleParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("openAICompatibleParameters", this.openAICompatibleParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeSourceOpenAICompatibleVectorizer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeSourceOpenAICompatibleVectorizer if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeSourceOpenAICompatibleVectorizer. + */ + @Generated + public static KnowledgeSourceOpenAICompatibleVectorizer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenAICompatibleVectorizerParameters openAICompatibleParameters = null; + VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.OPEN_AICOMPATIBLE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("openAICompatibleParameters".equals(fieldName)) { + openAICompatibleParameters = OpenAICompatibleVectorizerParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = VectorSearchVectorizerKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + KnowledgeSourceOpenAICompatibleVectorizer deserializedKnowledgeSourceOpenAICompatibleVectorizer + = new KnowledgeSourceOpenAICompatibleVectorizer(openAICompatibleParameters); + deserializedKnowledgeSourceOpenAICompatibleVectorizer.kind = kind; + return deserializedKnowledgeSourceOpenAICompatibleVectorizer; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceVectorizer.java index fc74417ba172d..1fa668c0a4b63 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceVectorizer.java @@ -78,7 +78,9 @@ public static KnowledgeSourceVectorizer fromJson(JsonReader jsonReader) throws I } } // Use the discriminator value to determine which subtype should be deserialized. - if ("azureOpenAI".equals(discriminatorValue)) { + if ("openAICompatible".equals(discriminatorValue)) { + return KnowledgeSourceOpenAICompatibleVectorizer.fromJson(readerToUse.reset()); + } else if ("azureOpenAI".equals(discriminatorValue)) { return KnowledgeSourceAzureOpenAIVectorizer.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SearchIndexKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SearchIndexKnowledgeSourceParams.java index 614682b1d3055..ba67aa246933f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SearchIndexKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SearchIndexKnowledgeSourceParams.java @@ -9,6 +9,9 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints; +import com.azure.search.documents.models.VectorQueryTopicGraph; import java.io.IOException; /** @@ -113,11 +116,17 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeStringField("filterAddOn", this.filterAddOn); + jsonWriter.writeJsonField("queryHintOverrides", this.queryHintOverrides); + jsonWriter.writeJsonField("topicGraph", this.topicGraph); return jsonWriter.writeEndObject(); } @@ -137,11 +146,16 @@ public static SearchIndexKnowledgeSourceParams fromJson(JsonReader jsonReader) t Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.SEARCH_INDEX; String filterAddOn = null; + SearchIndexKnowledgeSourceQueryHints queryHintOverrides = null; + VectorQueryTopicGraph topicGraph = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -153,16 +167,26 @@ public static SearchIndexKnowledgeSourceParams fromJson(JsonReader jsonReader) t includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); } else if ("filterAddOn".equals(fieldName)) { filterAddOn = reader.getString(); + } else if ("queryHintOverrides".equals(fieldName)) { + queryHintOverrides = SearchIndexKnowledgeSourceQueryHints.fromJson(reader); + } else if ("topicGraph".equals(fieldName)) { + topicGraph = VectorQueryTopicGraph.fromJson(reader); } else { reader.skipChildren(); } @@ -172,11 +196,16 @@ public static SearchIndexKnowledgeSourceParams fromJson(JsonReader jsonReader) t deserializedSearchIndexKnowledgeSourceParams.setIncludeReferences(includeReferences); deserializedSearchIndexKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); deserializedSearchIndexKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedSearchIndexKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedSearchIndexKnowledgeSourceParams.setFailOnError(failOnError); deserializedSearchIndexKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedSearchIndexKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedSearchIndexKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedSearchIndexKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedSearchIndexKnowledgeSourceParams.kind = kind; deserializedSearchIndexKnowledgeSourceParams.filterAddOn = filterAddOn; + deserializedSearchIndexKnowledgeSourceParams.queryHintOverrides = queryHintOverrides; + deserializedSearchIndexKnowledgeSourceParams.topicGraph = topicGraph; return deserializedSearchIndexKnowledgeSourceParams; }); } @@ -210,4 +239,97 @@ public SearchIndexKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputD super.setMaxOutputDocuments(maxOutputDocuments); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SearchIndexKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /* + * Hints that guide query planning toward useful filters and boosts. If specified, this object replaces the complete + * set of query hints configured on the knowledge source. + */ + @Generated + private SearchIndexKnowledgeSourceQueryHints queryHintOverrides; + + /** + * Get the queryHintOverrides property: Hints that guide query planning toward useful filters and boosts. If + * specified, this object replaces the complete set of query hints configured on the knowledge source. + * + * @return the queryHintOverrides value. + */ + @Generated + public SearchIndexKnowledgeSourceQueryHints getQueryHintOverrides() { + return this.queryHintOverrides; + } + + /** + * Set the queryHintOverrides property: Hints that guide query planning toward useful filters and boosts. If + * specified, this object replaces the complete set of query hints configured on the knowledge source. + * + * @param queryHintOverrides the queryHintOverrides value to set. + * @return the SearchIndexKnowledgeSourceParams object itself. + */ + @Generated + public SearchIndexKnowledgeSourceParams + setQueryHintOverrides(SearchIndexKnowledgeSourceQueryHints queryHintOverrides) { + this.queryHintOverrides = queryHintOverrides; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SearchIndexKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SearchIndexKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } + + /* + * Overrides the knowledge source's stored topicGraph for this retrieval. When omitted, the stored knowledge source + * value applies. + */ + @Generated + private VectorQueryTopicGraph topicGraph; + + /** + * Get the topicGraph property: Overrides the knowledge source's stored topicGraph for this retrieval. When omitted, + * the stored knowledge source value applies. + * + * @return the topicGraph value. + */ + @Generated + public VectorQueryTopicGraph getTopicGraph() { + return this.topicGraph; + } + + /** + * Set the topicGraph property: Overrides the knowledge source's stored topicGraph for this retrieval. When omitted, + * the stored knowledge source value applies. + * + * @param topicGraph the topicGraph value to set. + * @return the SearchIndexKnowledgeSourceParams object itself. + */ + @Generated + public SearchIndexKnowledgeSourceParams setTopicGraph(VectorQueryTopicGraph topicGraph) { + this.topicGraph = topicGraph; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SynchronizationState.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SynchronizationState.java index 8cd41cc38b67f..609f364601dd5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SynchronizationState.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/SynchronizationState.java @@ -135,6 +135,7 @@ public static SynchronizationState fromJson(JsonReader jsonReader) throws IOExce int itemsUpdatesProcessed = 0; int itemsUpdatesFailed = 0; int itemsSkipped = 0; + KnowledgeSourceGraphStatistics graphStatistics = null; List errors = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -148,6 +149,8 @@ public static SynchronizationState fromJson(JsonReader jsonReader) throws IOExce itemsUpdatesFailed = reader.getInt(); } else if ("itemsSkipped".equals(fieldName)) { itemsSkipped = reader.getInt(); + } else if ("graphStatistics".equals(fieldName)) { + graphStatistics = KnowledgeSourceGraphStatistics.fromJson(reader); } else if ("errors".equals(fieldName)) { errors = reader.readArray(reader1 -> KnowledgeSourceSynchronizationError.fromJson(reader1)); } else { @@ -156,6 +159,7 @@ public static SynchronizationState fromJson(JsonReader jsonReader) throws IOExce } SynchronizationState deserializedSynchronizationState = new SynchronizationState(startTime, itemsUpdatesProcessed, itemsUpdatesFailed, itemsSkipped); + deserializedSynchronizationState.graphStatistics = graphStatistics; deserializedSynchronizationState.errors = errors; return deserializedSynchronizationState; }); @@ -191,4 +195,21 @@ public SynchronizationState setErrors(List this.errors = errors; return this; } + + /* + * Graph extraction statistics for this synchronization. Omitted when no graph extraction took place. + */ + @Generated + private KnowledgeSourceGraphStatistics graphStatistics; + + /** + * Get the graphStatistics property: Graph extraction statistics for this synchronization. Omitted when no graph + * extraction took place. + * + * @return the graphStatistics value. + */ + @Generated + public KnowledgeSourceGraphStatistics getGraphStatistics() { + return this.graphStatistics; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchDebugInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchDebugInfo.java new file mode 100644 index 0000000000000..346cf4aaa120e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchDebugInfo.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Bounded diagnostics returned for agentic search when debug selects agentic or all. Retrieved documents remain in + * value; prompts and raw model reasoning are excluded. Disabling diagnostics does not disable usage accounting or + * actionable error reporting. + */ +@Immutable +public final class AgenticSearchDebugInfo implements JsonSerializable { + + /* + * The reason agentic processing stopped, when available. + */ + @Generated + private AgenticSearchTerminationReason terminationReason; + + /* + * Issued subqueries with their originating model turns. This is not a per-document trace or a stable pagination + * contract. + */ + @Generated + private List subQueries; + + /* + * Token usage for agentic query planning and ranking across this request. + */ + @Generated + private AgenticSearchUsage usage; + + /** + * Creates an instance of AgenticSearchDebugInfo class. + */ + @Generated + private AgenticSearchDebugInfo() { + } + + /** + * Get the terminationReason property: The reason agentic processing stopped, when available. + * + * @return the terminationReason value. + */ + @Generated + public AgenticSearchTerminationReason getTerminationReason() { + return this.terminationReason; + } + + /** + * Get the subQueries property: Issued subqueries with their originating model turns. This is not a per-document + * trace or a stable pagination contract. + * + * @return the subQueries value. + */ + @Generated + public List getSubQueries() { + return this.subQueries; + } + + /** + * Get the usage property: Token usage for agentic query planning and ranking across this request. + * + * @return the usage value. + */ + @Generated + public AgenticSearchUsage getUsage() { + return this.usage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgenticSearchDebugInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgenticSearchDebugInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgenticSearchDebugInfo. + */ + @Generated + public static AgenticSearchDebugInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgenticSearchDebugInfo deserializedAgenticSearchDebugInfo = new AgenticSearchDebugInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("terminationReason".equals(fieldName)) { + deserializedAgenticSearchDebugInfo.terminationReason + = AgenticSearchTerminationReason.fromString(reader.getString()); + } else if ("subQueries".equals(fieldName)) { + List subQueries + = reader.readArray(reader1 -> AgenticSearchSubQuery.fromJson(reader1)); + deserializedAgenticSearchDebugInfo.subQueries = subQueries; + } else if ("usage".equals(fieldName)) { + deserializedAgenticSearchDebugInfo.usage = AgenticSearchUsage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedAgenticSearchDebugInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchOptions.java new file mode 100644 index 0000000000000..b1a0cf7aef0f5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchOptions.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request-scoped runtime options for agentic search; service safety limits apply independently. + */ +@Fluent +public final class AgenticSearchOptions implements JsonSerializable { + + /* + * Maximum duration in seconds for the complete agentic search request, including retrieval, ranking and retries. + */ + @Generated + private Integer maxRuntimeInSeconds; + + /** + * Creates an instance of AgenticSearchOptions class. + */ + @Generated + public AgenticSearchOptions() { + } + + /** + * Get the maxRuntimeInSeconds property: Maximum duration in seconds for the complete agentic search request, + * including retrieval, ranking and retries. + * + * @return the maxRuntimeInSeconds value. + */ + @Generated + public Integer getMaxRuntimeInSeconds() { + return this.maxRuntimeInSeconds; + } + + /** + * Set the maxRuntimeInSeconds property: Maximum duration in seconds for the complete agentic search request, + * including retrieval, ranking and retries. + * + * @param maxRuntimeInSeconds the maxRuntimeInSeconds value to set. + * @return the AgenticSearchOptions object itself. + */ + @Generated + public AgenticSearchOptions setMaxRuntimeInSeconds(Integer maxRuntimeInSeconds) { + this.maxRuntimeInSeconds = maxRuntimeInSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRuntimeInSeconds", this.maxRuntimeInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgenticSearchOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgenticSearchOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgenticSearchOptions. + */ + @Generated + public static AgenticSearchOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgenticSearchOptions deserializedAgenticSearchOptions = new AgenticSearchOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("maxRuntimeInSeconds".equals(fieldName)) { + deserializedAgenticSearchOptions.maxRuntimeInSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedAgenticSearchOptions; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchSubQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchSubQuery.java new file mode 100644 index 0000000000000..69c95fb475c9f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchSubQuery.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * One issued subquery from agentic search. The object permits future query metadata without changing the subquery + * collection shape. + */ +@Immutable +public final class AgenticSearchSubQuery implements JsonSerializable { + + /* + * The text of the issued search query. Does not expose model prompts, raw reasoning or retrieved document content. + */ + @Generated + private String search; + + /* + * One-based logical model turn that produced the query. Multiple subqueries can share the same iteration. + */ + @Generated + private int iteration; + + /** + * Creates an instance of AgenticSearchSubQuery class. + */ + @Generated + private AgenticSearchSubQuery() { + } + + /** + * Get the search property: The text of the issued search query. Does not expose model prompts, raw reasoning or + * retrieved document content. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * Get the iteration property: One-based logical model turn that produced the query. Multiple subqueries can share + * the same iteration. + * + * @return the iteration value. + */ + @Generated + public int getIteration() { + return this.iteration; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgenticSearchSubQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgenticSearchSubQuery if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgenticSearchSubQuery. + */ + @Generated + public static AgenticSearchSubQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgenticSearchSubQuery deserializedAgenticSearchSubQuery = new AgenticSearchSubQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("search".equals(fieldName)) { + deserializedAgenticSearchSubQuery.search = reader.getString(); + } else if ("iteration".equals(fieldName)) { + deserializedAgenticSearchSubQuery.iteration = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return deserializedAgenticSearchSubQuery; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchTerminationReason.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchTerminationReason.java new file mode 100644 index 0000000000000..e85f768c24838 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchTerminationReason.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Why agentic processing stopped. Non-model failures retain their existing error details and HTTP status. + */ +public final class AgenticSearchTerminationReason extends ExpandableStringEnum { + + /** + * Processing completed normally after a valid model stop or a service-owned iteration bound. This does not + * guarantee complete evidence. + */ + @Generated + public static final AgenticSearchTerminationReason MODEL_STOPPED = fromString("modelStopped"); + + /** + * The request deadline ended agentic processing before a valid stop. + */ + @Generated + public static final AgenticSearchTerminationReason MAX_RUNTIME_EXCEEDED = fromString("maxRuntimeExceeded"); + + /** + * Agentic model processing failed before a valid model stop. + */ + @Generated + public static final AgenticSearchTerminationReason MODEL_FAILED = fromString("modelFailed"); + + /** + * Creates a new instance of AgenticSearchTerminationReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AgenticSearchTerminationReason() { + } + + /** + * Creates or finds a AgenticSearchTerminationReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgenticSearchTerminationReason. + */ + @Generated + public static AgenticSearchTerminationReason fromString(String name) { + return fromString(name, AgenticSearchTerminationReason.class); + } + + /** + * Gets known AgenticSearchTerminationReason values. + * + * @return known AgenticSearchTerminationReason values. + */ + @Generated + public static Collection values() { + return values(AgenticSearchTerminationReason.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchUsage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchUsage.java new file mode 100644 index 0000000000000..90cf4ccd747b0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AgenticSearchUsage.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Token usage for agentic query planning and ranking across the search request, including documents not returned in the + * response. + */ +@Immutable +public final class AgenticSearchUsage implements JsonSerializable { + + /* + * The number of tokens consumed by the agentic model for query planning, excluding ranking work. + */ + @Generated + private long agenticPlanningTokens; + + /* + * The number of tokens consumed for semantic ranking, including documents not returned in the response. Excludes + * agentic query-planning tokens. + */ + @Generated + private long reasoningTokens; + + /** + * Creates an instance of AgenticSearchUsage class. + */ + @Generated + private AgenticSearchUsage() { + } + + /** + * Get the agenticPlanningTokens property: The number of tokens consumed by the agentic model for query planning, + * excluding ranking work. + * + * @return the agenticPlanningTokens value. + */ + @Generated + public long getAgenticPlanningTokens() { + return this.agenticPlanningTokens; + } + + /** + * Get the reasoningTokens property: The number of tokens consumed for semantic ranking, including documents not + * returned in the response. Excludes agentic query-planning tokens. + * + * @return the reasoningTokens value. + */ + @Generated + public long getReasoningTokens() { + return this.reasoningTokens; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgenticSearchUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgenticSearchUsage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgenticSearchUsage. + */ + @Generated + public static AgenticSearchUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgenticSearchUsage deserializedAgenticSearchUsage = new AgenticSearchUsage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agenticPlanningTokens".equals(fieldName)) { + deserializedAgenticSearchUsage.agenticPlanningTokens = reader.getLong(); + } else if ("reasoningTokens".equals(fieldName)) { + deserializedAgenticSearchUsage.reasoningTokens = reader.getLong(); + } else { + reader.skipChildren(); + } + } + return deserializedAgenticSearchUsage; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BalancedVectorQueryTopicGraph.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BalancedVectorQueryTopicGraph.java new file mode 100644 index 0000000000000..9def20556f93e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/BalancedVectorQueryTopicGraph.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Blends pure vector similarity with diversity-aware retrieval. Recommended default to balance diversity with + * relevance. + */ +@Fluent +public final class BalancedVectorQueryTopicGraph extends VectorQueryTopicGraph { + + /* + * The kind of topic graph vector search to use. + */ + @Generated + private VectorSearchTopicGraphKind kind = VectorSearchTopicGraphKind.BALANCED; + + /* + * The minimum number of vector candidates to retrieve before topic graph sampling. The default is 1,000 for classic + * services and 500 for serverless services. + */ + @Generated + private Integer minDiversityPoolSize; + + /** + * Creates an instance of BalancedVectorQueryTopicGraph class. + */ + @Generated + public BalancedVectorQueryTopicGraph() { + } + + /** + * Get the kind property: The kind of topic graph vector search to use. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchTopicGraphKind getKind() { + return this.kind; + } + + /** + * Get the minDiversityPoolSize property: The minimum number of vector candidates to retrieve before topic graph + * sampling. The default is 1,000 for classic services and 500 for serverless services. + * + * @return the minDiversityPoolSize value. + */ + @Generated + public Integer getMinDiversityPoolSize() { + return this.minDiversityPoolSize; + } + + /** + * Set the minDiversityPoolSize property: The minimum number of vector candidates to retrieve before topic graph + * sampling. The default is 1,000 for classic services and 500 for serverless services. + * + * @param minDiversityPoolSize the minDiversityPoolSize value to set. + * @return the BalancedVectorQueryTopicGraph object itself. + */ + @Generated + public BalancedVectorQueryTopicGraph setMinDiversityPoolSize(Integer minDiversityPoolSize) { + this.minDiversityPoolSize = minDiversityPoolSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("minDiversityPoolSize", this.minDiversityPoolSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BalancedVectorQueryTopicGraph from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BalancedVectorQueryTopicGraph if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BalancedVectorQueryTopicGraph. + */ + @Generated + public static BalancedVectorQueryTopicGraph fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BalancedVectorQueryTopicGraph deserializedBalancedVectorQueryTopicGraph + = new BalancedVectorQueryTopicGraph(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedBalancedVectorQueryTopicGraph.kind + = VectorSearchTopicGraphKind.fromString(reader.getString()); + } else if ("minDiversityPoolSize".equals(fieldName)) { + deserializedBalancedVectorQueryTopicGraph.minDiversityPoolSize + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedBalancedVectorQueryTopicGraph; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DebugInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DebugInfo.java new file mode 100644 index 0000000000000..0b0f4fff6eaf1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DebugInfo.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains debugging information that can be used to further explore your search results. + */ +@Immutable +public final class DebugInfo implements JsonSerializable { + + /* + * Contains debugging information specific to query rewrites. + */ + @Generated + private QueryRewritesDebugInfo queryRewrites; + + /** + * Creates an instance of DebugInfo class. + */ + @Generated + public DebugInfo() { + } + + /** + * Get the queryRewrites property: Contains debugging information specific to query rewrites. + * + * @return the queryRewrites value. + */ + @Generated + public QueryRewritesDebugInfo getQueryRewrites() { + return this.queryRewrites; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DebugInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DebugInfo if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the DebugInfo. + */ + @Generated + public static DebugInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DebugInfo deserializedDebugInfo = new DebugInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("queryRewrites".equals(fieldName)) { + deserializedDebugInfo.queryRewrites = QueryRewritesDebugInfo.fromJson(reader); + } else if ("agentic".equals(fieldName)) { + deserializedDebugInfo.agentic = AgenticSearchDebugInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedDebugInfo; + }); + } + + /* + * Contains request-wide agentic diagnostics when debug selects agentic or all. Does not imply that classic query + * rewriting executed. + */ + @Generated + private AgenticSearchDebugInfo agentic; + + /** + * Get the agentic property: Contains request-wide agentic diagnostics when debug selects agentic or all. Does not + * imply that classic query rewriting executed. + * + * @return the agentic value. + */ + @Generated + public AgenticSearchDebugInfo getAgentic() { + return this.agentic; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DiverseVectorQueryTopicGraph.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DiverseVectorQueryTopicGraph.java new file mode 100644 index 0000000000000..b60a37d9a02ee --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DiverseVectorQueryTopicGraph.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Uses topic graph diverse retrieval. + */ +@Fluent +public final class DiverseVectorQueryTopicGraph extends VectorQueryTopicGraph { + + /* + * The kind of topic graph vector search to use. + */ + @Generated + private VectorSearchTopicGraphKind kind = VectorSearchTopicGraphKind.DIVERSE; + + /* + * The diversity factor used for topic graph diverse retrieval. If omitted, the default configured on the topic + * graph profile is used. + */ + @Generated + private Float diversityFactor; + + /* + * The minimum number of vector candidates to retrieve before topic graph sampling. The default is 1,000 for classic + * services and 500 for serverless services. + */ + @Generated + private Integer minDiversityPoolSize; + + /** + * Creates an instance of DiverseVectorQueryTopicGraph class. + */ + @Generated + public DiverseVectorQueryTopicGraph() { + } + + /** + * Get the kind property: The kind of topic graph vector search to use. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchTopicGraphKind getKind() { + return this.kind; + } + + /** + * Get the diversityFactor property: The diversity factor used for topic graph diverse retrieval. If omitted, the + * default configured on the topic graph profile is used. + * + * @return the diversityFactor value. + */ + @Generated + public Float getDiversityFactor() { + return this.diversityFactor; + } + + /** + * Set the diversityFactor property: The diversity factor used for topic graph diverse retrieval. If omitted, the + * default configured on the topic graph profile is used. + * + * @param diversityFactor the diversityFactor value to set. + * @return the DiverseVectorQueryTopicGraph object itself. + */ + @Generated + public DiverseVectorQueryTopicGraph setDiversityFactor(Float diversityFactor) { + this.diversityFactor = diversityFactor; + return this; + } + + /** + * Get the minDiversityPoolSize property: The minimum number of vector candidates to retrieve before topic graph + * sampling. The default is 1,000 for classic services and 500 for serverless services. + * + * @return the minDiversityPoolSize value. + */ + @Generated + public Integer getMinDiversityPoolSize() { + return this.minDiversityPoolSize; + } + + /** + * Set the minDiversityPoolSize property: The minimum number of vector candidates to retrieve before topic graph + * sampling. The default is 1,000 for classic services and 500 for serverless services. + * + * @param minDiversityPoolSize the minDiversityPoolSize value to set. + * @return the DiverseVectorQueryTopicGraph object itself. + */ + @Generated + public DiverseVectorQueryTopicGraph setMinDiversityPoolSize(Integer minDiversityPoolSize) { + this.minDiversityPoolSize = minDiversityPoolSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("diversityFactor", this.diversityFactor); + jsonWriter.writeNumberField("minDiversityPoolSize", this.minDiversityPoolSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiverseVectorQueryTopicGraph from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiverseVectorQueryTopicGraph if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiverseVectorQueryTopicGraph. + */ + @Generated + public static DiverseVectorQueryTopicGraph fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiverseVectorQueryTopicGraph deserializedDiverseVectorQueryTopicGraph = new DiverseVectorQueryTopicGraph(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedDiverseVectorQueryTopicGraph.kind + = VectorSearchTopicGraphKind.fromString(reader.getString()); + } else if ("diversityFactor".equals(fieldName)) { + deserializedDiverseVectorQueryTopicGraph.diversityFactor = reader.getNullable(JsonReader::getFloat); + } else if ("minDiversityPoolSize".equals(fieldName)) { + deserializedDiverseVectorQueryTopicGraph.minDiversityPoolSize + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedDiverseVectorQueryTopicGraph; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphOptions.java new file mode 100644 index 0000000000000..ecd3ed90f5700 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphOptions.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.util.List; + +/** + * Options for graph API. + */ +@Fluent +public final class GraphOptions { + + /* + * Token identifying the user for which the query is being executed. This token is used to enforce security + * restrictions on documents. + */ + @Generated + private String querySourceAuthorization; + + /* + * A value that enables elevated read that bypass document level permission checks for the query operation. + */ + @Generated + private Boolean enableElevatedRead; + + /* + * The nonempty GQL query to bind and execute. + */ + @Generated + private final String gql; + + /* + * Full-text search text used to constrain graph backend requests. + */ + @Generated + private String search; + + /* + * An OData filter over graph-index fields applied throughout graph execution. + */ + @Generated + private String filter; + + /* + * Vector queries used to constrain the graph's backend searches. + */ + @Generated + private List vectorQueries; + + /* + * Executes the query by default. planOnly builds the plan without backend query execution and requires at least one + * explain stage. + */ + @Generated + private GraphQueryExecutionMode executionMode; + + /* + * Diagnostic plan stages to include in the response. Plan representations are diagnostic information rather than an + * executable client contract. + */ + @Generated + private List explain; + + /* + * Whether to include graph execution statistics. Defaults to true. + */ + @Generated + private Boolean includeStatistics; + + /* + * Whether to include informational diagnostics. Errors and warnings are returned regardless of this setting. + */ + @Generated + private Boolean includeDiagnostics; + + /* + * Controls bounded assertion evidence and optional source-document hydration. + */ + @Generated + private GraphQueryProvenanceParameters provenance; + + /** + * Creates an instance of GraphOptions class. + * + * @param gql the gql value to set. + */ + @Generated + public GraphOptions(String gql) { + this.gql = gql; + } + + /** + * Get the querySourceAuthorization property: Token identifying the user for which the query is being executed. This + * token is used to enforce security restrictions on documents. + * + * @return the querySourceAuthorization value. + */ + @Generated + public String getQuerySourceAuthorization() { + return this.querySourceAuthorization; + } + + /** + * Set the querySourceAuthorization property: Token identifying the user for which the query is being executed. This + * token is used to enforce security restrictions on documents. + * + * @param querySourceAuthorization the querySourceAuthorization value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setQuerySourceAuthorization(String querySourceAuthorization) { + this.querySourceAuthorization = querySourceAuthorization; + return this; + } + + /** + * Get the enableElevatedRead property: A value that enables elevated read that bypass document level permission + * checks for the query operation. + * + * @return the enableElevatedRead value. + */ + @Generated + public Boolean isEnableElevatedRead() { + return this.enableElevatedRead; + } + + /** + * Set the enableElevatedRead property: A value that enables elevated read that bypass document level permission + * checks for the query operation. + * + * @param enableElevatedRead the enableElevatedRead value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setEnableElevatedRead(Boolean enableElevatedRead) { + this.enableElevatedRead = enableElevatedRead; + return this; + } + + /** + * Get the gql property: The nonempty GQL query to bind and execute. + * + * @return the gql value. + */ + @Generated + public String getGql() { + return this.gql; + } + + /** + * Get the search property: Full-text search text used to constrain graph backend requests. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * Set the search property: Full-text search text used to constrain graph backend requests. + * + * @param search the search value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setSearch(String search) { + this.search = search; + return this; + } + + /** + * Get the filter property: An OData filter over graph-index fields applied throughout graph execution. + * + * @return the filter value. + */ + @Generated + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: An OData filter over graph-index fields applied throughout graph execution. + * + * @param filter the filter value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the vectorQueries property: Vector queries used to constrain the graph's backend searches. + * + * @return the vectorQueries value. + */ + @Generated + public List getVectorQueries() { + return this.vectorQueries; + } + + /** + * Set the vectorQueries property: Vector queries used to constrain the graph's backend searches. + * + * @param vectorQueries the vectorQueries value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setVectorQueries(List vectorQueries) { + this.vectorQueries = vectorQueries; + return this; + } + + /** + * Get the executionMode property: Executes the query by default. planOnly builds the plan without backend query + * execution and requires at least one explain stage. + * + * @return the executionMode value. + */ + @Generated + public GraphQueryExecutionMode getExecutionMode() { + return this.executionMode; + } + + /** + * Set the executionMode property: Executes the query by default. planOnly builds the plan without backend query + * execution and requires at least one explain stage. + * + * @param executionMode the executionMode value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setExecutionMode(GraphQueryExecutionMode executionMode) { + this.executionMode = executionMode; + return this; + } + + /** + * Get the explain property: Diagnostic plan stages to include in the response. Plan representations are diagnostic + * information rather than an executable client contract. + * + * @return the explain value. + */ + @Generated + public List getExplain() { + return this.explain; + } + + /** + * Set the explain property: Diagnostic plan stages to include in the response. Plan representations are diagnostic + * information rather than an executable client contract. + * + * @param explain the explain value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setExplain(List explain) { + this.explain = explain; + return this; + } + + /** + * Get the includeStatistics property: Whether to include graph execution statistics. Defaults to true. + * + * @return the includeStatistics value. + */ + @Generated + public Boolean isIncludeStatistics() { + return this.includeStatistics; + } + + /** + * Set the includeStatistics property: Whether to include graph execution statistics. Defaults to true. + * + * @param includeStatistics the includeStatistics value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setIncludeStatistics(Boolean includeStatistics) { + this.includeStatistics = includeStatistics; + return this; + } + + /** + * Get the includeDiagnostics property: Whether to include informational diagnostics. Errors and warnings are + * returned regardless of this setting. + * + * @return the includeDiagnostics value. + */ + @Generated + public Boolean isIncludeDiagnostics() { + return this.includeDiagnostics; + } + + /** + * Set the includeDiagnostics property: Whether to include informational diagnostics. Errors and warnings are + * returned regardless of this setting. + * + * @param includeDiagnostics the includeDiagnostics value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setIncludeDiagnostics(Boolean includeDiagnostics) { + this.includeDiagnostics = includeDiagnostics; + return this; + } + + /** + * Get the provenance property: Controls bounded assertion evidence and optional source-document hydration. + * + * @return the provenance value. + */ + @Generated + public GraphQueryProvenanceParameters getProvenance() { + return this.provenance; + } + + /** + * Set the provenance property: Controls bounded assertion evidence and optional source-document hydration. + * + * @param provenance the provenance value to set. + * @return the GraphOptions object itself. + */ + @Generated + public GraphOptions setProvenance(GraphQueryProvenanceParameters provenance) { + this.provenance = provenance; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnostic.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnostic.java new file mode 100644 index 0000000000000..5317d96665455 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnostic.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A graph planning or execution diagnostic. + */ +@Immutable +public final class GraphQueryDiagnostic implements JsonSerializable { + + /* + * Stable machine-readable diagnostic identifier. + */ + @Generated + private String code; + + /* + * The diagnostic's importance. + */ + @Generated + private GraphQueryDiagnosticSeverity severity; + + /* + * The stage that produced the diagnostic. + */ + @Generated + private GraphQueryDiagnosticPhase phase; + + /* + * Human-readable explanation; applications should use code rather than parse this text. + */ + @Generated + private String message; + + /* + * Optional source-span description associated with the diagnostic. + */ + @Generated + private String span; + + /* + * Suggested corrections or alternatives. + */ + @Generated + private List suggestions; + + /** + * Creates an instance of GraphQueryDiagnostic class. + */ + @Generated + private GraphQueryDiagnostic() { + } + + /** + * Get the code property: Stable machine-readable diagnostic identifier. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the severity property: The diagnostic's importance. + * + * @return the severity value. + */ + @Generated + public GraphQueryDiagnosticSeverity getSeverity() { + return this.severity; + } + + /** + * Get the phase property: The stage that produced the diagnostic. + * + * @return the phase value. + */ + @Generated + public GraphQueryDiagnosticPhase getPhase() { + return this.phase; + } + + /** + * Get the message property: Human-readable explanation; applications should use code rather than parse this text. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the span property: Optional source-span description associated with the diagnostic. + * + * @return the span value. + */ + @Generated + public String getSpan() { + return this.span; + } + + /** + * Get the suggestions property: Suggested corrections or alternatives. + * + * @return the suggestions value. + */ + @Generated + public List getSuggestions() { + return this.suggestions; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("phase", this.phase == null ? null : this.phase.toString()); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("span", this.span); + jsonWriter.writeArrayField("suggestions", this.suggestions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryDiagnostic from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryDiagnostic if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryDiagnostic. + */ + @Generated + public static GraphQueryDiagnostic fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryDiagnostic deserializedGraphQueryDiagnostic = new GraphQueryDiagnostic(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + deserializedGraphQueryDiagnostic.code = reader.getString(); + } else if ("severity".equals(fieldName)) { + deserializedGraphQueryDiagnostic.severity + = GraphQueryDiagnosticSeverity.fromString(reader.getString()); + } else if ("phase".equals(fieldName)) { + deserializedGraphQueryDiagnostic.phase = GraphQueryDiagnosticPhase.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedGraphQueryDiagnostic.message = reader.getString(); + } else if ("span".equals(fieldName)) { + deserializedGraphQueryDiagnostic.span = reader.getString(); + } else if ("suggestions".equals(fieldName)) { + List suggestions = reader.readArray(reader1 -> reader1.getString()); + deserializedGraphQueryDiagnostic.suggestions = suggestions; + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryDiagnostic; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticPhase.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticPhase.java new file mode 100644 index 0000000000000..5408cc12f33b2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticPhase.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The stage that produced a graph query diagnostic. + */ +public final class GraphQueryDiagnosticPhase extends ExpandableStringEnum { + + /** + * Query syntax and parsing. + */ + @Generated + public static final GraphQueryDiagnosticPhase PARSE = fromString("parse"); + + /** + * Variable, parameter, function, and semantic binding. + */ + @Generated + public static final GraphQueryDiagnosticPhase BIND = fromString("bind"); + + /** + * Request-option validation. + */ + @Generated + public static final GraphQueryDiagnosticPhase VALIDATION = fromString("validation"); + + /** + * Query planning, including unsupported query shapes and query-breadth restrictions. + */ + @Generated + public static final GraphQueryDiagnosticPhase PLANNING = fromString("planning"); + + /** + * Runtime evaluation, execution-limit warnings, and execution summaries. + */ + @Generated + public static final GraphQueryDiagnosticPhase EXECUTION = fromString("execution"); + + /** + * Creates a new instance of GraphQueryDiagnosticPhase value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphQueryDiagnosticPhase() { + } + + /** + * Creates or finds a GraphQueryDiagnosticPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQueryDiagnosticPhase. + */ + @Generated + public static GraphQueryDiagnosticPhase fromString(String name) { + return fromString(name, GraphQueryDiagnosticPhase.class); + } + + /** + * Gets known GraphQueryDiagnosticPhase values. + * + * @return known GraphQueryDiagnosticPhase values. + */ + @Generated + public static Collection values() { + return values(GraphQueryDiagnosticPhase.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticSeverity.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticSeverity.java new file mode 100644 index 0000000000000..bac557b3ff49b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticSeverity.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The importance of a graph query diagnostic. + */ +public final class GraphQueryDiagnosticSeverity extends ExpandableStringEnum { + + /** + * The query was rejected or could not be evaluated successfully. + */ + @Generated + public static final GraphQueryDiagnosticSeverity ERROR = fromString("error"); + + /** + * Execution returned a result with a caveat, such as an execution or provenance limit. + */ + @Generated + public static final GraphQueryDiagnosticSeverity WARNING = fromString("warning"); + + /** + * Informational diagnostics, such as an optional execution summary. + */ + @Generated + public static final GraphQueryDiagnosticSeverity INFO = fromString("info"); + + /** + * Creates a new instance of GraphQueryDiagnosticSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphQueryDiagnosticSeverity() { + } + + /** + * Creates or finds a GraphQueryDiagnosticSeverity from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQueryDiagnosticSeverity. + */ + @Generated + public static GraphQueryDiagnosticSeverity fromString(String name) { + return fromString(name, GraphQueryDiagnosticSeverity.class); + } + + /** + * Gets known GraphQueryDiagnosticSeverity values. + * + * @return known GraphQueryDiagnosticSeverity values. + */ + @Generated + public static Collection values() { + return values(GraphQueryDiagnosticSeverity.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidence.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidence.java new file mode 100644 index 0000000000000..29d11ee51d53a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidence.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Source assertion identifiers and confidence values retained as graph evidence. + */ +@Immutable +public final class GraphQueryEvidence implements JsonSerializable { + + /* + * Assertion document identifier in the graph index. + */ + @Generated + private String edgeId; + + /* + * Source chunk identifier used for source-document lookup. + */ + @Generated + private String chunkId; + + /* + * Parent source document identifier. + */ + @Generated + private String parentId; + + /* + * Confidence values associated with the assertion and its components. + */ + @Generated + private GraphQueryEvidenceConfidence confidence; + + /** + * Creates an instance of GraphQueryEvidence class. + */ + @Generated + private GraphQueryEvidence() { + } + + /** + * Get the edgeId property: Assertion document identifier in the graph index. + * + * @return the edgeId value. + */ + @Generated + public String getEdgeId() { + return this.edgeId; + } + + /** + * Get the chunkId property: Source chunk identifier used for source-document lookup. + * + * @return the chunkId value. + */ + @Generated + public String getChunkId() { + return this.chunkId; + } + + /** + * Get the parentId property: Parent source document identifier. + * + * @return the parentId value. + */ + @Generated + public String getParentId() { + return this.parentId; + } + + /** + * Get the confidence property: Confidence values associated with the assertion and its components. + * + * @return the confidence value. + */ + @Generated + public GraphQueryEvidenceConfidence getConfidence() { + return this.confidence; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("edgeId", this.edgeId); + jsonWriter.writeStringField("chunkId", this.chunkId); + jsonWriter.writeStringField("parentId", this.parentId); + jsonWriter.writeJsonField("confidence", this.confidence); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryEvidence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryEvidence if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryEvidence. + */ + @Generated + public static GraphQueryEvidence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryEvidence deserializedGraphQueryEvidence = new GraphQueryEvidence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("edgeId".equals(fieldName)) { + deserializedGraphQueryEvidence.edgeId = reader.getString(); + } else if ("chunkId".equals(fieldName)) { + deserializedGraphQueryEvidence.chunkId = reader.getString(); + } else if ("parentId".equals(fieldName)) { + deserializedGraphQueryEvidence.parentId = reader.getString(); + } else if ("confidence".equals(fieldName)) { + deserializedGraphQueryEvidence.confidence = GraphQueryEvidenceConfidence.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryEvidence; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceConfidence.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceConfidence.java new file mode 100644 index 0000000000000..75e09b4b8ebd3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceConfidence.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Confidence values recorded on a supporting assertion. + */ +@Immutable +public final class GraphQueryEvidenceConfidence implements JsonSerializable { + + /* + * Confidence in the complete relationship. + */ + @Generated + private Double edge; + + /* + * Confidence in the subject grounding. + */ + @Generated + private Double subject; + + /* + * Confidence in predicate alignment. + */ + @Generated + private Double predicate; + + /* + * Confidence in the object grounding. + */ + @Generated + private Double object; + + /** + * Creates an instance of GraphQueryEvidenceConfidence class. + */ + @Generated + private GraphQueryEvidenceConfidence() { + } + + /** + * Get the edge property: Confidence in the complete relationship. + * + * @return the edge value. + */ + @Generated + public Double getEdge() { + return this.edge; + } + + /** + * Get the subject property: Confidence in the subject grounding. + * + * @return the subject value. + */ + @Generated + public Double getSubject() { + return this.subject; + } + + /** + * Get the predicate property: Confidence in predicate alignment. + * + * @return the predicate value. + */ + @Generated + public Double getPredicate() { + return this.predicate; + } + + /** + * Get the object property: Confidence in the object grounding. + * + * @return the object value. + */ + @Generated + public Double getObject() { + return this.object; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("edge", this.edge); + jsonWriter.writeNumberField("subject", this.subject); + jsonWriter.writeNumberField("predicate", this.predicate); + jsonWriter.writeNumberField("object", this.object); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryEvidenceConfidence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryEvidenceConfidence if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryEvidenceConfidence. + */ + @Generated + public static GraphQueryEvidenceConfidence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryEvidenceConfidence deserializedGraphQueryEvidenceConfidence = new GraphQueryEvidenceConfidence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("edge".equals(fieldName)) { + deserializedGraphQueryEvidenceConfidence.edge = reader.getNullable(JsonReader::getDouble); + } else if ("subject".equals(fieldName)) { + deserializedGraphQueryEvidenceConfidence.subject = reader.getNullable(JsonReader::getDouble); + } else if ("predicate".equals(fieldName)) { + deserializedGraphQueryEvidenceConfidence.predicate = reader.getNullable(JsonReader::getDouble); + } else if ("object".equals(fieldName)) { + deserializedGraphQueryEvidenceConfidence.object = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryEvidenceConfidence; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCount.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCount.java new file mode 100644 index 0000000000000..fce749a8f56e8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCount.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An evidence count whose relation describes whether collection was complete. + */ +@Immutable +public final class GraphQueryEvidenceCount implements JsonSerializable { + + /* + * Number of supporting evidence entries observed. + */ + @Generated + private Integer value; + + /* + * Whether value is the exact count or a lower bound. + */ + @Generated + private GraphQueryEvidenceCountRelation relation; + + /** + * Creates an instance of GraphQueryEvidenceCount class. + */ + @Generated + private GraphQueryEvidenceCount() { + } + + /** + * Get the value property: Number of supporting evidence entries observed. + * + * @return the value value. + */ + @Generated + public Integer getValue() { + return this.value; + } + + /** + * Get the relation property: Whether value is the exact count or a lower bound. + * + * @return the relation value. + */ + @Generated + public GraphQueryEvidenceCountRelation getRelation() { + return this.relation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeStringField("relation", this.relation == null ? null : this.relation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryEvidenceCount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryEvidenceCount if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryEvidenceCount. + */ + @Generated + public static GraphQueryEvidenceCount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryEvidenceCount deserializedGraphQueryEvidenceCount = new GraphQueryEvidenceCount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("value".equals(fieldName)) { + deserializedGraphQueryEvidenceCount.value = reader.getNullable(JsonReader::getInt); + } else if ("relation".equals(fieldName)) { + deserializedGraphQueryEvidenceCount.relation + = GraphQueryEvidenceCountRelation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryEvidenceCount; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCountRelation.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCountRelation.java new file mode 100644 index 0000000000000..93de7f5504494 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCountRelation.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Completeness of an evidence count. + */ +public final class GraphQueryEvidenceCountRelation extends ExpandableStringEnum { + + /** + * All supporting evidence was counted. + */ + @Generated + public static final GraphQueryEvidenceCountRelation EXACT = fromString("exact"); + + /** + * At least this many supporting entries exist; collection was bounded. + */ + @Generated + public static final GraphQueryEvidenceCountRelation LOWER_BOUND = fromString("lowerBound"); + + /** + * Creates a new instance of GraphQueryEvidenceCountRelation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphQueryEvidenceCountRelation() { + } + + /** + * Creates or finds a GraphQueryEvidenceCountRelation from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQueryEvidenceCountRelation. + */ + @Generated + public static GraphQueryEvidenceCountRelation fromString(String name) { + return fromString(name, GraphQueryEvidenceCountRelation.class); + } + + /** + * Gets known GraphQueryEvidenceCountRelation values. + * + * @return known GraphQueryEvidenceCountRelation values. + */ + @Generated + public static Collection values() { + return values(GraphQueryEvidenceCountRelation.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExecutionMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExecutionMode.java new file mode 100644 index 0000000000000..883756a922844 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExecutionMode.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether a graph query is executed or only planned. + */ +public final class GraphQueryExecutionMode extends ExpandableStringEnum { + + /** + * Build and execute the graph plan. + */ + @Generated + public static final GraphQueryExecutionMode EXECUTE = fromString("execute"); + + /** + * Build the graph plan without executing backend searches. + */ + @Generated + public static final GraphQueryExecutionMode PLAN_ONLY = fromString("planOnly"); + + /** + * Creates a new instance of GraphQueryExecutionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphQueryExecutionMode() { + } + + /** + * Creates or finds a GraphQueryExecutionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQueryExecutionMode. + */ + @Generated + public static GraphQueryExecutionMode fromString(String name) { + return fromString(name, GraphQueryExecutionMode.class); + } + + /** + * Gets known GraphQueryExecutionMode values. + * + * @return known GraphQueryExecutionMode values. + */ + @Generated + public static Collection values() { + return values(GraphQueryExecutionMode.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplain.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplain.java new file mode 100644 index 0000000000000..df31240c03729 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplain.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Diagnostic query-plan representations keyed by requested explain stage. + */ +@Immutable +public final class GraphQueryExplain implements JsonSerializable { + + /* + * Diagnostic query-plan representations keyed by requested explain stage. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of GraphQueryExplain class. + */ + @Generated + private GraphQueryExplain() { + } + + /** + * Get the additionalProperties property: Diagnostic query-plan representations keyed by requested explain stage. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryExplain from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryExplain if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryExplain. + */ + @Generated + public static GraphQueryExplain fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryExplain deserializedGraphQueryExplain = new GraphQueryExplain(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + deserializedGraphQueryExplain.additionalProperties = additionalProperties; + return deserializedGraphQueryExplain; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplainStage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplainStage.java new file mode 100644 index 0000000000000..965f30e006fd0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryExplainStage.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Diagnostic stages available when inspecting a graph query. + */ +public final class GraphQueryExplainStage extends ExpandableStringEnum { + + /** + * Parsed query syntax. + */ + @Generated + public static final GraphQueryExplainStage SYNTAX = fromString("syntax"); + + /** + * Bound semantic intermediate representation. + */ + @Generated + public static final GraphQueryExplainStage SEMANTIC_IR = fromString("semanticIr"); + + /** + * Logical plan before optimization. + */ + @Generated + public static final GraphQueryExplainStage LOGICAL_PLAN = fromString("logicalPlan"); + + /** + * Logical plan after optimization. + */ + @Generated + public static final GraphQueryExplainStage OPTIMIZED_LOGICAL_PLAN = fromString("optimizedLogicalPlan"); + + /** + * Physical execution plan. + */ + @Generated + public static final GraphQueryExplainStage PHYSICAL_PLAN = fromString("physicalPlan"); + + /** + * Attribution of backend requests to execution-plan nodes. + */ + @Generated + public static final GraphQueryExplainStage REQUEST_ATTRIBUTIONS = fromString("requestAttributions"); + + /** + * All available diagnostic stages. + */ + @Generated + public static final GraphQueryExplainStage FULL = fromString("full"); + + /** + * Creates a new instance of GraphQueryExplainStage value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphQueryExplainStage() { + } + + /** + * Creates or finds a GraphQueryExplainStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQueryExplainStage. + */ + @Generated + public static GraphQueryExplainStage fromString(String name) { + return fromString(name, GraphQueryExplainStage.class); + } + + /** + * Gets known GraphQueryExplainStage values. + * + * @return known GraphQueryExplainStage values. + */ + @Generated + public static Collection values() { + return values(GraphQueryExplainStage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocument.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocument.java new file mode 100644 index 0000000000000..107e92564e73c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocument.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * A source document containing the selected retrievable fields. + */ +@Immutable +public final class GraphQueryProvenanceDocument implements JsonSerializable { + + /* + * A source document containing the selected retrievable fields. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of GraphQueryProvenanceDocument class. + */ + @Generated + private GraphQueryProvenanceDocument() { + } + + /** + * Get the additionalProperties property: A source document containing the selected retrievable fields. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryProvenanceDocument from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryProvenanceDocument if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryProvenanceDocument. + */ + @Generated + public static GraphQueryProvenanceDocument fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryProvenanceDocument deserializedGraphQueryProvenanceDocument = new GraphQueryProvenanceDocument(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + deserializedGraphQueryProvenanceDocument.additionalProperties = additionalProperties; + return deserializedGraphQueryProvenanceDocument; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocuments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocuments.java new file mode 100644 index 0000000000000..cf0af68e127d4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocuments.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Source documents keyed by document ID. Each document contains the selected retrievable source fields. + */ +@Immutable +public final class GraphQueryProvenanceDocuments implements JsonSerializable { + + /* + * Source documents keyed by document ID. Each document contains the selected retrievable source fields. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of GraphQueryProvenanceDocuments class. + */ + @Generated + private GraphQueryProvenanceDocuments() { + } + + /** + * Get the additionalProperties property: Source documents keyed by document ID. Each document contains the selected + * retrievable source fields. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryProvenanceDocuments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryProvenanceDocuments if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryProvenanceDocuments. + */ + @Generated + public static GraphQueryProvenanceDocuments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryProvenanceDocuments deserializedGraphQueryProvenanceDocuments + = new GraphQueryProvenanceDocuments(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, GraphQueryProvenanceDocument.fromJson(reader)); + } + deserializedGraphQueryProvenanceDocuments.additionalProperties = additionalProperties; + return deserializedGraphQueryProvenanceDocuments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceHydrateDocumentsParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceHydrateDocumentsParameters.java new file mode 100644 index 0000000000000..ec323cd0af146 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceHydrateDocumentsParameters.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Selects fields from the source index configured by graphProfile.provenanceIndexName. + */ +@Fluent +public final class GraphQueryProvenanceHydrateDocumentsParameters + implements JsonSerializable { + + /* + * Comma-separated source document fields to return; omitted selects the service's default retrievable fields. + */ + @Generated + private String select; + + /** + * Creates an instance of GraphQueryProvenanceHydrateDocumentsParameters class. + */ + @Generated + public GraphQueryProvenanceHydrateDocumentsParameters() { + } + + /** + * Get the select property: Comma-separated source document fields to return; omitted selects the service's default + * retrievable fields. + * + * @return the select value. + */ + @Generated + public String getSelect() { + return this.select; + } + + /** + * Set the select property: Comma-separated source document fields to return; omitted selects the service's default + * retrievable fields. + * + * @param select the select value to set. + * @return the GraphQueryProvenanceHydrateDocumentsParameters object itself. + */ + @Generated + public GraphQueryProvenanceHydrateDocumentsParameters setSelect(String select) { + this.select = select; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("select", this.select); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryProvenanceHydrateDocumentsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryProvenanceHydrateDocumentsParameters if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryProvenanceHydrateDocumentsParameters. + */ + @Generated + public static GraphQueryProvenanceHydrateDocumentsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryProvenanceHydrateDocumentsParameters deserializedGraphQueryProvenanceHydrateDocumentsParameters + = new GraphQueryProvenanceHydrateDocumentsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("select".equals(fieldName)) { + deserializedGraphQueryProvenanceHydrateDocumentsParameters.select = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryProvenanceHydrateDocumentsParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceKind.java new file mode 100644 index 0000000000000..1878143856f5e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceKind.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of assertion evidence returned with graph rows. + */ +public final class GraphQueryProvenanceKind extends ExpandableStringEnum { + + /** + * Return evidence identifiers without source documents. + */ + @Generated + public static final GraphQueryProvenanceKind IDS = fromString("ids"); + + /** + * Return evidence identifiers and selected documents from the profile-configured provenance index. + */ + @Generated + public static final GraphQueryProvenanceKind HYDRATE = fromString("hydrate"); + + /** + * Creates a new instance of GraphQueryProvenanceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GraphQueryProvenanceKind() { + } + + /** + * Creates or finds a GraphQueryProvenanceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQueryProvenanceKind. + */ + @Generated + public static GraphQueryProvenanceKind fromString(String name) { + return fromString(name, GraphQueryProvenanceKind.class); + } + + /** + * Gets known GraphQueryProvenanceKind values. + * + * @return known GraphQueryProvenanceKind values. + */ + @Generated + public static Collection values() { + return values(GraphQueryProvenanceKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceParameters.java new file mode 100644 index 0000000000000..77d067bff426c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryProvenanceParameters.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Bounded provenance collection options for a graph query. + */ +@Fluent +public final class GraphQueryProvenanceParameters implements JsonSerializable { + + /* + * Whether to return evidence identifiers or also hydrate their source documents. + */ + @Generated + private final GraphQueryProvenanceKind kind; + + /* + * Maximum evidence entries collected per result row. When bounded, the response indicates whether the evidence + * count is exact or a lower bound. + */ + @Generated + private Integer maxEvidencePerRow; + + /* + * Source-document selection options. Required when kind is hydrate. + */ + @Generated + private GraphQueryProvenanceHydrateDocumentsParameters hydrateDocuments; + + /** + * Creates an instance of GraphQueryProvenanceParameters class. + * + * @param kind the kind value to set. + */ + @Generated + public GraphQueryProvenanceParameters(GraphQueryProvenanceKind kind) { + this.kind = kind; + } + + /** + * Get the kind property: Whether to return evidence identifiers or also hydrate their source documents. + * + * @return the kind value. + */ + @Generated + public GraphQueryProvenanceKind getKind() { + return this.kind; + } + + /** + * Get the maxEvidencePerRow property: Maximum evidence entries collected per result row. When bounded, the response + * indicates whether the evidence count is exact or a lower bound. + * + * @return the maxEvidencePerRow value. + */ + @Generated + public Integer getMaxEvidencePerRow() { + return this.maxEvidencePerRow; + } + + /** + * Set the maxEvidencePerRow property: Maximum evidence entries collected per result row. When bounded, the response + * indicates whether the evidence count is exact or a lower bound. + * + * @param maxEvidencePerRow the maxEvidencePerRow value to set. + * @return the GraphQueryProvenanceParameters object itself. + */ + @Generated + public GraphQueryProvenanceParameters setMaxEvidencePerRow(Integer maxEvidencePerRow) { + this.maxEvidencePerRow = maxEvidencePerRow; + return this; + } + + /** + * Get the hydrateDocuments property: Source-document selection options. Required when kind is hydrate. + * + * @return the hydrateDocuments value. + */ + @Generated + public GraphQueryProvenanceHydrateDocumentsParameters getHydrateDocuments() { + return this.hydrateDocuments; + } + + /** + * Set the hydrateDocuments property: Source-document selection options. Required when kind is hydrate. + * + * @param hydrateDocuments the hydrateDocuments value to set. + * @return the GraphQueryProvenanceParameters object itself. + */ + @Generated + public GraphQueryProvenanceParameters + setHydrateDocuments(GraphQueryProvenanceHydrateDocumentsParameters hydrateDocuments) { + this.hydrateDocuments = hydrateDocuments; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("maxEvidencePerRow", this.maxEvidencePerRow); + jsonWriter.writeJsonField("hydrateDocuments", this.hydrateDocuments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryProvenanceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryProvenanceParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphQueryProvenanceParameters. + */ + @Generated + public static GraphQueryProvenanceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryProvenanceKind kind = null; + Integer maxEvidencePerRow = null; + GraphQueryProvenanceHydrateDocumentsParameters hydrateDocuments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + kind = GraphQueryProvenanceKind.fromString(reader.getString()); + } else if ("maxEvidencePerRow".equals(fieldName)) { + maxEvidencePerRow = reader.getNullable(JsonReader::getInt); + } else if ("hydrateDocuments".equals(fieldName)) { + hydrateDocuments = GraphQueryProvenanceHydrateDocumentsParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + GraphQueryProvenanceParameters deserializedGraphQueryProvenanceParameters + = new GraphQueryProvenanceParameters(kind); + deserializedGraphQueryProvenanceParameters.maxEvidencePerRow = maxEvidencePerRow; + deserializedGraphQueryProvenanceParameters.hydrateDocuments = hydrateDocuments; + return deserializedGraphQueryProvenanceParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryResult.java new file mode 100644 index 0000000000000..3282dd9dd292f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryResult.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A graph query's projected rows and optional execution information. + */ +@Immutable +public final class GraphQueryResult implements JsonSerializable { + + /* + * Number of projected rows in this response, not the size of an unbounded graph population. + */ + @Generated + private Long count; + + /* + * Query projection rows. planOnly returns an empty collection. + */ + @Generated + private List value; + + /* + * Execution statistics, when requested and available. + */ + @Generated + private GraphQueryStatistics statistics; + + /* + * Structured errors, warnings, and requested informational diagnostics. + */ + @Generated + private List diagnostics; + + /* + * Requested diagnostic stages. Absent stages are omitted. + */ + @Generated + private GraphQueryExplain explain; + + /* + * Hydrated source documents keyed by document ID, shared across result rows. + */ + @Generated + private GraphQueryProvenanceDocuments provenanceDocuments; + + /** + * Creates an instance of GraphQueryResult class. + */ + @Generated + private GraphQueryResult() { + } + + /** + * Get the count property: Number of projected rows in this response, not the size of an unbounded graph population. + * + * @return the count value. + */ + @Generated + public Long getCount() { + return this.count; + } + + /** + * Get the value property: Query projection rows. planOnly returns an empty collection. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * Get the statistics property: Execution statistics, when requested and available. + * + * @return the statistics value. + */ + @Generated + public GraphQueryStatistics getStatistics() { + return this.statistics; + } + + /** + * Get the diagnostics property: Structured errors, warnings, and requested informational diagnostics. + * + * @return the diagnostics value. + */ + @Generated + public List getDiagnostics() { + return this.diagnostics; + } + + /** + * Get the explain property: Requested diagnostic stages. Absent stages are omitted. + * + * @return the explain value. + */ + @Generated + public GraphQueryExplain getExplain() { + return this.explain; + } + + /** + * Get the provenanceDocuments property: Hydrated source documents keyed by document ID, shared across result rows. + * + * @return the provenanceDocuments value. + */ + @Generated + public GraphQueryProvenanceDocuments getProvenanceDocuments() { + return this.provenanceDocuments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphQueryResult. + */ + @Generated + public static GraphQueryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryResult deserializedGraphQueryResult = new GraphQueryResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GraphQueryRow.fromJson(reader1)); + deserializedGraphQueryResult.value = value; + } else if ("@odata.count".equals(fieldName)) { + deserializedGraphQueryResult.count = reader.getNullable(JsonReader::getLong); + } else if ("@search.graphStats".equals(fieldName)) { + deserializedGraphQueryResult.statistics = GraphQueryStatistics.fromJson(reader); + } else if ("@search.graphDiagnostics".equals(fieldName)) { + List diagnostics + = reader.readArray(reader1 -> GraphQueryDiagnostic.fromJson(reader1)); + deserializedGraphQueryResult.diagnostics = diagnostics; + } else if ("@search.graphExplain".equals(fieldName)) { + deserializedGraphQueryResult.explain = GraphQueryExplain.fromJson(reader); + } else if ("@search.graphProvenanceDocuments".equals(fieldName)) { + deserializedGraphQueryResult.provenanceDocuments = GraphQueryProvenanceDocuments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryResult; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRow.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRow.java new file mode 100644 index 0000000000000..cafb63d492a6b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRow.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * A dynamic graph projection row with optional bounded assertion evidence. + */ +@Immutable +public final class GraphQueryRow implements JsonSerializable { + + /* + * Assertion evidence supporting this projected row. + */ + @Generated + private GraphQueryRowProvenance provenance; + + /* + * A dynamic graph projection row with optional bounded assertion evidence. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of GraphQueryRow class. + */ + @Generated + private GraphQueryRow() { + } + + /** + * Get the provenance property: Assertion evidence supporting this projected row. + * + * @return the provenance value. + */ + @Generated + public GraphQueryRowProvenance getProvenance() { + return this.provenance; + } + + /** + * Get the additionalProperties property: A dynamic graph projection row with optional bounded assertion evidence. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryRow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryRow if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryRow. + */ + @Generated + public static GraphQueryRow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryRow deserializedGraphQueryRow = new GraphQueryRow(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("@search.graphProvenance".equals(fieldName)) { + deserializedGraphQueryRow.provenance = GraphQueryRowProvenance.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedGraphQueryRow.additionalProperties = additionalProperties; + return deserializedGraphQueryRow; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRowProvenance.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRowProvenance.java new file mode 100644 index 0000000000000..503d767603bfb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryRowProvenance.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Assertion evidence supporting one projected graph row. + */ +@Immutable +public final class GraphQueryRowProvenance implements JsonSerializable { + + /* + * Whether the query requested evidence IDs or source hydration. + */ + @Generated + private GraphQueryProvenanceKind kind; + + /* + * Number of supporting assertions and the completeness relation of that count. + */ + @Generated + private GraphQueryEvidenceCount evidenceCount; + + /* + * Bounded evidence entries for this result row. + */ + @Generated + private List evidence; + + /** + * Creates an instance of GraphQueryRowProvenance class. + */ + @Generated + private GraphQueryRowProvenance() { + } + + /** + * Get the kind property: Whether the query requested evidence IDs or source hydration. + * + * @return the kind value. + */ + @Generated + public GraphQueryProvenanceKind getKind() { + return this.kind; + } + + /** + * Get the evidenceCount property: Number of supporting assertions and the completeness relation of that count. + * + * @return the evidenceCount value. + */ + @Generated + public GraphQueryEvidenceCount getEvidenceCount() { + return this.evidenceCount; + } + + /** + * Get the evidence property: Bounded evidence entries for this result row. + * + * @return the evidence value. + */ + @Generated + public List getEvidence() { + return this.evidence; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("evidenceCount", this.evidenceCount); + jsonWriter.writeArrayField("evidence", this.evidence, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryRowProvenance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryRowProvenance if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryRowProvenance. + */ + @Generated + public static GraphQueryRowProvenance fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryRowProvenance deserializedGraphQueryRowProvenance = new GraphQueryRowProvenance(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedGraphQueryRowProvenance.kind = GraphQueryProvenanceKind.fromString(reader.getString()); + } else if ("evidenceCount".equals(fieldName)) { + deserializedGraphQueryRowProvenance.evidenceCount = GraphQueryEvidenceCount.fromJson(reader); + } else if ("evidence".equals(fieldName)) { + List evidence + = reader.readArray(reader1 -> GraphQueryEvidence.fromJson(reader1)); + deserializedGraphQueryRowProvenance.evidence = evidence; + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryRowProvenance; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryStatistics.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryStatistics.java new file mode 100644 index 0000000000000..2b63564ba4f98 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryStatistics.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Execution statistics for a graph query; counters describe work performed rather than result-row counts. + */ +@Immutable +public final class GraphQueryStatistics implements JsonSerializable { + + /* + * Whether the request executed or only produced a plan. + */ + @Generated + private GraphQueryExecutionMode executionMode; + + /* + * Backend search requests performed by the graph query. + */ + @Generated + private Integer queryCount; + + /* + * Backend assertion documents fetched during execution. + */ + @Generated + private Integer documentsFetched; + + /* + * Whether execution reports an estimated result. + */ + @Generated + private Boolean isEstimated; + + /* + * Reported total execution time in milliseconds. + */ + @Generated + private Long totalMs; + + /* + * Reported search time in milliseconds. + */ + @Generated + private Long searchMs; + + /* + * Time spent producing the query plan, in milliseconds. + */ + @Generated + private Long planningMs; + + /** + * Creates an instance of GraphQueryStatistics class. + */ + @Generated + private GraphQueryStatistics() { + } + + /** + * Get the executionMode property: Whether the request executed or only produced a plan. + * + * @return the executionMode value. + */ + @Generated + public GraphQueryExecutionMode getExecutionMode() { + return this.executionMode; + } + + /** + * Get the queryCount property: Backend search requests performed by the graph query. + * + * @return the queryCount value. + */ + @Generated + public Integer getQueryCount() { + return this.queryCount; + } + + /** + * Get the documentsFetched property: Backend assertion documents fetched during execution. + * + * @return the documentsFetched value. + */ + @Generated + public Integer getDocumentsFetched() { + return this.documentsFetched; + } + + /** + * Get the isEstimated property: Whether execution reports an estimated result. + * + * @return the isEstimated value. + */ + @Generated + public Boolean isEstimated() { + return this.isEstimated; + } + + /** + * Get the totalMs property: Reported total execution time in milliseconds. + * + * @return the totalMs value. + */ + @Generated + public Long getTotalMs() { + return this.totalMs; + } + + /** + * Get the searchMs property: Reported search time in milliseconds. + * + * @return the searchMs value. + */ + @Generated + public Long getSearchMs() { + return this.searchMs; + } + + /** + * Get the planningMs property: Time spent producing the query plan, in milliseconds. + * + * @return the planningMs value. + */ + @Generated + public Long getPlanningMs() { + return this.planningMs; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionMode", this.executionMode == null ? null : this.executionMode.toString()); + jsonWriter.writeNumberField("queryCount", this.queryCount); + jsonWriter.writeNumberField("documentsFetched", this.documentsFetched); + jsonWriter.writeBooleanField("isEstimated", this.isEstimated); + jsonWriter.writeNumberField("totalMs", this.totalMs); + jsonWriter.writeNumberField("searchMs", this.searchMs); + jsonWriter.writeNumberField("planningMs", this.planningMs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueryStatistics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueryStatistics if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueryStatistics. + */ + @Generated + public static GraphQueryStatistics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueryStatistics deserializedGraphQueryStatistics = new GraphQueryStatistics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("executionMode".equals(fieldName)) { + deserializedGraphQueryStatistics.executionMode + = GraphQueryExecutionMode.fromString(reader.getString()); + } else if ("queryCount".equals(fieldName)) { + deserializedGraphQueryStatistics.queryCount = reader.getNullable(JsonReader::getInt); + } else if ("documentsFetched".equals(fieldName)) { + deserializedGraphQueryStatistics.documentsFetched = reader.getNullable(JsonReader::getInt); + } else if ("isEstimated".equals(fieldName)) { + deserializedGraphQueryStatistics.isEstimated = reader.getNullable(JsonReader::getBoolean); + } else if ("totalMs".equals(fieldName)) { + deserializedGraphQueryStatistics.totalMs = reader.getNullable(JsonReader::getLong); + } else if ("searchMs".equals(fieldName)) { + deserializedGraphQueryStatistics.searchMs = reader.getNullable(JsonReader::getLong); + } else if ("planningMs".equals(fieldName)) { + deserializedGraphQueryStatistics.planningMs = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + return deserializedGraphQueryStatistics; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NoneVectorQueryTopicGraph.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NoneVectorQueryTopicGraph.java new file mode 100644 index 0000000000000..ca28641e13ff2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/NoneVectorQueryTopicGraph.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Uses normal vector search without topic graph diverse retrieval. + */ +@Immutable +public final class NoneVectorQueryTopicGraph extends VectorQueryTopicGraph { + + /* + * The kind of topic graph vector search to use. + */ + @Generated + private VectorSearchTopicGraphKind kind = VectorSearchTopicGraphKind.NONE; + + /** + * Creates an instance of NoneVectorQueryTopicGraph class. + */ + @Generated + public NoneVectorQueryTopicGraph() { + } + + /** + * Get the kind property: The kind of topic graph vector search to use. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchTopicGraphKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoneVectorQueryTopicGraph from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoneVectorQueryTopicGraph if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NoneVectorQueryTopicGraph. + */ + @Generated + public static NoneVectorQueryTopicGraph fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoneVectorQueryTopicGraph deserializedNoneVectorQueryTopicGraph = new NoneVectorQueryTopicGraph(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedNoneVectorQueryTopicGraph.kind + = VectorSearchTopicGraphKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedNoneVectorQueryTopicGraph; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OperationState.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OperationState.java new file mode 100644 index 0000000000000..330fd66a78215 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/OperationState.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryDebugMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryDebugMode.java index 7042a0f3383b8..f8d3055fee82e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryDebugMode.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryDebugMode.java @@ -79,4 +79,11 @@ public static QueryDebugMode fromString(String name) { public static Collection values() { return values(QueryDebugMode.class); } + + /** + * Returns bounded diagnostics for agentic search under @search.debug.agentic. Combine with other supported + * modes using |; this selector does not enable agentic retrieval or query rewriting. + */ + @Generated + public static final QueryDebugMode AGENTIC = fromString("agentic"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java index 36e6aefd2cc42..11b502a3632fa 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryType.java @@ -65,4 +65,11 @@ public static QueryType fromString(String name) { public static Collection values() { return values(QueryType.class); } + + /** + * Uses an agentic model to generate queries and rerank search results within one index. Requires nonempty + * natural-language search text. + */ + @Generated + public static final QueryType AGENTIC = fromString("agentic"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java index 97ee0f3b1d0b4..176761e45d389 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java @@ -1095,4 +1095,66 @@ public SearchOptions setMoreLikeThis(String moreLikeThis) { this.moreLikeThis = moreLikeThis; return this; } + + /* + * The key of the document to use as the basis for finding similar documents. This parameter cannot be used together + * with search text. + */ + @Generated + private String moreLikeThis; + + /* + * Request-scoped runtime options when queryType is set to 'agentic'. Not supported with other query modes. Use the + * existing debug selector for diagnostics. + */ + @Generated + private AgenticSearchOptions agenticOptions; + + /** + * Get the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This + * parameter cannot be used together with search text. + * + * @return the moreLikeThis value. + */ + @Generated + public String getMoreLikeThis() { + return this.moreLikeThis; + } + + /** + * Set the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This + * parameter cannot be used together with search text. + * + * @param moreLikeThis the moreLikeThis value to set. + * @return the SearchOptions object itself. + */ + @Generated + public SearchOptions setMoreLikeThis(String moreLikeThis) { + this.moreLikeThis = moreLikeThis; + return this; + } + + /** + * Get the agenticOptions property: Request-scoped runtime options when queryType is set to 'agentic'. Not supported + * with other query modes. Use the existing debug selector for diagnostics. + * + * @return the agenticOptions value. + */ + @Generated + public AgenticSearchOptions getAgenticOptions() { + return this.agenticOptions; + } + + /** + * Set the agenticOptions property: Request-scoped runtime options when queryType is set to 'agentic'. Not supported + * with other query modes. Use the existing debug selector for diagnostics. + * + * @param agenticOptions the agenticOptions value to set. + * @return the SearchOptions object itself. + */ + @Generated + public SearchOptions setAgenticOptions(AgenticSearchOptions agenticOptions) { + this.agenticOptions = agenticOptions; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchPagedResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchPagedResponse.java index c839aa64cfe41..890cbfdc185d3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchPagedResponse.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchPagedResponse.java @@ -80,6 +80,24 @@ public List getAnswers() { return page.getAnswers(); } + /** + * Gets diagnostic information requested by the query's debug option. + * + * @return the query diagnostics, or null when not returned. + */ + public DebugInfo getDebugInfo() { + return page.getDebugInfo(); + } + + /** + * Gets the result of semantic query rewriting. + * + * @return the query rewrite result type, or null when not returned. + */ + public SemanticQueryRewritesResultType getSemanticQueryRewritesResultType() { + return page.getSemanticQueryRewritesResultType(); + } + /** * Get the semanticPartialResponseReason property: Reason that a partial response was returned for a semantic * ranking request. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java index ddeb7137d63c5..46e9f6f39d2d0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java @@ -572,6 +572,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.orderBy.stream().map(element -> element == null ? "" : element).collect(Collectors.joining(","))); } jsonWriter.writeStringField("queryType", this.queryType == null ? null : this.queryType.toString()); + jsonWriter.writeJsonField("agenticOptions", this.agenticOptions); jsonWriter.writeStringField("scoringStatistics", this.scoringStatistics == null ? null : this.scoringStatistics.toString()); jsonWriter.writeStringField("sessionId", this.sessionId); @@ -654,6 +655,8 @@ public static SearchRequest fromJson(JsonReader jsonReader) throws IOException { deserializedSearchRequest.orderBy = orderBy; } else if ("queryType".equals(fieldName)) { deserializedSearchRequest.queryType = QueryType.fromString(reader.getString()); + } else if ("agenticOptions".equals(fieldName)) { + deserializedSearchRequest.agenticOptions = AgenticSearchOptions.fromJson(reader); } else if ("scoringStatistics".equals(fieldName)) { deserializedSearchRequest.scoringStatistics = ScoringStatistics.fromString(reader.getString()); } else if ("sessionId".equals(fieldName)) { @@ -1120,4 +1123,66 @@ public SearchRequest setMoreLikeThis(String moreLikeThis) { this.moreLikeThis = moreLikeThis; return this; } + + /* + * The key of the document to use as the basis for finding similar documents. This parameter cannot be used together + * with search text. + */ + @Generated + private String moreLikeThis; + + /* + * Request-scoped runtime options when queryType is set to 'agentic'. Not supported with other query modes. Use the + * existing debug selector for diagnostics. + */ + @Generated + private AgenticSearchOptions agenticOptions; + + /** + * Get the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This + * parameter cannot be used together with search text. + * + * @return the moreLikeThis value. + */ + @Generated + public String getMoreLikeThis() { + return this.moreLikeThis; + } + + /** + * Set the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This + * parameter cannot be used together with search text. + * + * @param moreLikeThis the moreLikeThis value to set. + * @return the SearchRequest object itself. + */ + @Generated + public SearchRequest setMoreLikeThis(String moreLikeThis) { + this.moreLikeThis = moreLikeThis; + return this; + } + + /** + * Get the agenticOptions property: Request-scoped runtime options when queryType is set to 'agentic'. Not supported + * with other query modes. Use the existing debug selector for diagnostics. + * + * @return the agenticOptions value. + */ + @Generated + public AgenticSearchOptions getAgenticOptions() { + return this.agenticOptions; + } + + /** + * Set the agenticOptions property: Request-scoped runtime options when queryType is set to 'agentic'. Not supported + * with other query modes. Use the existing debug selector for diagnostics. + * + * @param agenticOptions the agenticOptions value to set. + * @return the SearchRequest object itself. + */ + @Generated + public SearchRequest setAgenticOptions(AgenticSearchOptions agenticOptions) { + this.agenticOptions = agenticOptions; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java index 16d047202bee0..2b3e950ef1d3b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java @@ -200,6 +200,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("exhaustive", this.exhaustive); jsonWriter.writeNumberField("oversampling", this.oversampling); jsonWriter.writeNumberField("weight", this.weight); + jsonWriter.writeJsonField("threshold", this.threshold); + jsonWriter.writeStringField("filterOverride", this.filterOverride); + jsonWriter.writeNumberField("perDocumentVectorLimit", this.perDocumentVectorLimit); + jsonWriter.writeJsonField("topicGraph", this.topicGraph); return jsonWriter.writeEndObject(); } @@ -233,6 +237,10 @@ public static VectorQuery fromJson(JsonReader jsonReader) throws IOException { return VectorizedQuery.fromJson(readerToUse.reset()); } else if ("text".equals(discriminatorValue)) { return VectorizableTextQuery.fromJson(readerToUse.reset()); + } else if ("imageUrl".equals(discriminatorValue)) { + return VectorizableImageUrlQuery.fromJson(readerToUse.reset()); + } else if ("imageBinary".equals(discriminatorValue)) { + return VectorizableImageBinaryQuery.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -259,6 +267,14 @@ static VectorQuery fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOEx deserializedVectorQuery.oversampling = reader.getNullable(JsonReader::getDouble); } else if ("weight".equals(fieldName)) { deserializedVectorQuery.weight = reader.getNullable(JsonReader::getFloat); + } else if ("threshold".equals(fieldName)) { + deserializedVectorQuery.threshold = VectorThreshold.fromJson(reader); + } else if ("filterOverride".equals(fieldName)) { + deserializedVectorQuery.filterOverride = reader.getString(); + } else if ("perDocumentVectorLimit".equals(fieldName)) { + deserializedVectorQuery.perDocumentVectorLimit = reader.getNullable(JsonReader::getInt); + } else if ("topicGraph".equals(fieldName)) { + deserializedVectorQuery.topicGraph = VectorQueryTopicGraph.fromJson(reader); } else { reader.skipChildren(); } @@ -282,4 +298,131 @@ public VectorQuery setWeight(Float weight) { this.weight = weight; return this; } + + /* + * The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. + */ + @Generated + private VectorThreshold threshold; + + /* + * The OData filter expression to apply to this specific vector query. If no filter expression is defined at the + * vector level, the expression defined in the top level filter parameter is used instead. + */ + @Generated + private String filterOverride; + + /* + * Controls how many vectors can be matched from each document in a vector search query. Setting it to 1 ensures at + * most one vector per document is matched, guaranteeing results come from distinct documents. Setting it to 0 + * (unlimited) allows multiple relevant vectors from the same document to be matched. Default is 0. + */ + @Generated + private Integer perDocumentVectorLimit; + + /** + * Get the threshold property: The threshold used for vector queries. Note this can only be set if all 'fields' use + * the same similarity metric. + * + * @return the threshold value. + */ + @Generated + public VectorThreshold getThreshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold used for vector queries. Note this can only be set if all 'fields' use + * the same similarity metric. + * + * @param threshold the threshold value to set. + * @return the VectorQuery object itself. + */ + @Generated + public VectorQuery setThreshold(VectorThreshold threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the filterOverride property: The OData filter expression to apply to this specific vector query. If no filter + * expression is defined at the vector level, the expression defined in the top level filter parameter is used + * instead. + * + * @return the filterOverride value. + */ + @Generated + public String getFilterOverride() { + return this.filterOverride; + } + + /** + * Set the filterOverride property: The OData filter expression to apply to this specific vector query. If no filter + * expression is defined at the vector level, the expression defined in the top level filter parameter is used + * instead. + * + * @param filterOverride the filterOverride value to set. + * @return the VectorQuery object itself. + */ + @Generated + public VectorQuery setFilterOverride(String filterOverride) { + this.filterOverride = filterOverride; + return this; + } + + /** + * Get the perDocumentVectorLimit property: Controls how many vectors can be matched from each document in a vector + * search query. Setting it to 1 ensures at most one vector per document is matched, guaranteeing results come from + * distinct documents. Setting it to 0 (unlimited) allows multiple relevant vectors from the same document to be + * matched. Default is 0. + * + * @return the perDocumentVectorLimit value. + */ + @Generated + public Integer getPerDocumentVectorLimit() { + return this.perDocumentVectorLimit; + } + + /** + * Set the perDocumentVectorLimit property: Controls how many vectors can be matched from each document in a vector + * search query. Setting it to 1 ensures at most one vector per document is matched, guaranteeing results come from + * distinct documents. Setting it to 0 (unlimited) allows multiple relevant vectors from the same document to be + * matched. Default is 0. + * + * @param perDocumentVectorLimit the perDocumentVectorLimit value to set. + * @return the VectorQuery object itself. + */ + @Generated + public VectorQuery setPerDocumentVectorLimit(Integer perDocumentVectorLimit) { + this.perDocumentVectorLimit = perDocumentVectorLimit; + return this; + } + + /* + * Topic graph vector search options. + */ + @Generated + private VectorQueryTopicGraph topicGraph; + + /** + * Get the topicGraph property: Topic graph vector search options. + * + * @return the topicGraph value. + */ + @Generated + public VectorQueryTopicGraph getTopicGraph() { + return this.topicGraph; + } + + /** + * Set the topicGraph property: Topic graph vector search options. + * + * @param topicGraph the topicGraph value to set. + * @return the VectorQuery object itself. + */ + @Generated + public VectorQuery setTopicGraph(VectorQueryTopicGraph topicGraph) { + this.topicGraph = topicGraph; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQueryTopicGraph.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQueryTopicGraph.java new file mode 100644 index 0000000000000..5372ca546e116 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQueryTopicGraph.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base type for topic graph vector search options. + */ +@Immutable +public class VectorQueryTopicGraph implements JsonSerializable { + + /* + * The kind of topic graph vector search to use. + */ + @Generated + private VectorSearchTopicGraphKind kind = VectorSearchTopicGraphKind.fromString("VectorQueryTopicGraph"); + + /** + * Creates an instance of VectorQueryTopicGraph class. + */ + @Generated + public VectorQueryTopicGraph() { + } + + /** + * Get the kind property: The kind of topic graph vector search to use. + * + * @return the kind value. + */ + @Generated + public VectorSearchTopicGraphKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorQueryTopicGraph from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorQueryTopicGraph if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorQueryTopicGraph. + */ + @Generated + public static VectorQueryTopicGraph fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("none".equals(discriminatorValue)) { + return NoneVectorQueryTopicGraph.fromJson(readerToUse.reset()); + } else if ("diverse".equals(discriminatorValue)) { + return DiverseVectorQueryTopicGraph.fromJson(readerToUse.reset()); + } else if ("balanced".equals(discriminatorValue)) { + return BalancedVectorQueryTopicGraph.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static VectorQueryTopicGraph fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorQueryTopicGraph deserializedVectorQueryTopicGraph = new VectorQueryTopicGraph(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedVectorQueryTopicGraph.kind = VectorSearchTopicGraphKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedVectorQueryTopicGraph; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSearchTopicGraphKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSearchTopicGraphKind.java new file mode 100644 index 0000000000000..fa74a89bb3df6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSearchTopicGraphKind.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of topic graph vector search to use. + */ +public final class VectorSearchTopicGraphKind extends ExpandableStringEnum { + + /** + * Use normal vector search when topic graph diverse retrieval is off. + */ + @Generated + public static final VectorSearchTopicGraphKind NONE = fromString("none"); + + /** + * Use topic graph diverse retrieval. + */ + @Generated + public static final VectorSearchTopicGraphKind DIVERSE = fromString("diverse"); + + /** + * Blends pure vector similarity with diversity-aware retrieval. Recommended default to balance diversity with + * relevance. + */ + @Generated + public static final VectorSearchTopicGraphKind BALANCED = fromString("balanced"); + + /** + * Creates a new instance of VectorSearchTopicGraphKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorSearchTopicGraphKind() { + } + + /** + * Creates or finds a VectorSearchTopicGraphKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorSearchTopicGraphKind. + */ + @Generated + public static VectorSearchTopicGraphKind fromString(String name) { + return fromString(name, VectorSearchTopicGraphKind.class); + } + + /** + * Gets known VectorSearchTopicGraphKind values. + * + * @return known VectorSearchTopicGraphKind values. + */ + @Generated + public static Collection values() { + return values(VectorSearchTopicGraphKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageBinaryQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageBinaryQuery.java new file mode 100644 index 0000000000000..37718efb988ac --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageBinaryQuery.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The query parameters to use for vector search when a base 64 encoded binary of an image that needs to be vectorized + * is provided. + */ +@Fluent +public final class VectorizableImageBinaryQuery extends VectorQuery { + + /* + * Type of query. + */ + @Generated + private VectorQueryKind kind = VectorQueryKind.IMAGE_BINARY; + + /* + * The base 64 encoded binary of an image to be vectorized to perform a vector search query. + */ + @Generated + private String base64Image; + + /** + * Creates an instance of VectorizableImageBinaryQuery class. + */ + @Generated + public VectorizableImageBinaryQuery() { + } + + /** + * Get the kind property: Type of query. + * + * @return the kind value. + */ + @Generated + @Override + public VectorQueryKind getKind() { + return this.kind; + } + + /** + * Get the base64Image property: The base 64 encoded binary of an image to be vectorized to perform a vector search + * query. + * + * @return the base64Image value. + */ + @Generated + public String getBase64Image() { + return this.base64Image; + } + + /** + * Set the base64Image property: The base 64 encoded binary of an image to be vectorized to perform a vector search + * query. + * + * @param base64Image the base64Image value to set. + * @return the VectorizableImageBinaryQuery object itself. + */ + @Generated + public VectorizableImageBinaryQuery setBase64Image(String base64Image) { + this.base64Image = base64Image; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setKNearestNeighbors(Integer kNearestNeighbors) { + super.setKNearestNeighbors(kNearestNeighbors); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setFields(String fields) { + super.setFields(fields); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setExhaustive(Boolean exhaustive) { + super.setExhaustive(exhaustive); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setOversampling(Double oversampling) { + super.setOversampling(oversampling); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("k", getKNearestNeighbors()); + jsonWriter.writeStringField("fields", getFields()); + jsonWriter.writeBooleanField("exhaustive", isExhaustive()); + jsonWriter.writeNumberField("oversampling", getOversampling()); + jsonWriter.writeNumberField("weight", getWeight()); + jsonWriter.writeJsonField("threshold", getThreshold()); + jsonWriter.writeStringField("filterOverride", getFilterOverride()); + jsonWriter.writeNumberField("perDocumentVectorLimit", getPerDocumentVectorLimit()); + jsonWriter.writeJsonField("topicGraph", getTopicGraph()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("base64Image", this.base64Image); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorizableImageBinaryQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorizableImageBinaryQuery if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorizableImageBinaryQuery. + */ + @Generated + public static VectorizableImageBinaryQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorizableImageBinaryQuery deserializedVectorizableImageBinaryQuery = new VectorizableImageBinaryQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("k".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery + .setKNearestNeighbors(reader.getNullable(JsonReader::getInt)); + } else if ("fields".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setFields(reader.getString()); + } else if ("exhaustive".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setExhaustive(reader.getNullable(JsonReader::getBoolean)); + } else if ("oversampling".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setOversampling(reader.getNullable(JsonReader::getDouble)); + } else if ("weight".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setWeight(reader.getNullable(JsonReader::getFloat)); + } else if ("threshold".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setThreshold(VectorThreshold.fromJson(reader)); + } else if ("filterOverride".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setFilterOverride(reader.getString()); + } else if ("perDocumentVectorLimit".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery + .setPerDocumentVectorLimit(reader.getNullable(JsonReader::getInt)); + } else if ("topicGraph".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.setTopicGraph(VectorQueryTopicGraph.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.kind = VectorQueryKind.fromString(reader.getString()); + } else if ("base64Image".equals(fieldName)) { + deserializedVectorizableImageBinaryQuery.base64Image = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedVectorizableImageBinaryQuery; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setWeight(Float weight) { + super.setWeight(weight); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setThreshold(VectorThreshold threshold) { + super.setThreshold(threshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setFilterOverride(String filterOverride) { + super.setFilterOverride(filterOverride); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setPerDocumentVectorLimit(Integer perDocumentVectorLimit) { + super.setPerDocumentVectorLimit(perDocumentVectorLimit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageBinaryQuery setTopicGraph(VectorQueryTopicGraph topicGraph) { + super.setTopicGraph(topicGraph); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageUrlQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageUrlQuery.java new file mode 100644 index 0000000000000..792e7006bf7a4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableImageUrlQuery.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The query parameters to use for vector search when an url that represents an image value that needs to be vectorized + * is provided. + */ +@Fluent +public final class VectorizableImageUrlQuery extends VectorQuery { + + /* + * Type of query. + */ + @Generated + private VectorQueryKind kind = VectorQueryKind.IMAGE_URL; + + /* + * The URL of an image to be vectorized to perform a vector search query. + */ + @Generated + private String url; + + /** + * Creates an instance of VectorizableImageUrlQuery class. + */ + @Generated + public VectorizableImageUrlQuery() { + } + + /** + * Get the kind property: Type of query. + * + * @return the kind value. + */ + @Generated + @Override + public VectorQueryKind getKind() { + return this.kind; + } + + /** + * Get the url property: The URL of an image to be vectorized to perform a vector search query. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Set the url property: The URL of an image to be vectorized to perform a vector search query. + * + * @param url the url value to set. + * @return the VectorizableImageUrlQuery object itself. + */ + @Generated + public VectorizableImageUrlQuery setUrl(String url) { + this.url = url; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setKNearestNeighbors(Integer kNearestNeighbors) { + super.setKNearestNeighbors(kNearestNeighbors); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setFields(String fields) { + super.setFields(fields); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setExhaustive(Boolean exhaustive) { + super.setExhaustive(exhaustive); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setOversampling(Double oversampling) { + super.setOversampling(oversampling); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("k", getKNearestNeighbors()); + jsonWriter.writeStringField("fields", getFields()); + jsonWriter.writeBooleanField("exhaustive", isExhaustive()); + jsonWriter.writeNumberField("oversampling", getOversampling()); + jsonWriter.writeNumberField("weight", getWeight()); + jsonWriter.writeJsonField("threshold", getThreshold()); + jsonWriter.writeStringField("filterOverride", getFilterOverride()); + jsonWriter.writeNumberField("perDocumentVectorLimit", getPerDocumentVectorLimit()); + jsonWriter.writeJsonField("topicGraph", getTopicGraph()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorizableImageUrlQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorizableImageUrlQuery if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorizableImageUrlQuery. + */ + @Generated + public static VectorizableImageUrlQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorizableImageUrlQuery deserializedVectorizableImageUrlQuery = new VectorizableImageUrlQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("k".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setKNearestNeighbors(reader.getNullable(JsonReader::getInt)); + } else if ("fields".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setFields(reader.getString()); + } else if ("exhaustive".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setExhaustive(reader.getNullable(JsonReader::getBoolean)); + } else if ("oversampling".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setOversampling(reader.getNullable(JsonReader::getDouble)); + } else if ("weight".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setWeight(reader.getNullable(JsonReader::getFloat)); + } else if ("threshold".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setThreshold(VectorThreshold.fromJson(reader)); + } else if ("filterOverride".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setFilterOverride(reader.getString()); + } else if ("perDocumentVectorLimit".equals(fieldName)) { + deserializedVectorizableImageUrlQuery + .setPerDocumentVectorLimit(reader.getNullable(JsonReader::getInt)); + } else if ("topicGraph".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.setTopicGraph(VectorQueryTopicGraph.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.kind = VectorQueryKind.fromString(reader.getString()); + } else if ("url".equals(fieldName)) { + deserializedVectorizableImageUrlQuery.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedVectorizableImageUrlQuery; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setWeight(Float weight) { + super.setWeight(weight); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setThreshold(VectorThreshold threshold) { + super.setThreshold(threshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setFilterOverride(String filterOverride) { + super.setFilterOverride(filterOverride); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setPerDocumentVectorLimit(Integer perDocumentVectorLimit) { + super.setPerDocumentVectorLimit(perDocumentVectorLimit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableImageUrlQuery setTopicGraph(VectorQueryTopicGraph topicGraph) { + super.setTopicGraph(topicGraph); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java index e7ed64b7fd8fd..45f42c50ecbf3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java @@ -111,8 +111,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("exhaustive", isExhaustive()); jsonWriter.writeNumberField("oversampling", getOversampling()); jsonWriter.writeNumberField("weight", getWeight()); + jsonWriter.writeJsonField("threshold", getThreshold()); + jsonWriter.writeStringField("filterOverride", getFilterOverride()); + jsonWriter.writeNumberField("perDocumentVectorLimit", getPerDocumentVectorLimit()); + jsonWriter.writeJsonField("topicGraph", getTopicGraph()); jsonWriter.writeStringField("text", this.text); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("queryRewrites", this.queryRewrites == null ? null : this.queryRewrites.toString()); return jsonWriter.writeEndObject(); } @@ -133,8 +138,13 @@ public static VectorizableTextQuery fromJson(JsonReader jsonReader) throws IOExc Boolean exhaustive = null; Double oversampling = null; Float weight = null; + VectorThreshold threshold = null; + String filterOverride = null; + Integer perDocumentVectorLimit = null; + VectorQueryTopicGraph topicGraph = null; String text = null; VectorQueryKind kind = VectorQueryKind.TEXT; + QueryRewritesType queryRewrites = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -148,10 +158,20 @@ public static VectorizableTextQuery fromJson(JsonReader jsonReader) throws IOExc oversampling = reader.getNullable(JsonReader::getDouble); } else if ("weight".equals(fieldName)) { weight = reader.getNullable(JsonReader::getFloat); + } else if ("threshold".equals(fieldName)) { + threshold = VectorThreshold.fromJson(reader); + } else if ("filterOverride".equals(fieldName)) { + filterOverride = reader.getString(); + } else if ("perDocumentVectorLimit".equals(fieldName)) { + perDocumentVectorLimit = reader.getNullable(JsonReader::getInt); + } else if ("topicGraph".equals(fieldName)) { + topicGraph = VectorQueryTopicGraph.fromJson(reader); } else if ("text".equals(fieldName)) { text = reader.getString(); } else if ("kind".equals(fieldName)) { kind = VectorQueryKind.fromString(reader.getString()); + } else if ("queryRewrites".equals(fieldName)) { + queryRewrites = QueryRewritesType.fromString(reader.getString()); } else { reader.skipChildren(); } @@ -162,7 +182,12 @@ public static VectorizableTextQuery fromJson(JsonReader jsonReader) throws IOExc deserializedVectorizableTextQuery.setExhaustive(exhaustive); deserializedVectorizableTextQuery.setOversampling(oversampling); deserializedVectorizableTextQuery.setWeight(weight); + deserializedVectorizableTextQuery.setThreshold(threshold); + deserializedVectorizableTextQuery.setFilterOverride(filterOverride); + deserializedVectorizableTextQuery.setPerDocumentVectorLimit(perDocumentVectorLimit); + deserializedVectorizableTextQuery.setTopicGraph(topicGraph); deserializedVectorizableTextQuery.kind = kind; + deserializedVectorizableTextQuery.queryRewrites = queryRewrites; return deserializedVectorizableTextQuery; }); } @@ -176,4 +201,74 @@ public VectorizableTextQuery setWeight(Float weight) { super.setWeight(weight); return this; } + + /* + * Can be configured to let a generative model rewrite the query before sending it to be vectorized. + */ + @Generated + private QueryRewritesType queryRewrites; + + /** + * Get the queryRewrites property: Can be configured to let a generative model rewrite the query before sending it + * to be vectorized. + * + * @return the queryRewrites value. + */ + @Generated + public QueryRewritesType getQueryRewrites() { + return this.queryRewrites; + } + + /** + * Set the queryRewrites property: Can be configured to let a generative model rewrite the query before sending it + * to be vectorized. + * + * @param queryRewrites the queryRewrites value to set. + * @return the VectorizableTextQuery object itself. + */ + @Generated + public VectorizableTextQuery setQueryRewrites(QueryRewritesType queryRewrites) { + this.queryRewrites = queryRewrites; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableTextQuery setThreshold(VectorThreshold threshold) { + super.setThreshold(threshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableTextQuery setFilterOverride(String filterOverride) { + super.setFilterOverride(filterOverride); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableTextQuery setPerDocumentVectorLimit(Integer perDocumentVectorLimit) { + super.setPerDocumentVectorLimit(perDocumentVectorLimit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizableTextQuery setTopicGraph(VectorQueryTopicGraph topicGraph) { + super.setTopicGraph(topicGraph); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java index f7c2fb7f9eb94..83914ad992b80 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java @@ -112,6 +112,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("exhaustive", isExhaustive()); jsonWriter.writeNumberField("oversampling", getOversampling()); jsonWriter.writeNumberField("weight", getWeight()); + jsonWriter.writeJsonField("threshold", getThreshold()); + jsonWriter.writeStringField("filterOverride", getFilterOverride()); + jsonWriter.writeNumberField("perDocumentVectorLimit", getPerDocumentVectorLimit()); + jsonWriter.writeJsonField("topicGraph", getTopicGraph()); jsonWriter.writeArrayField("vector", this.vector, (writer, element) -> writer.writeFloat(element)); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); @@ -134,6 +138,10 @@ public static VectorizedQuery fromJson(JsonReader jsonReader) throws IOException Boolean exhaustive = null; Double oversampling = null; Float weight = null; + VectorThreshold threshold = null; + String filterOverride = null; + Integer perDocumentVectorLimit = null; + VectorQueryTopicGraph topicGraph = null; List vector = null; VectorQueryKind kind = VectorQueryKind.VECTOR; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -149,6 +157,14 @@ public static VectorizedQuery fromJson(JsonReader jsonReader) throws IOException oversampling = reader.getNullable(JsonReader::getDouble); } else if ("weight".equals(fieldName)) { weight = reader.getNullable(JsonReader::getFloat); + } else if ("threshold".equals(fieldName)) { + threshold = VectorThreshold.fromJson(reader); + } else if ("filterOverride".equals(fieldName)) { + filterOverride = reader.getString(); + } else if ("perDocumentVectorLimit".equals(fieldName)) { + perDocumentVectorLimit = reader.getNullable(JsonReader::getInt); + } else if ("topicGraph".equals(fieldName)) { + topicGraph = VectorQueryTopicGraph.fromJson(reader); } else if ("vector".equals(fieldName)) { vector = reader.readArray(reader1 -> reader1.getFloat()); } else if ("kind".equals(fieldName)) { @@ -163,6 +179,10 @@ public static VectorizedQuery fromJson(JsonReader jsonReader) throws IOException deserializedVectorizedQuery.setExhaustive(exhaustive); deserializedVectorizedQuery.setOversampling(oversampling); deserializedVectorizedQuery.setWeight(weight); + deserializedVectorizedQuery.setThreshold(threshold); + deserializedVectorizedQuery.setFilterOverride(filterOverride); + deserializedVectorizedQuery.setPerDocumentVectorLimit(perDocumentVectorLimit); + deserializedVectorizedQuery.setTopicGraph(topicGraph); deserializedVectorizedQuery.kind = kind; return deserializedVectorizedQuery; }); @@ -177,4 +197,44 @@ public VectorizedQuery setWeight(Float weight) { super.setWeight(weight); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizedQuery setThreshold(VectorThreshold threshold) { + super.setThreshold(threshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizedQuery setFilterOverride(String filterOverride) { + super.setFilterOverride(filterOverride); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizedQuery setPerDocumentVectorLimit(Integer perDocumentVectorLimit) { + super.setPerDocumentVectorLimit(perDocumentVectorLimit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VectorizedQuery setTopicGraph(VectorQueryTopicGraph topicGraph) { + super.setTopicGraph(topicGraph); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/module-info.java b/sdk/search/azure-search-documents/src/main/java/module-info.java index 76d73614fd214..925519f236ed7 100644 --- a/sdk/search/azure-search-documents/src/main/java/module-info.java +++ b/sdk/search/azure-search-documents/src/main/java/module-info.java @@ -12,8 +12,8 @@ exports com.azure.search.documents.indexes.models; exports com.azure.search.documents.knowledgebases.models; - opens com.azure.search.documents.models to com.azure.core; opens com.azure.search.documents.implementation.models to com.azure.core; + opens com.azure.search.documents.models to com.azure.core; opens com.azure.search.documents.indexes.models to com.azure.core; opens com.azure.search.documents.knowledgebases.models to com.azure.core; opens com.azure.search.documents.indexes to com.azure.core; diff --git a/sdk/search/azure-search-documents/src/main/resources/META-INF/azure-search-documents_metadata.json b/sdk/search/azure-search-documents/src/main/resources/META-INF/azure-search-documents_metadata.json index 1e04dbabaa786..c563315772251 100644 --- a/sdk/search/azure-search-documents/src/main/resources/META-INF/azure-search-documents_metadata.json +++ b/sdk/search/azure-search-documents/src/main/resources/META-INF/azure-search-documents_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Search":"2026-10-01"},"crossLanguagePackageId":"Search","crossLanguageVersion":"5482911d6e2b","crossLanguageDefinitions":{"com.azure.search.documents.SearchAsyncClient":"Customizations.SearchClient","com.azure.search.documents.SearchAsyncClient.autocomplete":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchAsyncClient.autocompleteGet":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchAsyncClient.autocompleteGetWithResponse":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchAsyncClient.autocompleteWithResponse":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchAsyncClient.getDocument":"Customizations.SearchClient.get","com.azure.search.documents.SearchAsyncClient.getDocumentCount":"Customizations.SearchClient.count","com.azure.search.documents.SearchAsyncClient.getDocumentCountWithResponse":"Customizations.SearchClient.count","com.azure.search.documents.SearchAsyncClient.getDocumentWithResponse":"Customizations.SearchClient.get","com.azure.search.documents.SearchAsyncClient.index":"Customizations.SearchClient.index","com.azure.search.documents.SearchAsyncClient.indexWithResponse":"Customizations.SearchClient.index","com.azure.search.documents.SearchAsyncClient.search":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchAsyncClient.searchGet":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchAsyncClient.searchGetWithResponse":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchAsyncClient.searchWithResponse":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchAsyncClient.suggest":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchAsyncClient.suggestGet":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchAsyncClient.suggestGetWithResponse":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchAsyncClient.suggestWithResponse":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchClient":"Customizations.SearchClient","com.azure.search.documents.SearchClient.autocomplete":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchClient.autocompleteGet":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchClient.autocompleteGetWithResponse":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchClient.autocompleteWithResponse":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchClient.getDocument":"Customizations.SearchClient.get","com.azure.search.documents.SearchClient.getDocumentCount":"Customizations.SearchClient.count","com.azure.search.documents.SearchClient.getDocumentCountWithResponse":"Customizations.SearchClient.count","com.azure.search.documents.SearchClient.getDocumentWithResponse":"Customizations.SearchClient.get","com.azure.search.documents.SearchClient.index":"Customizations.SearchClient.index","com.azure.search.documents.SearchClient.indexWithResponse":"Customizations.SearchClient.index","com.azure.search.documents.SearchClient.search":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchClient.searchGet":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchClient.searchGetWithResponse":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchClient.searchWithResponse":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchClient.suggest":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchClient.suggestGet":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchClient.suggestGetWithResponse":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchClient.suggestWithResponse":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchClientBuilder":"Customizations.SearchClient","com.azure.search.documents.implementation.models.AutocompletePostRequest":"Customizations.SearchClient.autocompletePost.Request.anonymous","com.azure.search.documents.implementation.models.SearchPostRequest":"Customizations.SearchClient.searchPost.Request.anonymous","com.azure.search.documents.implementation.models.SuggestPostRequest":"Customizations.SearchClient.suggestPost.Request.anonymous","com.azure.search.documents.indexes.SearchIndexAsyncClient":"Customizations.SearchIndexClient","com.azure.search.documents.indexes.SearchIndexAsyncClient.analyzeText":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexAsyncClient.analyzeTextWithResponse":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexAsyncClient.createAlias":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createAliasWithResponse":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndex":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndexWithResponse":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeBase":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeSource":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateAlias":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateAliasWithResponse":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateIndex":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateIndexWithResponse":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeBase":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeSource":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateSynonymMap":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateSynonymMapWithResponse":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.createSynonymMap":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.createSynonymMapWithResponse":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteAlias":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteAliasWithResponse":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteIndex":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteIndexWithResponse":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeBase":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSource":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSourceFile":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSourceFileWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteSynonymMap":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteSynonymMapWithResponse":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.getAlias":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.getAliasWithResponse":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndex":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexStatistics":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexStatisticsWithResponse":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexWithResponse":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeBase":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSource":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceStatus":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceStatusWithResponse":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.getServiceStatistics":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getServiceStatisticsWithResponse":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getSynonymMap":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.getSynonymMapWithResponse":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.listAliases":"Customizations.SearchIndexClient.listAliases","com.azure.search.documents.indexes.SearchIndexAsyncClient.listIndexStatsSummary":"Customizations.SearchIndexClient.getIndexStatsSummary","com.azure.search.documents.indexes.SearchIndexAsyncClient.listIndexes":"Customizations.SearchIndexClient.listIndexes","com.azure.search.documents.indexes.SearchIndexAsyncClient.listIndexesWithSelectedProperties":"Customizations.SearchIndexClient.listIndexesWithSelectedProperties","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeBases":"Customizations.SearchIndexClient.listKnowledgeBases","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeSourceFiles":"Customizations.SearchIndexClient.listKnowledgeSourceFiles","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeSources":"Customizations.SearchIndexClient.listKnowledgeSources","com.azure.search.documents.indexes.SearchIndexAsyncClient.listSynonymMaps":"Customizations.SearchIndexClient.listSynonymMaps","com.azure.search.documents.indexes.SearchIndexAsyncClient.updateKnowledgeSourceFile":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.updateKnowledgeSourceFileWithResponseInternal":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.uploadKnowledgeSourceFileMultipart":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexAsyncClient.uploadKnowledgeSourceFileMultipartWithResponseInternal":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient":"Customizations.SearchIndexClient","com.azure.search.documents.indexes.SearchIndexClient.analyzeText":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexClient.analyzeTextWithResponse":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexClient.createAlias":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexClient.createAliasWithResponse":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexClient.createIndex":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexClient.createIndexWithResponse":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeBase":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeSource":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateAlias":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateAliasWithResponse":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateIndex":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateIndexWithResponse":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeBase":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeSource":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateSynonymMap":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateSynonymMapWithResponse":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.createSynonymMap":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.createSynonymMapWithResponse":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.deleteAlias":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexClient.deleteAliasWithResponse":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexClient.deleteIndex":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexClient.deleteIndexWithResponse":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeBase":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSource":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSourceFile":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSourceFileWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.deleteSynonymMap":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.deleteSynonymMapWithResponse":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.getAlias":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexClient.getAliasWithResponse":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexClient.getIndex":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexClient.getIndexStatistics":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexClient.getIndexStatisticsWithResponse":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexClient.getIndexWithResponse":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeBase":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSource":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceStatus":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceStatusWithResponse":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.getServiceStatistics":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexClient.getServiceStatisticsWithResponse":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexClient.getSynonymMap":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.getSynonymMapWithResponse":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.listAliases":"Customizations.SearchIndexClient.listAliases","com.azure.search.documents.indexes.SearchIndexClient.listIndexStatsSummary":"Customizations.SearchIndexClient.getIndexStatsSummary","com.azure.search.documents.indexes.SearchIndexClient.listIndexes":"Customizations.SearchIndexClient.listIndexes","com.azure.search.documents.indexes.SearchIndexClient.listIndexesWithSelectedProperties":"Customizations.SearchIndexClient.listIndexesWithSelectedProperties","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeBases":"Customizations.SearchIndexClient.listKnowledgeBases","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeSourceFiles":"Customizations.SearchIndexClient.listKnowledgeSourceFiles","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeSources":"Customizations.SearchIndexClient.listKnowledgeSources","com.azure.search.documents.indexes.SearchIndexClient.listSynonymMaps":"Customizations.SearchIndexClient.listSynonymMaps","com.azure.search.documents.indexes.SearchIndexClient.updateKnowledgeSourceFile":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.updateKnowledgeSourceFileWithResponseInternal":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.uploadKnowledgeSourceFileMultipart":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient.uploadKnowledgeSourceFileMultipartWithResponseInternal":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClientBuilder":"Customizations.SearchIndexClient","com.azure.search.documents.indexes.SearchIndexerAsyncClient":"Customizations.SearchIndexerClient","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnection":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexer":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexerWithResponse":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnection":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexer":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerWithResponse":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillset":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillset":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillsetWithResponse":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnection":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexer":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexerWithResponse":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillset":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillsetWithResponse":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnection":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexer":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatus":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatusWithResponse":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerWithResponse":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillset":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillsetWithResponse":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections":"Customizations.SearchIndexerClient.listDataSources","com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers":"Customizations.SearchIndexerClient.listIndexers","com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsets":"Customizations.SearchIndexerClient.listSkillsets","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexer":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexerWithResponse":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resync":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resyncWithResponse":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexer":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexerWithResponse":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerClient":"Customizations.SearchIndexerClient","com.azure.search.documents.indexes.SearchIndexerClient.createDataSourceConnection":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createIndexer":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createIndexerWithResponse":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateDataSourceConnection":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateIndexer":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateIndexerWithResponse":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateSkillset":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateSkillsetWithResponse":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerClient.createSkillset":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerClient.createSkillsetWithResponse":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerClient.deleteDataSourceConnection":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerClient.deleteDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerClient.deleteIndexer":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerClient.deleteIndexerWithResponse":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerClient.deleteSkillset":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerClient.deleteSkillsetWithResponse":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerClient.getDataSourceConnection":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerClient.getDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerClient.getIndexer":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerClient.getIndexerStatus":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerClient.getIndexerStatusWithResponse":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerClient.getIndexerWithResponse":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerClient.getSkillset":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerClient.getSkillsetWithResponse":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnections":"Customizations.SearchIndexerClient.listDataSources","com.azure.search.documents.indexes.SearchIndexerClient.listIndexers":"Customizations.SearchIndexerClient.listIndexers","com.azure.search.documents.indexes.SearchIndexerClient.listSkillsets":"Customizations.SearchIndexerClient.listSkillsets","com.azure.search.documents.indexes.SearchIndexerClient.resetIndexer":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerClient.resetIndexerWithResponse":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerClient.resync":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerClient.resyncWithResponse":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerClient.runIndexer":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerClient.runIndexerWithResponse":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerClientBuilder":"Customizations.SearchIndexerClient","com.azure.search.documents.indexes.models.AIServicesAccountIdentity":"Search.AIServicesAccountIdentity","com.azure.search.documents.indexes.models.AIServicesAccountKey":"Search.AIServicesAccountKey","com.azure.search.documents.indexes.models.AnalyzeResult":"Search.AnalyzeResult","com.azure.search.documents.indexes.models.AnalyzeTextOptions":"Search.AnalyzeRequest","com.azure.search.documents.indexes.models.AnalyzedTokenInfo":"Search.AnalyzedTokenInfo","com.azure.search.documents.indexes.models.AsciiFoldingTokenFilter":"Search.AsciiFoldingTokenFilter","com.azure.search.documents.indexes.models.AzureActiveDirectoryApplicationCredentials":"Search.AzureActiveDirectoryApplicationCredentials","com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource":"Search.AzureBlobKnowledgeSource","com.azure.search.documents.indexes.models.AzureBlobKnowledgeSourceParameters":"Search.AzureBlobKnowledgeSourceParameters","com.azure.search.documents.indexes.models.AzureOpenAIEmbeddingSkill":"Search.AzureOpenAIEmbeddingSkill","com.azure.search.documents.indexes.models.AzureOpenAIModelName":"Search.AzureOpenAIModelName","com.azure.search.documents.indexes.models.AzureOpenAIVectorizer":"Search.AzureOpenAIVectorizer","com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters":"Search.AzureOpenAIVectorizerParameters","com.azure.search.documents.indexes.models.BM25SimilarityAlgorithm":"Search.BM25SimilarityAlgorithm","com.azure.search.documents.indexes.models.BinaryQuantizationCompression":"Search.BinaryQuantizationCompression","com.azure.search.documents.indexes.models.BlobIndexerDataToExtract":"Search.BlobIndexerDataToExtract","com.azure.search.documents.indexes.models.BlobIndexerImageAction":"Search.BlobIndexerImageAction","com.azure.search.documents.indexes.models.BlobIndexerPDFTextRotationAlgorithm":"Search.BlobIndexerPDFTextRotationAlgorithm","com.azure.search.documents.indexes.models.BlobIndexerParsingMode":"Search.BlobIndexerParsingMode","com.azure.search.documents.indexes.models.CharFilter":"Search.CharFilter","com.azure.search.documents.indexes.models.CharFilterName":"Search.CharFilterName","com.azure.search.documents.indexes.models.ChatCompletionCommonModelParameters":"Search.ChatCompletionCommonModelParameters","com.azure.search.documents.indexes.models.ChatCompletionExtraParametersBehavior":"Search.ChatCompletionExtraParametersBehavior","com.azure.search.documents.indexes.models.ChatCompletionResponseFormat":"Search.ChatCompletionResponseFormat","com.azure.search.documents.indexes.models.ChatCompletionResponseFormatType":"Search.ChatCompletionResponseFormatType","com.azure.search.documents.indexes.models.ChatCompletionSchema":"Search.ChatCompletionSchema","com.azure.search.documents.indexes.models.ChatCompletionSchemaProperties":"Search.ChatCompletionSchemaProperties","com.azure.search.documents.indexes.models.ChatCompletionSkill":"Search.ChatCompletionSkill","com.azure.search.documents.indexes.models.CjkBigramTokenFilter":"Search.CjkBigramTokenFilter","com.azure.search.documents.indexes.models.CjkBigramTokenFilterScripts":"Search.CjkBigramTokenFilterScripts","com.azure.search.documents.indexes.models.ClassicSimilarityAlgorithm":"Search.ClassicSimilarityAlgorithm","com.azure.search.documents.indexes.models.ClassicTokenizer":"Search.ClassicTokenizer","com.azure.search.documents.indexes.models.CognitiveServicesAccount":"Search.CognitiveServicesAccount","com.azure.search.documents.indexes.models.CognitiveServicesAccountKey":"Search.CognitiveServicesAccountKey","com.azure.search.documents.indexes.models.CommonGramTokenFilter":"Search.CommonGramTokenFilter","com.azure.search.documents.indexes.models.ConditionalSkill":"Search.ConditionalSkill","com.azure.search.documents.indexes.models.ContentColumnMapping":"Search.ContentColumnMapping","com.azure.search.documents.indexes.models.ContentUnderstandingSkill":"Search.ContentUnderstandingSkill","com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingProperties":"Search.ContentUnderstandingSkillChunkingProperties","com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingUnit":"Search.ContentUnderstandingSkillChunkingUnit","com.azure.search.documents.indexes.models.ContentUnderstandingSkillExtractionOptions":"Search.ContentUnderstandingSkillExtractionOptions","com.azure.search.documents.indexes.models.CorsOptions":"Search.CorsOptions","com.azure.search.documents.indexes.models.CreatedResources":"Search.CreatedResources","com.azure.search.documents.indexes.models.CustomAnalyzer":"Search.CustomAnalyzer","com.azure.search.documents.indexes.models.CustomEntity":"Search.CustomEntity","com.azure.search.documents.indexes.models.CustomEntityAlias":"Search.CustomEntityAlias","com.azure.search.documents.indexes.models.CustomEntityLookupSkill":"Search.CustomEntityLookupSkill","com.azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage":"Search.CustomEntityLookupSkillLanguage","com.azure.search.documents.indexes.models.CustomNormalizer":"Search.CustomNormalizer","com.azure.search.documents.indexes.models.DataChangeDetectionPolicy":"Search.DataChangeDetectionPolicy","com.azure.search.documents.indexes.models.DataDeletionDetectionPolicy":"Search.DataDeletionDetectionPolicy","com.azure.search.documents.indexes.models.DataSourceCredentials":"Search.DataSourceCredentials","com.azure.search.documents.indexes.models.DefaultCognitiveServicesAccount":"Search.DefaultCognitiveServicesAccount","com.azure.search.documents.indexes.models.DictionaryDecompounderTokenFilter":"Search.DictionaryDecompounderTokenFilter","com.azure.search.documents.indexes.models.DistanceScoringFunction":"Search.DistanceScoringFunction","com.azure.search.documents.indexes.models.DistanceScoringParameters":"Search.DistanceScoringParameters","com.azure.search.documents.indexes.models.DocumentExtractionSkill":"Search.DocumentExtractionSkill","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkill":"Search.DocumentIntelligenceLayoutSkill","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillChunkingProperties":"Search.DocumentIntelligenceLayoutSkillChunkingProperties","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillChunkingUnit":"Search.DocumentIntelligenceLayoutSkillChunkingUnit","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillExtractionOptions":"Search.DocumentIntelligenceLayoutSkillExtractionOptions","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth":"Search.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillOutputFormat":"Search.DocumentIntelligenceLayoutSkillOutputFormat","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillOutputMode":"Search.DocumentIntelligenceLayoutSkillOutputMode","com.azure.search.documents.indexes.models.DocumentKeysOrIds":"Search.DocumentKeysOrIds","com.azure.search.documents.indexes.models.EdgeNGramTokenFilter":"Search.EdgeNGramTokenFilter","com.azure.search.documents.indexes.models.EdgeNGramTokenFilterSide":"Search.EdgeNGramTokenFilterSide","com.azure.search.documents.indexes.models.EdgeNGramTokenFilterV2":"Search.EdgeNGramTokenFilterV2","com.azure.search.documents.indexes.models.EdgeNGramTokenizer":"Search.EdgeNGramTokenizer","com.azure.search.documents.indexes.models.ElisionTokenFilter":"Search.ElisionTokenFilter","com.azure.search.documents.indexes.models.EmbeddingColumnMapping":"Search.EmbeddingColumnMapping","com.azure.search.documents.indexes.models.EntityCategory":"Search.EntityCategory","com.azure.search.documents.indexes.models.EntityLinkingSkill":"Search.EntityLinkingSkill","com.azure.search.documents.indexes.models.EntityRecognitionSkillLanguage":"Search.EntityRecognitionSkillLanguage","com.azure.search.documents.indexes.models.EntityRecognitionSkillV3":"Search.EntityRecognitionSkillV3","com.azure.search.documents.indexes.models.ExhaustiveKnnAlgorithmConfiguration":"Search.ExhaustiveKnnAlgorithmConfiguration","com.azure.search.documents.indexes.models.ExhaustiveKnnParameters":"Search.ExhaustiveKnnParameters","com.azure.search.documents.indexes.models.FieldMapping":"Search.FieldMapping","com.azure.search.documents.indexes.models.FieldMappingFunction":"Search.FieldMappingFunction","com.azure.search.documents.indexes.models.FileKnowledgeSource":"Search.FileKnowledgeSource","com.azure.search.documents.indexes.models.FileKnowledgeSourceExtractionMode":"Search.FileKnowledgeSourceExtractionMode","com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters":"Search.FileKnowledgeSourceParameters","com.azure.search.documents.indexes.models.FileUploadMetadata":"Search.FileUploadMetadata","com.azure.search.documents.indexes.models.FreshnessScoringFunction":"Search.FreshnessScoringFunction","com.azure.search.documents.indexes.models.FreshnessScoringParameters":"Search.FreshnessScoringParameters","com.azure.search.documents.indexes.models.GetIndexStatisticsResult":"Search.GetIndexStatisticsResult","com.azure.search.documents.indexes.models.HighWaterMarkChangeDetectionPolicy":"Search.HighWaterMarkChangeDetectionPolicy","com.azure.search.documents.indexes.models.HnswAlgorithmConfiguration":"Search.HnswAlgorithmConfiguration","com.azure.search.documents.indexes.models.HnswParameters":"Search.HnswParameters","com.azure.search.documents.indexes.models.ImageAnalysisSkill":"Search.ImageAnalysisSkill","com.azure.search.documents.indexes.models.ImageAnalysisSkillLanguage":"Search.ImageAnalysisSkillLanguage","com.azure.search.documents.indexes.models.ImageDetail":"Search.ImageDetail","com.azure.search.documents.indexes.models.IndexProjectionMode":"Search.IndexProjectionMode","com.azure.search.documents.indexes.models.IndexStatisticsSummary":"Search.IndexStatisticsSummary","com.azure.search.documents.indexes.models.IndexedOneLakeKnowledgeSource":"Search.IndexedOneLakeKnowledgeSource","com.azure.search.documents.indexes.models.IndexedOneLakeKnowledgeSourceParameters":"Search.IndexedOneLakeKnowledgeSourceParameters","com.azure.search.documents.indexes.models.IndexedSharePointContainerName":"Search.IndexedSharePointContainerName","com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSource":"Search.IndexedSharePointKnowledgeSource","com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSourceParameters":"Search.IndexedSharePointKnowledgeSourceParameters","com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSource":"Search.IndexedSqlKnowledgeSource","com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSourceParameters":"Search.IndexedSqlKnowledgeSourceParameters","com.azure.search.documents.indexes.models.IndexerExecutionEnvironment":"Search.IndexerExecutionEnvironment","com.azure.search.documents.indexes.models.IndexerExecutionResult":"Search.IndexerExecutionResult","com.azure.search.documents.indexes.models.IndexerExecutionStatus":"Search.IndexerExecutionStatus","com.azure.search.documents.indexes.models.IndexerPermissionOption":"Search.IndexerPermissionOption","com.azure.search.documents.indexes.models.IndexerResyncBody":"Search.IndexerResyncBody","com.azure.search.documents.indexes.models.IndexerResyncOption":"Search.IndexerResyncOption","com.azure.search.documents.indexes.models.IndexerRuntime":"Search.IndexerRuntime","com.azure.search.documents.indexes.models.IndexerStatus":"Search.IndexerStatus","com.azure.search.documents.indexes.models.IndexingParameters":"Search.IndexingParameters","com.azure.search.documents.indexes.models.IndexingParametersConfiguration":"Search.IndexingParametersConfiguration","com.azure.search.documents.indexes.models.IndexingSchedule":"Search.IndexingSchedule","com.azure.search.documents.indexes.models.InputFieldMappingEntry":"Search.InputFieldMappingEntry","com.azure.search.documents.indexes.models.KeepTokenFilter":"Search.KeepTokenFilter","com.azure.search.documents.indexes.models.KeyPhraseExtractionSkill":"Search.KeyPhraseExtractionSkill","com.azure.search.documents.indexes.models.KeyPhraseExtractionSkillLanguage":"Search.KeyPhraseExtractionSkillLanguage","com.azure.search.documents.indexes.models.KeywordMarkerTokenFilter":"Search.KeywordMarkerTokenFilter","com.azure.search.documents.indexes.models.KeywordTokenizer":"Search.KeywordTokenizer","com.azure.search.documents.indexes.models.KeywordTokenizerV2":"Search.KeywordTokenizerV2","com.azure.search.documents.indexes.models.KnowledgeBase":"Search.KnowledgeBase","com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel":"Search.KnowledgeBaseAzureOpenAIModel","com.azure.search.documents.indexes.models.KnowledgeBaseModel":"Search.KnowledgeBaseModel","com.azure.search.documents.indexes.models.KnowledgeBaseModelKind":"Search.KnowledgeBaseModelKind","com.azure.search.documents.indexes.models.KnowledgeSource":"Search.KnowledgeSource","com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode":"Search.KnowledgeSourceContentExtractionMode","com.azure.search.documents.indexes.models.KnowledgeSourceFile":"Search.KnowledgeSourceFile","com.azure.search.documents.indexes.models.KnowledgeSourceFileCapacity":"Search.KnowledgeSourceFileCapacity","com.azure.search.documents.indexes.models.KnowledgeSourceIngestionPermissionOption":"Search.KnowledgeSourceIngestionPermissionOption","com.azure.search.documents.indexes.models.KnowledgeSourceKind":"Search.KnowledgeSourceKind","com.azure.search.documents.indexes.models.KnowledgeSourceReference":"Search.KnowledgeSourceReference","com.azure.search.documents.indexes.models.KnowledgeSourceSynchronizationStatus":"Search.KnowledgeSourceSynchronizationStatus","com.azure.search.documents.indexes.models.LanguageDetectionSkill":"Search.LanguageDetectionSkill","com.azure.search.documents.indexes.models.LengthTokenFilter":"Search.LengthTokenFilter","com.azure.search.documents.indexes.models.LexicalAnalyzer":"Search.LexicalAnalyzer","com.azure.search.documents.indexes.models.LexicalAnalyzerName":"Search.LexicalAnalyzerName","com.azure.search.documents.indexes.models.LexicalNormalizer":"Search.LexicalNormalizer","com.azure.search.documents.indexes.models.LexicalNormalizerName":"Search.LexicalNormalizerName","com.azure.search.documents.indexes.models.LexicalTokenizer":"Search.LexicalTokenizer","com.azure.search.documents.indexes.models.LexicalTokenizerName":"Search.LexicalTokenizerName","com.azure.search.documents.indexes.models.LimitTokenFilter":"Search.LimitTokenFilter","com.azure.search.documents.indexes.models.ListDataSourcesResult":"Search.ListDataSourcesResult","com.azure.search.documents.indexes.models.ListIndexersResult":"Search.ListIndexersResult","com.azure.search.documents.indexes.models.ListSkillsetsResult":"Search.ListSkillsetsResult","com.azure.search.documents.indexes.models.ListSynonymMapsResult":"Search.ListSynonymMapsResult","com.azure.search.documents.indexes.models.ListingSearchType":"Search.ListingSearchType","com.azure.search.documents.indexes.models.LuceneStandardAnalyzer":"Search.LuceneStandardAnalyzer","com.azure.search.documents.indexes.models.LuceneStandardTokenizer":"Search.LuceneStandardTokenizer","com.azure.search.documents.indexes.models.LuceneStandardTokenizerV2":"Search.LuceneStandardTokenizerV2","com.azure.search.documents.indexes.models.MagnitudeScoringFunction":"Search.MagnitudeScoringFunction","com.azure.search.documents.indexes.models.MagnitudeScoringParameters":"Search.MagnitudeScoringParameters","com.azure.search.documents.indexes.models.MappingCharFilter":"Search.MappingCharFilter","com.azure.search.documents.indexes.models.MarkdownHeaderDepth":"Search.MarkdownHeaderDepth","com.azure.search.documents.indexes.models.MarkdownParsingSubmode":"Search.MarkdownParsingSubmode","com.azure.search.documents.indexes.models.MergeSkill":"Search.MergeSkill","com.azure.search.documents.indexes.models.MicrosoftLanguageStemmingTokenizer":"Search.MicrosoftLanguageStemmingTokenizer","com.azure.search.documents.indexes.models.MicrosoftLanguageTokenizer":"Search.MicrosoftLanguageTokenizer","com.azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage":"Search.MicrosoftStemmingTokenizerLanguage","com.azure.search.documents.indexes.models.MicrosoftTokenizerLanguage":"Search.MicrosoftTokenizerLanguage","com.azure.search.documents.indexes.models.NGramTokenFilter":"Search.NGramTokenFilter","com.azure.search.documents.indexes.models.NGramTokenFilterV2":"Search.NGramTokenFilterV2","com.azure.search.documents.indexes.models.NGramTokenizer":"Search.NGramTokenizer","com.azure.search.documents.indexes.models.NativeBlobSoftDeleteDeletionDetectionPolicy":"Search.NativeBlobSoftDeleteDeletionDetectionPolicy","com.azure.search.documents.indexes.models.OcrLineEnding":"Search.OcrLineEnding","com.azure.search.documents.indexes.models.OcrSkill":"Search.OcrSkill","com.azure.search.documents.indexes.models.OcrSkillLanguage":"Search.OcrSkillLanguage","com.azure.search.documents.indexes.models.OutputFieldMappingEntry":"Search.OutputFieldMappingEntry","com.azure.search.documents.indexes.models.PIIDetectionSkill":"Search.PIIDetectionSkill","com.azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode":"Search.PIIDetectionSkillMaskingMode","com.azure.search.documents.indexes.models.PathHierarchyTokenizerV2":"Search.PathHierarchyTokenizerV2","com.azure.search.documents.indexes.models.PatternAnalyzer":"Search.PatternAnalyzer","com.azure.search.documents.indexes.models.PatternCaptureTokenFilter":"Search.PatternCaptureTokenFilter","com.azure.search.documents.indexes.models.PatternReplaceCharFilter":"Search.PatternReplaceCharFilter","com.azure.search.documents.indexes.models.PatternReplaceTokenFilter":"Search.PatternReplaceTokenFilter","com.azure.search.documents.indexes.models.PatternTokenizer":"Search.PatternTokenizer","com.azure.search.documents.indexes.models.PermissionFilter":"Search.PermissionFilter","com.azure.search.documents.indexes.models.PhoneticEncoder":"Search.PhoneticEncoder","com.azure.search.documents.indexes.models.PhoneticTokenFilter":"Search.PhoneticTokenFilter","com.azure.search.documents.indexes.models.RankingOrder":"Search.RankingOrder","com.azure.search.documents.indexes.models.RegexFlags":"Search.RegexFlags","com.azure.search.documents.indexes.models.RescoringOptions":"Search.RescoringOptions","com.azure.search.documents.indexes.models.ResourceCounter":"Search.ResourceCounter","com.azure.search.documents.indexes.models.ScalarQuantizationCompression":"Search.ScalarQuantizationCompression","com.azure.search.documents.indexes.models.ScalarQuantizationParameters":"Search.ScalarQuantizationParameters","com.azure.search.documents.indexes.models.ScoringFunction":"Search.ScoringFunction","com.azure.search.documents.indexes.models.ScoringFunctionAggregation":"Search.ScoringFunctionAggregation","com.azure.search.documents.indexes.models.ScoringFunctionInterpolation":"Search.ScoringFunctionInterpolation","com.azure.search.documents.indexes.models.ScoringProfile":"Search.ScoringProfile","com.azure.search.documents.indexes.models.SearchAlias":"Search.SearchAlias","com.azure.search.documents.indexes.models.SearchField":"Search.SearchField","com.azure.search.documents.indexes.models.SearchFieldDataType":"Search.SearchFieldDataType","com.azure.search.documents.indexes.models.SearchIndex":"Search.SearchIndex","com.azure.search.documents.indexes.models.SearchIndexFieldReference":"Search.SearchIndexFieldReference","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource":"Search.SearchIndexKnowledgeSource","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters":"Search.SearchIndexKnowledgeSourceParameters","com.azure.search.documents.indexes.models.SearchIndexPermissionFilterOption":"Search.SearchIndexPermissionFilterOption","com.azure.search.documents.indexes.models.SearchIndexResponse":"Search.SearchIndexResponse","com.azure.search.documents.indexes.models.SearchIndexer":"Search.SearchIndexer","com.azure.search.documents.indexes.models.SearchIndexerDataContainer":"Search.SearchIndexerDataContainer","com.azure.search.documents.indexes.models.SearchIndexerDataIdentity":"Search.SearchIndexerDataIdentity","com.azure.search.documents.indexes.models.SearchIndexerDataNoneIdentity":"Search.SearchIndexerDataNoneIdentity","com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection":"Search.SearchIndexerDataSource","com.azure.search.documents.indexes.models.SearchIndexerDataSourceType":"Search.SearchIndexerDataSourceType","com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity":"Search.SearchIndexerDataUserAssignedIdentity","com.azure.search.documents.indexes.models.SearchIndexerError":"Search.SearchIndexerError","com.azure.search.documents.indexes.models.SearchIndexerIndexProjection":"Search.SearchIndexerIndexProjection","com.azure.search.documents.indexes.models.SearchIndexerIndexProjectionSelector":"Search.SearchIndexerIndexProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerIndexProjectionsParameters":"Search.SearchIndexerIndexProjectionsParameters","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStore":"Search.SearchIndexerKnowledgeStore","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreBlobProjectionSelector":"Search.SearchIndexerKnowledgeStoreBlobProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreFileProjectionSelector":"Search.SearchIndexerKnowledgeStoreFileProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreObjectProjectionSelector":"Search.SearchIndexerKnowledgeStoreObjectProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreProjection":"Search.SearchIndexerKnowledgeStoreProjection","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreProjectionSelector":"Search.SearchIndexerKnowledgeStoreProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreTableProjectionSelector":"Search.SearchIndexerKnowledgeStoreTableProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerLimits":"Search.SearchIndexerLimits","com.azure.search.documents.indexes.models.SearchIndexerSkill":"Search.SearchIndexerSkill","com.azure.search.documents.indexes.models.SearchIndexerSkillset":"Search.SearchIndexerSkillset","com.azure.search.documents.indexes.models.SearchIndexerStatus":"Search.SearchIndexerStatus","com.azure.search.documents.indexes.models.SearchIndexerWarning":"Search.SearchIndexerWarning","com.azure.search.documents.indexes.models.SearchResourceEncryptionKey":"Search.SearchResourceEncryptionKey","com.azure.search.documents.indexes.models.SearchServiceCounters":"Search.SearchServiceCounters","com.azure.search.documents.indexes.models.SearchServiceLimits":"Search.SearchServiceLimits","com.azure.search.documents.indexes.models.SearchServiceStatistics":"Search.SearchServiceStatistics","com.azure.search.documents.indexes.models.SearchSuggester":"Search.SearchSuggester","com.azure.search.documents.indexes.models.SemanticConfiguration":"Search.SemanticConfiguration","com.azure.search.documents.indexes.models.SemanticField":"Search.SemanticField","com.azure.search.documents.indexes.models.SemanticPrioritizedFields":"Search.SemanticPrioritizedFields","com.azure.search.documents.indexes.models.SemanticSearch":"Search.SemanticSearch","com.azure.search.documents.indexes.models.SentimentSkillLanguage":"Search.SentimentSkillLanguage","com.azure.search.documents.indexes.models.SentimentSkillV3":"Search.SentimentSkillV3","com.azure.search.documents.indexes.models.ServiceIndexersRuntime":"Search.ServiceIndexersRuntime","com.azure.search.documents.indexes.models.ShaperSkill":"Search.ShaperSkill","com.azure.search.documents.indexes.models.ShingleTokenFilter":"Search.ShingleTokenFilter","com.azure.search.documents.indexes.models.SimilarityAlgorithm":"Search.SimilarityAlgorithm","com.azure.search.documents.indexes.models.SkillNames":"Search.SkillNames","com.azure.search.documents.indexes.models.SnowballTokenFilter":"Search.SnowballTokenFilter","com.azure.search.documents.indexes.models.SnowballTokenFilterLanguage":"Search.SnowballTokenFilterLanguage","com.azure.search.documents.indexes.models.SoftDeleteColumnDeletionDetectionPolicy":"Search.SoftDeleteColumnDeletionDetectionPolicy","com.azure.search.documents.indexes.models.SplitSkill":"Search.SplitSkill","com.azure.search.documents.indexes.models.SplitSkillLanguage":"Search.SplitSkillLanguage","com.azure.search.documents.indexes.models.SqlIntegratedChangeTrackingPolicy":"Search.SqlIntegratedChangeTrackingPolicy","com.azure.search.documents.indexes.models.StemmerOverrideTokenFilter":"Search.StemmerOverrideTokenFilter","com.azure.search.documents.indexes.models.StemmerTokenFilter":"Search.StemmerTokenFilter","com.azure.search.documents.indexes.models.StemmerTokenFilterLanguage":"Search.StemmerTokenFilterLanguage","com.azure.search.documents.indexes.models.StopAnalyzer":"Search.StopAnalyzer","com.azure.search.documents.indexes.models.StopwordsList":"Search.StopwordsList","com.azure.search.documents.indexes.models.StopwordsTokenFilter":"Search.StopwordsTokenFilter","com.azure.search.documents.indexes.models.SynonymMap":"Search.SynonymMap","com.azure.search.documents.indexes.models.SynonymTokenFilter":"Search.SynonymTokenFilter","com.azure.search.documents.indexes.models.TagScoringFunction":"Search.TagScoringFunction","com.azure.search.documents.indexes.models.TagScoringParameters":"Search.TagScoringParameters","com.azure.search.documents.indexes.models.TextSplitMode":"Search.TextSplitMode","com.azure.search.documents.indexes.models.TextTranslationSkill":"Search.TextTranslationSkill","com.azure.search.documents.indexes.models.TextTranslationSkillLanguage":"Search.TextTranslationSkillLanguage","com.azure.search.documents.indexes.models.TextWeights":"Search.TextWeights","com.azure.search.documents.indexes.models.TokenCharacterKind":"Search.TokenCharacterKind","com.azure.search.documents.indexes.models.TokenFilter":"Search.TokenFilter","com.azure.search.documents.indexes.models.TokenFilterName":"Search.TokenFilterName","com.azure.search.documents.indexes.models.TruncateTokenFilter":"Search.TruncateTokenFilter","com.azure.search.documents.indexes.models.UaxUrlEmailTokenizer":"Search.UaxUrlEmailTokenizer","com.azure.search.documents.indexes.models.UniqueTokenFilter":"Search.UniqueTokenFilter","com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest":"Search.UpdateKnowledgeSourceFileRequest","com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest":"Search.UploadKnowledgeSourceFileMultipartRequest","com.azure.search.documents.indexes.models.VectorEncodingFormat":"Search.VectorEncodingFormat","com.azure.search.documents.indexes.models.VectorSearch":"Search.VectorSearch","com.azure.search.documents.indexes.models.VectorSearchAlgorithmConfiguration":"Search.VectorSearchAlgorithmConfiguration","com.azure.search.documents.indexes.models.VectorSearchAlgorithmKind":"Search.VectorSearchAlgorithmKind","com.azure.search.documents.indexes.models.VectorSearchAlgorithmMetric":"Search.VectorSearchAlgorithmMetric","com.azure.search.documents.indexes.models.VectorSearchCompression":"Search.VectorSearchCompression","com.azure.search.documents.indexes.models.VectorSearchCompressionKind":"Search.VectorSearchCompressionKind","com.azure.search.documents.indexes.models.VectorSearchCompressionRescoreStorageMethod":"Search.VectorSearchCompressionRescoreStorageMethod","com.azure.search.documents.indexes.models.VectorSearchCompressionTarget":"Search.VectorSearchCompressionTarget","com.azure.search.documents.indexes.models.VectorSearchProfile":"Search.VectorSearchProfile","com.azure.search.documents.indexes.models.VectorSearchVectorizer":"Search.VectorSearchVectorizer","com.azure.search.documents.indexes.models.VectorSearchVectorizerKind":"Search.VectorSearchVectorizerKind","com.azure.search.documents.indexes.models.VisualFeature":"Search.VisualFeature","com.azure.search.documents.indexes.models.WebApiHttpHeaders":"Search.WebApiHttpHeaders","com.azure.search.documents.indexes.models.WebApiSkill":"Search.WebApiSkill","com.azure.search.documents.indexes.models.WebApiVectorizer":"Search.WebApiVectorizer","com.azure.search.documents.indexes.models.WebApiVectorizerParameters":"Search.WebApiVectorizerParameters","com.azure.search.documents.indexes.models.WebKnowledgeSource":"Search.WebKnowledgeSource","com.azure.search.documents.indexes.models.WebKnowledgeSourceDomain":"Search.WebKnowledgeSourceDomain","com.azure.search.documents.indexes.models.WebKnowledgeSourceDomains":"Search.WebKnowledgeSourceDomains","com.azure.search.documents.indexes.models.WebKnowledgeSourceParameters":"Search.WebKnowledgeSourceParameters","com.azure.search.documents.indexes.models.WordDelimiterTokenFilter":"Search.WordDelimiterTokenFilter","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient":"Customizations.KnowledgeBaseRetrievalClient","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieve":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieveStream":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieveStreamWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieveWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient":"Customizations.KnowledgeBaseRetrievalClient","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieve":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieveStream":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieveStreamWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieveWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder":"Customizations.KnowledgeBaseRetrievalClient","com.azure.search.documents.knowledgebases.models.AiServices":"Search.AIServices","com.azure.search.documents.knowledgebases.models.AzureBlobKnowledgeSourceParams":"Search.AzureBlobKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.CompletedSynchronizationState":"Search.CompletedSynchronizationState","com.azure.search.documents.knowledgebases.models.FileKnowledgeSourceParams":"Search.FileKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.IndexedOneLakeKnowledgeSourceParams":"Search.IndexedOneLakeKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.IndexedSharePointKnowledgeSourceParams":"Search.IndexedSharePointKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.IndexedSqlKnowledgeSourceParams":"Search.IndexedSqlKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityCompletedStreamEvent":"Search.KnowledgeBaseActivityCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord":"Search.KnowledgeBaseActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel":"Search.KnowledgeBaseActivityRecordModel","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordType":"Search.KnowledgeBaseActivityRecordType","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedEvent":"Search.KnowledgeBaseActivityStartedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedStreamEvent":"Search.KnowledgeBaseActivityStartedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord":"Search.KnowledgeBaseAgenticReasoningActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedEvent":"Search.KnowledgeBaseAnswerCompletedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent":"Search.KnowledgeBaseAnswerCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityArguments":"Search.KnowledgeBaseAzureBlobActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityRecord":"Search.KnowledgeBaseAzureBlobActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobReference":"Search.KnowledgeBaseAzureBlobReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseErrorAdditionalInfo":"Search.KnowledgeBaseErrorAdditionalInfo","com.azure.search.documents.knowledgebases.models.KnowledgeBaseErrorDetail":"Search.KnowledgeBaseErrorDetail","com.azure.search.documents.knowledgebases.models.KnowledgeBaseErrorStreamEvent":"Search.KnowledgeBaseErrorStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileActivityArguments":"Search.KnowledgeBaseFileActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileActivityRecord":"Search.KnowledgeBaseFileActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileReference":"Search.KnowledgeBaseFileReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseImageContent":"Search.KnowledgeBaseImageContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeActivityArguments":"Search.KnowledgeBaseIndexedOneLakeActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeActivityRecord":"Search.KnowledgeBaseIndexedOneLakeActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeReference":"Search.KnowledgeBaseIndexedOneLakeReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointActivityArguments":"Search.KnowledgeBaseIndexedSharePointActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointActivityRecord":"Search.KnowledgeBaseIndexedSharePointActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointReference":"Search.KnowledgeBaseIndexedSharePointReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlActivityArguments":"Search.KnowledgeBaseIndexedSqlActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlActivityRecord":"Search.KnowledgeBaseIndexedSqlActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference":"Search.KnowledgeBaseIndexedSqlReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage":"Search.KnowledgeBaseMessage","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageContent":"Search.KnowledgeBaseMessageContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageContentType":"Search.KnowledgeBaseMessageContentType","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageImageContent":"Search.KnowledgeBaseMessageImageContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageTextContent":"Search.KnowledgeBaseMessageTextContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord":"Search.KnowledgeBaseModelAnswerSynthesisActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelQueryPlanningActivityRecord":"Search.KnowledgeBaseModelQueryPlanningActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelWebSummarizationActivityRecord":"Search.KnowledgeBaseModelWebSummarizationActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference":"Search.KnowledgeBaseReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseReferenceType":"Search.KnowledgeBaseReferenceType","com.azure.search.documents.knowledgebases.models.KnowledgeBaseReferencesCompletedStreamEvent":"Search.KnowledgeBaseReferencesCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent":"Search.KnowledgeBaseResponseCompletedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedStreamEvent":"Search.KnowledgeBaseResponseCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions":"Search.KnowledgeBaseRetrievalRequest","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult":"Search.KnowledgeBaseRetrievalResponse","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent":"Search.KnowledgeBaseRetrievalStartedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedStreamEvent":"Search.KnowledgeBaseRetrievalStartedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStatusCode":"Search.KnowledgeBaseRetrievalStatusCode","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent":"Search.KnowledgeBaseRetrievalStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityArguments":"Search.KnowledgeBaseSearchIndexActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityRecord":"Search.KnowledgeBaseSearchIndexActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference":"Search.KnowledgeBaseSearchIndexReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseStreamErrorEvent":"Search.KnowledgeBaseStreamErrorEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityArguments":"Search.KnowledgeBaseWebActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityRecord":"Search.KnowledgeBaseWebActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWebReference":"Search.KnowledgeBaseWebReference","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntent":"Search.KnowledgeRetrievalIntent","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntentType":"Search.KnowledgeRetrievalIntentType","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort":"Search.KnowledgeRetrievalLowReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMediumReasoningEffort":"Search.KnowledgeRetrievalMediumReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort":"Search.KnowledgeRetrievalMinimalReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode":"Search.KnowledgeRetrievalOutputMode","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort":"Search.KnowledgeRetrievalReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind":"Search.KnowledgeRetrievalReasoningEffortKind","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent":"Search.KnowledgeRetrievalSemanticIntent","com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer":"Search.KnowledgeSourceAzureOpenAIVectorizer","com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters":"Search.KnowledgeSourceIngestionParameters","com.azure.search.documents.knowledgebases.models.KnowledgeSourceNetworkAccessMode":"Search.KnowledgeSourceNetworkAccessMode","com.azure.search.documents.knowledgebases.models.KnowledgeSourceParams":"Search.KnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatistics":"Search.KnowledgeSourceStatistics","com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatus":"Search.KnowledgeSourceStatus","com.azure.search.documents.knowledgebases.models.KnowledgeSourceSynchronizationError":"Search.KnowledgeSourceSynchronizationError","com.azure.search.documents.knowledgebases.models.KnowledgeSourceVectorizer":"Search.KnowledgeSourceVectorizer","com.azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams":"Search.SearchIndexKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.SynchronizationState":"Search.SynchronizationState","com.azure.search.documents.knowledgebases.models.WebKnowledgeSourceParams":"Search.WebKnowledgeSourceParams","com.azure.search.documents.models.AutocompleteItem":"Search.AutocompleteItem","com.azure.search.documents.models.AutocompleteMode":"Search.AutocompleteMode","com.azure.search.documents.models.AutocompleteOptions":null,"com.azure.search.documents.models.AutocompleteResult":"Search.AutocompleteResult","com.azure.search.documents.models.ContentFileDetails":"TypeSpec.Http.File","com.azure.search.documents.models.ContentUnderstandingSkillChunkingMethod":"Search.ContentUnderstandingSkillChunkingMethod","com.azure.search.documents.models.DocumentDebugInfo":"Search.DocumentDebugInfo","com.azure.search.documents.models.FacetResult":"Search.FacetResult","com.azure.search.documents.models.IndexAction":"Search.IndexAction","com.azure.search.documents.models.IndexActionType":"Search.IndexActionType","com.azure.search.documents.models.IndexDocumentsBatch":"Search.IndexBatch","com.azure.search.documents.models.IndexDocumentsResult":"Search.IndexDocumentsResult","com.azure.search.documents.models.IndexingResult":"Search.IndexingResult","com.azure.search.documents.models.LookupDocument":"Search.LookupDocument","com.azure.search.documents.models.QueryAnswerResult":"Search.QueryAnswerResult","com.azure.search.documents.models.QueryAnswerType":"Search.QueryAnswerType","com.azure.search.documents.models.QueryCaptionResult":"Search.QueryCaptionResult","com.azure.search.documents.models.QueryCaptionType":"Search.QueryCaptionType","com.azure.search.documents.models.QueryDebugMode":"Search.QueryDebugMode","com.azure.search.documents.models.QueryResultDocumentSubscores":"Search.QueryResultDocumentSubscores","com.azure.search.documents.models.QueryType":"Search.QueryType","com.azure.search.documents.models.ScoringStatistics":"Search.ScoringStatistics","com.azure.search.documents.models.SearchDocumentsResult":"Search.SearchDocumentsResult","com.azure.search.documents.models.SearchMode":"Search.SearchMode","com.azure.search.documents.models.SearchOptions":null,"com.azure.search.documents.models.SearchRequest":"Search.SearchRequest","com.azure.search.documents.models.SearchResult":"Search.SearchResult","com.azure.search.documents.models.SemanticErrorMode":"Search.SemanticErrorMode","com.azure.search.documents.models.SemanticErrorReason":"Search.SemanticErrorReason","com.azure.search.documents.models.SemanticSearchResultsType":"Search.SemanticSearchResultsType","com.azure.search.documents.models.SharePointConnectorAppRegistration":"Search.SharePointConnectorAppRegistration","com.azure.search.documents.models.SingleVectorFieldResult":"Search.SingleVectorFieldResult","com.azure.search.documents.models.SuggestDocumentsResult":"Search.SuggestDocumentsResult","com.azure.search.documents.models.SuggestOptions":null,"com.azure.search.documents.models.SuggestResult":"Search.SuggestResult","com.azure.search.documents.models.TextResult":"Search.TextResult","com.azure.search.documents.models.VectorFilterMode":"Search.VectorFilterMode","com.azure.search.documents.models.VectorQuery":"Search.VectorQuery","com.azure.search.documents.models.VectorQueryKind":"Search.VectorQueryKind","com.azure.search.documents.models.VectorizableTextQuery":"Search.VectorizableTextQuery","com.azure.search.documents.models.VectorizedQuery":"Search.VectorizedQuery","com.azure.search.documents.models.VectorsDebugInfo":"Search.VectorsDebugInfo"},"generatedFiles":["src/main/java/com/azure/search/documents/SearchAsyncClient.java","src/main/java/com/azure/search/documents/SearchClient.java","src/main/java/com/azure/search/documents/SearchClientBuilder.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java","src/main/java/com/azure/search/documents/implementation/MultipartFormDataHelper.java","src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java","src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java","src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java","src/main/java/com/azure/search/documents/implementation/models/AutocompletePostRequest.java","src/main/java/com/azure/search/documents/implementation/models/SearchPostRequest.java","src/main/java/com/azure/search/documents/implementation/models/SuggestPostRequest.java","src/main/java/com/azure/search/documents/implementation/models/package-info.java","src/main/java/com/azure/search/documents/implementation/package-info.java","src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java","src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java","src/main/java/com/azure/search/documents/indexes/models/AIServicesAccountIdentity.java","src/main/java/com/azure/search/documents/indexes/models/AIServicesAccountKey.java","src/main/java/com/azure/search/documents/indexes/models/AnalyzeResult.java","src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java","src/main/java/com/azure/search/documents/indexes/models/AnalyzedTokenInfo.java","src/main/java/com/azure/search/documents/indexes/models/AsciiFoldingTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/AzureActiveDirectoryApplicationCredentials.java","src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIEmbeddingSkill.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIVectorizerParameters.java","src/main/java/com/azure/search/documents/indexes/models/BM25SimilarityAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/BinaryQuantizationCompression.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerDataToExtract.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerImageAction.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerPDFTextRotationAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerParsingMode.java","src/main/java/com/azure/search/documents/indexes/models/CharFilter.java","src/main/java/com/azure/search/documents/indexes/models/CharFilterName.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionCommonModelParameters.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionExtraParametersBehavior.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionResponseFormat.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionResponseFormatType.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionSchema.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionSchemaProperties.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionSkill.java","src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilterScripts.java","src/main/java/com/azure/search/documents/indexes/models/ClassicSimilarityAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/ClassicTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/CognitiveServicesAccount.java","src/main/java/com/azure/search/documents/indexes/models/CognitiveServicesAccountKey.java","src/main/java/com/azure/search/documents/indexes/models/CommonGramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/ConditionalSkill.java","src/main/java/com/azure/search/documents/indexes/models/ContentColumnMapping.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkill.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkillChunkingProperties.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkillChunkingUnit.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkillExtractionOptions.java","src/main/java/com/azure/search/documents/indexes/models/CorsOptions.java","src/main/java/com/azure/search/documents/indexes/models/CreatedResources.java","src/main/java/com/azure/search/documents/indexes/models/CustomAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntity.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntityAlias.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntityLookupSkill.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntityLookupSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/CustomNormalizer.java","src/main/java/com/azure/search/documents/indexes/models/DataChangeDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/DataDeletionDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/DataSourceCredentials.java","src/main/java/com/azure/search/documents/indexes/models/DefaultCognitiveServicesAccount.java","src/main/java/com/azure/search/documents/indexes/models/DictionaryDecompounderTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/DistanceScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/DistanceScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/DocumentExtractionSkill.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkill.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillChunkingProperties.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillChunkingUnit.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillExtractionOptions.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillMarkdownHeaderDepth.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillOutputFormat.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillOutputMode.java","src/main/java/com/azure/search/documents/indexes/models/DocumentKeysOrIds.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenFilterSide.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenFilterV2.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/ElisionTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/EmbeddingColumnMapping.java","src/main/java/com/azure/search/documents/indexes/models/EntityCategory.java","src/main/java/com/azure/search/documents/indexes/models/EntityLinkingSkill.java","src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkillV3.java","src/main/java/com/azure/search/documents/indexes/models/ExhaustiveKnnAlgorithmConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/ExhaustiveKnnParameters.java","src/main/java/com/azure/search/documents/indexes/models/FieldMapping.java","src/main/java/com/azure/search/documents/indexes/models/FieldMappingFunction.java","src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSourceExtractionMode.java","src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/FileUploadMetadata.java","src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/GetIndexStatisticsResult.java","src/main/java/com/azure/search/documents/indexes/models/HighWaterMarkChangeDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/HnswAlgorithmConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/HnswParameters.java","src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkill.java","src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/ImageDetail.java","src/main/java/com/azure/search/documents/indexes/models/IndexProjectionMode.java","src/main/java/com/azure/search/documents/indexes/models/IndexStatisticsSummary.java","src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointContainerName.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionEnvironment.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionResult.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatus.java","src/main/java/com/azure/search/documents/indexes/models/IndexerPermissionOption.java","src/main/java/com/azure/search/documents/indexes/models/IndexerResyncBody.java","src/main/java/com/azure/search/documents/indexes/models/IndexerResyncOption.java","src/main/java/com/azure/search/documents/indexes/models/IndexerRuntime.java","src/main/java/com/azure/search/documents/indexes/models/IndexerStatus.java","src/main/java/com/azure/search/documents/indexes/models/IndexingParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexingParametersConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/IndexingSchedule.java","src/main/java/com/azure/search/documents/indexes/models/InputFieldMappingEntry.java","src/main/java/com/azure/search/documents/indexes/models/KeepTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/KeyPhraseExtractionSkill.java","src/main/java/com/azure/search/documents/indexes/models/KeyPhraseExtractionSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/KeywordMarkerTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/KeywordTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/KeywordTokenizerV2.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBase.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseAzureOpenAIModel.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModel.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModelKind.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceContentExtractionMode.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFile.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileCapacity.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceKind.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceReference.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceSynchronizationStatus.java","src/main/java/com/azure/search/documents/indexes/models/LanguageDetectionSkill.java","src/main/java/com/azure/search/documents/indexes/models/LengthTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/LexicalAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/LexicalAnalyzerName.java","src/main/java/com/azure/search/documents/indexes/models/LexicalNormalizer.java","src/main/java/com/azure/search/documents/indexes/models/LexicalNormalizerName.java","src/main/java/com/azure/search/documents/indexes/models/LexicalTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/LexicalTokenizerName.java","src/main/java/com/azure/search/documents/indexes/models/LimitTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/ListDataSourcesResult.java","src/main/java/com/azure/search/documents/indexes/models/ListIndexersResult.java","src/main/java/com/azure/search/documents/indexes/models/ListSkillsetsResult.java","src/main/java/com/azure/search/documents/indexes/models/ListSynonymMapsResult.java","src/main/java/com/azure/search/documents/indexes/models/ListingSearchType.java","src/main/java/com/azure/search/documents/indexes/models/LuceneStandardAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/LuceneStandardTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/LuceneStandardTokenizerV2.java","src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/MappingCharFilter.java","src/main/java/com/azure/search/documents/indexes/models/MarkdownHeaderDepth.java","src/main/java/com/azure/search/documents/indexes/models/MarkdownParsingSubmode.java","src/main/java/com/azure/search/documents/indexes/models/MergeSkill.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftLanguageStemmingTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftLanguageTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftStemmingTokenizerLanguage.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftTokenizerLanguage.java","src/main/java/com/azure/search/documents/indexes/models/NGramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/NGramTokenFilterV2.java","src/main/java/com/azure/search/documents/indexes/models/NGramTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/NativeBlobSoftDeleteDeletionDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/OcrLineEnding.java","src/main/java/com/azure/search/documents/indexes/models/OcrSkill.java","src/main/java/com/azure/search/documents/indexes/models/OcrSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/OutputFieldMappingEntry.java","src/main/java/com/azure/search/documents/indexes/models/PIIDetectionSkill.java","src/main/java/com/azure/search/documents/indexes/models/PIIDetectionSkillMaskingMode.java","src/main/java/com/azure/search/documents/indexes/models/PathHierarchyTokenizerV2.java","src/main/java/com/azure/search/documents/indexes/models/PatternAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/PatternCaptureTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/PatternReplaceCharFilter.java","src/main/java/com/azure/search/documents/indexes/models/PatternReplaceTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/PatternTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/PermissionFilter.java","src/main/java/com/azure/search/documents/indexes/models/PhoneticEncoder.java","src/main/java/com/azure/search/documents/indexes/models/PhoneticTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/RankingOrder.java","src/main/java/com/azure/search/documents/indexes/models/RegexFlags.java","src/main/java/com/azure/search/documents/indexes/models/RescoringOptions.java","src/main/java/com/azure/search/documents/indexes/models/ResourceCounter.java","src/main/java/com/azure/search/documents/indexes/models/ScalarQuantizationCompression.java","src/main/java/com/azure/search/documents/indexes/models/ScalarQuantizationParameters.java","src/main/java/com/azure/search/documents/indexes/models/ScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/ScoringFunctionAggregation.java","src/main/java/com/azure/search/documents/indexes/models/ScoringFunctionInterpolation.java","src/main/java/com/azure/search/documents/indexes/models/ScoringProfile.java","src/main/java/com/azure/search/documents/indexes/models/SearchAlias.java","src/main/java/com/azure/search/documents/indexes/models/SearchField.java","src/main/java/com/azure/search/documents/indexes/models/SearchFieldDataType.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexFieldReference.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexPermissionFilterOption.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexResponse.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataContainer.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataIdentity.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataNoneIdentity.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceConnection.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceType.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataUserAssignedIdentity.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerError.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerIndexProjection.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerIndexProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerIndexProjectionsParameters.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStore.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreBlobProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreFileProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreObjectProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreProjection.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreTableProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerLimits.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkill.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerStatus.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerWarning.java","src/main/java/com/azure/search/documents/indexes/models/SearchResourceEncryptionKey.java","src/main/java/com/azure/search/documents/indexes/models/SearchServiceCounters.java","src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java","src/main/java/com/azure/search/documents/indexes/models/SearchServiceStatistics.java","src/main/java/com/azure/search/documents/indexes/models/SearchSuggester.java","src/main/java/com/azure/search/documents/indexes/models/SemanticConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/SemanticField.java","src/main/java/com/azure/search/documents/indexes/models/SemanticPrioritizedFields.java","src/main/java/com/azure/search/documents/indexes/models/SemanticSearch.java","src/main/java/com/azure/search/documents/indexes/models/SentimentSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/SentimentSkillV3.java","src/main/java/com/azure/search/documents/indexes/models/ServiceIndexersRuntime.java","src/main/java/com/azure/search/documents/indexes/models/ShaperSkill.java","src/main/java/com/azure/search/documents/indexes/models/ShingleTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/SimilarityAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/SkillNames.java","src/main/java/com/azure/search/documents/indexes/models/SnowballTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/SnowballTokenFilterLanguage.java","src/main/java/com/azure/search/documents/indexes/models/SoftDeleteColumnDeletionDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/SplitSkill.java","src/main/java/com/azure/search/documents/indexes/models/SplitSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/SqlIntegratedChangeTrackingPolicy.java","src/main/java/com/azure/search/documents/indexes/models/StemmerOverrideTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/StemmerTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/StemmerTokenFilterLanguage.java","src/main/java/com/azure/search/documents/indexes/models/StopAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/StopwordsList.java","src/main/java/com/azure/search/documents/indexes/models/StopwordsTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/SynonymMap.java","src/main/java/com/azure/search/documents/indexes/models/SynonymTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/TagScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/TagScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/TextSplitMode.java","src/main/java/com/azure/search/documents/indexes/models/TextTranslationSkill.java","src/main/java/com/azure/search/documents/indexes/models/TextTranslationSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/TextWeights.java","src/main/java/com/azure/search/documents/indexes/models/TokenCharacterKind.java","src/main/java/com/azure/search/documents/indexes/models/TokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/TokenFilterName.java","src/main/java/com/azure/search/documents/indexes/models/TruncateTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/UaxUrlEmailTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/UniqueTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/UpdateKnowledgeSourceFileRequest.java","src/main/java/com/azure/search/documents/indexes/models/UploadKnowledgeSourceFileMultipartRequest.java","src/main/java/com/azure/search/documents/indexes/models/VectorEncodingFormat.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearch.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchAlgorithmConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchAlgorithmKind.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchAlgorithmMetric.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompression.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionKind.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionRescoreStorageMethod.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionTarget.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchProfile.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizerKind.java","src/main/java/com/azure/search/documents/indexes/models/VisualFeature.java","src/main/java/com/azure/search/documents/indexes/models/WebApiHttpHeaders.java","src/main/java/com/azure/search/documents/indexes/models/WebApiSkill.java","src/main/java/com/azure/search/documents/indexes/models/WebApiVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/WebApiVectorizerParameters.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSourceDomain.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSourceDomains.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/WordDelimiterTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/package-info.java","src/main/java/com/azure/search/documents/indexes/package-info.java","src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java","src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java","src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClientBuilder.java","src/main/java/com/azure/search/documents/knowledgebases/models/AiServices.java","src/main/java/com/azure/search/documents/knowledgebases/models/AzureBlobKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/CompletedSynchronizationState.java","src/main/java/com/azure/search/documents/knowledgebases/models/FileKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/IndexedOneLakeKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSharePointKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSqlKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordModel.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAgenticReasoningActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorAdditionalInfo.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorDetail.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseImageContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessage.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageContentType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageImageContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageTextContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseModelAnswerSynthesisActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseModelQueryPlanningActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseModelWebSummarizationActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferencesCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalResult.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStatusCode.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseStreamErrorEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalIntent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalIntentType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalLowReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalMediumReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalMinimalReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalOutputMode.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffortKind.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalSemanticIntent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceAzureOpenAIVectorizer.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceNetworkAccessMode.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceStatistics.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceStatus.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceSynchronizationError.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceVectorizer.java","src/main/java/com/azure/search/documents/knowledgebases/models/SearchIndexKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/SynchronizationState.java","src/main/java/com/azure/search/documents/knowledgebases/models/WebKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/package-info.java","src/main/java/com/azure/search/documents/knowledgebases/package-info.java","src/main/java/com/azure/search/documents/models/AutocompleteItem.java","src/main/java/com/azure/search/documents/models/AutocompleteMode.java","src/main/java/com/azure/search/documents/models/AutocompleteOptions.java","src/main/java/com/azure/search/documents/models/AutocompleteResult.java","src/main/java/com/azure/search/documents/models/ContentFileDetails.java","src/main/java/com/azure/search/documents/models/ContentUnderstandingSkillChunkingMethod.java","src/main/java/com/azure/search/documents/models/DocumentDebugInfo.java","src/main/java/com/azure/search/documents/models/FacetResult.java","src/main/java/com/azure/search/documents/models/IndexAction.java","src/main/java/com/azure/search/documents/models/IndexActionType.java","src/main/java/com/azure/search/documents/models/IndexDocumentsBatch.java","src/main/java/com/azure/search/documents/models/IndexDocumentsResult.java","src/main/java/com/azure/search/documents/models/IndexingResult.java","src/main/java/com/azure/search/documents/models/LookupDocument.java","src/main/java/com/azure/search/documents/models/QueryAnswerResult.java","src/main/java/com/azure/search/documents/models/QueryAnswerType.java","src/main/java/com/azure/search/documents/models/QueryCaptionResult.java","src/main/java/com/azure/search/documents/models/QueryCaptionType.java","src/main/java/com/azure/search/documents/models/QueryDebugMode.java","src/main/java/com/azure/search/documents/models/QueryResultDocumentSubscores.java","src/main/java/com/azure/search/documents/models/QueryType.java","src/main/java/com/azure/search/documents/models/ScoringStatistics.java","src/main/java/com/azure/search/documents/models/SearchDocumentsResult.java","src/main/java/com/azure/search/documents/models/SearchMode.java","src/main/java/com/azure/search/documents/models/SearchOptions.java","src/main/java/com/azure/search/documents/models/SearchRequest.java","src/main/java/com/azure/search/documents/models/SearchResult.java","src/main/java/com/azure/search/documents/models/SemanticErrorMode.java","src/main/java/com/azure/search/documents/models/SemanticErrorReason.java","src/main/java/com/azure/search/documents/models/SemanticSearchResultsType.java","src/main/java/com/azure/search/documents/models/SharePointConnectorAppRegistration.java","src/main/java/com/azure/search/documents/models/SingleVectorFieldResult.java","src/main/java/com/azure/search/documents/models/SuggestDocumentsResult.java","src/main/java/com/azure/search/documents/models/SuggestOptions.java","src/main/java/com/azure/search/documents/models/SuggestResult.java","src/main/java/com/azure/search/documents/models/TextResult.java","src/main/java/com/azure/search/documents/models/VectorFilterMode.java","src/main/java/com/azure/search/documents/models/VectorQuery.java","src/main/java/com/azure/search/documents/models/VectorQueryKind.java","src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java","src/main/java/com/azure/search/documents/models/VectorizedQuery.java","src/main/java/com/azure/search/documents/models/VectorsDebugInfo.java","src/main/java/com/azure/search/documents/models/package-info.java","src/main/java/com/azure/search/documents/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Search":"2026-11-01-preview"},"crossLanguagePackageId":"Search","crossLanguageVersion":"46b854c8ed5e","crossLanguageDefinitions":{"com.azure.search.documents.SearchAsyncClient":"Customizations.SearchClient","com.azure.search.documents.SearchAsyncClient.autocomplete":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchAsyncClient.autocompleteGet":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchAsyncClient.autocompleteGetWithResponse":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchAsyncClient.autocompleteWithResponse":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchAsyncClient.getDocument":"Customizations.SearchClient.get","com.azure.search.documents.SearchAsyncClient.getDocumentCount":"Customizations.SearchClient.count","com.azure.search.documents.SearchAsyncClient.getDocumentCountWithResponse":"Customizations.SearchClient.count","com.azure.search.documents.SearchAsyncClient.getDocumentWithResponse":"Customizations.SearchClient.get","com.azure.search.documents.SearchAsyncClient.graph":"Customizations.SearchClient.graph","com.azure.search.documents.SearchAsyncClient.graphWithResponse":"Customizations.SearchClient.graph","com.azure.search.documents.SearchAsyncClient.index":"Customizations.SearchClient.index","com.azure.search.documents.SearchAsyncClient.indexWithResponse":"Customizations.SearchClient.index","com.azure.search.documents.SearchAsyncClient.search":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchAsyncClient.searchGet":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchAsyncClient.searchGetWithResponse":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchAsyncClient.searchWithResponse":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchAsyncClient.suggest":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchAsyncClient.suggestGet":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchAsyncClient.suggestGetWithResponse":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchAsyncClient.suggestWithResponse":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchClient":"Customizations.SearchClient","com.azure.search.documents.SearchClient.autocomplete":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchClient.autocompleteGet":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchClient.autocompleteGetWithResponse":"Customizations.SearchClient.autocompleteGet","com.azure.search.documents.SearchClient.autocompleteWithResponse":"Customizations.SearchClient.autocompletePost","com.azure.search.documents.SearchClient.getDocument":"Customizations.SearchClient.get","com.azure.search.documents.SearchClient.getDocumentCount":"Customizations.SearchClient.count","com.azure.search.documents.SearchClient.getDocumentCountWithResponse":"Customizations.SearchClient.count","com.azure.search.documents.SearchClient.getDocumentWithResponse":"Customizations.SearchClient.get","com.azure.search.documents.SearchClient.graph":"Customizations.SearchClient.graph","com.azure.search.documents.SearchClient.graphWithResponse":"Customizations.SearchClient.graph","com.azure.search.documents.SearchClient.index":"Customizations.SearchClient.index","com.azure.search.documents.SearchClient.indexWithResponse":"Customizations.SearchClient.index","com.azure.search.documents.SearchClient.search":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchClient.searchGet":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchClient.searchGetWithResponse":"Customizations.SearchClient.searchGet","com.azure.search.documents.SearchClient.searchWithResponse":"Customizations.SearchClient.searchPost","com.azure.search.documents.SearchClient.suggest":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchClient.suggestGet":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchClient.suggestGetWithResponse":"Customizations.SearchClient.suggestGet","com.azure.search.documents.SearchClient.suggestWithResponse":"Customizations.SearchClient.suggestPost","com.azure.search.documents.SearchClientBuilder":"Customizations.SearchClient","com.azure.search.documents.implementation.models.AutocompletePostRequest":"Customizations.SearchClient.autocompletePost.Request.anonymous","com.azure.search.documents.implementation.models.GraphRequest":"Customizations.SearchClient.graph.Request.anonymous","com.azure.search.documents.implementation.models.SearchPostRequest":"Customizations.SearchClient.searchPost.Request.anonymous","com.azure.search.documents.implementation.models.SuggestPostRequest":"Customizations.SearchClient.suggestPost.Request.anonymous","com.azure.search.documents.indexes.SearchIndexAsyncClient":"Customizations.SearchIndexClient","com.azure.search.documents.indexes.SearchIndexAsyncClient.analyzeText":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexAsyncClient.analyzeTextWithResponse":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexAsyncClient.beginIngestKnowledgeSourceFileMultipart":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexAsyncClient.beginIngestKnowledgeSourceFileMultipartInternal":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexAsyncClient.beginIngestKnowledgeSourceFileMultipartWithModel":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexAsyncClient.beginIngestKnowledgeSourceFileReplacement":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileReplacement","com.azure.search.documents.indexes.SearchIndexAsyncClient.beginIngestKnowledgeSourceFileReplacementInternal":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileReplacement","com.azure.search.documents.indexes.SearchIndexAsyncClient.beginIngestKnowledgeSourceFileReplacementWithModel":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileReplacement","com.azure.search.documents.indexes.SearchIndexAsyncClient.createAlias":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createAliasWithResponse":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndex":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndexWithResponse":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeBase":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeSource":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateAlias":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateAliasWithResponse":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateIndex":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateIndexWithResponse":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeBase":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeSource":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateSynonymMap":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateSynonymMapWithResponse":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.createSynonymMap":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.createSynonymMapWithResponse":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteAlias":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteAliasWithResponse":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteIndex":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteIndexWithResponse":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeBase":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSource":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSourceFile":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSourceFileWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteSynonymMap":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteSynonymMapWithResponse":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.getAlias":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.getAliasWithResponse":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndex":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexStatistics":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexStatisticsWithResponse":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexWithResponse":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeBase":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSource":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceFileIngestionOperation":"Customizations.SearchIndexClient.getKnowledgeSourceFileIngestionOperation","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceFileIngestionOperationWithResponse":"Customizations.SearchIndexClient.getKnowledgeSourceFileIngestionOperation","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceStatus":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceStatusWithResponse":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexAsyncClient.getKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexAsyncClient.getServiceStatistics":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getServiceStatisticsWithResponse":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexAsyncClient.getSynonymMap":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.getSynonymMapWithResponse":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexAsyncClient.listAliases":"Customizations.SearchIndexClient.listAliases","com.azure.search.documents.indexes.SearchIndexAsyncClient.listIndexStatsSummary":"Customizations.SearchIndexClient.getIndexStatsSummary","com.azure.search.documents.indexes.SearchIndexAsyncClient.listIndexes":"Customizations.SearchIndexClient.listIndexes","com.azure.search.documents.indexes.SearchIndexAsyncClient.listIndexesWithSelectedProperties":"Customizations.SearchIndexClient.listIndexesWithSelectedProperties","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeBases":"Customizations.SearchIndexClient.listKnowledgeBases","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeSourceFileIngestionOperations":"Customizations.SearchIndexClient.listKnowledgeSourceFileIngestionOperations","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeSourceFiles":"Customizations.SearchIndexClient.listKnowledgeSourceFiles","com.azure.search.documents.indexes.SearchIndexAsyncClient.listKnowledgeSources":"Customizations.SearchIndexClient.listKnowledgeSources","com.azure.search.documents.indexes.SearchIndexAsyncClient.listSynonymMaps":"Customizations.SearchIndexClient.listSynonymMaps","com.azure.search.documents.indexes.SearchIndexAsyncClient.updateKnowledgeSourceFile":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.updateKnowledgeSourceFileWithResponseInternal":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.uploadKnowledgeSourceFile":"Customizations.SearchIndexClient.uploadKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexAsyncClient.uploadKnowledgeSourceFileMultipart":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexAsyncClient.uploadKnowledgeSourceFileMultipartWithResponseInternal":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexAsyncClient.uploadKnowledgeSourceFileWithResponse":"Customizations.SearchIndexClient.uploadKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient":"Customizations.SearchIndexClient","com.azure.search.documents.indexes.SearchIndexClient.analyzeText":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexClient.analyzeTextWithResponse":"Customizations.SearchIndexClient.analyze","com.azure.search.documents.indexes.SearchIndexClient.beginIngestKnowledgeSourceFileMultipart":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient.beginIngestKnowledgeSourceFileMultipartInternal":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient.beginIngestKnowledgeSourceFileMultipartWithModel":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient.beginIngestKnowledgeSourceFileReplacement":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileReplacement","com.azure.search.documents.indexes.SearchIndexClient.beginIngestKnowledgeSourceFileReplacementInternal":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileReplacement","com.azure.search.documents.indexes.SearchIndexClient.beginIngestKnowledgeSourceFileReplacementWithModel":"Customizations.SearchIndexClient.ingestKnowledgeSourceFileReplacement","com.azure.search.documents.indexes.SearchIndexClient.createAlias":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexClient.createAliasWithResponse":"Customizations.SearchIndexClient.createAlias","com.azure.search.documents.indexes.SearchIndexClient.createIndex":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexClient.createIndexWithResponse":"Customizations.SearchIndexClient.createIndex","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeBase":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeSource":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateAlias":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateAliasWithResponse":"Customizations.SearchIndexClient.createOrUpdateAlias","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateIndex":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateIndexWithResponse":"Customizations.SearchIndexClient.createOrUpdateIndex","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeBase":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeSource":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.createOrUpdateKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateSynonymMap":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateSynonymMapWithResponse":"Customizations.SearchIndexClient.createOrUpdateSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.createSynonymMap":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.createSynonymMapWithResponse":"Customizations.SearchIndexClient.createSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.deleteAlias":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexClient.deleteAliasWithResponse":"Customizations.SearchIndexClient.deleteAlias","com.azure.search.documents.indexes.SearchIndexClient.deleteIndex":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexClient.deleteIndexWithResponse":"Customizations.SearchIndexClient.deleteIndex","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeBase":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSource":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSourceFile":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSourceFileWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.deleteKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.deleteKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.deleteSynonymMap":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.deleteSynonymMapWithResponse":"Customizations.SearchIndexClient.deleteSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.getAlias":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexClient.getAliasWithResponse":"Customizations.SearchIndexClient.getAlias","com.azure.search.documents.indexes.SearchIndexClient.getIndex":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexClient.getIndexStatistics":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexClient.getIndexStatisticsWithResponse":"Customizations.SearchIndexClient.getStatistics","com.azure.search.documents.indexes.SearchIndexClient.getIndexWithResponse":"Customizations.SearchIndexClient.getIndex","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeBase":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeBaseWithResponse":"Customizations.SearchIndexClient.getKnowledgeBase","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSource":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceFileIngestionOperation":"Customizations.SearchIndexClient.getKnowledgeSourceFileIngestionOperation","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceFileIngestionOperationWithResponse":"Customizations.SearchIndexClient.getKnowledgeSourceFileIngestionOperation","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceStatus":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceStatusWithResponse":"Customizations.SearchIndexClient.getKnowledgeSourceStatus","com.azure.search.documents.indexes.SearchIndexClient.getKnowledgeSourceWithResponse":"Customizations.SearchIndexClient.getKnowledgeSource","com.azure.search.documents.indexes.SearchIndexClient.getServiceStatistics":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexClient.getServiceStatisticsWithResponse":"Customizations.SearchIndexClient.getServiceStatistics","com.azure.search.documents.indexes.SearchIndexClient.getSynonymMap":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.getSynonymMapWithResponse":"Customizations.SearchIndexClient.getSynonymMap","com.azure.search.documents.indexes.SearchIndexClient.listAliases":"Customizations.SearchIndexClient.listAliases","com.azure.search.documents.indexes.SearchIndexClient.listIndexStatsSummary":"Customizations.SearchIndexClient.getIndexStatsSummary","com.azure.search.documents.indexes.SearchIndexClient.listIndexes":"Customizations.SearchIndexClient.listIndexes","com.azure.search.documents.indexes.SearchIndexClient.listIndexesWithSelectedProperties":"Customizations.SearchIndexClient.listIndexesWithSelectedProperties","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeBases":"Customizations.SearchIndexClient.listKnowledgeBases","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeSourceFileIngestionOperations":"Customizations.SearchIndexClient.listKnowledgeSourceFileIngestionOperations","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeSourceFiles":"Customizations.SearchIndexClient.listKnowledgeSourceFiles","com.azure.search.documents.indexes.SearchIndexClient.listKnowledgeSources":"Customizations.SearchIndexClient.listKnowledgeSources","com.azure.search.documents.indexes.SearchIndexClient.listSynonymMaps":"Customizations.SearchIndexClient.listSynonymMaps","com.azure.search.documents.indexes.SearchIndexClient.updateKnowledgeSourceFile":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.updateKnowledgeSourceFileWithResponseInternal":"Customizations.SearchIndexClient.updateKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.uploadKnowledgeSourceFile":"Customizations.SearchIndexClient.uploadKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClient.uploadKnowledgeSourceFileMultipart":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient.uploadKnowledgeSourceFileMultipartWithResponseInternal":"Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart","com.azure.search.documents.indexes.SearchIndexClient.uploadKnowledgeSourceFileWithResponse":"Customizations.SearchIndexClient.uploadKnowledgeSourceFile","com.azure.search.documents.indexes.SearchIndexClientBuilder":"Customizations.SearchIndexClient","com.azure.search.documents.indexes.SearchIndexerAsyncClient":"Customizations.SearchIndexerClient","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnection":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexer":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexerWithResponse":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnection":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexer":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerWithResponse":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillset":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillset":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillsetWithResponse":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnection":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexer":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexerWithResponse":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillset":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillsetWithResponse":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnection":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexer":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatus":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatusWithResponse":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerWithResponse":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillset":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillsetWithResponse":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections":"Customizations.SearchIndexerClient.listDataSources","com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers":"Customizations.SearchIndexerClient.listIndexers","com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsets":"Customizations.SearchIndexerClient.listSkillsets","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetDocuments":"Customizations.SearchIndexerClient.resetDocs","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetDocumentsWithResponse":"Customizations.SearchIndexerClient.resetDocs","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexer":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexerWithResponse":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetSkills":"Customizations.SearchIndexerClient.resetSkills","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetSkillsWithResponse":"Customizations.SearchIndexerClient.resetSkills","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resync":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerAsyncClient.resyncWithResponse":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexer":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexerWithResponse":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerClient":"Customizations.SearchIndexerClient","com.azure.search.documents.indexes.SearchIndexerClient.createDataSourceConnection":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createIndexer":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createIndexerWithResponse":"Customizations.SearchIndexerClient.createIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateDataSourceConnection":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.createOrUpdateDataSource","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateIndexer":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateIndexerWithResponse":"Customizations.SearchIndexerClient.createOrUpdateIndexer","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateSkillset":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateSkillsetWithResponse":"Customizations.SearchIndexerClient.createOrUpdateSkillset","com.azure.search.documents.indexes.SearchIndexerClient.createSkillset":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerClient.createSkillsetWithResponse":"Customizations.SearchIndexerClient.createSkillset","com.azure.search.documents.indexes.SearchIndexerClient.deleteDataSourceConnection":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerClient.deleteDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.deleteDataSource","com.azure.search.documents.indexes.SearchIndexerClient.deleteIndexer":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerClient.deleteIndexerWithResponse":"Customizations.SearchIndexerClient.deleteIndexer","com.azure.search.documents.indexes.SearchIndexerClient.deleteSkillset":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerClient.deleteSkillsetWithResponse":"Customizations.SearchIndexerClient.deleteSkillset","com.azure.search.documents.indexes.SearchIndexerClient.getDataSourceConnection":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerClient.getDataSourceConnectionWithResponse":"Customizations.SearchIndexerClient.getDataSource","com.azure.search.documents.indexes.SearchIndexerClient.getIndexer":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerClient.getIndexerStatus":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerClient.getIndexerStatusWithResponse":"Customizations.SearchIndexerClient.getIndexerStatus","com.azure.search.documents.indexes.SearchIndexerClient.getIndexerWithResponse":"Customizations.SearchIndexerClient.getIndexer","com.azure.search.documents.indexes.SearchIndexerClient.getSkillset":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerClient.getSkillsetWithResponse":"Customizations.SearchIndexerClient.getSkillset","com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnections":"Customizations.SearchIndexerClient.listDataSources","com.azure.search.documents.indexes.SearchIndexerClient.listIndexers":"Customizations.SearchIndexerClient.listIndexers","com.azure.search.documents.indexes.SearchIndexerClient.listSkillsets":"Customizations.SearchIndexerClient.listSkillsets","com.azure.search.documents.indexes.SearchIndexerClient.resetDocuments":"Customizations.SearchIndexerClient.resetDocs","com.azure.search.documents.indexes.SearchIndexerClient.resetDocumentsWithResponse":"Customizations.SearchIndexerClient.resetDocs","com.azure.search.documents.indexes.SearchIndexerClient.resetIndexer":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerClient.resetIndexerWithResponse":"Customizations.SearchIndexerClient.resetIndexer","com.azure.search.documents.indexes.SearchIndexerClient.resetSkills":"Customizations.SearchIndexerClient.resetSkills","com.azure.search.documents.indexes.SearchIndexerClient.resetSkillsWithResponse":"Customizations.SearchIndexerClient.resetSkills","com.azure.search.documents.indexes.SearchIndexerClient.resync":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerClient.resyncWithResponse":"Customizations.SearchIndexerClient.resync","com.azure.search.documents.indexes.SearchIndexerClient.runIndexer":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerClient.runIndexerWithResponse":"Customizations.SearchIndexerClient.runIndexer","com.azure.search.documents.indexes.SearchIndexerClientBuilder":"Customizations.SearchIndexerClient","com.azure.search.documents.indexes.models.AIFoundryModelCatalogName":"Search.AIFoundryModelCatalogName","com.azure.search.documents.indexes.models.AIServicesAccountIdentity":"Search.AIServicesAccountIdentity","com.azure.search.documents.indexes.models.AIServicesAccountKey":"Search.AIServicesAccountKey","com.azure.search.documents.indexes.models.AIServicesVisionParameters":"Search.AIServicesVisionParameters","com.azure.search.documents.indexes.models.AIServicesVisionVectorizer":"Search.AIServicesVisionVectorizer","com.azure.search.documents.indexes.models.AnalyzeResult":"Search.AnalyzeResult","com.azure.search.documents.indexes.models.AnalyzeTextOptions":"Search.AnalyzeRequest","com.azure.search.documents.indexes.models.AnalyzedTokenInfo":"Search.AnalyzedTokenInfo","com.azure.search.documents.indexes.models.AsciiFoldingTokenFilter":"Search.AsciiFoldingTokenFilter","com.azure.search.documents.indexes.models.AzureActiveDirectoryApplicationCredentials":"Search.AzureActiveDirectoryApplicationCredentials","com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource":"Search.AzureBlobKnowledgeSource","com.azure.search.documents.indexes.models.AzureBlobKnowledgeSourceParameters":"Search.AzureBlobKnowledgeSourceParameters","com.azure.search.documents.indexes.models.AzureMachineLearningParameters":"Search.AMLParameters","com.azure.search.documents.indexes.models.AzureMachineLearningSkill":"Search.AzureMachineLearningSkill","com.azure.search.documents.indexes.models.AzureMachineLearningVectorizer":"Search.AMLVectorizer","com.azure.search.documents.indexes.models.AzureOpenAIEmbeddingSkill":"Search.AzureOpenAIEmbeddingSkill","com.azure.search.documents.indexes.models.AzureOpenAIModelName":"Search.AzureOpenAIModelName","com.azure.search.documents.indexes.models.AzureOpenAITokenizerParameters":"Search.AzureOpenAITokenizerParameters","com.azure.search.documents.indexes.models.AzureOpenAIVectorizer":"Search.AzureOpenAIVectorizer","com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters":"Search.AzureOpenAIVectorizerParameters","com.azure.search.documents.indexes.models.BM25SimilarityAlgorithm":"Search.BM25SimilarityAlgorithm","com.azure.search.documents.indexes.models.BinaryQuantizationCompression":"Search.BinaryQuantizationCompression","com.azure.search.documents.indexes.models.BlobIndexerDataToExtract":"Search.BlobIndexerDataToExtract","com.azure.search.documents.indexes.models.BlobIndexerImageAction":"Search.BlobIndexerImageAction","com.azure.search.documents.indexes.models.BlobIndexerPDFTextRotationAlgorithm":"Search.BlobIndexerPDFTextRotationAlgorithm","com.azure.search.documents.indexes.models.BlobIndexerParsingMode":"Search.BlobIndexerParsingMode","com.azure.search.documents.indexes.models.CharFilter":"Search.CharFilter","com.azure.search.documents.indexes.models.CharFilterName":"Search.CharFilterName","com.azure.search.documents.indexes.models.ChatCompletionCommonModelParameters":"Search.ChatCompletionCommonModelParameters","com.azure.search.documents.indexes.models.ChatCompletionExtraParametersBehavior":"Search.ChatCompletionExtraParametersBehavior","com.azure.search.documents.indexes.models.ChatCompletionResponseFormat":"Search.ChatCompletionResponseFormat","com.azure.search.documents.indexes.models.ChatCompletionResponseFormatType":"Search.ChatCompletionResponseFormatType","com.azure.search.documents.indexes.models.ChatCompletionSchema":"Search.ChatCompletionSchema","com.azure.search.documents.indexes.models.ChatCompletionSchemaProperties":"Search.ChatCompletionSchemaProperties","com.azure.search.documents.indexes.models.ChatCompletionSkill":"Search.ChatCompletionSkill","com.azure.search.documents.indexes.models.CjkBigramTokenFilter":"Search.CjkBigramTokenFilter","com.azure.search.documents.indexes.models.CjkBigramTokenFilterScripts":"Search.CjkBigramTokenFilterScripts","com.azure.search.documents.indexes.models.ClassicSimilarityAlgorithm":"Search.ClassicSimilarityAlgorithm","com.azure.search.documents.indexes.models.ClassicTokenizer":"Search.ClassicTokenizer","com.azure.search.documents.indexes.models.CognitiveServicesAccount":"Search.CognitiveServicesAccount","com.azure.search.documents.indexes.models.CognitiveServicesAccountKey":"Search.CognitiveServicesAccountKey","com.azure.search.documents.indexes.models.CommonGramTokenFilter":"Search.CommonGramTokenFilter","com.azure.search.documents.indexes.models.ConditionalSkill":"Search.ConditionalSkill","com.azure.search.documents.indexes.models.ContentColumnMapping":"Search.ContentColumnMapping","com.azure.search.documents.indexes.models.ContentUnderstandingSkill":"Search.ContentUnderstandingSkill","com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingProperties":"Search.ContentUnderstandingSkillChunkingProperties","com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingUnit":"Search.ContentUnderstandingSkillChunkingUnit","com.azure.search.documents.indexes.models.ContentUnderstandingSkillExtractionOptions":"Search.ContentUnderstandingSkillExtractionOptions","com.azure.search.documents.indexes.models.CorsOptions":"Search.CorsOptions","com.azure.search.documents.indexes.models.CreatedResources":"Search.CreatedResources","com.azure.search.documents.indexes.models.CustomAnalyzer":"Search.CustomAnalyzer","com.azure.search.documents.indexes.models.CustomEntity":"Search.CustomEntity","com.azure.search.documents.indexes.models.CustomEntityAlias":"Search.CustomEntityAlias","com.azure.search.documents.indexes.models.CustomEntityLookupSkill":"Search.CustomEntityLookupSkill","com.azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage":"Search.CustomEntityLookupSkillLanguage","com.azure.search.documents.indexes.models.CustomNormalizer":"Search.CustomNormalizer","com.azure.search.documents.indexes.models.DataChangeDetectionPolicy":"Search.DataChangeDetectionPolicy","com.azure.search.documents.indexes.models.DataDeletionDetectionPolicy":"Search.DataDeletionDetectionPolicy","com.azure.search.documents.indexes.models.DataSourceCredentials":"Search.DataSourceCredentials","com.azure.search.documents.indexes.models.DefaultCognitiveServicesAccount":"Search.DefaultCognitiveServicesAccount","com.azure.search.documents.indexes.models.DictionaryDecompounderTokenFilter":"Search.DictionaryDecompounderTokenFilter","com.azure.search.documents.indexes.models.DistanceScoringFunction":"Search.DistanceScoringFunction","com.azure.search.documents.indexes.models.DistanceScoringParameters":"Search.DistanceScoringParameters","com.azure.search.documents.indexes.models.DocumentExtractionSkill":"Search.DocumentExtractionSkill","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkill":"Search.DocumentIntelligenceLayoutSkill","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillChunkingProperties":"Search.DocumentIntelligenceLayoutSkillChunkingProperties","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillChunkingUnit":"Search.DocumentIntelligenceLayoutSkillChunkingUnit","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillExtractionOptions":"Search.DocumentIntelligenceLayoutSkillExtractionOptions","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth":"Search.DocumentIntelligenceLayoutSkillMarkdownHeaderDepth","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillOutputFormat":"Search.DocumentIntelligenceLayoutSkillOutputFormat","com.azure.search.documents.indexes.models.DocumentIntelligenceLayoutSkillOutputMode":"Search.DocumentIntelligenceLayoutSkillOutputMode","com.azure.search.documents.indexes.models.DocumentKeysOrIds":"Search.DocumentKeysOrIds","com.azure.search.documents.indexes.models.EdgeNGramTokenFilter":"Search.EdgeNGramTokenFilter","com.azure.search.documents.indexes.models.EdgeNGramTokenFilterSide":"Search.EdgeNGramTokenFilterSide","com.azure.search.documents.indexes.models.EdgeNGramTokenFilterV2":"Search.EdgeNGramTokenFilterV2","com.azure.search.documents.indexes.models.EdgeNGramTokenizer":"Search.EdgeNGramTokenizer","com.azure.search.documents.indexes.models.ElisionTokenFilter":"Search.ElisionTokenFilter","com.azure.search.documents.indexes.models.EmbeddingColumnMapping":"Search.EmbeddingColumnMapping","com.azure.search.documents.indexes.models.EntityCategory":"Search.EntityCategory","com.azure.search.documents.indexes.models.EntityLinkingSkill":"Search.EntityLinkingSkill","com.azure.search.documents.indexes.models.EntityRecognitionSkillLanguage":"Search.EntityRecognitionSkillLanguage","com.azure.search.documents.indexes.models.EntityRecognitionSkillV3":"Search.EntityRecognitionSkillV3","com.azure.search.documents.indexes.models.EntraAppAuthentication":"Search.EntraAppAuthentication","com.azure.search.documents.indexes.models.ExhaustiveKnnAlgorithmConfiguration":"Search.ExhaustiveKnnAlgorithmConfiguration","com.azure.search.documents.indexes.models.ExhaustiveKnnParameters":"Search.ExhaustiveKnnParameters","com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSource":"Search.FabricDataAgentKnowledgeSource","com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSourceParameters":"Search.FabricDataAgentKnowledgeSourceParameters","com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSource":"Search.FabricOntologyKnowledgeSource","com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSourceParameters":"Search.FabricOntologyKnowledgeSourceParameters","com.azure.search.documents.indexes.models.FieldMapping":"Search.FieldMapping","com.azure.search.documents.indexes.models.FieldMappingFunction":"Search.FieldMappingFunction","com.azure.search.documents.indexes.models.FileKnowledgeSource":"Search.FileKnowledgeSource","com.azure.search.documents.indexes.models.FileKnowledgeSourceExtractionMode":"Search.FileKnowledgeSourceExtractionMode","com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters":"Search.FileKnowledgeSourceParameters","com.azure.search.documents.indexes.models.FileUploadMetadata":"Search.FileUploadMetadata","com.azure.search.documents.indexes.models.FreshnessScoringFunction":"Search.FreshnessScoringFunction","com.azure.search.documents.indexes.models.FreshnessScoringParameters":"Search.FreshnessScoringParameters","com.azure.search.documents.indexes.models.GetIndexStatisticsResult":"Search.GetIndexStatisticsResult","com.azure.search.documents.indexes.models.GraphFieldMappings":"Search.GraphFieldMappings","com.azure.search.documents.indexes.models.GraphProfile":"Search.GraphProfile","com.azure.search.documents.indexes.models.GraphProfileKind":"Search.GraphProfileKind","com.azure.search.documents.indexes.models.HighWaterMarkChangeDetectionPolicy":"Search.HighWaterMarkChangeDetectionPolicy","com.azure.search.documents.indexes.models.HnswAlgorithmConfiguration":"Search.HnswAlgorithmConfiguration","com.azure.search.documents.indexes.models.HnswParameters":"Search.HnswParameters","com.azure.search.documents.indexes.models.ImageAnalysisSkill":"Search.ImageAnalysisSkill","com.azure.search.documents.indexes.models.ImageAnalysisSkillLanguage":"Search.ImageAnalysisSkillLanguage","com.azure.search.documents.indexes.models.ImageDetail":"Search.ImageDetail","com.azure.search.documents.indexes.models.IndexProjectionMode":"Search.IndexProjectionMode","com.azure.search.documents.indexes.models.IndexStatisticsSummary":"Search.IndexStatisticsSummary","com.azure.search.documents.indexes.models.IndexedOneLakeKnowledgeSource":"Search.IndexedOneLakeKnowledgeSource","com.azure.search.documents.indexes.models.IndexedOneLakeKnowledgeSourceParameters":"Search.IndexedOneLakeKnowledgeSourceParameters","com.azure.search.documents.indexes.models.IndexedSharePointContainerName":"Search.IndexedSharePointContainerName","com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSource":"Search.IndexedSharePointKnowledgeSource","com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSourceParameters":"Search.IndexedSharePointKnowledgeSourceParameters","com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSource":"Search.IndexedSqlKnowledgeSource","com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSourceParameters":"Search.IndexedSqlKnowledgeSourceParameters","com.azure.search.documents.indexes.models.IndexerCurrentState":"Search.IndexerCurrentState","com.azure.search.documents.indexes.models.IndexerExecutionEnvironment":"Search.IndexerExecutionEnvironment","com.azure.search.documents.indexes.models.IndexerExecutionResult":"Search.IndexerExecutionResult","com.azure.search.documents.indexes.models.IndexerExecutionStatus":"Search.IndexerExecutionStatus","com.azure.search.documents.indexes.models.IndexerExecutionStatusDetail":"Search.IndexerExecutionStatusDetail","com.azure.search.documents.indexes.models.IndexerPermissionOption":"Search.IndexerPermissionOption","com.azure.search.documents.indexes.models.IndexerResyncBody":"Search.IndexerResyncBody","com.azure.search.documents.indexes.models.IndexerResyncOption":"Search.IndexerResyncOption","com.azure.search.documents.indexes.models.IndexerRuntime":"Search.IndexerRuntime","com.azure.search.documents.indexes.models.IndexerStatus":"Search.IndexerStatus","com.azure.search.documents.indexes.models.IndexingMode":"Search.IndexingMode","com.azure.search.documents.indexes.models.IndexingParameters":"Search.IndexingParameters","com.azure.search.documents.indexes.models.IndexingParametersConfiguration":"Search.IndexingParametersConfiguration","com.azure.search.documents.indexes.models.IndexingSchedule":"Search.IndexingSchedule","com.azure.search.documents.indexes.models.InputFieldMappingEntry":"Search.InputFieldMappingEntry","com.azure.search.documents.indexes.models.KeepTokenFilter":"Search.KeepTokenFilter","com.azure.search.documents.indexes.models.KeyPhraseExtractionSkill":"Search.KeyPhraseExtractionSkill","com.azure.search.documents.indexes.models.KeyPhraseExtractionSkillLanguage":"Search.KeyPhraseExtractionSkillLanguage","com.azure.search.documents.indexes.models.KeywordMarkerTokenFilter":"Search.KeywordMarkerTokenFilter","com.azure.search.documents.indexes.models.KeywordTokenizer":"Search.KeywordTokenizer","com.azure.search.documents.indexes.models.KeywordTokenizerV2":"Search.KeywordTokenizerV2","com.azure.search.documents.indexes.models.KnowledgeBase":"Search.KnowledgeBase","com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel":"Search.KnowledgeBaseAzureOpenAIModel","com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model":"Search.KnowledgeBaseMicrosoftRetriever1Model","com.azure.search.documents.indexes.models.KnowledgeBaseModel":"Search.KnowledgeBaseModel","com.azure.search.documents.indexes.models.KnowledgeBaseModelKind":"Search.KnowledgeBaseModelKind","com.azure.search.documents.indexes.models.KnowledgeBaseOpenAICompatibleModel":"Search.KnowledgeBaseOpenAICompatibleModel","com.azure.search.documents.indexes.models.KnowledgeBaseOpenAICompatibleParameters":"Search.KnowledgeBaseOpenAICompatibleParameters","com.azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults":"Search.KnowledgeBaseRetrieveDefaults","com.azure.search.documents.indexes.models.KnowledgeBaseTool":"Search.KnowledgeBaseTool","com.azure.search.documents.indexes.models.KnowledgeBaseToolKnowledgeSourceReference":"Search.KnowledgeBaseToolKnowledgeSourceReference","com.azure.search.documents.indexes.models.KnowledgeSource":"Search.KnowledgeSource","com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode":"Search.KnowledgeSourceContentExtractionMode","com.azure.search.documents.indexes.models.KnowledgeSourceFile":"Search.KnowledgeSourceFile","com.azure.search.documents.indexes.models.KnowledgeSourceFileCapacity":"Search.KnowledgeSourceFileCapacity","com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionError":"Search.KnowledgeSourceFileIngestionError","com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation":"Search.KnowledgeSourceFileIngestionOperation","com.azure.search.documents.indexes.models.KnowledgeSourceGraphExtractionParameters":"Search.KnowledgeSourceGraphExtractionParameters","com.azure.search.documents.indexes.models.KnowledgeSourceGraphGrounding":"Search.KnowledgeSourceGraphGrounding","com.azure.search.documents.indexes.models.KnowledgeSourceGraphGroundingIndex":"Search.KnowledgeSourceGraphGroundingIndex","com.azure.search.documents.indexes.models.KnowledgeSourceGraphGroundingSourceKind":"Search.KnowledgeSourceGraphGroundingSourceKind","com.azure.search.documents.indexes.models.KnowledgeSourceGraphOntology":"Search.KnowledgeSourceGraphOntology","com.azure.search.documents.indexes.models.KnowledgeSourceGraphOntologySourceKind":"Search.KnowledgeSourceGraphOntologySourceKind","com.azure.search.documents.indexes.models.KnowledgeSourceIngestionPermissionOption":"Search.KnowledgeSourceIngestionPermissionOption","com.azure.search.documents.indexes.models.KnowledgeSourceKind":"Search.KnowledgeSourceKind","com.azure.search.documents.indexes.models.KnowledgeSourceReference":"Search.KnowledgeSourceReference","com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing":"Search.KnowledgeSourceResultsProcessing","com.azure.search.documents.indexes.models.KnowledgeSourceSynchronizationStatus":"Search.KnowledgeSourceSynchronizationStatus","com.azure.search.documents.indexes.models.LanguageDetectionSkill":"Search.LanguageDetectionSkill","com.azure.search.documents.indexes.models.LengthTokenFilter":"Search.LengthTokenFilter","com.azure.search.documents.indexes.models.LexicalAnalyzer":"Search.LexicalAnalyzer","com.azure.search.documents.indexes.models.LexicalAnalyzerName":"Search.LexicalAnalyzerName","com.azure.search.documents.indexes.models.LexicalNormalizer":"Search.LexicalNormalizer","com.azure.search.documents.indexes.models.LexicalNormalizerName":"Search.LexicalNormalizerName","com.azure.search.documents.indexes.models.LexicalTokenizer":"Search.LexicalTokenizer","com.azure.search.documents.indexes.models.LexicalTokenizerName":"Search.LexicalTokenizerName","com.azure.search.documents.indexes.models.LimitTokenFilter":"Search.LimitTokenFilter","com.azure.search.documents.indexes.models.ListDataSourcesResult":"Search.ListDataSourcesResult","com.azure.search.documents.indexes.models.ListIndexersResult":"Search.ListIndexersResult","com.azure.search.documents.indexes.models.ListSkillsetsResult":"Search.ListSkillsetsResult","com.azure.search.documents.indexes.models.ListSynonymMapsResult":"Search.ListSynonymMapsResult","com.azure.search.documents.indexes.models.ListingSearchType":"Search.ListingSearchType","com.azure.search.documents.indexes.models.LuceneStandardAnalyzer":"Search.LuceneStandardAnalyzer","com.azure.search.documents.indexes.models.LuceneStandardTokenizer":"Search.LuceneStandardTokenizer","com.azure.search.documents.indexes.models.LuceneStandardTokenizerV2":"Search.LuceneStandardTokenizerV2","com.azure.search.documents.indexes.models.MagnitudeScoringFunction":"Search.MagnitudeScoringFunction","com.azure.search.documents.indexes.models.MagnitudeScoringParameters":"Search.MagnitudeScoringParameters","com.azure.search.documents.indexes.models.MappingCharFilter":"Search.MappingCharFilter","com.azure.search.documents.indexes.models.MarkdownHeaderDepth":"Search.MarkdownHeaderDepth","com.azure.search.documents.indexes.models.MarkdownParsingSubmode":"Search.MarkdownParsingSubmode","com.azure.search.documents.indexes.models.McpServerAuthentication":"Search.McpServerAuthentication","com.azure.search.documents.indexes.models.McpServerAuthenticationKind":"Search.McpServerAuthenticationKind","com.azure.search.documents.indexes.models.McpServerAutoOutputParsing":"Search.McpServerAutoOutputParsing","com.azure.search.documents.indexes.models.McpServerFoundryConnectionAuthentication":"Search.McpServerFoundryConnectionAuthentication","com.azure.search.documents.indexes.models.McpServerFoundryConnectionParameters":"Search.McpServerFoundryConnectionParameters","com.azure.search.documents.indexes.models.McpServerHeaders":"Search.McpServerHeaders","com.azure.search.documents.indexes.models.McpServerJsonOutputParsing":"Search.McpServerJsonOutputParsing","com.azure.search.documents.indexes.models.McpServerKnowledgeSource":"Search.McpServerKnowledgeSource","com.azure.search.documents.indexes.models.McpServerKnowledgeSourceParameters":"Search.McpServerKnowledgeSourceParameters","com.azure.search.documents.indexes.models.McpServerNoneOutputParsing":"Search.McpServerNoneOutputParsing","com.azure.search.documents.indexes.models.McpServerOutputParsing":"Search.McpServerOutputParsing","com.azure.search.documents.indexes.models.McpServerOutputParsingJsonParameters":"Search.McpServerOutputParsingJsonParameters","com.azure.search.documents.indexes.models.McpServerOutputParsingKind":"Search.McpServerOutputParsingKind","com.azure.search.documents.indexes.models.McpServerOutputParsingSplitParameters":"Search.McpServerOutputParsingSplitParameters","com.azure.search.documents.indexes.models.McpServerSplitOutputParsing":"Search.McpServerSplitOutputParsing","com.azure.search.documents.indexes.models.McpServerStoredHeadersAuthentication":"Search.McpServerStoredHeadersAuthentication","com.azure.search.documents.indexes.models.McpServerStoredHeadersParameters":"Search.McpServerStoredHeadersParameters","com.azure.search.documents.indexes.models.McpServerTool":"Search.McpServerTool","com.azure.search.documents.indexes.models.MergeSkill":"Search.MergeSkill","com.azure.search.documents.indexes.models.MicrosoftLanguageStemmingTokenizer":"Search.MicrosoftLanguageStemmingTokenizer","com.azure.search.documents.indexes.models.MicrosoftLanguageTokenizer":"Search.MicrosoftLanguageTokenizer","com.azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage":"Search.MicrosoftStemmingTokenizerLanguage","com.azure.search.documents.indexes.models.MicrosoftTokenizerLanguage":"Search.MicrosoftTokenizerLanguage","com.azure.search.documents.indexes.models.NGramTokenFilter":"Search.NGramTokenFilter","com.azure.search.documents.indexes.models.NGramTokenFilterV2":"Search.NGramTokenFilterV2","com.azure.search.documents.indexes.models.NGramTokenizer":"Search.NGramTokenizer","com.azure.search.documents.indexes.models.NativeBlobSoftDeleteDeletionDetectionPolicy":"Search.NativeBlobSoftDeleteDeletionDetectionPolicy","com.azure.search.documents.indexes.models.OcrLineEnding":"Search.OcrLineEnding","com.azure.search.documents.indexes.models.OcrSkill":"Search.OcrSkill","com.azure.search.documents.indexes.models.OcrSkillLanguage":"Search.OcrSkillLanguage","com.azure.search.documents.indexes.models.OneLakeSecuritySource":"Search.OneLakeSecuritySource","com.azure.search.documents.indexes.models.OpenAICompatibleVectorizer":"Search.OpenAICompatibleVectorizer","com.azure.search.documents.indexes.models.OpenAICompatibleVectorizerParameters":"Search.OpenAICompatibleVectorizerParameters","com.azure.search.documents.indexes.models.OutputFieldMappingEntry":"Search.OutputFieldMappingEntry","com.azure.search.documents.indexes.models.PIIDetectionSkill":"Search.PIIDetectionSkill","com.azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode":"Search.PIIDetectionSkillMaskingMode","com.azure.search.documents.indexes.models.PathHierarchyTokenizerV2":"Search.PathHierarchyTokenizerV2","com.azure.search.documents.indexes.models.PatternAnalyzer":"Search.PatternAnalyzer","com.azure.search.documents.indexes.models.PatternCaptureTokenFilter":"Search.PatternCaptureTokenFilter","com.azure.search.documents.indexes.models.PatternReplaceCharFilter":"Search.PatternReplaceCharFilter","com.azure.search.documents.indexes.models.PatternReplaceTokenFilter":"Search.PatternReplaceTokenFilter","com.azure.search.documents.indexes.models.PatternTokenizer":"Search.PatternTokenizer","com.azure.search.documents.indexes.models.PermissionFilter":"Search.PermissionFilter","com.azure.search.documents.indexes.models.PhoneticEncoder":"Search.PhoneticEncoder","com.azure.search.documents.indexes.models.PhoneticTokenFilter":"Search.PhoneticTokenFilter","com.azure.search.documents.indexes.models.RandomScoringFunction":"Search.RandomScoringFunction","com.azure.search.documents.indexes.models.RandomScoringParameters":"Search.RandomScoringParameters","com.azure.search.documents.indexes.models.RankingOrder":"Search.RankingOrder","com.azure.search.documents.indexes.models.RegexFlags":"Search.RegexFlags","com.azure.search.documents.indexes.models.RemoteSharePointKnowledgeSource":"Search.RemoteSharePointKnowledgeSource","com.azure.search.documents.indexes.models.RemoteSharePointKnowledgeSourceParameters":"Search.RemoteSharePointKnowledgeSourceParameters","com.azure.search.documents.indexes.models.RescoringOptions":"Search.RescoringOptions","com.azure.search.documents.indexes.models.ResourceCounter":"Search.ResourceCounter","com.azure.search.documents.indexes.models.ScalarQuantizationCompression":"Search.ScalarQuantizationCompression","com.azure.search.documents.indexes.models.ScalarQuantizationParameters":"Search.ScalarQuantizationParameters","com.azure.search.documents.indexes.models.ScoringFunction":"Search.ScoringFunction","com.azure.search.documents.indexes.models.ScoringFunctionAggregation":"Search.ScoringFunctionAggregation","com.azure.search.documents.indexes.models.ScoringFunctionInterpolation":"Search.ScoringFunctionInterpolation","com.azure.search.documents.indexes.models.ScoringProfile":"Search.ScoringProfile","com.azure.search.documents.indexes.models.SearchAlias":"Search.SearchAlias","com.azure.search.documents.indexes.models.SearchField":"Search.SearchField","com.azure.search.documents.indexes.models.SearchFieldDataType":"Search.SearchFieldDataType","com.azure.search.documents.indexes.models.SearchIndex":"Search.SearchIndex","com.azure.search.documents.indexes.models.SearchIndexFieldReference":"Search.SearchIndexFieldReference","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource":"Search.SearchIndexKnowledgeSource","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoost":"Search.SearchIndexKnowledgeSourceBoost","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoostKind":"Search.SearchIndexKnowledgeSourceBoostKind","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFieldValueBoost":"Search.SearchIndexKnowledgeSourceFieldValueBoost","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint":"Search.SearchIndexKnowledgeSourceFilterHint","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration":"Search.SearchIndexKnowledgeSourceFilterHintAutoConfiguration","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceMultiWordExpressionBoost":"Search.SearchIndexKnowledgeSourceMultiWordExpressionBoost","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters":"Search.SearchIndexKnowledgeSourceParameters","com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints":"Search.SearchIndexKnowledgeSourceQueryHints","com.azure.search.documents.indexes.models.SearchIndexPermissionFilterOption":"Search.SearchIndexPermissionFilterOption","com.azure.search.documents.indexes.models.SearchIndexResponse":"Search.SearchIndexResponse","com.azure.search.documents.indexes.models.SearchIndexer":"Search.SearchIndexer","com.azure.search.documents.indexes.models.SearchIndexerCache":"Search.SearchIndexerCache","com.azure.search.documents.indexes.models.SearchIndexerDataContainer":"Search.SearchIndexerDataContainer","com.azure.search.documents.indexes.models.SearchIndexerDataIdentity":"Search.SearchIndexerDataIdentity","com.azure.search.documents.indexes.models.SearchIndexerDataNoneIdentity":"Search.SearchIndexerDataNoneIdentity","com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection":"Search.SearchIndexerDataSource","com.azure.search.documents.indexes.models.SearchIndexerDataSourceType":"Search.SearchIndexerDataSourceType","com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity":"Search.SearchIndexerDataUserAssignedIdentity","com.azure.search.documents.indexes.models.SearchIndexerError":"Search.SearchIndexerError","com.azure.search.documents.indexes.models.SearchIndexerIndexProjection":"Search.SearchIndexerIndexProjection","com.azure.search.documents.indexes.models.SearchIndexerIndexProjectionSelector":"Search.SearchIndexerIndexProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerIndexProjectionsParameters":"Search.SearchIndexerIndexProjectionsParameters","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStore":"Search.SearchIndexerKnowledgeStore","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreBlobProjectionSelector":"Search.SearchIndexerKnowledgeStoreBlobProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreFileProjectionSelector":"Search.SearchIndexerKnowledgeStoreFileProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreObjectProjectionSelector":"Search.SearchIndexerKnowledgeStoreObjectProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreParameters":"Search.SearchIndexerKnowledgeStoreParameters","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreProjection":"Search.SearchIndexerKnowledgeStoreProjection","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreProjectionSelector":"Search.SearchIndexerKnowledgeStoreProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreTableProjectionSelector":"Search.SearchIndexerKnowledgeStoreTableProjectionSelector","com.azure.search.documents.indexes.models.SearchIndexerLimits":"Search.SearchIndexerLimits","com.azure.search.documents.indexes.models.SearchIndexerSkill":"Search.SearchIndexerSkill","com.azure.search.documents.indexes.models.SearchIndexerSkillset":"Search.SearchIndexerSkillset","com.azure.search.documents.indexes.models.SearchIndexerStatus":"Search.SearchIndexerStatus","com.azure.search.documents.indexes.models.SearchIndexerWarning":"Search.SearchIndexerWarning","com.azure.search.documents.indexes.models.SearchResourceEncryptionKey":"Search.SearchResourceEncryptionKey","com.azure.search.documents.indexes.models.SearchServiceCounters":"Search.SearchServiceCounters","com.azure.search.documents.indexes.models.SearchServiceLimits":"Search.SearchServiceLimits","com.azure.search.documents.indexes.models.SearchServiceStatistics":"Search.SearchServiceStatistics","com.azure.search.documents.indexes.models.SearchSuggester":"Search.SearchSuggester","com.azure.search.documents.indexes.models.SemanticConfiguration":"Search.SemanticConfiguration","com.azure.search.documents.indexes.models.SemanticField":"Search.SemanticField","com.azure.search.documents.indexes.models.SemanticPrioritizedFields":"Search.SemanticPrioritizedFields","com.azure.search.documents.indexes.models.SemanticSearch":"Search.SemanticSearch","com.azure.search.documents.indexes.models.SentimentSkillLanguage":"Search.SentimentSkillLanguage","com.azure.search.documents.indexes.models.SentimentSkillV3":"Search.SentimentSkillV3","com.azure.search.documents.indexes.models.ServiceIndexersRuntime":"Search.ServiceIndexersRuntime","com.azure.search.documents.indexes.models.ShaperSkill":"Search.ShaperSkill","com.azure.search.documents.indexes.models.ShingleTokenFilter":"Search.ShingleTokenFilter","com.azure.search.documents.indexes.models.SimilarityAlgorithm":"Search.SimilarityAlgorithm","com.azure.search.documents.indexes.models.SkillNames":"Search.SkillNames","com.azure.search.documents.indexes.models.SnowballTokenFilter":"Search.SnowballTokenFilter","com.azure.search.documents.indexes.models.SnowballTokenFilterLanguage":"Search.SnowballTokenFilterLanguage","com.azure.search.documents.indexes.models.SoftDeleteColumnDeletionDetectionPolicy":"Search.SoftDeleteColumnDeletionDetectionPolicy","com.azure.search.documents.indexes.models.SplitSkill":"Search.SplitSkill","com.azure.search.documents.indexes.models.SplitSkillEncoderModelName":"Search.SplitSkillEncoderModelName","com.azure.search.documents.indexes.models.SplitSkillLanguage":"Search.SplitSkillLanguage","com.azure.search.documents.indexes.models.SplitSkillUnit":"Search.SplitSkillUnit","com.azure.search.documents.indexes.models.SqlIntegratedChangeTrackingPolicy":"Search.SqlIntegratedChangeTrackingPolicy","com.azure.search.documents.indexes.models.StemmerOverrideTokenFilter":"Search.StemmerOverrideTokenFilter","com.azure.search.documents.indexes.models.StemmerTokenFilter":"Search.StemmerTokenFilter","com.azure.search.documents.indexes.models.StemmerTokenFilterLanguage":"Search.StemmerTokenFilterLanguage","com.azure.search.documents.indexes.models.StopAnalyzer":"Search.StopAnalyzer","com.azure.search.documents.indexes.models.StopwordsList":"Search.StopwordsList","com.azure.search.documents.indexes.models.StopwordsTokenFilter":"Search.StopwordsTokenFilter","com.azure.search.documents.indexes.models.SynonymMap":"Search.SynonymMap","com.azure.search.documents.indexes.models.SynonymTokenFilter":"Search.SynonymTokenFilter","com.azure.search.documents.indexes.models.TagScoringFunction":"Search.TagScoringFunction","com.azure.search.documents.indexes.models.TagScoringParameters":"Search.TagScoringParameters","com.azure.search.documents.indexes.models.TextSplitMode":"Search.TextSplitMode","com.azure.search.documents.indexes.models.TextTranslationSkill":"Search.TextTranslationSkill","com.azure.search.documents.indexes.models.TextTranslationSkillLanguage":"Search.TextTranslationSkillLanguage","com.azure.search.documents.indexes.models.TextWeights":"Search.TextWeights","com.azure.search.documents.indexes.models.TokenCharacterKind":"Search.TokenCharacterKind","com.azure.search.documents.indexes.models.TokenFilter":"Search.TokenFilter","com.azure.search.documents.indexes.models.TokenFilterName":"Search.TokenFilterName","com.azure.search.documents.indexes.models.TruncateTokenFilter":"Search.TruncateTokenFilter","com.azure.search.documents.indexes.models.UaxUrlEmailTokenizer":"Search.UaxUrlEmailTokenizer","com.azure.search.documents.indexes.models.UniqueTokenFilter":"Search.UniqueTokenFilter","com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest":"Search.UpdateKnowledgeSourceFileRequest","com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest":"Search.UploadKnowledgeSourceFileMultipartRequest","com.azure.search.documents.indexes.models.VectorEncodingFormat":"Search.VectorEncodingFormat","com.azure.search.documents.indexes.models.VectorSearch":"Search.VectorSearch","com.azure.search.documents.indexes.models.VectorSearchAlgorithmConfiguration":"Search.VectorSearchAlgorithmConfiguration","com.azure.search.documents.indexes.models.VectorSearchAlgorithmKind":"Search.VectorSearchAlgorithmKind","com.azure.search.documents.indexes.models.VectorSearchAlgorithmMetric":"Search.VectorSearchAlgorithmMetric","com.azure.search.documents.indexes.models.VectorSearchCompression":"Search.VectorSearchCompression","com.azure.search.documents.indexes.models.VectorSearchCompressionKind":"Search.VectorSearchCompressionKind","com.azure.search.documents.indexes.models.VectorSearchCompressionRescoreStorageMethod":"Search.VectorSearchCompressionRescoreStorageMethod","com.azure.search.documents.indexes.models.VectorSearchCompressionTarget":"Search.VectorSearchCompressionTarget","com.azure.search.documents.indexes.models.VectorSearchProfile":"Search.VectorSearchProfile","com.azure.search.documents.indexes.models.VectorSearchTopicGraphProfile":"Search.VectorSearchTopicGraphProfile","com.azure.search.documents.indexes.models.VectorSearchVectorizer":"Search.VectorSearchVectorizer","com.azure.search.documents.indexes.models.VectorSearchVectorizerKind":"Search.VectorSearchVectorizerKind","com.azure.search.documents.indexes.models.VisionVectorizeSkill":"Search.VisionVectorizeSkill","com.azure.search.documents.indexes.models.VisualFeature":"Search.VisualFeature","com.azure.search.documents.indexes.models.WebApiHttpHeaders":"Search.WebApiHttpHeaders","com.azure.search.documents.indexes.models.WebApiSkill":"Search.WebApiSkill","com.azure.search.documents.indexes.models.WebApiVectorizer":"Search.WebApiVectorizer","com.azure.search.documents.indexes.models.WebApiVectorizerParameters":"Search.WebApiVectorizerParameters","com.azure.search.documents.indexes.models.WebKnowledgeSource":"Search.WebKnowledgeSource","com.azure.search.documents.indexes.models.WebKnowledgeSourceDomain":"Search.WebKnowledgeSourceDomain","com.azure.search.documents.indexes.models.WebKnowledgeSourceDomains":"Search.WebKnowledgeSourceDomains","com.azure.search.documents.indexes.models.WebKnowledgeSourceParameters":"Search.WebKnowledgeSourceParameters","com.azure.search.documents.indexes.models.WordDelimiterTokenFilter":"Search.WordDelimiterTokenFilter","com.azure.search.documents.indexes.models.WorkIQKnowledgeSource":"Search.WorkIQKnowledgeSource","com.azure.search.documents.indexes.models.WorkIQKnowledgeSourceParameters":"Search.WorkIQKnowledgeSourceParameters","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient":"Customizations.KnowledgeBaseRetrievalClient","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieve":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieveStream":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieveStreamWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient.retrieveWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient":"Customizations.KnowledgeBaseRetrievalClient","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieve":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieveStream":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieveStreamWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieveStream","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieveWithResponse":"Customizations.KnowledgeBaseRetrievalClient.retrieve","com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder":"Customizations.KnowledgeBaseRetrievalClient","com.azure.search.documents.knowledgebases.models.AgentRuntimeGraphHydrateDocumentsParams":"Search.AgentRuntimeGraphHydrateDocumentsParams","com.azure.search.documents.knowledgebases.models.AgentRuntimeGraphParams":"Search.AgentRuntimeGraphParams","com.azure.search.documents.knowledgebases.models.AgentRuntimeGraphProvenanceParams":"Search.AgentRuntimeGraphProvenanceParams","com.azure.search.documents.knowledgebases.models.AiServices":"Search.AIServices","com.azure.search.documents.knowledgebases.models.AssetStore":"Search.AssetStore","com.azure.search.documents.knowledgebases.models.AzureBlobKnowledgeSourceParams":"Search.AzureBlobKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.CompletedSynchronizationState":"Search.CompletedSynchronizationState","com.azure.search.documents.knowledgebases.models.FabricDataAgentKnowledgeSourceParams":"Search.FabricDataAgentKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.FabricOntologyKnowledgeSourceParams":"Search.FabricOntologyKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.FileKnowledgeSourceParams":"Search.FileKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.FreshnessPolicy":"Search.FreshnessPolicy","com.azure.search.documents.knowledgebases.models.ImageServingStatistics":"Search.ImageServingStatistics","com.azure.search.documents.knowledgebases.models.IndexedOneLakeKnowledgeSourceParams":"Search.IndexedOneLakeKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.IndexedSharePointKnowledgeSourceParams":"Search.IndexedSharePointKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.IndexedSqlKnowledgeSourceParams":"Search.IndexedSqlKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityCompletedStreamEvent":"Search.KnowledgeBaseActivityCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord":"Search.KnowledgeBaseActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel":"Search.KnowledgeBaseActivityRecordModel","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordType":"Search.KnowledgeBaseActivityRecordType","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedEvent":"Search.KnowledgeBaseActivityStartedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedStreamEvent":"Search.KnowledgeBaseActivityStartedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord":"Search.KnowledgeBaseAgenticReasoningActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedEvent":"Search.KnowledgeBaseAnswerCompletedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent":"Search.KnowledgeBaseAnswerCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityArguments":"Search.KnowledgeBaseAzureBlobActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityRecord":"Search.KnowledgeBaseAzureBlobActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobReference":"Search.KnowledgeBaseAzureBlobReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseErrorAdditionalInfo":"Search.KnowledgeBaseErrorAdditionalInfo","com.azure.search.documents.knowledgebases.models.KnowledgeBaseErrorDetail":"Search.KnowledgeBaseErrorDetail","com.azure.search.documents.knowledgebases.models.KnowledgeBaseErrorStreamEvent":"Search.KnowledgeBaseErrorStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFabricDataAgentActivityArguments":"Search.KnowledgeBaseFabricDataAgentActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFabricDataAgentActivityRecord":"Search.KnowledgeBaseFabricDataAgentActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFabricDataAgentReference":"Search.KnowledgeBaseFabricDataAgentReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFabricOntologyActivityArguments":"Search.KnowledgeBaseFabricOntologyActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFabricOntologyActivityRecord":"Search.KnowledgeBaseFabricOntologyActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFabricOntologyReference":"Search.KnowledgeBaseFabricOntologyReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileActivityArguments":"Search.KnowledgeBaseFileActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileActivityRecord":"Search.KnowledgeBaseFileActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileReference":"Search.KnowledgeBaseFileReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityArguments":"Search.KnowledgeBaseGraphSearchActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord":"Search.KnowledgeBaseGraphSearchActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchReference":"Search.KnowledgeBaseGraphSearchReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseImageContent":"Search.KnowledgeBaseImageContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeActivityArguments":"Search.KnowledgeBaseIndexedOneLakeActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeActivityRecord":"Search.KnowledgeBaseIndexedOneLakeActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeReference":"Search.KnowledgeBaseIndexedOneLakeReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointActivityArguments":"Search.KnowledgeBaseIndexedSharePointActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointActivityRecord":"Search.KnowledgeBaseIndexedSharePointActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointReference":"Search.KnowledgeBaseIndexedSharePointReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlActivityArguments":"Search.KnowledgeBaseIndexedSqlActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlActivityRecord":"Search.KnowledgeBaseIndexedSqlActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference":"Search.KnowledgeBaseIndexedSqlReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMcpServerActivityArguments":"Search.KnowledgeBaseMcpServerActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMcpServerActivityRecord":"Search.KnowledgeBaseMcpServerActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMcpServerReference":"Search.KnowledgeBaseMcpServerReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage":"Search.KnowledgeBaseMessage","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageContent":"Search.KnowledgeBaseMessageContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageContentType":"Search.KnowledgeBaseMessageContentType","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageImageContent":"Search.KnowledgeBaseMessageImageContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageTextContent":"Search.KnowledgeBaseMessageTextContent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord":"Search.KnowledgeBaseModelAnswerSynthesisActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelQueryPlanningActivityRecord":"Search.KnowledgeBaseModelQueryPlanningActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelWebSummarizationActivityRecord":"Search.KnowledgeBaseModelWebSummarizationActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing":"Search.KnowledgeBaseQueryHintProcessing","com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference":"Search.KnowledgeBaseReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseReferenceType":"Search.KnowledgeBaseReferenceType","com.azure.search.documents.knowledgebases.models.KnowledgeBaseReferencesCompletedStreamEvent":"Search.KnowledgeBaseReferencesCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointActivityArguments":"Search.KnowledgeBaseRemoteSharePointActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointActivityRecord":"Search.KnowledgeBaseRemoteSharePointActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointReference":"Search.KnowledgeBaseRemoteSharePointReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent":"Search.KnowledgeBaseResponseCompletedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedStreamEvent":"Search.KnowledgeBaseResponseCompletedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions":"Search.KnowledgeBaseRetrievalRequest","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult":"Search.KnowledgeBaseRetrievalResponse","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent":"Search.KnowledgeBaseRetrievalStartedEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedStreamEvent":"Search.KnowledgeBaseRetrievalStartedStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStatusCode":"Search.KnowledgeBaseRetrievalStatusCode","com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent":"Search.KnowledgeBaseRetrievalStreamEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityArguments":"Search.KnowledgeBaseSearchIndexActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityRecord":"Search.KnowledgeBaseSearchIndexActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference":"Search.KnowledgeBaseSearchIndexReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseStreamErrorEvent":"Search.KnowledgeBaseStreamErrorEvent","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityArguments":"Search.KnowledgeBaseWebActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityRecord":"Search.KnowledgeBaseWebActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWebReference":"Search.KnowledgeBaseWebReference","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityArguments":"Search.KnowledgeBaseWorkIQActivityArguments","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityRecord":"Search.KnowledgeBaseWorkIQActivityRecord","com.azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQReference":"Search.KnowledgeBaseWorkIQReference","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalAutoReasoningEffort":"Search.KnowledgeRetrievalAutoReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntent":"Search.KnowledgeRetrievalIntent","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntentType":"Search.KnowledgeRetrievalIntentType","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort":"Search.KnowledgeRetrievalLowReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMediumReasoningEffort":"Search.KnowledgeRetrievalMediumReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort":"Search.KnowledgeRetrievalMinimalReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode":"Search.KnowledgeRetrievalOutputMode","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort":"Search.KnowledgeRetrievalReasoningEffort","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind":"Search.KnowledgeRetrievalReasoningEffortKind","com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent":"Search.KnowledgeRetrievalSemanticIntent","com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer":"Search.KnowledgeSourceAzureOpenAIVectorizer","com.azure.search.documents.knowledgebases.models.KnowledgeSourceCache":"Search.KnowledgeSourceCache","com.azure.search.documents.knowledgebases.models.KnowledgeSourceGraphProvenanceKind":"Search.KnowledgeSourceGraphProvenanceKind","com.azure.search.documents.knowledgebases.models.KnowledgeSourceGraphStatistics":"Search.KnowledgeSourceGraphStatistics","com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters":"Search.KnowledgeSourceIngestionParameters","com.azure.search.documents.knowledgebases.models.KnowledgeSourceNetworkAccessMode":"Search.KnowledgeSourceNetworkAccessMode","com.azure.search.documents.knowledgebases.models.KnowledgeSourceOpenAICompatibleVectorizer":"Search.KnowledgeSourceOpenAICompatibleVectorizer","com.azure.search.documents.knowledgebases.models.KnowledgeSourceParams":"Search.KnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatistics":"Search.KnowledgeSourceStatistics","com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatus":"Search.KnowledgeSourceStatus","com.azure.search.documents.knowledgebases.models.KnowledgeSourceSynchronizationError":"Search.KnowledgeSourceSynchronizationError","com.azure.search.documents.knowledgebases.models.KnowledgeSourceVectorizer":"Search.KnowledgeSourceVectorizer","com.azure.search.documents.knowledgebases.models.McpServerKnowledgeSourceParams":"Search.McpServerKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo":"Search.PurviewSensitivityLabelInfo","com.azure.search.documents.knowledgebases.models.RemoteSharePointKnowledgeSourceParams":"Search.RemoteSharePointKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams":"Search.SearchIndexKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.ServedImage":"Search.ServedImage","com.azure.search.documents.knowledgebases.models.SynchronizationState":"Search.SynchronizationState","com.azure.search.documents.knowledgebases.models.WebKnowledgeSourceParams":"Search.WebKnowledgeSourceParams","com.azure.search.documents.knowledgebases.models.WorkIQKnowledgeSourceParams":"Search.WorkIQKnowledgeSourceParams","com.azure.search.documents.models.AgenticSearchDebugInfo":"Search.AgenticSearchDebugInfo","com.azure.search.documents.models.AgenticSearchOptions":"Search.AgenticSearchOptions","com.azure.search.documents.models.AgenticSearchSubQuery":"Search.AgenticSearchSubQuery","com.azure.search.documents.models.AgenticSearchTerminationReason":"Search.AgenticSearchTerminationReason","com.azure.search.documents.models.AgenticSearchUsage":"Search.AgenticSearchUsage","com.azure.search.documents.models.AutocompleteItem":"Search.AutocompleteItem","com.azure.search.documents.models.AutocompleteMode":"Search.AutocompleteMode","com.azure.search.documents.models.AutocompleteOptions":null,"com.azure.search.documents.models.AutocompleteResult":"Search.AutocompleteResult","com.azure.search.documents.models.BalancedVectorQueryTopicGraph":"Search.BalancedVectorQueryTopicGraph","com.azure.search.documents.models.ContentFileDetails":"TypeSpec.Http.File","com.azure.search.documents.models.ContentUnderstandingSkillChunkingMethod":"Search.ContentUnderstandingSkillChunkingMethod","com.azure.search.documents.models.DebugInfo":"Search.DebugInfo","com.azure.search.documents.models.DiverseVectorQueryTopicGraph":"Search.DiverseVectorQueryTopicGraph","com.azure.search.documents.models.DocumentDebugInfo":"Search.DocumentDebugInfo","com.azure.search.documents.models.FacetResult":"Search.FacetResult","com.azure.search.documents.models.GraphOptions":null,"com.azure.search.documents.models.GraphQueryDiagnostic":"Search.GraphQueryDiagnostic","com.azure.search.documents.models.GraphQueryDiagnosticPhase":"Search.GraphQueryDiagnosticPhase","com.azure.search.documents.models.GraphQueryDiagnosticSeverity":"Search.GraphQueryDiagnosticSeverity","com.azure.search.documents.models.GraphQueryEvidence":"Search.GraphQueryEvidence","com.azure.search.documents.models.GraphQueryEvidenceConfidence":"Search.GraphQueryEvidenceConfidence","com.azure.search.documents.models.GraphQueryEvidenceCount":"Search.GraphQueryEvidenceCount","com.azure.search.documents.models.GraphQueryEvidenceCountRelation":"Search.GraphQueryEvidenceCountRelation","com.azure.search.documents.models.GraphQueryExecutionMode":"Search.GraphQueryExecutionMode","com.azure.search.documents.models.GraphQueryExplain":"Search.GraphQueryExplain","com.azure.search.documents.models.GraphQueryExplainStage":"Search.GraphQueryExplainStage","com.azure.search.documents.models.GraphQueryProvenanceDocument":"Search.GraphQueryProvenanceDocument","com.azure.search.documents.models.GraphQueryProvenanceDocuments":"Search.GraphQueryProvenanceDocuments","com.azure.search.documents.models.GraphQueryProvenanceHydrateDocumentsParameters":"Search.GraphQueryProvenanceHydrateDocumentsParameters","com.azure.search.documents.models.GraphQueryProvenanceKind":"Search.GraphQueryProvenanceKind","com.azure.search.documents.models.GraphQueryProvenanceParameters":"Search.GraphQueryProvenanceParameters","com.azure.search.documents.models.GraphQueryResult":"Search.GraphQueryResult","com.azure.search.documents.models.GraphQueryRow":"Search.GraphQueryRow","com.azure.search.documents.models.GraphQueryRowProvenance":"Search.GraphQueryRowProvenance","com.azure.search.documents.models.GraphQueryStatistics":"Search.GraphQueryStatistics","com.azure.search.documents.models.HybridCountAndFacetMode":"Search.HybridCountAndFacetMode","com.azure.search.documents.models.HybridSearch":"Search.HybridSearch","com.azure.search.documents.models.IndexAction":"Search.IndexAction","com.azure.search.documents.models.IndexActionType":"Search.IndexActionType","com.azure.search.documents.models.IndexDocumentsBatch":"Search.IndexBatch","com.azure.search.documents.models.IndexDocumentsResult":"Search.IndexDocumentsResult","com.azure.search.documents.models.IndexingResult":"Search.IndexingResult","com.azure.search.documents.models.LookupDocument":"Search.LookupDocument","com.azure.search.documents.models.NoneVectorQueryTopicGraph":"Search.NoneVectorQueryTopicGraph","com.azure.search.documents.models.OperationState":"Azure.Core.Foundations.OperationState","com.azure.search.documents.models.QueryAnswerResult":"Search.QueryAnswerResult","com.azure.search.documents.models.QueryAnswerType":"Search.QueryAnswerType","com.azure.search.documents.models.QueryCaptionResult":"Search.QueryCaptionResult","com.azure.search.documents.models.QueryCaptionType":"Search.QueryCaptionType","com.azure.search.documents.models.QueryDebugMode":"Search.QueryDebugMode","com.azure.search.documents.models.QueryLanguage":"Search.QueryLanguage","com.azure.search.documents.models.QueryResultDocumentInnerHit":"Search.QueryResultDocumentInnerHit","com.azure.search.documents.models.QueryResultDocumentRerankerInput":"Search.QueryResultDocumentRerankerInput","com.azure.search.documents.models.QueryResultDocumentSemanticField":"Search.QueryResultDocumentSemanticField","com.azure.search.documents.models.QueryResultDocumentSubscores":"Search.QueryResultDocumentSubscores","com.azure.search.documents.models.QueryRewritesDebugInfo":"Search.QueryRewritesDebugInfo","com.azure.search.documents.models.QueryRewritesType":"Search.QueryRewritesType","com.azure.search.documents.models.QueryRewritesValuesDebugInfo":"Search.QueryRewritesValuesDebugInfo","com.azure.search.documents.models.QuerySpellerType":"Search.QuerySpellerType","com.azure.search.documents.models.QueryType":"Search.QueryType","com.azure.search.documents.models.ScoringStatistics":"Search.ScoringStatistics","com.azure.search.documents.models.SearchDocumentsResult":"Search.SearchDocumentsResult","com.azure.search.documents.models.SearchMode":"Search.SearchMode","com.azure.search.documents.models.SearchOptions":null,"com.azure.search.documents.models.SearchRequest":"Search.SearchRequest","com.azure.search.documents.models.SearchResult":"Search.SearchResult","com.azure.search.documents.models.SearchScoreThreshold":"Search.SearchScoreThreshold","com.azure.search.documents.models.SemanticDebugInfo":"Search.SemanticDebugInfo","com.azure.search.documents.models.SemanticErrorMode":"Search.SemanticErrorMode","com.azure.search.documents.models.SemanticErrorReason":"Search.SemanticErrorReason","com.azure.search.documents.models.SemanticFieldState":"Search.SemanticFieldState","com.azure.search.documents.models.SemanticQueryRewritesResultType":"Search.SemanticQueryRewritesResultType","com.azure.search.documents.models.SemanticSearchResultsType":"Search.SemanticSearchResultsType","com.azure.search.documents.models.SharePointConnectorAppRegistration":"Search.SharePointConnectorAppRegistration","com.azure.search.documents.models.SingleVectorFieldResult":"Search.SingleVectorFieldResult","com.azure.search.documents.models.SuggestDocumentsResult":"Search.SuggestDocumentsResult","com.azure.search.documents.models.SuggestOptions":null,"com.azure.search.documents.models.SuggestResult":"Search.SuggestResult","com.azure.search.documents.models.TextResult":"Search.TextResult","com.azure.search.documents.models.VectorFilterMode":"Search.VectorFilterMode","com.azure.search.documents.models.VectorQuery":"Search.VectorQuery","com.azure.search.documents.models.VectorQueryKind":"Search.VectorQueryKind","com.azure.search.documents.models.VectorQueryTopicGraph":"Search.VectorQueryTopicGraph","com.azure.search.documents.models.VectorSearchTopicGraphKind":"Search.VectorSearchTopicGraphKind","com.azure.search.documents.models.VectorSimilarityThreshold":"Search.VectorSimilarityThreshold","com.azure.search.documents.models.VectorThreshold":"Search.VectorThreshold","com.azure.search.documents.models.VectorThresholdKind":"Search.VectorThresholdKind","com.azure.search.documents.models.VectorizableImageBinaryQuery":"Search.VectorizableImageBinaryQuery","com.azure.search.documents.models.VectorizableImageUrlQuery":"Search.VectorizableImageUrlQuery","com.azure.search.documents.models.VectorizableTextQuery":"Search.VectorizableTextQuery","com.azure.search.documents.models.VectorizedQuery":"Search.VectorizedQuery","com.azure.search.documents.models.VectorsDebugInfo":"Search.VectorsDebugInfo"},"generatedFiles":["src/main/java/com/azure/search/documents/SearchAsyncClient.java","src/main/java/com/azure/search/documents/SearchClient.java","src/main/java/com/azure/search/documents/SearchClientBuilder.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/SearchServiceVersion.java","src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java","src/main/java/com/azure/search/documents/implementation/MultipartFormDataHelper.java","src/main/java/com/azure/search/documents/implementation/OperationLocationPollingStrategy.java","src/main/java/com/azure/search/documents/implementation/PollingUtils.java","src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java","src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java","src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java","src/main/java/com/azure/search/documents/implementation/SyncOperationLocationPollingStrategy.java","src/main/java/com/azure/search/documents/implementation/models/AutocompletePostRequest.java","src/main/java/com/azure/search/documents/implementation/models/GraphRequest.java","src/main/java/com/azure/search/documents/implementation/models/SearchPostRequest.java","src/main/java/com/azure/search/documents/implementation/models/SuggestPostRequest.java","src/main/java/com/azure/search/documents/implementation/models/package-info.java","src/main/java/com/azure/search/documents/implementation/package-info.java","src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java","src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java","src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java","src/main/java/com/azure/search/documents/indexes/models/AIFoundryModelCatalogName.java","src/main/java/com/azure/search/documents/indexes/models/AIServicesAccountIdentity.java","src/main/java/com/azure/search/documents/indexes/models/AIServicesAccountKey.java","src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionParameters.java","src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/AnalyzeResult.java","src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java","src/main/java/com/azure/search/documents/indexes/models/AnalyzedTokenInfo.java","src/main/java/com/azure/search/documents/indexes/models/AsciiFoldingTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/AzureActiveDirectoryApplicationCredentials.java","src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java","src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningSkill.java","src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIEmbeddingSkill.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAITokenizerParameters.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIVectorizerParameters.java","src/main/java/com/azure/search/documents/indexes/models/BM25SimilarityAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/BinaryQuantizationCompression.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerDataToExtract.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerImageAction.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerPDFTextRotationAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/BlobIndexerParsingMode.java","src/main/java/com/azure/search/documents/indexes/models/CharFilter.java","src/main/java/com/azure/search/documents/indexes/models/CharFilterName.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionCommonModelParameters.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionExtraParametersBehavior.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionResponseFormat.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionResponseFormatType.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionSchema.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionSchemaProperties.java","src/main/java/com/azure/search/documents/indexes/models/ChatCompletionSkill.java","src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilterScripts.java","src/main/java/com/azure/search/documents/indexes/models/ClassicSimilarityAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/ClassicTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/CognitiveServicesAccount.java","src/main/java/com/azure/search/documents/indexes/models/CognitiveServicesAccountKey.java","src/main/java/com/azure/search/documents/indexes/models/CommonGramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/ConditionalSkill.java","src/main/java/com/azure/search/documents/indexes/models/ContentColumnMapping.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkill.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkillChunkingProperties.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkillChunkingUnit.java","src/main/java/com/azure/search/documents/indexes/models/ContentUnderstandingSkillExtractionOptions.java","src/main/java/com/azure/search/documents/indexes/models/CorsOptions.java","src/main/java/com/azure/search/documents/indexes/models/CreatedResources.java","src/main/java/com/azure/search/documents/indexes/models/CustomAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntity.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntityAlias.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntityLookupSkill.java","src/main/java/com/azure/search/documents/indexes/models/CustomEntityLookupSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/CustomNormalizer.java","src/main/java/com/azure/search/documents/indexes/models/DataChangeDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/DataDeletionDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/DataSourceCredentials.java","src/main/java/com/azure/search/documents/indexes/models/DefaultCognitiveServicesAccount.java","src/main/java/com/azure/search/documents/indexes/models/DictionaryDecompounderTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/DistanceScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/DistanceScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/DocumentExtractionSkill.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkill.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillChunkingProperties.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillChunkingUnit.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillExtractionOptions.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillMarkdownHeaderDepth.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillOutputFormat.java","src/main/java/com/azure/search/documents/indexes/models/DocumentIntelligenceLayoutSkillOutputMode.java","src/main/java/com/azure/search/documents/indexes/models/DocumentKeysOrIds.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenFilterSide.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenFilterV2.java","src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/ElisionTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/EmbeddingColumnMapping.java","src/main/java/com/azure/search/documents/indexes/models/EntityCategory.java","src/main/java/com/azure/search/documents/indexes/models/EntityLinkingSkill.java","src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkillV3.java","src/main/java/com/azure/search/documents/indexes/models/EntraAppAuthentication.java","src/main/java/com/azure/search/documents/indexes/models/ExhaustiveKnnAlgorithmConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/ExhaustiveKnnParameters.java","src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/FieldMapping.java","src/main/java/com/azure/search/documents/indexes/models/FieldMappingFunction.java","src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSourceExtractionMode.java","src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/FileUploadMetadata.java","src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/FreshnessScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/GetIndexStatisticsResult.java","src/main/java/com/azure/search/documents/indexes/models/GraphFieldMappings.java","src/main/java/com/azure/search/documents/indexes/models/GraphProfile.java","src/main/java/com/azure/search/documents/indexes/models/GraphProfileKind.java","src/main/java/com/azure/search/documents/indexes/models/HighWaterMarkChangeDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/HnswAlgorithmConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/HnswParameters.java","src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkill.java","src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/ImageDetail.java","src/main/java/com/azure/search/documents/indexes/models/IndexProjectionMode.java","src/main/java/com/azure/search/documents/indexes/models/IndexStatisticsSummary.java","src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointContainerName.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexerCurrentState.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionEnvironment.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionResult.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatus.java","src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatusDetail.java","src/main/java/com/azure/search/documents/indexes/models/IndexerPermissionOption.java","src/main/java/com/azure/search/documents/indexes/models/IndexerResyncBody.java","src/main/java/com/azure/search/documents/indexes/models/IndexerResyncOption.java","src/main/java/com/azure/search/documents/indexes/models/IndexerRuntime.java","src/main/java/com/azure/search/documents/indexes/models/IndexerStatus.java","src/main/java/com/azure/search/documents/indexes/models/IndexingMode.java","src/main/java/com/azure/search/documents/indexes/models/IndexingParameters.java","src/main/java/com/azure/search/documents/indexes/models/IndexingParametersConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/IndexingSchedule.java","src/main/java/com/azure/search/documents/indexes/models/InputFieldMappingEntry.java","src/main/java/com/azure/search/documents/indexes/models/KeepTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/KeyPhraseExtractionSkill.java","src/main/java/com/azure/search/documents/indexes/models/KeyPhraseExtractionSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/KeywordMarkerTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/KeywordTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/KeywordTokenizerV2.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBase.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseAzureOpenAIModel.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseMicrosoftRetriever1Model.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModel.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseModelKind.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleModel.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseOpenAICompatibleParameters.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseRetrieveDefaults.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseTool.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseToolKnowledgeSourceReference.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceContentExtractionMode.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFile.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileCapacity.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionError.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceFileIngestionOperation.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphExtractionParameters.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGrounding.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingIndex.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphGroundingSourceKind.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntology.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceGraphOntologySourceKind.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceKind.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceReference.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceResultsProcessing.java","src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceSynchronizationStatus.java","src/main/java/com/azure/search/documents/indexes/models/LanguageDetectionSkill.java","src/main/java/com/azure/search/documents/indexes/models/LengthTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/LexicalAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/LexicalAnalyzerName.java","src/main/java/com/azure/search/documents/indexes/models/LexicalNormalizer.java","src/main/java/com/azure/search/documents/indexes/models/LexicalNormalizerName.java","src/main/java/com/azure/search/documents/indexes/models/LexicalTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/LexicalTokenizerName.java","src/main/java/com/azure/search/documents/indexes/models/LimitTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/ListDataSourcesResult.java","src/main/java/com/azure/search/documents/indexes/models/ListIndexersResult.java","src/main/java/com/azure/search/documents/indexes/models/ListSkillsetsResult.java","src/main/java/com/azure/search/documents/indexes/models/ListSynonymMapsResult.java","src/main/java/com/azure/search/documents/indexes/models/ListingSearchType.java","src/main/java/com/azure/search/documents/indexes/models/LuceneStandardAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/LuceneStandardTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/LuceneStandardTokenizerV2.java","src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/MagnitudeScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/MappingCharFilter.java","src/main/java/com/azure/search/documents/indexes/models/MarkdownHeaderDepth.java","src/main/java/com/azure/search/documents/indexes/models/MarkdownParsingSubmode.java","src/main/java/com/azure/search/documents/indexes/models/McpServerAuthentication.java","src/main/java/com/azure/search/documents/indexes/models/McpServerAuthenticationKind.java","src/main/java/com/azure/search/documents/indexes/models/McpServerAutoOutputParsing.java","src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionAuthentication.java","src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionParameters.java","src/main/java/com/azure/search/documents/indexes/models/McpServerHeaders.java","src/main/java/com/azure/search/documents/indexes/models/McpServerJsonOutputParsing.java","src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/McpServerNoneOutputParsing.java","src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsing.java","src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingJsonParameters.java","src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingKind.java","src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingSplitParameters.java","src/main/java/com/azure/search/documents/indexes/models/McpServerSplitOutputParsing.java","src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersAuthentication.java","src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersParameters.java","src/main/java/com/azure/search/documents/indexes/models/McpServerTool.java","src/main/java/com/azure/search/documents/indexes/models/MergeSkill.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftLanguageStemmingTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftLanguageTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftStemmingTokenizerLanguage.java","src/main/java/com/azure/search/documents/indexes/models/MicrosoftTokenizerLanguage.java","src/main/java/com/azure/search/documents/indexes/models/NGramTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/NGramTokenFilterV2.java","src/main/java/com/azure/search/documents/indexes/models/NGramTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/NativeBlobSoftDeleteDeletionDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/OcrLineEnding.java","src/main/java/com/azure/search/documents/indexes/models/OcrSkill.java","src/main/java/com/azure/search/documents/indexes/models/OcrSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/OneLakeSecuritySource.java","src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/OpenAICompatibleVectorizerParameters.java","src/main/java/com/azure/search/documents/indexes/models/OutputFieldMappingEntry.java","src/main/java/com/azure/search/documents/indexes/models/PIIDetectionSkill.java","src/main/java/com/azure/search/documents/indexes/models/PIIDetectionSkillMaskingMode.java","src/main/java/com/azure/search/documents/indexes/models/PathHierarchyTokenizerV2.java","src/main/java/com/azure/search/documents/indexes/models/PatternAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/PatternCaptureTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/PatternReplaceCharFilter.java","src/main/java/com/azure/search/documents/indexes/models/PatternReplaceTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/PatternTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/PermissionFilter.java","src/main/java/com/azure/search/documents/indexes/models/PhoneticEncoder.java","src/main/java/com/azure/search/documents/indexes/models/PhoneticTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/RandomScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/RandomScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/RankingOrder.java","src/main/java/com/azure/search/documents/indexes/models/RegexFlags.java","src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/RescoringOptions.java","src/main/java/com/azure/search/documents/indexes/models/ResourceCounter.java","src/main/java/com/azure/search/documents/indexes/models/ScalarQuantizationCompression.java","src/main/java/com/azure/search/documents/indexes/models/ScalarQuantizationParameters.java","src/main/java/com/azure/search/documents/indexes/models/ScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/ScoringFunctionAggregation.java","src/main/java/com/azure/search/documents/indexes/models/ScoringFunctionInterpolation.java","src/main/java/com/azure/search/documents/indexes/models/ScoringProfile.java","src/main/java/com/azure/search/documents/indexes/models/SearchAlias.java","src/main/java/com/azure/search/documents/indexes/models/SearchField.java","src/main/java/com/azure/search/documents/indexes/models/SearchFieldDataType.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexFieldReference.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoost.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoostKind.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFieldValueBoost.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHint.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFilterHintAutoConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceMultiWordExpressionBoost.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceQueryHints.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexPermissionFilterOption.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexResponse.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerCache.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataContainer.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataIdentity.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataNoneIdentity.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceConnection.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceType.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataUserAssignedIdentity.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerError.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerIndexProjection.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerIndexProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerIndexProjectionsParameters.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStore.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreBlobProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreFileProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreObjectProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreParameters.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreProjection.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreTableProjectionSelector.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerLimits.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkill.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerStatus.java","src/main/java/com/azure/search/documents/indexes/models/SearchIndexerWarning.java","src/main/java/com/azure/search/documents/indexes/models/SearchResourceEncryptionKey.java","src/main/java/com/azure/search/documents/indexes/models/SearchServiceCounters.java","src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java","src/main/java/com/azure/search/documents/indexes/models/SearchServiceStatistics.java","src/main/java/com/azure/search/documents/indexes/models/SearchSuggester.java","src/main/java/com/azure/search/documents/indexes/models/SemanticConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/SemanticField.java","src/main/java/com/azure/search/documents/indexes/models/SemanticPrioritizedFields.java","src/main/java/com/azure/search/documents/indexes/models/SemanticSearch.java","src/main/java/com/azure/search/documents/indexes/models/SentimentSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/SentimentSkillV3.java","src/main/java/com/azure/search/documents/indexes/models/ServiceIndexersRuntime.java","src/main/java/com/azure/search/documents/indexes/models/ShaperSkill.java","src/main/java/com/azure/search/documents/indexes/models/ShingleTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/SimilarityAlgorithm.java","src/main/java/com/azure/search/documents/indexes/models/SkillNames.java","src/main/java/com/azure/search/documents/indexes/models/SnowballTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/SnowballTokenFilterLanguage.java","src/main/java/com/azure/search/documents/indexes/models/SoftDeleteColumnDeletionDetectionPolicy.java","src/main/java/com/azure/search/documents/indexes/models/SplitSkill.java","src/main/java/com/azure/search/documents/indexes/models/SplitSkillEncoderModelName.java","src/main/java/com/azure/search/documents/indexes/models/SplitSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/SplitSkillUnit.java","src/main/java/com/azure/search/documents/indexes/models/SqlIntegratedChangeTrackingPolicy.java","src/main/java/com/azure/search/documents/indexes/models/StemmerOverrideTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/StemmerTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/StemmerTokenFilterLanguage.java","src/main/java/com/azure/search/documents/indexes/models/StopAnalyzer.java","src/main/java/com/azure/search/documents/indexes/models/StopwordsList.java","src/main/java/com/azure/search/documents/indexes/models/StopwordsTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/SynonymMap.java","src/main/java/com/azure/search/documents/indexes/models/SynonymTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/TagScoringFunction.java","src/main/java/com/azure/search/documents/indexes/models/TagScoringParameters.java","src/main/java/com/azure/search/documents/indexes/models/TextSplitMode.java","src/main/java/com/azure/search/documents/indexes/models/TextTranslationSkill.java","src/main/java/com/azure/search/documents/indexes/models/TextTranslationSkillLanguage.java","src/main/java/com/azure/search/documents/indexes/models/TextWeights.java","src/main/java/com/azure/search/documents/indexes/models/TokenCharacterKind.java","src/main/java/com/azure/search/documents/indexes/models/TokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/TokenFilterName.java","src/main/java/com/azure/search/documents/indexes/models/TruncateTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/UaxUrlEmailTokenizer.java","src/main/java/com/azure/search/documents/indexes/models/UniqueTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/UpdateKnowledgeSourceFileRequest.java","src/main/java/com/azure/search/documents/indexes/models/UploadKnowledgeSourceFileMultipartRequest.java","src/main/java/com/azure/search/documents/indexes/models/VectorEncodingFormat.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearch.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchAlgorithmConfiguration.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchAlgorithmKind.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchAlgorithmMetric.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompression.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionKind.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionRescoreStorageMethod.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionTarget.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchProfile.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizerKind.java","src/main/java/com/azure/search/documents/indexes/models/VisionVectorizeSkill.java","src/main/java/com/azure/search/documents/indexes/models/VisualFeature.java","src/main/java/com/azure/search/documents/indexes/models/WebApiHttpHeaders.java","src/main/java/com/azure/search/documents/indexes/models/WebApiSkill.java","src/main/java/com/azure/search/documents/indexes/models/WebApiVectorizer.java","src/main/java/com/azure/search/documents/indexes/models/WebApiVectorizerParameters.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSourceDomain.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSourceDomains.java","src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/WordDelimiterTokenFilter.java","src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSource.java","src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSourceParameters.java","src/main/java/com/azure/search/documents/indexes/models/package-info.java","src/main/java/com/azure/search/documents/indexes/package-info.java","src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java","src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java","src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClientBuilder.java","src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphHydrateDocumentsParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/AgentRuntimeGraphProvenanceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/AiServices.java","src/main/java/com/azure/search/documents/knowledgebases/models/AssetStore.java","src/main/java/com/azure/search/documents/knowledgebases/models/AzureBlobKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/CompletedSynchronizationState.java","src/main/java/com/azure/search/documents/knowledgebases/models/FabricDataAgentKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/FabricOntologyKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/FileKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/FreshnessPolicy.java","src/main/java/com/azure/search/documents/knowledgebases/models/ImageServingStatistics.java","src/main/java/com/azure/search/documents/knowledgebases/models/IndexedOneLakeKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSharePointKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/IndexedSqlKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordModel.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityStartedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAgenticReasoningActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAnswerCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorAdditionalInfo.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorDetail.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseGraphSearchReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseImageContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessage.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageContentType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageImageContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMessageTextContent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseModelAnswerSynthesisActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseModelQueryPlanningActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseModelWebSummarizationActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseQueryHintProcessing.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferencesCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalResult.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStartedStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStatusCode.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalStreamEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseStreamErrorEvent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityArguments.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityRecord.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQReference.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalAutoReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalIntent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalIntentType.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalLowReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalMediumReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalMinimalReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalOutputMode.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffort.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffortKind.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalSemanticIntent.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceAzureOpenAIVectorizer.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceCache.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphProvenanceKind.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceGraphStatistics.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceNetworkAccessMode.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceOpenAICompatibleVectorizer.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceStatistics.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceStatus.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceSynchronizationError.java","src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceVectorizer.java","src/main/java/com/azure/search/documents/knowledgebases/models/McpServerKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/PurviewSensitivityLabelInfo.java","src/main/java/com/azure/search/documents/knowledgebases/models/RemoteSharePointKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/SearchIndexKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/ServedImage.java","src/main/java/com/azure/search/documents/knowledgebases/models/SynchronizationState.java","src/main/java/com/azure/search/documents/knowledgebases/models/WebKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/WorkIQKnowledgeSourceParams.java","src/main/java/com/azure/search/documents/knowledgebases/models/package-info.java","src/main/java/com/azure/search/documents/knowledgebases/package-info.java","src/main/java/com/azure/search/documents/models/AgenticSearchDebugInfo.java","src/main/java/com/azure/search/documents/models/AgenticSearchOptions.java","src/main/java/com/azure/search/documents/models/AgenticSearchSubQuery.java","src/main/java/com/azure/search/documents/models/AgenticSearchTerminationReason.java","src/main/java/com/azure/search/documents/models/AgenticSearchUsage.java","src/main/java/com/azure/search/documents/models/AutocompleteItem.java","src/main/java/com/azure/search/documents/models/AutocompleteMode.java","src/main/java/com/azure/search/documents/models/AutocompleteOptions.java","src/main/java/com/azure/search/documents/models/AutocompleteResult.java","src/main/java/com/azure/search/documents/models/BalancedVectorQueryTopicGraph.java","src/main/java/com/azure/search/documents/models/ContentFileDetails.java","src/main/java/com/azure/search/documents/models/ContentUnderstandingSkillChunkingMethod.java","src/main/java/com/azure/search/documents/models/DebugInfo.java","src/main/java/com/azure/search/documents/models/DiverseVectorQueryTopicGraph.java","src/main/java/com/azure/search/documents/models/DocumentDebugInfo.java","src/main/java/com/azure/search/documents/models/FacetResult.java","src/main/java/com/azure/search/documents/models/GraphOptions.java","src/main/java/com/azure/search/documents/models/GraphQueryDiagnostic.java","src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticPhase.java","src/main/java/com/azure/search/documents/models/GraphQueryDiagnosticSeverity.java","src/main/java/com/azure/search/documents/models/GraphQueryEvidence.java","src/main/java/com/azure/search/documents/models/GraphQueryEvidenceConfidence.java","src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCount.java","src/main/java/com/azure/search/documents/models/GraphQueryEvidenceCountRelation.java","src/main/java/com/azure/search/documents/models/GraphQueryExecutionMode.java","src/main/java/com/azure/search/documents/models/GraphQueryExplain.java","src/main/java/com/azure/search/documents/models/GraphQueryExplainStage.java","src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocument.java","src/main/java/com/azure/search/documents/models/GraphQueryProvenanceDocuments.java","src/main/java/com/azure/search/documents/models/GraphQueryProvenanceHydrateDocumentsParameters.java","src/main/java/com/azure/search/documents/models/GraphQueryProvenanceKind.java","src/main/java/com/azure/search/documents/models/GraphQueryProvenanceParameters.java","src/main/java/com/azure/search/documents/models/GraphQueryResult.java","src/main/java/com/azure/search/documents/models/GraphQueryRow.java","src/main/java/com/azure/search/documents/models/GraphQueryRowProvenance.java","src/main/java/com/azure/search/documents/models/GraphQueryStatistics.java","src/main/java/com/azure/search/documents/models/HybridCountAndFacetMode.java","src/main/java/com/azure/search/documents/models/HybridSearch.java","src/main/java/com/azure/search/documents/models/IndexAction.java","src/main/java/com/azure/search/documents/models/IndexActionType.java","src/main/java/com/azure/search/documents/models/IndexDocumentsBatch.java","src/main/java/com/azure/search/documents/models/IndexDocumentsResult.java","src/main/java/com/azure/search/documents/models/IndexingResult.java","src/main/java/com/azure/search/documents/models/LookupDocument.java","src/main/java/com/azure/search/documents/models/NoneVectorQueryTopicGraph.java","src/main/java/com/azure/search/documents/models/OperationState.java","src/main/java/com/azure/search/documents/models/QueryAnswerResult.java","src/main/java/com/azure/search/documents/models/QueryAnswerType.java","src/main/java/com/azure/search/documents/models/QueryCaptionResult.java","src/main/java/com/azure/search/documents/models/QueryCaptionType.java","src/main/java/com/azure/search/documents/models/QueryDebugMode.java","src/main/java/com/azure/search/documents/models/QueryLanguage.java","src/main/java/com/azure/search/documents/models/QueryResultDocumentInnerHit.java","src/main/java/com/azure/search/documents/models/QueryResultDocumentRerankerInput.java","src/main/java/com/azure/search/documents/models/QueryResultDocumentSemanticField.java","src/main/java/com/azure/search/documents/models/QueryResultDocumentSubscores.java","src/main/java/com/azure/search/documents/models/QueryRewritesDebugInfo.java","src/main/java/com/azure/search/documents/models/QueryRewritesType.java","src/main/java/com/azure/search/documents/models/QueryRewritesValuesDebugInfo.java","src/main/java/com/azure/search/documents/models/QuerySpellerType.java","src/main/java/com/azure/search/documents/models/QueryType.java","src/main/java/com/azure/search/documents/models/ScoringStatistics.java","src/main/java/com/azure/search/documents/models/SearchDocumentsResult.java","src/main/java/com/azure/search/documents/models/SearchMode.java","src/main/java/com/azure/search/documents/models/SearchOptions.java","src/main/java/com/azure/search/documents/models/SearchRequest.java","src/main/java/com/azure/search/documents/models/SearchResult.java","src/main/java/com/azure/search/documents/models/SearchScoreThreshold.java","src/main/java/com/azure/search/documents/models/SemanticDebugInfo.java","src/main/java/com/azure/search/documents/models/SemanticErrorMode.java","src/main/java/com/azure/search/documents/models/SemanticErrorReason.java","src/main/java/com/azure/search/documents/models/SemanticFieldState.java","src/main/java/com/azure/search/documents/models/SemanticQueryRewritesResultType.java","src/main/java/com/azure/search/documents/models/SemanticSearchResultsType.java","src/main/java/com/azure/search/documents/models/SharePointConnectorAppRegistration.java","src/main/java/com/azure/search/documents/models/SingleVectorFieldResult.java","src/main/java/com/azure/search/documents/models/SuggestDocumentsResult.java","src/main/java/com/azure/search/documents/models/SuggestOptions.java","src/main/java/com/azure/search/documents/models/SuggestResult.java","src/main/java/com/azure/search/documents/models/TextResult.java","src/main/java/com/azure/search/documents/models/VectorFilterMode.java","src/main/java/com/azure/search/documents/models/VectorQuery.java","src/main/java/com/azure/search/documents/models/VectorQueryKind.java","src/main/java/com/azure/search/documents/models/VectorQueryTopicGraph.java","src/main/java/com/azure/search/documents/models/VectorSearchTopicGraphKind.java","src/main/java/com/azure/search/documents/models/VectorSimilarityThreshold.java","src/main/java/com/azure/search/documents/models/VectorThreshold.java","src/main/java/com/azure/search/documents/models/VectorThresholdKind.java","src/main/java/com/azure/search/documents/models/VectorizableImageBinaryQuery.java","src/main/java/com/azure/search/documents/models/VectorizableImageUrlQuery.java","src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java","src/main/java/com/azure/search/documents/models/VectorizedQuery.java","src/main/java/com/azure/search/documents/models/VectorsDebugInfo.java","src/main/java/com/azure/search/documents/models/package-info.java","src/main/java/com/azure/search/documents/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java new file mode 100644 index 0000000000000..94cee81555c8b --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.search.documents.indexes.models.RandomScoringFunction; +import com.azure.search.documents.indexes.models.RandomScoringParameters; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration; +import com.azure.search.documents.models.BalancedVectorQueryTopicGraph; +import com.azure.search.documents.models.GraphOptions; +import com.azure.search.documents.models.GraphQueryExecutionMode; +import com.azure.search.documents.models.GraphQueryExplainStage; +import com.azure.search.documents.models.GraphQueryResult; +import com.azure.search.documents.models.VectorizedQuery; +import reactor.core.publisher.Mono; + +import java.util.Collections; +import java.util.List; + +/** + * Examples using existing indexes with the November 2026 preview API. + */ +public final class PreviewSearchSamples { + /** + * Plans a graph query without executing backend searches. + * + * @param client a client for an existing graph index. + * @return the plan and diagnostics. + */ + public GraphQueryResult planGraph(SearchClient client) { + return client.graph(new GraphOptions("MATCH (n) RETURN n") + .setExecutionMode(GraphQueryExecutionMode.PLAN_ONLY) + .setExplain(Collections.singletonList(GraphQueryExplainStage.fromString("logical"))) + .setIncludeDiagnostics(true)); + } + + /** + * Executes a graph query asynchronously. + * + * @param client a client for an existing graph index. + * @return the projected rows and execution statistics. + */ + public Mono queryGraph(SearchAsyncClient client) { + return client.graph(new GraphOptions("MATCH (n) RETURN n").setIncludeStatistics(true)); + } + + /** + * Creates a balanced topic graph vector query. + * + * @param vector the query vector matching the index dimensions. + * @return the query for a topic-graph-enabled vector field. + */ + public VectorizedQuery balancedVector(List vector) { + return new VectorizedQuery(vector).setFields("contentVector") + .setTopicGraph(new BalancedVectorQueryTopicGraph().setMinDiversityPoolSize(500)); + } + + /** + * Grounds a filter hint using cached facet values. + * + * @return the knowledge source's category filter hint. + */ + public SearchIndexKnowledgeSourceFilterHint automaticFilterHint() { + return new SearchIndexKnowledgeSourceFilterHint("category").setAutoConfiguration( + new SearchIndexKnowledgeSourceFilterHintAutoConfiguration().setCacheTtl(900).setMaxFacetValueCount(32)); + } + + /** + * Creates seeded random scoring for a scoring profile. + * + * @return the scoring function. Supply the seed through the named query scoring parameter. + */ + public RandomScoringFunction seededRandomScoring() { + return new RandomScoringFunction().setParameters(new RandomScoringParameters("seed")); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java new file mode 100644 index 0000000000000..9eb20b96037c3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.core.util.BinaryData; +import com.azure.search.documents.indexes.models.RandomScoringFunction; +import com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model; +import com.azure.search.documents.indexes.models.KnowledgeBaseModel; +import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; +import com.azure.search.documents.indexes.models.RandomScoringParameters; +import com.azure.search.documents.indexes.models.ScoringFunction; +import com.azure.search.documents.indexes.models.MagnitudeScoringFunction; +import com.azure.search.documents.indexes.models.MagnitudeScoringParameters; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.SearchIndexerClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceCache; +import com.azure.search.documents.models.BalancedVectorQueryTopicGraph; +import com.azure.search.documents.models.DiverseVectorQueryTopicGraph; +import com.azure.search.documents.models.GraphOptions; +import com.azure.search.documents.models.GraphQueryExecutionMode; +import com.azure.search.documents.models.GraphQueryExplainStage; +import com.azure.search.documents.models.GraphQueryResult; +import com.azure.search.documents.models.NoneVectorQueryTopicGraph; +import com.azure.search.documents.models.SearchPagedResponse; +import com.azure.search.documents.models.VectorQueryTopicGraph; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +import java.util.Collections; +import java.util.Map; +import java.nio.charset.StandardCharsets; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class PreviewApiTests { + private static final String GRAPH_RESPONSE = "{\"@odata.count\":1,\"value\":[{\"name\":\"Ada\",\"score\":0.75}]," + + "\"@search.graphStats\":{\"executionMode\":\"planOnly\",\"planningMs\":12}," + + "\"@search.graphDiagnostics\":[{\"code\":\"PlanReady\",\"severity\":\"info\",\"phase\":\"plan\"," + + "\"span\":null,\"suggestions\":[\"execute\"]}]," + + "\"@search.graphExplain\":{\"logical\":{\"operator\":\"scan\"}}}"; + + @Test + public void preservesPreviousVersionsAndDefaultsToNewPreview() { + assertEquals("2026-11-01-preview", SearchServiceVersion.getLatest().getVersion()); + assertEquals("2026-08-01-preview", SearchServiceVersion.V2026_08_01_PREVIEW.getVersion()); + assertEquals("2026-04-01", SearchServiceVersion.V2026_04_01.getVersion()); + assertEquals("2020-06-30", SearchServiceVersion.V2020_06_30.getVersion()); + } + + @Test + public void existingListConveniencesUseRenamedProtocolOperations() { + com.azure.core.http.HttpClient transport = request -> Mono + .just(new MockHttpResponse(request, 200, "{\"value\":[]}".getBytes(StandardCharsets.UTF_8))); + SearchIndexClientBuilder indexes = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .httpClient(transport); + SearchIndexerClientBuilder indexers + = new SearchIndexerClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .httpClient(transport); + assertEquals(0, indexes.buildClient().listSynonymMaps().stream().count()); + assertEquals(0, indexes.buildAsyncClient().listSynonymMaps().collectList().block().size()); + assertEquals(0, indexers.buildClient().listDataSourceConnections().stream().count()); + assertEquals(0, indexers.buildAsyncClient().listDataSourceConnections().collectList().block().size()); + assertEquals(0, indexers.buildClient().listIndexers().stream().count()); + assertEquals(0, indexers.buildAsyncClient().listIndexers().collectList().block().size()); + assertEquals(0, indexers.buildClient().listSkillsets().stream().count()); + assertEquals(0, indexers.buildAsyncClient().listSkillsets().collectList().block().size()); + } + + @Test + public void fileDeletePreservesExistingParameterOrder() { + SearchIndexClientBuilder builder = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .httpClient(request -> { + assertTrue(request.getUrl().getPath().contains("/knowledgesources('source')/files('file')")); + return Mono.just(new MockHttpResponse(request, 204)); + }); + builder.buildClient().deleteKnowledgeSourceFile("file", "source"); + builder.buildAsyncClient().deleteKnowledgeSourceFile("file", "source").block(); + } + + @Test + public void syncAndAsyncGraphClientsForwardOptionsAndDeserializeDiagnostics() { + SearchClientBuilder builder = new SearchClientBuilder().endpoint("https://example.search.windows.net") + .indexName("graph") + .credential(new AzureKeyCredential("key")) + .httpClient(request -> { + assertTrue(request.getUrl().toString().contains("/docs/search.graph")); + assertTrue(request.getUrl().getQuery().contains("api-version=2026-11-01-preview")); + assertEquals("source-token", + request.getHeaders().getValue(HttpHeaderName.fromString("x-ms-query-source-authorization"))); + assertEquals("false", + request.getHeaders().getValue(HttpHeaderName.fromString("x-ms-enable-elevated-read"))); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("MATCH (n) RETURN n", body.get("gql")); + assertEquals("planOnly", body.get("executionMode")); + assertEquals(Boolean.TRUE, body.get("includeDiagnostics")); + return Mono.just(new MockHttpResponse(request, 200, GRAPH_RESPONSE.getBytes(StandardCharsets.UTF_8))); + }); + GraphOptions options + = new GraphOptions("MATCH (n) RETURN n").setExecutionMode(GraphQueryExecutionMode.PLAN_ONLY) + .setExplain(Collections.singletonList(GraphQueryExplainStage.fromString("logical"))) + .setIncludeDiagnostics(true) + .setQuerySourceAuthorization("source-token") + .setEnableElevatedRead(false); + + assertGraphResult(builder.buildClient().graph(options)); + assertGraphResult(builder.buildAsyncClient().graph(options).block()); + Response syncResponse = builder.buildClient().graphWithResponse(options, null); + assertEquals(200, syncResponse.getStatusCode()); + assertGraphResult(syncResponse.getValue()); + Response asyncResponse = builder.buildAsyncClient().graphWithResponse(options, null).block(); + assertNotNull(asyncResponse); + assertEquals(200, asyncResponse.getStatusCode()); + assertGraphResult(asyncResponse.getValue()); + } + + private static void assertGraphResult(GraphQueryResult result) { + assertNotNull(result); + assertEquals(1L, result.getCount()); + assertEquals("Ada", result.getValue().get(0).getAdditionalProperties().get("name")); + assertEquals(12L, result.getStatistics().getPlanningMs()); + assertEquals("PlanReady", result.getDiagnostics().get(0).getCode()); + assertTrue(result.getExplain().getAdditionalProperties().containsKey("logical")); + } + + @Test + public void graphRejectionsPreserveResponseDiagnostics() { + String error = "{\"error\":{\"code\":\"InvalidRequestParameter\",\"message\":\"Invalid graph query\"}," + + "\"@search.graphDiagnostics\":[{\"code\":\"UnknownVariable\",\"severity\":\"error\",\"phase\":\"bind\"}]}"; + SearchClientBuilder builder = new SearchClientBuilder().endpoint("https://example.search.windows.net") + .indexName("graph") + .credential(new AzureKeyCredential("key")) + .httpClient( + request -> Mono.just(new MockHttpResponse(request, 400, error.getBytes(StandardCharsets.UTF_8)))); + HttpResponseException sync = assertThrows(HttpResponseException.class, + () -> builder.buildClient().graph(new GraphOptions("MATCH (n) RETURN missing"))); + HttpResponseException async = assertThrows(HttpResponseException.class, + () -> builder.buildAsyncClient().graph(new GraphOptions("MATCH (n) RETURN missing")).block()); + assertEquals(400, sync.getResponse().getStatusCode()); + assertTrue(sync.getResponse().getBodyAsString().block().contains("UnknownVariable")); + assertTrue(async.getResponse().getBodyAsString().block().contains("UnknownVariable")); + } + + @Test + public void topicGraphDiscriminatorsRoundTrip() { + assertTopicGraph("{\"kind\":\"none\"}", NoneVectorQueryTopicGraph.class); + assertTopicGraph("{\"kind\":\"diverse\",\"diversityFactor\":0.5,\"minDiversityPoolSize\":500}", + DiverseVectorQueryTopicGraph.class); + assertTopicGraph("{\"kind\":\"balanced\",\"minDiversityPoolSize\":500}", BalancedVectorQueryTopicGraph.class); + } + + private static void assertTopicGraph(String json, Class type) { + VectorQueryTopicGraph value = BinaryData.fromString(json).toObject(VectorQueryTopicGraph.class); + assertInstanceOf(type, value); + assertEquals(BinaryData.fromString(json).toObject(Map.class), BinaryData.fromObject(value).toObject(Map.class)); + } + + @Test + public void automaticFilterHintsSerializeFacetConfiguration() { + SearchIndexKnowledgeSourceFilterHint hint + = new SearchIndexKnowledgeSourceFilterHint("category").setAutoConfiguration( + new SearchIndexKnowledgeSourceFilterHintAutoConfiguration().setCacheTtl(900).setMaxFacetValueCount(32)); + SearchIndexKnowledgeSourceFilterHint restored + = BinaryData.fromObject(hint).toObject(SearchIndexKnowledgeSourceFilterHint.class); + assertEquals("category", restored.getField()); + assertEquals(900, restored.getAutoConfiguration().getCacheTtl()); + assertEquals(32, restored.getAutoConfiguration().getMaxFacetValueCount()); + } + + @Test + public void randomScoringOmitsFieldAndBoostWhileClassicBaseRemainsCompatible() { + RandomScoringFunction random = new RandomScoringFunction().setParameters(new RandomScoringParameters("seed")); + Map json = BinaryData.fromObject(random).toObject(Map.class); + assertEquals("random", json.get("type")); + assertFalse(json.containsKey("fieldName")); + assertFalse(json.containsKey("boost")); + assertInstanceOf(RandomScoringFunction.class, BinaryData.fromObject(random).toObject(ScoringFunction.class)); + + ScoringFunction classic = new ScoringFunction("rating", 2.5); + ScoringFunction restored = BinaryData.fromObject(classic).toObject(ScoringFunction.class); + assertEquals("rating", restored.getFieldName()); + assertEquals(2.5, restored.getBoost()); + ScoringFunction magnitude = new MagnitudeScoringFunction("rating", 2.5, new MagnitudeScoringParameters(0, 5)); + assertEquals("rating", magnitude.getFieldName()); + assertEquals(2.5, magnitude.getBoost()); + assertEquals(BinaryData.fromObject(magnitude).toObject(Map.class), + BinaryData.fromObject(BinaryData.fromObject(magnitude).toObject(ScoringFunction.class)) + .toObject(Map.class)); + } + + @Test + public void pagedResponsesExposePreviewQueryDiagnostics() { + SearchPagedResponse page = new SearchPagedResponse( + new SimpleResponse<>(new HttpRequest(HttpMethod.POST, "https://example.search.windows.net"), 200, + new HttpHeaders(), + BinaryData.fromString("{\"value\":[],\"@search.debug\":{\"queryRewrites\":{}}," + + "\"@search.semanticQueryRewritesResultType\":\"originalQueryOnly\"}")), + SearchServiceVersion.V2026_11_01_PREVIEW); + assertNotNull(page.getDebugInfo()); + assertNotNull(page.getDebugInfo().getQueryRewrites()); + assertEquals("originalQueryOnly", page.getSemanticQueryRewritesResultType().toString()); + } + + @Test + public void knowledgeCacheAndGraphActivityDeserialize() { + KnowledgeSourceCache cache = new KnowledgeSourceCache("UseDevelopmentStorage=true").setEnableReprocessing(true); + KnowledgeSourceCache restored = BinaryData.fromObject(cache).toObject(KnowledgeSourceCache.class); + assertEquals(cache.getStorageConnectionString(), restored.getStorageConnectionString()); + assertEquals(Boolean.TRUE, restored.isEnableReprocessing()); + KnowledgeBaseActivityRecord activity + = BinaryData + .fromString("{\"type\":\"graphSearch\",\"id\":1,\"graphSearchArguments\":{\"query\":\"connections\"," + + "\"modelName\":\"model\",\"graphIndexName\":\"graph\"}}") + .toObject(KnowledgeBaseActivityRecord.class); + assertInstanceOf(KnowledgeBaseGraphSearchActivityRecord.class, activity); + assertEquals("model", + ((KnowledgeBaseGraphSearchActivityRecord) activity).getGraphSearchArguments().getModelName()); + } + + @Test + public void microsoftRetrieverModelRoundTripsPolymorphically() { + KnowledgeBaseModel model = new KnowledgeBaseMicrosoftRetriever1Model(); + KnowledgeBaseModel restored = BinaryData.fromObject(model).toObject(KnowledgeBaseModel.class); + assertInstanceOf(KnowledgeBaseMicrosoftRetriever1Model.class, restored); + assertEquals("microsoftRetriever1", restored.getKind().toString()); + } + + @Test + public void fileIngestionOperationRetainsItsWireKind() { + KnowledgeSourceFileIngestionOperation operation = BinaryData + .fromString("{\"id\":\"operation\",\"status\":\"succeeded\",\"kind\":\"knowledgeSourceFileIngestion\"}") + .toObject(KnowledgeSourceFileIngestionOperation.class); + assertEquals("knowledgeSourceFileIngestion", operation.getKind()); + assertEquals(operation.getKind(), BinaryData.fromObject(operation).toObject(Map.class).get("kind")); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/implementation/SearchUtilsTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/implementation/SearchUtilsTests.java new file mode 100644 index 0000000000000..5cc36b31a6d55 --- /dev/null +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/implementation/SearchUtilsTests.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.implementation; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.search.documents.SearchClient; +import com.azure.search.documents.SearchClientBuilder; +import com.azure.search.documents.models.HybridSearch; +import com.azure.search.documents.models.AgenticSearchOptions; +import com.azure.search.documents.models.QueryLanguage; +import com.azure.search.documents.models.QueryRewritesType; +import com.azure.search.documents.models.QuerySpellerType; +import com.azure.search.documents.models.SearchOptions; +import com.azure.search.documents.models.SearchRequest; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +import java.util.Arrays; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.atomic.AtomicInteger; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + +public class SearchUtilsTests { + @Test + public void transfersPreviewOptionsToSearchRequest() { + HybridSearch hybridSearch = new HybridSearch().setMaxTextRecallSize(100); + AgenticSearchOptions agenticOptions = new AgenticSearchOptions(); + SearchOptions options = new SearchOptions().setQueryLanguage(QueryLanguage.EN_US) + .setQuerySpeller(QuerySpellerType.LEXICON) + .setQueryRewrites(QueryRewritesType.GENERATIVE) + .setSemanticFields(Arrays.asList("title", "content")) + .setHybridSearch(hybridSearch) + .setMoreLikeThis("document-id") + .setAgenticOptions(agenticOptions); + + SearchRequest request = SearchUtils.fromSearchOptions(options); + + assertEquals(options.getQueryLanguage(), request.getQueryLanguage()); + assertEquals(options.getQuerySpeller(), request.getQuerySpeller()); + assertEquals(options.getQueryRewrites(), request.getQueryRewrites()); + assertEquals(options.getSemanticFields(), request.getSemanticFields()); + assertSame(hybridSearch, request.getHybridSearch()); + assertEquals("document-id", request.getMoreLikeThis()); + assertSame(agenticOptions, request.getAgenticOptions()); + assertNull(SearchUtils.fromSearchOptions(null)); + } + + @Test + public void preservesAuthorizationAcrossSearchPages() { + AtomicInteger requests = new AtomicInteger(); + SearchClientBuilder builder = new SearchClientBuilder().endpoint("https://example.search.windows.net") + .indexName("documents") + .credential(new AzureKeyCredential("key")) + .httpClient(request -> { + assertEquals("source-token", + request.getHeaders().getValue(HttpHeaderName.fromString("x-ms-query-source-authorization"))); + String json = requests.incrementAndGet() % 2 != 0 + ? "{\"value\":[{\"@search.score\":1,\"id\":\"1\"}]," + + "\"@search.nextPageParameters\":{\"search\":\"*\"}}" + : "{\"value\":[{\"@search.score\":1,\"id\":\"2\"}]}"; + return Mono.just(new MockHttpResponse(request, 200, json.getBytes(StandardCharsets.UTF_8))); + }); + SearchOptions options = new SearchOptions().setQuerySourceAuthorization("source-token"); + assertEquals(2, builder.buildClient().search(options).stream().count()); + assertEquals(2, builder.buildAsyncClient().search(options).collectList().block().size()); + assertEquals(4, requests.get()); + } + + @Test + public void forwardsAuthorizationHeadersFromSearchOptions() { + SearchClient client = new SearchClientBuilder().endpoint("https://example.search.windows.net") + .indexName("documents") + .credential(new AzureKeyCredential("key")) + .httpClient(request -> { + assertEquals("source-token", + request.getHeaders().getValue(HttpHeaderName.fromString("x-ms-query-source-authorization"))); + assertEquals("false", + request.getHeaders().getValue(HttpHeaderName.fromString("x-ms-enable-elevated-read"))); + return Mono.just(new MockHttpResponse(request, 200, "{\"value\":[]}".getBytes(StandardCharsets.UTF_8))); + }) + .buildClient(); + + assertEquals(0, + client.search(new SearchOptions().setQuerySourceAuthorization("source-token").setEnableElevatedRead(false)) + .stream() + .count()); + } +} diff --git a/sdk/search/azure-search-documents/tsp-location.yaml b/sdk/search/azure-search-documents/tsp-location.yaml index 1579746e2ddff..8cf8d0829c684 100644 --- a/sdk/search/azure-search-documents/tsp-location.yaml +++ b/sdk/search/azure-search-documents/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/search/data-plane/Search -commit: 7391f1b9af16184e5d33bab7a0a69d0d61ca8794 +commit: 2c0ca3a8b788bc866d2312b72bc05b49b048973d repo: Azure/azure-rest-api-specs cleanup: true From cf06e534332f1955d8fb0ceed0e118d02ae6a3ff Mon Sep 17 00:00:00 2001 From: Yangyang Lu Date: Fri, 23 Oct 2026 16:35:10 -0700 Subject: [PATCH 02/20] Complete Search preview field annotations and align spec documentation Preserve underlying test exception diagnostics and add focused regressions. Regenerate model documentation from spec b41ba04c0219f6622b7f5214fc020f90bad339ae without changing the SDK version or recordings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-search-documents/CHANGELOG.md | 1 + .../implementation/FieldBuilder.java | 2 + .../search/documents/indexes/BasicField.java | 16 +++++++ .../models/VectorSearchTopicGraphProfile.java | 7 ++- .../models/BalancedVectorQueryTopicGraph.java | 7 ++- .../models/DiverseVectorQueryTopicGraph.java | 7 ++- .../azure-search-documents_metadata.json | 2 +- .../azure/search/documents/TestHelpers.java | 2 +- .../search/documents/TestHelpersTests.java | 20 +++++++++ .../documents/indexes/FieldBuilderTests.java | 44 +++++++++++++++++++ .../azure-search-documents/tsp-location.yaml | 2 +- 11 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpersTests.java diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 119229724b9bd..dfdab825f8a7f 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -16,6 +16,7 @@ ### Bugs Fixed +- Forwarded topic graph profile and organization access expiration settings from field-builder annotations. - Fixed convenience search requests dropping preview query language, spelling, rewriting, hybrid, semantic field, and authorization options. ### Other Changes diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java index 723fc5d59da23..be14c8cc359cd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java @@ -297,6 +297,7 @@ private static SearchField enrichBasicSearchField(SearchField searchField, Basic .setFilterable(toBoolean(basicField.isFilterable())) .setSortable(toBoolean(basicField.isSortable())) .setFacetable(toBoolean(basicField.isFacetable())) + .setOrganizationAccessExpiration(toBoolean(basicField.isOrganizationAccessExpiration())) .setAnalyzerName(nullOrT(basicField.analyzerName(), LexicalAnalyzerName::fromString)) .setSearchAnalyzerName(nullOrT(basicField.searchAnalyzerName(), LexicalAnalyzerName::fromString)) .setIndexAnalyzerName(nullOrT(basicField.indexAnalyzerName(), LexicalAnalyzerName::fromString)) @@ -304,6 +305,7 @@ private static SearchField enrichBasicSearchField(SearchField searchField, Basic .setVectorSearchDimensions( basicField.vectorSearchDimensions() > 0 ? basicField.vectorSearchDimensions() : null) .setVectorSearchProfileName(nullOrT(basicField.vectorSearchProfileName(), Function.identity())) + .setTopicGraphProfile(nullOrT(basicField.topicGraphProfile(), Function.identity())) .setVectorEncodingFormat(nullOrT(basicField.vectorEncodingFormat(), VectorEncodingFormat::fromString)) .setSynonymMapNames(synonymMapNames(basicField.synonymMapNames())); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java index afda163f8935b..f546de3fadd4c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java @@ -111,6 +111,13 @@ */ BooleanHelper isSensitivityLabel() default BooleanHelper.NULL; + /** + * Indicates whether the field contains the expiration time for organization-wide document access. + * + * @return A flag indicating whether the {@link SearchField field} contains organization access expiration times. + */ + BooleanHelper isOrganizationAccessExpiration() default BooleanHelper.NULL; + /** * A {@link LexicalAnalyzerName} to associate as the search and index analyzer for the {@link SearchField field}. * @@ -162,6 +169,15 @@ */ String vectorSearchProfileName() default ""; + /** + * The name of the topic graph profile associated with the vector {@link SearchField field}. + *

+ * If the value is empty, the field won't have a {@link SearchField#getTopicGraphProfile()} value. + * + * @return The name of the topic graph profile associated with the vector {@link SearchField field}. + */ + String topicGraphProfile() default ""; + /** * A {@link VectorEncodingFormat} to be associated with the {@link SearchField field}. *

diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java index 30c9e5331c216..22fe7193f6196 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchTopicGraphProfile.java @@ -45,8 +45,7 @@ public final class VectorSearchTopicGraphProfile implements JsonSerializable "Expected exception to be instanceof HttpResponseException. Actual exception: " + throwable); assertEquals(statusCode, ex.getResponse().getStatusCode()); if (expectedMessage != null) { diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpersTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpersTests.java new file mode 100644 index 0000000000000..02ad90ed3df82 --- /dev/null +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpersTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class TestHelpersTests { + @Test + public void unexpectedHttpFailureRetainsItsDiagnosticMessage() { + RuntimeException unexpected = new RuntimeException("Unexpected transport failure"); + AssertionError failure + = assertThrows(AssertionError.class, () -> TestHelpers.verifyHttpResponseError(unexpected, 400, null)); + + assertTrue(failure.getMessage().contains(unexpected.toString())); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java index 7e26290992b8f..1640df383390e 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java @@ -4,6 +4,7 @@ package com.azure.search.documents.indexes; import com.azure.core.models.GeoPoint; +import com.azure.core.util.BinaryData; import com.azure.search.documents.TestHelpers; import com.azure.search.documents.indexes.models.LexicalNormalizerName; import com.azure.search.documents.indexes.models.SearchField; @@ -159,6 +160,49 @@ public void supportedFields() { } + @Test + public void previewFieldAnnotationsAreForwardedAndSerialized() { + Map fields = SearchIndexClient.buildSearchFields(PreviewFields.class) + .stream() + .collect(Collectors.toMap(SearchField::getName, field -> field)); + + assertEquals(Boolean.TRUE, fields.get("expiration").isOrganizationAccessExpiration()); + assertEquals(Boolean.FALSE, fields.get("nonExpiration").isOrganizationAccessExpiration()); + assertEquals("topics", fields.get("embedding").getTopicGraphProfile()); + assertEquals(Boolean.TRUE, + BinaryData.fromObject(fields.get("expiration")).toObject(Map.class).get("organizationAccessExpiration")); + assertEquals(Boolean.FALSE, + BinaryData.fromObject(fields.get("nonExpiration")).toObject(Map.class).get("organizationAccessExpiration")); + assertEquals("topics", + BinaryData.fromObject(fields.get("embedding")).toObject(Map.class).get("topicGraphProfile")); + } + + @Test + public void previewFieldAnnotationsDefaultToServiceDefaults() { + for (SearchField field : SearchIndexClient.buildSearchFields(AllSupportedFields.class)) { + assertNull(field.isOrganizationAccessExpiration()); + assertNull(field.getTopicGraphProfile()); + } + } + + @SuppressWarnings("unused") + private static final class PreviewFields { + @BasicField(name = "expiration", isOrganizationAccessExpiration = BasicField.BooleanHelper.TRUE) + private OffsetDateTime expiration; + + @BasicField( + name = "embedding", + vectorSearchDimensions = 3, + vectorSearchProfileName = "vectors", + topicGraphProfile = "topics") + private float[] embedding; + + @BasicField(name = "nonExpiration", isOrganizationAccessExpiration = BasicField.BooleanHelper.FALSE) + public OffsetDateTime getNonExpiration() { + return null; + } + } + @SuppressWarnings({ "unused", "UseOfObsoleteDateTimeApi" }) private static final class AllSupportedFields { // 1. name = 'NullableInt', OData type = INT32 diff --git a/sdk/search/azure-search-documents/tsp-location.yaml b/sdk/search/azure-search-documents/tsp-location.yaml index 8cf8d0829c684..7d42f9c1985e7 100644 --- a/sdk/search/azure-search-documents/tsp-location.yaml +++ b/sdk/search/azure-search-documents/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/search/data-plane/Search -commit: 2c0ca3a8b788bc866d2312b72bc05b49b048973d +commit: b41ba04c0219f6622b7f5214fc020f90bad339ae repo: Azure/azure-rest-api-specs cleanup: true From 26cb65d8bcc9ea6fa47ac29d10c9cdcc02b1d7da Mon Sep 17 00:00:00 2001 From: Yangyang Lu Date: Tue, 27 Oct 2026 15:39:51 -0700 Subject: [PATCH 03/20] Address Search November preview SDK review feedback Complete BasicField annotations and FieldBuilder mappings for sensitivity label IDs/names, source document IDs, SharePoint site URLs, and permission filters. Add serialization and default-value regression coverage. Remove the August preview service version through customization and regenerate at the unchanged spec pin b41ba04c0219f6622b7f5214fc020f90bad339ae, retaining supported GA versions and the November preview. Clarify the spec-defined Blob and Indexed SharePoint queryHints/queryHintOverrides removals and retained Search Index support in the changelog. Validation: package, Checkstyle, SpotBugs, Spotless, Revapi against GA 12.0.3, and local consumer checks passed. Focused tests: 41 passed, 2 existing skips. Full playback CI remains blocked by recording mismatches; no live tests run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-search-documents/CHANGELOG.md | 7 +- .../src/main/java/SearchCustomizations.java | 4 +- .../documents/SearchServiceVersion.java | 4 -- .../implementation/FieldBuilder.java | 6 ++ .../search/documents/indexes/BasicField.java | 35 +++++++++- .../search/documents/PreviewApiTests.java | 9 ++- .../documents/indexes/FieldBuilderTests.java | 69 +++++++++++++++++++ 7 files changed, 122 insertions(+), 12 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index dfdab825f8a7f..84103509bb038 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- Added support for `2026-11-01-preview`, now the default service version. Previously supported service versions remain available. +- Added support for `2026-11-01-preview`, now the default service version. Previously supported GA service versions remain available. - Added synchronous and asynchronous graph queries, typed HTTP responses, query planning, diagnostics, statistics, and provenance models. - Added graph extraction, enrichment cache, graph retrieval activities and references, and updated knowledge source and model options. - Added `none`, `diverse`, and `balanced` vector topic graph retrieval, facet-backed filter hint auto-configuration, and random scoring. @@ -12,11 +12,14 @@ ### Breaking Changes -- Removed preview query hints and query hint overrides from non-SearchIndex knowledge sources, and their query hint processing activity properties, to match the service contract. SearchIndex knowledge source hints remain supported. +- Removed `SearchServiceVersion.V2026_08_01_PREVIEW`; `V2026_11_01_PREVIEW` is now the only supported preview service version. +- Removed preview `queryHints` from `AzureBlobKnowledgeSourceParameters` and `IndexedSharePointKnowledgeSourceParameters`, and `queryHintOverrides` from their runtime parameter models, to match the November contract in [spec PR #47300](https://github.com/Azure/azure-rest-api-specs/pull/47300). These properties remain supported on `SearchIndexKnowledgeSourceParameters` and `SearchIndexKnowledgeSourceParams`, respectively; `topicGraph` is not a replacement for query hints. +- Removed preview query hints and query hint overrides from other non-SearchIndex knowledge sources, and their query hint processing activity properties, to match the service contract. ### Bugs Fixed - Forwarded topic graph profile and organization access expiration settings from field-builder annotations. +- Added field-builder annotations for sensitivity label IDs and names, source document IDs, and SharePoint site URLs, and forwarded permission filter settings to generated search fields. - Fixed convenience search requests dropping preview query language, spelling, rewriting, hybrid, semantic field, and authorization options. ### Other Changes diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index 7e63195d00bbd..f6d9647da5ca0 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -675,7 +675,7 @@ private static void addSearchAudienceScopeHandling(ClassCustomization customizat private static void includeOldApiVersions(ClassCustomization customization) { customization.customizeAst(ast -> ast.getEnumByName(customization.getClassName()).ifPresent(enumDeclaration -> { NodeList entries = enumDeclaration.getEntries(); - for (String version : Arrays.asList("2026-08-01-preview", "2026-04-01", "2025-09-01", + for (String version : Arrays.asList("2026-04-01", "2025-09-01", "2024-07-01", "2023-11-01", "2020-06-30")) { String enumName = ("V" + version.replace("-", "_")); enumName = enumName.toUpperCase(java.util.Locale.ROOT); @@ -693,7 +693,7 @@ private static void includeOldApiVersions(ClassCustomization customization) { private static void removeOldPreviewApiVersions(ClassCustomization customization) { customization.customizeAst(ast -> ast.getEnumByName(customization.getClassName()) .ifPresent(enumDeclaration -> enumDeclaration.getEntries() - .removeIf(entry -> Arrays.asList("V2025_11_01_PREVIEW", "V2026_05_01_PREVIEW") + .removeIf(entry -> Arrays.asList("V2025_11_01_PREVIEW", "V2026_05_01_PREVIEW", "V2026_08_01_PREVIEW") .contains(entry.getNameAsString())))); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java index b56df7c6e4984..407591e834f0f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java @@ -30,10 +30,6 @@ public enum SearchServiceVersion implements ServiceVersion { * Enum value 2026-04-01. */ V2026_04_01("2026-04-01"), - /** - * Enum value 2026-08-01-preview. - */ - V2026_08_01_PREVIEW("2026-08-01-preview"), /** * Enum value 2026-10-01. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java index be14c8cc359cd..af12dd97ee1fa 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FieldBuilder.java @@ -10,6 +10,7 @@ import com.azure.search.documents.indexes.ComplexField; import com.azure.search.documents.indexes.models.LexicalAnalyzerName; import com.azure.search.documents.indexes.models.LexicalNormalizerName; +import com.azure.search.documents.indexes.models.PermissionFilter; import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.VectorEncodingFormat; @@ -297,6 +298,11 @@ private static SearchField enrichBasicSearchField(SearchField searchField, Basic .setFilterable(toBoolean(basicField.isFilterable())) .setSortable(toBoolean(basicField.isSortable())) .setFacetable(toBoolean(basicField.isFacetable())) + .setPermissionFilter(nullOrT(basicField.permissionFilter(), PermissionFilter::fromString)) + .setSensitivityLabelId(toBoolean(basicField.isSensitivityLabelId())) + .setSensitivityLabelName(toBoolean(basicField.isSensitivityLabelName())) + .setSourceDocumentId(toBoolean(basicField.isSourceDocumentId())) + .setSharepointSiteUrl(toBoolean(basicField.isSharepointSiteUrl())) .setOrganizationAccessExpiration(toBoolean(basicField.isOrganizationAccessExpiration())) .setAnalyzerName(nullOrT(basicField.analyzerName(), LexicalAnalyzerName::fromString)) .setSearchAnalyzerName(nullOrT(basicField.searchAnalyzerName(), LexicalAnalyzerName::fromString)) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java index f546de3fadd4c..0a144dbd6693d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java @@ -5,6 +5,7 @@ import com.azure.search.documents.indexes.models.LexicalAnalyzerName; import com.azure.search.documents.indexes.models.LexicalNormalizerName; +import com.azure.search.documents.indexes.models.PermissionFilter; import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SynonymMap; @@ -97,9 +98,11 @@ BooleanHelper isFacetable() default BooleanHelper.NULL; /** - * Indicates if the field or method should be used as a permission filter {@link SearchField field}. + * The {@link PermissionFilter} to associate with the {@link SearchField field}. + *

+ * If the value is empty, the field won't have a {@link SearchField#getPermissionFilter()} value. * - * @return A flag indicating if the field or method should generate as a filterable {@link SearchField field}. + * @return The permission filter associated with the {@link SearchField field}. */ String permissionFilter() default ""; @@ -111,6 +114,34 @@ */ BooleanHelper isSensitivityLabel() default BooleanHelper.NULL; + /** + * Indicates whether the field contains a Microsoft Purview sensitivity label ID used for document-level filtering. + * + * @return A flag indicating whether the {@link SearchField field} contains sensitivity label IDs. + */ + BooleanHelper isSensitivityLabelId() default BooleanHelper.NULL; + + /** + * Indicates whether the field contains the name of a Microsoft Purview sensitivity label applied to the document. + * + * @return A flag indicating whether the {@link SearchField field} contains sensitivity label names. + */ + BooleanHelper isSensitivityLabelName() default BooleanHelper.NULL; + + /** + * Indicates whether the field contains the source document identifier used for Microsoft Purview audit tracking. + * + * @return A flag indicating whether the {@link SearchField field} contains source document identifiers. + */ + BooleanHelper isSourceDocumentId() default BooleanHelper.NULL; + + /** + * Indicates whether the field contains a SharePoint site URL used for SharePoint group-based filtering. + * + * @return A flag indicating whether the {@link SearchField field} contains SharePoint site URLs. + */ + BooleanHelper isSharepointSiteUrl() default BooleanHelper.NULL; + /** * Indicates whether the field contains the expiration time for organization-wide document access. * diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java index 9eb20b96037c3..5313b862aeea6 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -41,6 +41,7 @@ import reactor.core.publisher.Mono; import java.util.Collections; +import java.util.Arrays; import java.util.Map; import java.nio.charset.StandardCharsets; @@ -59,9 +60,13 @@ public class PreviewApiTests { + "\"@search.graphExplain\":{\"logical\":{\"operator\":\"scan\"}}}"; @Test - public void preservesPreviousVersionsAndDefaultsToNewPreview() { + public void preservesGaVersionsAndOnlyLatestPreview() { assertEquals("2026-11-01-preview", SearchServiceVersion.getLatest().getVersion()); - assertEquals("2026-08-01-preview", SearchServiceVersion.V2026_08_01_PREVIEW.getVersion()); + assertEquals(Collections.singletonList(SearchServiceVersion.V2026_11_01_PREVIEW), + Arrays.stream(SearchServiceVersion.values()) + .filter(version -> version.getVersion().endsWith("-preview")) + .collect(java.util.stream.Collectors.toList())); + assertEquals("2026-10-01", SearchServiceVersion.V2026_10_01.getVersion()); assertEquals("2026-04-01", SearchServiceVersion.V2026_04_01.getVersion()); assertEquals("2020-06-30", SearchServiceVersion.V2020_06_30.getVersion()); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java index 1640df383390e..622609af61dd4 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java @@ -7,6 +7,7 @@ import com.azure.core.util.BinaryData; import com.azure.search.documents.TestHelpers; import com.azure.search.documents.indexes.models.LexicalNormalizerName; +import com.azure.search.documents.indexes.models.PermissionFilter; import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.testingmodels.HotelAnalyzerException; @@ -182,6 +183,74 @@ public void previewFieldAnnotationsDefaultToServiceDefaults() { for (SearchField field : SearchIndexClient.buildSearchFields(AllSupportedFields.class)) { assertNull(field.isOrganizationAccessExpiration()); assertNull(field.getTopicGraphProfile()); + assertNull(field.getPermissionFilter()); + assertNull(field.isSensitivityLabelId()); + assertNull(field.isSensitivityLabelName()); + assertNull(field.isSourceDocumentId()); + assertNull(field.isSharepointSiteUrl()); + } + } + + @Test + public void securityFieldAnnotationsAreForwardedAndSerialized() { + Map fields = SearchIndexClient.buildSearchFields(SecurityFields.class) + .stream() + .collect(Collectors.toMap(SearchField::getName, field -> field)); + + assertEquals(PermissionFilter.USER_IDS, fields.get("users").getPermissionFilter()); + assertEquals("userIds", BinaryData.fromObject(fields.get("users")).toObject(Map.class).get("permissionFilter")); + assertEquals(PermissionFilter.ONE_LAKE_PARENT_FOLDERS, fields.get("folders").getPermissionFilter()); + assertEquals("oneLakeParentFolders", + BinaryData.fromObject(fields.get("folders")).toObject(Map.class).get("permissionFilter")); + + for (String property : Arrays.asList("sensitivityLabelId", "sensitivityLabelName", "sourceDocumentId", + "sharepointSiteUrl")) { + assertEquals(Boolean.TRUE, BinaryData.fromObject(fields.get(property)).toObject(Map.class).get(property)); + assertEquals(Boolean.FALSE, + BinaryData.fromObject(fields.get("non" + property)).toObject(Map.class).get(property)); + } + } + + @SuppressWarnings("unused") + private static final class SecurityFields { + @BasicField(name = "users", permissionFilter = "userIds") + private List users; + + @BasicField(name = "sensitivityLabelId", isSensitivityLabelId = BasicField.BooleanHelper.TRUE) + private String sensitivityLabelId; + + @BasicField(name = "sensitivityLabelName", isSensitivityLabelName = BasicField.BooleanHelper.TRUE) + private String sensitivityLabelName; + + @BasicField(name = "sourceDocumentId", isSourceDocumentId = BasicField.BooleanHelper.TRUE) + private String sourceDocumentId; + + @BasicField(name = "sharepointSiteUrl", isSharepointSiteUrl = BasicField.BooleanHelper.TRUE) + private String sharepointSiteUrl; + + @BasicField(name = "folders", permissionFilter = "oneLakeParentFolders") + public List getFolders() { + return null; + } + + @BasicField(name = "nonsensitivityLabelId", isSensitivityLabelId = BasicField.BooleanHelper.FALSE) + public String getNonSensitivityLabelId() { + return null; + } + + @BasicField(name = "nonsensitivityLabelName", isSensitivityLabelName = BasicField.BooleanHelper.FALSE) + public String getNonSensitivityLabelName() { + return null; + } + + @BasicField(name = "nonsourceDocumentId", isSourceDocumentId = BasicField.BooleanHelper.FALSE) + public String getNonSourceDocumentId() { + return null; + } + + @BasicField(name = "nonsharepointSiteUrl", isSharepointSiteUrl = BasicField.BooleanHelper.FALSE) + public String getNonSharepointSiteUrl() { + return null; } } From e466a0a7ef3e5f7caf44513d6bf8d78c1594bca8 Mon Sep 17 00:00:00 2001 From: Yangyang Lu Date: Tue, 27 Oct 2026 16:01:52 -0700 Subject: [PATCH 04/20] Deprecate ignored Search field annotation and fix version guidance Deprecate BasicField.isSensitivityLabel() and document its existing no-op behavior and the distinct ID/name replacements. Preserve its signature, BooleanHelper.NULL default, and runtime behavior; add a changelog note. Correct the Search package skill and both references to retain supported GA versions and only the latest preview, removing obsolete previews through customization. Keep the existing latest-preview regression test unchanged. Validation: package/Javadoc, Checkstyle, SpotBugs, Spotless, Revapi against GA 12.0.3, and local GA binary/public API consumer checks passed. Focused tests: 41 passed, 2 existing skips. Skill documentation passed the repository-documented manual fallback checks because vally is unavailable. No live tests run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../.github/skills/azure-search-documents/SKILL.md | 9 +++++---- .../azure-search-documents/references/architecture.md | 4 ++-- .../references/customizations.md | 8 +++++--- sdk/search/azure-search-documents/CHANGELOG.md | 2 ++ .../com/azure/search/documents/indexes/BasicField.java | 10 +++++++--- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/SKILL.md b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/SKILL.md index d31f910eba7c0..f6989b12e298a 100644 --- a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/SKILL.md +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/SKILL.md @@ -32,10 +32,11 @@ Categorize each compilation error: `SearchServiceVersion.java` is generated but customized by `SearchCustomizations.java`. 1. Check `getLatest()` returns the new version -2. In `includeOldApiVersions()`: - - **Remove** any version the generator now produces (prevents duplicates) - - **Add** the previous latest version if not already produced by the generator -3. Verify all expected old versions are present +2. Retain supported GA versions and only the latest preview: + - In `includeOldApiVersions()`, add supported GA versions missing from generated output; do not re-add older previews. + - Remove any version the generator now produces from that list (prevents duplicates). + - Remove obsolete preview constants through `removeOldPreviewApiVersions()`. +3. Regenerate and verify supported GA constants remain, only the latest preview is present, and the latest-preview-only regression test passes. ## Detect Breaking Changes diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/architecture.md b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/architecture.md index 4d18c7e1fec80..cd30ce54fc115 100644 --- a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/architecture.md +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/architecture.md @@ -52,9 +52,9 @@ Generated methods have `@Generated` annotation. Some generated files contain BOT ## Service Version -`SearchServiceVersion.java` is generated but customized. The generator produces only the latest version constant. Older versions are added by `includeOldApiVersions()` in `SearchCustomizations.java`. +`SearchServiceVersion.java` is generated but customized. Supported GA versions missing from generated output are added by `includeOldApiVersions()` in `SearchCustomizations.java`. -When a new API version is released, the generator produces a new constant and updates `getLatest()`. The previous latest must be added to the customization list -- but only if the generator does NOT also produce it (otherwise you get duplicate enum constants). +Retain supported GA versions and only the latest preview. When a new API version is generated, verify `getLatest()` returns it. Do not re-add obsolete previews in `includeOldApiVersions()`; remove obsolete preview constants through `removeOldPreviewApiVersions()`. Do not add a GA constant already produced by the generator. Regenerate and run the latest-preview-only regression test. ## Key Hand-Written Files diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/customizations.md b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/customizations.md index 53e8e21c0d060..efed6c552bb17 100644 --- a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/customizations.md +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/references/customizations.md @@ -26,11 +26,11 @@ Note: The `azsdk_customized_code_update` MCP tool can apply many customization f ### 3. includeOldApiVersions -**What**: Prepends older version constants to the SearchServiceVersion enum. +**What**: Prepends supported GA version constants missing from the generated SearchServiceVersion enum. -**Current list**: See `includeOldApiVersions()` in `SearchCustomizations.java` for the authoritative version list. When a new API version is released, add the previous latest to this list -- but only if the generator does not already produce it. +**Current list**: See `includeOldApiVersions()` in `SearchCustomizations.java` for the authoritative GA version list. Do not add a version already produced by the generator or re-add an obsolete preview. -**When to update**: When a new API version is released -- add the previous latest to this list. **Critical**: check if the generator now produces a version that's in this list. If so, remove it to avoid duplicate enum constants. +**When to update**: Retain supported GA versions and only the latest preview. Add supported GA versions missing from generated output, and remove obsolete preview constants through `removeOldPreviewApiVersions()`. If the generator now produces a GA version in the inclusion list, remove it from the list to avoid duplicates. Regenerate and verify the latest-preview-only regression test passes. ### 4. removeGetApis @@ -59,7 +59,9 @@ Note: The `azsdk_customized_code_update` MCP tool can apply many customization f (silently does nothing -- no error, no warning) [ ] If new API version: [ ] Check includeOldApiVersions() list for duplicates with generator + [ ] Retain supported GA versions and remove obsolete previews through removeOldPreviewApiVersions() [ ] Verify getLatest() returns the new version + [ ] Run the latest-preview-only regression test [ ] If new client classes generated: [ ] Add hideWithResponseBinaryDataApis() call [ ] Add addSearchAudienceScopeHandling() call for builder diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 84103509bb038..f9128ccfeebe0 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -24,6 +24,8 @@ ### Other Changes +- Deprecated `BasicField.isSensitivityLabel()`, which has no effect when building search fields. Use `isSensitivityLabelId()` for sensitivity label ID filtering or `isSensitivityLabelName()` for sensitivity label names. The legacy member and its default remain unchanged for compatibility. + ## 12.1.0-beta.2 (2026-08-28) ### Features Added diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java index 0a144dbd6693d..5103dc653fce8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/BasicField.java @@ -107,11 +107,15 @@ String permissionFilter() default ""; /** - * Indicates if the field or method should be used for sensitivity label filtering. This enables document-level - * filtering based on Microsoft Purview sensitivity labels. + * Legacy sensitivity label annotation member retained for compatibility. This member has no effect on fields + * generated by {@link SearchIndexClient#buildSearchFields(Class)} or + * {@link SearchIndexAsyncClient#buildSearchFields(Class)}. * - * @return A flag indicating if the field or method should generate as a sensitivity label {@link SearchField field}. + * @return The legacy sensitivity label flag, which is ignored when building search fields. + * @deprecated Use {@link #isSensitivityLabelId()} for sensitivity label ID filtering or + * {@link #isSensitivityLabelName()} for a field containing sensitivity label names, according to the field's purpose. */ + @Deprecated BooleanHelper isSensitivityLabel() default BooleanHelper.NULL; /** From ad5f060e392105de0f9d4c762c87ea21d3365a11 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:39:40 -0800 Subject: [PATCH 05/20] Align Search preview with October GA and validated recordings Preserve GA streaming, lookup, listing, authorization, and file APIs through the preview customizations. Add regression and opt-in feature coverage, update release metadata, and pin the published recording assets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 9 +- sdk/search/azure-search-documents/README.md | 32 +- sdk/search/azure-search-documents/assets.json | 2 +- .../src/main/java/SearchCustomizations.java | 805 ++++++++-- sdk/search/azure-search-documents/pom.xml | 8 +- .../preview-feature-coverage.md | 142 ++ .../search/documents/SearchAsyncClient.java | 27 + .../azure/search/documents/SearchClient.java | 26 + .../KnowledgeBaseRetrievalClientImpl.java | 115 +- .../implementation/SearchClientImpl.java | 263 +++- .../indexes/SearchIndexAsyncClient.java | 71 +- .../documents/indexes/SearchIndexClient.java | 71 +- .../indexes/SearchIndexerAsyncClient.java | 38 + .../indexes/SearchIndexerClient.java | 38 + .../KnowledgeBaseRetrievalAsyncClient.java | 139 +- .../KnowledgeBaseRetrievalClient.java | 177 ++- .../models/KnowledgeBaseErrorStreamEvent.java | 30 +- ...ledgeBaseResponseCompletedStreamEvent.java | 30 +- .../models/KnowledgeBaseRetrievalOptions.java | 36 + .../src/samples/README.md | 62 +- .../KnowledgeBaseRetrievalStreamExample.java | 2 - .../azure/search/documents/ReadmeSamples.java | 53 +- .../documents/FileIngestionPollingTests.java | 268 ++++ .../documents/GetDocumentOptionsTests.java | 33 +- .../search/documents/KnowledgeBaseTests.java | 1383 +++++++++++++++-- .../search/documents/PreviewApiTests.java | 44 +- .../PreviewFeatureContractTests.java | 611 ++++++++ .../documents/PreviewFeatureLiveTests.java | 632 ++++++++ .../indexes/IndexersManagementTests.java | 55 +- .../documents/indexes/SearchListingTests.java | 3 +- .../KnowledgeBaseRetrievalStreamTests.java | 36 +- sdk/search/azure-search-perf/pom.xml | 4 +- 32 files changed, 4601 insertions(+), 644 deletions(-) create mode 100644 sdk/search/azure-search-documents/preview-feature-coverage.md create mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java create mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureContractTests.java create mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index f9128ccfeebe0..8ba44cab821e7 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.1.0-beta.3 (Unreleased) +## 12.3.0-beta.1 (Unreleased) ### Features Added @@ -9,18 +9,25 @@ - Added graph extraction, enrichment cache, graph retrieval activities and references, and updated knowledge source and model options. - Added `none`, `diverse`, and `balanced` vector topic graph retrieval, facet-backed filter hint auto-configuration, and random scoring. - Restored preview search options, including more-like-this and agentic search, and exposed query diagnostics on paged responses. +- Carried forward the October GA knowledge base retrieval APIs: closeable synchronous and direct typed asynchronous event streams, query-source authorization options and overloads, and nullable numeric completion status codes. Work IQ authorization remains available in the November preview. +- Added typed `RequestOptions` listing overloads and aligned `KnowledgeBaseIndexedSqlReference` with the GA `getDocumentUrl()` getter. +- Carried forward the final October GA `GetDocumentOptions` and synchronous/asynchronous document lookup overloads, including authorization headers, elevated read, selected fields, and caller `RequestOptions` precedence. ### Breaking Changes - Removed `SearchServiceVersion.V2026_08_01_PREVIEW`; `V2026_11_01_PREVIEW` is now the only supported preview service version. - Removed preview `queryHints` from `AzureBlobKnowledgeSourceParameters` and `IndexedSharePointKnowledgeSourceParameters`, and `queryHintOverrides` from their runtime parameter models, to match the November contract in [spec PR #47300](https://github.com/Azure/azure-rest-api-specs/pull/47300). These properties remain supported on `SearchIndexKnowledgeSourceParameters` and `SearchIndexKnowledgeSourceParams`, respectively; `topicGraph` is not a replacement for query hints. - Removed preview query hints and query hint overrides from other non-SearchIndex knowledge sources, and their query hint processing activity properties, to match the service contract. +- Aligned preview streaming APIs with the October GA signatures: synchronous `retrieveStream` returns a `CloseableIterableStream` instead of accepting a callback, and asynchronous `retrieveStream` emits typed events directly instead of `ServerSentEvent` envelopes. +- Removed preview-only `ServerSentEvent`, `ServerSentEventListener`, `UnknownKnowledgeBaseRetrievalStreamEvent`, and `KnowledgeBaseRetrievalStatusCode` types. As in GA, stream event wrappers have SDK-only constructors and are not JSON models; unknown events expose only their names. SQL references expose `getDocumentUrl()` instead of `getDocUrl()`. ### Bugs Fixed - Forwarded topic graph profile and organization access expiration settings from field-builder annotations. - Added field-builder annotations for sensitivity label IDs and names, source document IDs, and SharePoint site URLs, and forwarded permission filter settings to generated search fields. - Fixed convenience search requests dropping preview query language, spelling, rewriting, hybrid, semantic field, and authorization options. +- Carried forward SSE decoding, cancellation, backpressure, buffer ownership, and response-cleanup fixes. +- Aligned file delete and update argument order with GA: knowledge source `name` precedes `fileId`. ### Other Changes diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 53f1e264976c4..b2b7afc0a5b7c 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -75,7 +75,7 @@ add the direct dependency to your project as follows. com.azure azure-search-documents - 11.8.0 + 12.3.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -453,6 +453,20 @@ Map hotel = SEARCH_CLIENT.getDocument("1").getAdditionalProperti System.out.printf("This is hotelId %s, and this is hotel name %s.%n", hotel.get("Id"), hotel.get("Name")); ``` +Use `GetDocumentOptions` to select fields or supply a query-source authorization token for document-level permissions. +The three-argument `getDocumentWithResponse` overload is available on both synchronous and asynchronous clients. +Explicit headers in `RequestOptions` override the operation options; query parameters in `RequestOptions` are appended. + +```java readme-sample-retrieveDocumentWithOptions +GetDocumentOptions options = new GetDocumentOptions() + .setQuerySourceAuthorization(querySourceToken) + .setEnableElevatedRead(false) + .setSelectedFields(Arrays.asList("Id", "Name")); +Map hotel = SEARCH_CLIENT.getDocumentWithResponse("1", options, null) + .getValue().getAdditionalProperties(); +System.out.printf("This is hotelId %s, and this is hotel name %s.%n", hotel.get("Id"), hotel.get("Name")); +``` + ### Adding documents to your index You can `Upload`, `Merge`, `MergeOrUpload`, and `Delete` multiple documents from an index in a single batched request. @@ -565,6 +579,21 @@ For response headers and status, use `graphWithResponse`. A plan-only request mu See the [preview samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java). These APIs require a service that supports the preview; the samples do not provision resources. +The preview preserves the October GA knowledge base streaming APIs. `KnowledgeBaseRetrievalClient.retrieveStream` +returns a `CloseableIterableStream`; use try-with-resources, especially when stopping +early. `KnowledgeBaseRetrievalAsyncClient.retrieveStream` returns a `Flux` directly, +without `ServerSentEvent` envelopes. Known events expose typed payloads through `getValue()`; unknown events expose +only their names, not their payloads. Event wrappers are SDK-created envelopes; serialize their typed payloads instead. +Completion status codes remain nullable integers. +See the [streaming sample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java), +which provisions uniquely named sample resources and removes them afterward. + +Set `KnowledgeBaseRetrievalOptions.setQuerySourceAuthorization` to send query-source authorization as a header, +never as JSON. An explicit non-null authorization argument overrides the option; null falls back to it. +The three-argument retrieval and streaming overloads also support November's Work IQ authorization. +Typed listing overloads accept `RequestOptions` and preserve service continuation links. File delete and update APIs +take the knowledge source `name` before `fileId`. SQL references use the GA `getDocumentUrl()` getter. + * Samples are explained in detail [here][samples_readme]. * Read more about the [Azure AI Search service](https://learn.microsoft.com/azure/search/search-what-is-azure-search) @@ -605,4 +634,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [HttpResponseException]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/exception/HttpResponseException.java [status_codes]: https://learn.microsoft.com/rest/api/searchservice/http-status-codes [search-get-started-portal]: https://learn.microsoft.com/azure/search/search-get-started-portal - diff --git a/sdk/search/azure-search-documents/assets.json b/sdk/search/azure-search-documents/assets.json index 1148d9d09fb2e..db43ee587df9a 100644 --- a/sdk/search/azure-search-documents/assets.json +++ b/sdk/search/azure-search-documents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/search/azure-search-documents", - "Tag": "java/search/azure-search-documents_6b5dc0e6de" + "Tag": "java/search/azure-search-documents_6950366571" } diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index f6d9647da5ca0..1c05fcadadcc2 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -14,6 +14,7 @@ import com.github.javaparser.ast.body.VariableDeclarator; import com.github.javaparser.ast.expr.StringLiteralExpr; import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.Statement; import com.github.javaparser.ast.type.Type; import org.slf4j.Logger; @@ -52,14 +53,18 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) hideWithResponseBinaryDataApis(searchClient); hideWithResponseBinaryDataApis(searchAsyncClient); + addGetDocumentOptionsToImpl(libraryCustomization.getPackage("com.azure.search.documents.implementation") + .getClass("SearchClientImpl")); + addTypedGetDocumentWithOptions(searchClient); + addTypedGetDocumentWithOptions(searchAsyncClient); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexClient")); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexAsyncClient")); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexerClient")); hideWithResponseBinaryDataApis(indexes.getClass("SearchIndexerAsyncClient")); hideWithResponseBinaryDataApis(knowledge.getClass("KnowledgeBaseRetrievalClient")); hideWithResponseBinaryDataApis(knowledge.getClass("KnowledgeBaseRetrievalAsyncClient")); - preserveFileParameterOrder(indexes.getClass("SearchIndexClient")); - preserveFileParameterOrder(indexes.getClass("SearchIndexAsyncClient")); + preserveUploadParameterOrder(indexes.getClass("SearchIndexClient")); + preserveUploadParameterOrder(indexes.getClass("SearchIndexAsyncClient")); for (boolean async : Arrays.asList(false, true)) { String suffix = async ? "AsyncClient" : "Client"; repairListingConvenience(indexes.getClass("SearchIndex" + suffix), "SynonymMaps", "SynonymMap", async); @@ -109,6 +114,28 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) })); customizeKnowledgeBaseRetrievalStream(libraryCustomization, logger); + addQuerySourceAuthorizationOption( + libraryCustomization.getPackage(KNOWLEDGE_MODELS_PACKAGE).getClass("KnowledgeBaseRetrievalOptions")); + for (String className : Arrays.asList("KnowledgeBaseRetrievalClient", "KnowledgeBaseRetrievalAsyncClient")) { + ClassCustomization client = knowledge.getClass(className); + addGaRetrieveOverload(client); + addWorkIqRetrieveStream(client); + forwardQuerySourceAuthorizationOption(client); + } + addQuerySourceAuthorizationToRetrieveImpl( + libraryCustomization.getPackage("com.azure.search.documents.implementation") + .getClass("KnowledgeBaseRetrievalClientImpl")); + customizeResponseCompletedStatusCode(libraryCustomization); + for (String className : Arrays.asList("SearchIndexClient", "SearchIndexAsyncClient")) { + ClassCustomization client = indexes.getClass(className); + addTypedListingMethod(client, "listIndexStatsSummary", "IndexStatisticsSummary", false); + addTypedListingMethod(client, "listKnowledgeSourceFiles", "KnowledgeSourceFile", true); + } + libraryCustomization.getPackage(KNOWLEDGE_MODELS_PACKAGE) + .getClass("KnowledgeBaseIndexedSqlReference") + .customizeAst(ast -> ast.getClassByName("KnowledgeBaseIndexedSqlReference").ifPresent(clazz -> { + clazz.getMethodsByName("getDocUrl").get(0).setName("getDocumentUrl"); + })); customizeKnowledgeSourceStatusDurationParsing( libraryCustomization.getPackage("com.azure.search.documents.knowledgebases.models") .getClass("KnowledgeSourceStatus")); @@ -124,6 +151,39 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) .getClass("SearchResourceEncryptionKey")); } + private static void addGaRetrieveOverload(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + MethodDeclaration method = clazz.getMethodsBySignature("retrieve", "KnowledgeBaseRetrievalOptions", + "String", "String").get(0).clone(); + method.getParameters().remove(2); + method.getBody().get().getStatements().removeIf(statement -> statement.isIfStmt() + && statement.asIfStmt().getCondition().toString().equals("queryWorkIQSourceAuthorization != null")); + method.setJavadocComment("Retrieves relevant data from backing stores.\n\n" + + "@param retrievalRequest The retrieval request to process.\n" + + "@param querySourceAuthorization Token identifying the user for which the query is being executed. " + + "This token is used to enforce security restrictions on documents.\n" + + "@return The retrieval result.\n" + + "@throws com.azure.core.exception.HttpResponseException if the service rejects the request."); + clazz.addMember(method); + })); + } + + private static void addWorkIqRetrieveStream(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + MethodDeclaration method = clazz.getMethodsBySignature("retrieveStream", + "KnowledgeBaseRetrievalOptions", "String").get(0).clone(); + method.addParameter("String", "queryWorkIQSourceAuthorization"); + method.getBody().get().addStatement(1, StaticJavaParser.parseStatement( + "if (queryWorkIQSourceAuthorization != null) {" + + "requestOptions.setHeader(HttpHeaderName.fromString(" + + "\"x-ms-query-work-iq-source-authorization\"), queryWorkIQSourceAuthorization); }")); + method.getJavadocComment().ifPresent(javadoc -> javadoc.setContent(javadoc.getContent().replace("@return", + "@param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app " + + "registration configured on a Work IQ knowledge source.\n@return"))); + clazz.addMember(method); + })); + } + private static void preservePagedSearchAuthorization(ClassCustomization customization) { customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> clazz .getMethodsByName("search").forEach(method -> method @@ -164,15 +224,12 @@ private static void repairListingConvenience(ClassCustomization customization, S }); } - private static void preserveFileParameterOrder(ClassCustomization customization) { + private static void preserveUploadParameterOrder(ClassCustomization customization) { customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { for (MethodDeclaration method : clazz.getMethods()) { if (method.isPublic() && method.getParameters().size() >= 2 && method.getParameter(0).getNameAsString().equals("name") - && (method.getNameAsString().equals("deleteKnowledgeSourceFile") - || method.getNameAsString().equals("deleteKnowledgeSourceFileWithResponse") - || method.getNameAsString().equals("updateKnowledgeSourceFile") - || method.getNameAsString().equals("uploadKnowledgeSourceFile"))) { + && method.getNameAsString().equals("uploadKnowledgeSourceFile")) { com.github.javaparser.ast.body.Parameter first = method.getParameter(0); method.getParameters().set(0, method.getParameter(1)); method.getParameters().set(1, first); @@ -323,8 +380,6 @@ private static void customizeKnowledgeBaseRetrievalStream(LibraryCustomization l private static void addStreamModels(LibraryCustomization customization) { customization.getRawEditor().addFile(MODELS_PATH + "KnowledgeBaseRetrievalStreamEvent.java", baseEventSource()); - customization.getRawEditor() - .addFile(MODELS_PATH + "UnknownKnowledgeBaseRetrievalStreamEvent.java", unknownEventSource()); customization.getRawEditor() .addFile(MODELS_PATH + "KnowledgeBaseRetrievalStartedStreamEvent.java", wrapperSource("KnowledgeBaseRetrievalStartedStreamEvent", "KnowledgeBaseRetrievalStartedEvent", @@ -406,7 +461,6 @@ private static void customizeKnowledgeSourceStatusDurationParsing(ClassCustomiza private static void addAsyncRetrieveStream(ClassCustomization customization) { customization.customizeAst(ast -> ast.addImport("com.azure.core.http.HttpHeaderName") - .addImport("com.azure.search.documents.models.ServerSentEvent") .addImport("com.azure.search.documents.models.implementation.sse.ServerSentEventStreams") .addImport( "com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter") @@ -415,22 +469,20 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { .getClassByName(customization.getClassName()) .ifPresent(clazz -> { clazz.getMethodsByName("retrieveStream").forEach(MethodDeclaration::remove); - MethodDeclaration method - = StaticJavaParser - .parseBodyDeclaration("@Generated\n" - + "public Flux> retrieveStream(" - + "KnowledgeBaseRetrievalOptions retrievalRequest) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " return hiddenGeneratedRetrieveStreamWithResponse(" - + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" - + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " event -> event.getData().isTerminal()));\n" - + "}\n") - .asMethodDeclaration(); + MethodDeclaration method = StaticJavaParser + .parseBodyDeclaration( + "@Generated\n" + "public Flux retrieveStream(" + + "KnowledgeBaseRetrievalOptions retrievalRequest) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " return hiddenGeneratedRetrieveStreamWithResponse(" + + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" + + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " KnowledgeBaseRetrievalStreamEvent::isTerminal));\n" + "}\n") + .asMethodDeclaration(); method.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" + + "events.\n\n" + streamEventDocumentation() + "If received, the terminal {@code error} or {@code response.completed} event is emitted " + "before the stream completes. End-of-stream without a terminal event completes normally. " + "Transport and decoding failures are propagated through the reactive error path. The client " @@ -439,32 +491,23 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { + "@return A stream of typed knowledge base retrieval events."); clazz.addMember(method); - MethodDeclaration methodWithAuthorizationHeaders - = StaticJavaParser - .parseBodyDeclaration("@Generated\n" - + "public Flux> retrieveStream(" - + "KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization,\n" - + " String queryWorkIQSourceAuthorization) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " if (querySourceAuthorization != null) {\n" - + " requestOptions.setHeader(\n" - + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" - + " querySourceAuthorization);\n" - + " }\n" - + " if (queryWorkIQSourceAuthorization != null) {\n" - + " requestOptions.setHeader(\n" - + " HttpHeaderName.fromString(\"x-ms-query-work-iq-source-authorization\"),\n" - + " queryWorkIQSourceAuthorization);\n" - + " }\n" - + " return hiddenGeneratedRetrieveStreamWithResponse(" - + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" - + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " event -> event.getData().isTerminal()));\n" + "}\n") - .asMethodDeclaration(); + MethodDeclaration methodWithAuthorizationHeaders = StaticJavaParser + .parseBodyDeclaration( + "@Generated\n" + "public Flux retrieveStream(" + + "KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " if (querySourceAuthorization != null) {\n" + " requestOptions.setHeader(\n" + + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" + + " querySourceAuthorization);\n" + " }\n" + + " return hiddenGeneratedRetrieveStreamWithResponse(" + + "BinaryData.fromObject(retrievalRequest), requestOptions)\n" + + " .flatMapMany(response -> ServerSentEventStreams.toFlux(response,\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " KnowledgeBaseRetrievalStreamEvent::isTerminal));\n" + "}\n") + .asMethodDeclaration(); methodWithAuthorizationHeaders.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" + + "events.\n\n" + streamEventDocumentation() + "If received, the terminal {@code error} or {@code response.completed} event is emitted " + "before the stream completes. End-of-stream without a terminal event completes normally. " + "Transport and decoding failures are propagated through the reactive error path. The client " @@ -472,9 +515,6 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { + "@param retrievalRequest The retrieval request to process.\n" + "@param querySourceAuthorization Token identifying the user for which the query is being " + "executed. This token is used to enforce security restrictions on documents.\n" - + "@param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app " - + "registration configured on a Work IQ knowledge source. Used for on-behalf-of " - + "authentication to the Work IQ API.\n" + "@return A stream of typed knowledge base retrieval events."); clazz.addMember(methodWithAuthorizationHeaders); })); @@ -482,7 +522,7 @@ private static void addAsyncRetrieveStream(ClassCustomization customization) { private static void addSyncRetrieveStream(ClassCustomization customization) { customization.customizeAst(ast -> ast.addImport("com.azure.core.http.HttpHeaderName") - .addImport("com.azure.search.documents.models.ServerSentEventListener") + .addImport("com.azure.core.util.CloseableIterableStream") .addImport("com.azure.search.documents.models.implementation.sse.ServerSentEventStreams") .addImport( "com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter") @@ -490,120 +530,401 @@ private static void addSyncRetrieveStream(ClassCustomization customization) { .getClassByName(customization.getClassName()) .ifPresent(clazz -> { clazz.getMethodsByName("retrieveStream").forEach(MethodDeclaration::remove); - MethodDeclaration method - = StaticJavaParser - .parseBodyDeclaration("@Generated\n" - + "public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest,\n" - + " ServerSentEventListener listener) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " ServerSentEventStreams.listen(hiddenGeneratedRetrieveStreamWithResponse(\n" - + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " event -> event.getData().isTerminal(), listener);\n" - + "}\n") - .asMethodDeclaration(); + MethodDeclaration method = StaticJavaParser.parseBodyDeclaration("@Generated\n" + + "public CloseableIterableStream retrieveStream(" + + "KnowledgeBaseRetrievalOptions retrievalRequest) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " return ServerSentEventStreams.toIterableStream(hiddenGeneratedRetrieveStreamWithResponse(\n" + + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " KnowledgeBaseRetrievalStreamEvent::isTerminal);\n" + "}\n").asMethodDeclaration(); method.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" - + "If received, the terminal {@code error} or {@code response.completed} event is delivered " - + "before {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a " - + "terminal event closes normally. Transport and decoding failures are reported through " - + "{@link ServerSentEventListener#onError(Throwable)}. The client does not reconnect " - + "automatically.\n\n" - + "@param retrievalRequest The retrieval request to process.\n" - + "@param listener The listener that receives events and lifecycle notifications."); + + "events.\n\n" + streamEventDocumentation() + + "Events are decoded lazily by a single iterator. Use try-with-resources to close the " + + "stream when iteration ends early. The response is also closed on end-of-stream, a " + + "terminal event, or an iteration failure. Closing the stream is idempotent and may throw " + + "{@link java.io.IOException}.\n\n" + + "If received, the terminal {@code error} or {@code response.completed} event is emitted " + + "before iteration ends. A failure while closing after a terminal event is reported by the " + + "next iterator access or explicit close, after the terminal event is delivered. " + + "End-of-stream without a terminal event completes normally. " + + "Transport and decoding failures are thrown during iteration. The client does not " + + "reconnect automatically.\n\n" + "@param retrievalRequest The retrieval request to process.\n" + + "@return A closeable stream of typed knowledge base retrieval events."); clazz.addMember(method); - MethodDeclaration methodWithAuthorizationHeaders - = StaticJavaParser - .parseBodyDeclaration("@Generated\n" - + "public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest,\n" - + " String querySourceAuthorization, String queryWorkIQSourceAuthorization,\n" - + " ServerSentEventListener listener) {\n" - + " RequestOptions requestOptions = new RequestOptions();\n" - + " if (querySourceAuthorization != null) {\n" - + " requestOptions.setHeader(\n" - + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" - + " querySourceAuthorization);\n" - + " }\n" - + " if (queryWorkIQSourceAuthorization != null) {\n" - + " requestOptions.setHeader(\n" - + " HttpHeaderName.fromString(\"x-ms-query-work-iq-source-authorization\"),\n" - + " queryWorkIQSourceAuthorization);\n" - + " }\n" - + " ServerSentEventStreams.listen(hiddenGeneratedRetrieveStreamWithResponse(\n" - + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" - + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" - + " event -> event.getData().isTerminal(), listener);\n" + "}\n") - .asMethodDeclaration(); + MethodDeclaration methodWithAuthorizationHeaders = StaticJavaParser.parseBodyDeclaration("@Generated\n" + + "public CloseableIterableStream retrieveStream(" + + "KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " if (querySourceAuthorization != null) {\n" + " requestOptions.setHeader(\n" + + " HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" + + " querySourceAuthorization);\n" + " }\n" + + " return ServerSentEventStreams.toIterableStream(hiddenGeneratedRetrieveStreamWithResponse(\n" + + " BinaryData.fromObject(retrievalRequest), requestOptions),\n" + + " KnowledgeBaseRetrievalStreamEventConverter::convert,\n" + + " KnowledgeBaseRetrievalStreamEvent::isTerminal);\n" + "}\n").asMethodDeclaration(); methodWithAuthorizationHeaders.setJavadocComment( "Retrieves relevant data from backing stores and streams progress and results as server-sent " - + "events.\n\n" - + "If received, the terminal {@code error} or {@code response.completed} event is delivered " - + "before {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a " - + "terminal event closes normally. Transport and decoding failures are reported through " - + "{@link ServerSentEventListener#onError(Throwable)}. The client does not reconnect " - + "automatically.\n\n" - + "@param retrievalRequest The retrieval request to process.\n" + + "events.\n\n" + streamEventDocumentation() + + "Events are decoded lazily by a single iterator. Use try-with-resources to close the " + + "stream when iteration ends early. The response is also closed on end-of-stream, a " + + "terminal event, or an iteration failure. Closing the stream is idempotent and may throw " + + "{@link java.io.IOException}.\n\n" + + "If received, the terminal {@code error} or {@code response.completed} event is emitted " + + "before iteration ends. A failure while closing after a terminal event is reported by the " + + "next iterator access or explicit close, after the terminal event is delivered. " + + "End-of-stream without a terminal event completes normally. " + + "Transport and decoding failures are thrown during iteration. The client does not " + + "reconnect automatically.\n\n" + "@param retrievalRequest The retrieval request to process.\n" + "@param querySourceAuthorization Token identifying the user for which the query is being " + "executed. This token is used to enforce security restrictions on documents.\n" - + "@param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app " - + "registration configured on a Work IQ knowledge source. Used for on-behalf-of " - + "authentication to the Work IQ API.\n" - + "@param listener The listener that receives events and lifecycle notifications."); + + "@return A closeable stream of typed knowledge base retrieval events."); clazz.addMember(methodWithAuthorizationHeaders); })); } + private static final String KNOWLEDGE_MODELS_PACKAGE = "com.azure.search.documents.knowledgebases.models"; + + private static void customizeResponseCompletedStatusCode(LibraryCustomization libraryCustomization) { + String className = "KnowledgeBaseResponseCompletedEvent"; + libraryCustomization.getPackage(KNOWLEDGE_MODELS_PACKAGE) + .getClass(className) + .customizeAst(ast -> ast.getClassByName(className).ifPresent(clazz -> { + clazz.getFieldByName("statusCode") + .orElseThrow(() -> new IllegalStateException("statusCode field not found.")) + .getVariable(0) + .setType("Integer"); + clazz.getConstructors().get(0).getParameter(0).setType("Integer"); + clazz.getMethodsByName("getStatusCode").get(0).setType("Integer"); + + MethodDeclaration toJson = clazz.getMethodsByName("toJson").get(0); + String toJsonBody = toJson.getBody().orElseThrow(() -> new IllegalStateException("No body.")).toString(); + String generatedWrite = "this.statusCode == null ? null : this.statusCode.getValue()"; + if (!toJsonBody.contains(generatedWrite)) { + throw new IllegalStateException("toJson no longer uses the expected generated statusCode write."); + } + toJson.setBody(StaticJavaParser.parseBlock(toJsonBody.replace(generatedWrite, "this.statusCode"))); + + MethodDeclaration fromJson = clazz.getMethodsByName("fromJson").get(0); + String fromJsonBody + = fromJson.getBody().orElseThrow(() -> new IllegalStateException("No body.")).toString(); + String generatedDeclaration = "KnowledgeBaseRetrievalStatusCode statusCode = null;"; + String generatedRead = "statusCode = KnowledgeBaseRetrievalStatusCode.fromValue(reader.getInt());"; + if (!fromJsonBody.contains(generatedDeclaration) || !fromJsonBody.contains(generatedRead)) { + throw new IllegalStateException("fromJson no longer uses the expected generated statusCode read."); + } + fromJson.setBody(StaticJavaParser.parseBlock( + fromJsonBody.replace(generatedDeclaration, "Integer statusCode = null;") + .replace(generatedRead, "statusCode = reader.getNullable(JsonReader::getInt);"))); + + MethodDeclaration getStatusCode = clazz.getMethodsByName("getStatusCode").get(0); + getStatusCode.setJavadocComment("Get the statusCode property: The semantic HTTP status of the completed " + + "retrieval, not the actual HTTP transport response status. The service wire schema requires " + + "this value, but the SDK treats it as nullable: it returns null when the status code is missing " + + "or JSON null, and unknown values round trip as plain integers.\n\n" + + "@return the statusCode value, or null if it was not provided."); + })); + libraryCustomization.getRawEditor().removeFile(MODELS_PATH + "KnowledgeBaseRetrievalStatusCode.java"); + } + + private static void addQuerySourceAuthorizationOption(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + clazz.getFieldByName("querySourceAuthorization").ifPresent(FieldDeclaration::remove); + clazz.getMethodsByName("getQuerySourceAuthorization").forEach(MethodDeclaration::remove); + clazz.getMethodsByName("setQuerySourceAuthorization").forEach(MethodDeclaration::remove); + + FieldDeclaration field = clazz.addField("String", "querySourceAuthorization", Modifier.Keyword.PRIVATE); + field.addMarkerAnnotation("Generated"); + field.setJavadocComment("Token identifying the user for which the query is being executed. Client-only " + + "value that is sent as the x-ms-query-source-authorization header and is never serialized " + + "into the request body."); + + MethodDeclaration getter = StaticJavaParser + .parseBodyDeclaration("@Generated\n" + + "public String getQuerySourceAuthorization() {\n return this.querySourceAuthorization;\n}\n") + .asMethodDeclaration(); + getter.setJavadocComment("Get the querySourceAuthorization property: Token identifying the user for which " + + "the query is being executed. This token is used to enforce security restrictions on documents. " + + "It is only sent as the x-ms-query-source-authorization request header and is never part of the " + + "request body. A non-null authorization passed explicitly to a retrieve method overrides this " + + "value; a null explicit authorization falls back to it.\n\n" + + "@return the querySourceAuthorization value."); + clazz.addMember(getter); + + MethodDeclaration setter = StaticJavaParser.parseBodyDeclaration("@Generated\n" + + "public KnowledgeBaseRetrievalOptions setQuerySourceAuthorization(String querySourceAuthorization) {\n" + + " this.querySourceAuthorization = querySourceAuthorization;\n return this;\n}\n") + .asMethodDeclaration(); + setter.setJavadocComment("Set the querySourceAuthorization property: Token identifying the user for which " + + "the query is being executed. This token is used to enforce security restrictions on documents. " + + "It is only sent as the x-ms-query-source-authorization request header and is never part of the " + + "request body. A non-null authorization passed explicitly to a retrieve method overrides this " + + "value; a null explicit authorization falls back to it. An empty string is treated as a value.\n\n" + + "@param querySourceAuthorization the querySourceAuthorization value to set.\n" + + "@return the KnowledgeBaseRetrievalOptions object itself."); + clazz.addMember(setter); + })); + } + + private static void forwardQuerySourceAuthorizationOption(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + clazz.getMethodsByName("createRetrieveRequestOptions").forEach(MethodDeclaration::remove); + clazz.addMember(StaticJavaParser.parseBodyDeclaration("@Generated\n" + + "private static RequestOptions createRetrieveRequestOptions(" + + "KnowledgeBaseRetrievalOptions retrievalRequest,\n" + " String querySourceAuthorization) {\n" + + " RequestOptions requestOptions = new RequestOptions();\n" + + " String authorization = querySourceAuthorization != null\n" + + " ? querySourceAuthorization\n" + + " : (retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization());\n" + + " if (authorization != null) {\n" + + " requestOptions.setHeader(HttpHeaderName.fromString(\"x-ms-query-source-authorization\"),\n" + + " authorization);\n" + " }\n" + " return requestOptions;\n" + "}\n")); + + int updated = 0; + for (MethodDeclaration method : clazz.getMethods()) { + String name = method.getNameAsString(); + if (!method.isPublic() || !("retrieve".equals(name) || "retrieveStream".equals(name))) { + continue; + } + boolean hasExplicit = method.getParameterByName("querySourceAuthorization").isPresent(); + BlockStmt body = method.getBody() + .orElseThrow(() -> new IllegalStateException("Retrieve method has no body.")); + body.getStatements().removeIf(SearchCustomizations::isQuerySourceAuthorizationHeaderBlock); + boolean replaced = false; + for (int i = 0; i < body.getStatements().size(); i++) { + if (body.getStatements().get(i).toString().contains("new RequestOptions()")) { + body.getStatements() + .set(i, StaticJavaParser.parseStatement("RequestOptions requestOptions = " + + "createRetrieveRequestOptions(retrievalRequest, " + + (hasExplicit ? "querySourceAuthorization" : "null") + ");")); + replaced = true; + break; + } + } + if (!replaced) { + throw new IllegalStateException("Could not find the request options in " + name + "."); + } + + method.getJavadocComment().ifPresent(javadoc -> { + String content = javadoc.getContent() + .replaceFirst("@param retrievalRequest The retrieval request to process\\.", + "@param retrievalRequest The retrieval request to process. If its " + + "{@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is " + + "sent only as the x-ms-query-source-authorization header and is never serialized " + + "into the request body."); + if (hasExplicit) { + content = content.replaceFirst("security[\\s*]+restrictions[\\s*]+on[\\s*]+documents\\.", + "security restrictions on documents. A non-null value overrides " + + "{@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls " + + "back to it, and an empty string is treated as an explicit value."); + } + javadoc.setContent(content); + }); + updated++; + } + if (updated != 6) { + throw new IllegalStateException("Expected to update 6 retrieve methods in " + + customization.getClassName() + " but updated " + updated + "."); + } + })); + } + + private static void addQuerySourceAuthorizationToRetrieveImpl(ClassCustomization customization) { + customization.customizeAst(ast -> { + ast.addImport("com.azure.core.annotation.Generated"); + com.github.javaparser.ast.body.ClassOrInterfaceDeclaration clazz + = ast.getClassByName(customization.getClassName()) + .orElseThrow(() -> new IllegalStateException("Class not found.")); + + com.github.javaparser.ast.body.ClassOrInterfaceDeclaration service = clazz.getMembers() + .stream() + .filter(member -> member.isClassOrInterfaceDeclaration()) + .map(member -> member.asClassOrInterfaceDeclaration()) + .filter(type -> "KnowledgeBaseRetrievalClientService".equals(type.getNameAsString())) + .findFirst() + .orElseThrow(() -> new IllegalStateException("KnowledgeBaseRetrievalClientService not found.")); + int serviceUpdated = 0; + for (String name : Arrays.asList("retrieve", "retrieveSync")) { + for (MethodDeclaration method : service.getMethodsByName(name)) { + method.getParameters().removeIf(p -> "querySourceAuthorization".equals(p.getNameAsString())); + int index = -1; + for (int i = 0; i < method.getParameters().size(); i++) { + if ("requestOptions".equals(method.getParameter(i).getNameAsString())) { + index = i; + } + } + if (index < 0) { + throw new IllegalStateException("requestOptions parameter not found in " + name + "."); + } + method.getParameters() + .add(index, StaticJavaParser.parseParameter( + "@HeaderParam(\"x-ms-query-source-authorization\") String querySourceAuthorization")); + serviceUpdated++; + } + } + if (serviceUpdated != 2) { + throw new IllegalStateException( + "Expected to update 2 service retrieve methods but updated " + serviceUpdated + "."); + } + + for (boolean async : new boolean[] { true, false }) { + String name = async ? "retrieveWithResponseAsync" : "retrieveWithResponse"; + clazz.getMethodsByName(name) + .stream() + .filter(method -> method.getParameters().size() == 3) + .collect(java.util.stream.Collectors.toList()) + .forEach(MethodDeclaration::remove); + MethodDeclaration original = clazz.getMethodsByName(name) + .stream() + .filter(method -> method.getParameters().size() == 2 + && "BinaryData".equals(method.getParameter(0).getTypeAsString())) + .findFirst() + .orElseThrow(() -> new IllegalStateException(name + " not found.")); + + String returnType = original.getTypeAsString(); + String signature = "@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public " + returnType + + " " + name + "(BinaryData retrievalRequest, String querySourceAuthorization,\n" + + " RequestOptions requestOptions) {\n" + + " final String accept = \"application/json;odata.metadata=minimal\";\n" + + " final String contentType = \"application/json\";\n"; + String overloadSource; + String delegate; + if (async) { + overloadSource = signature + + " return FluxUtil.withContext(context -> service.retrieve(this.getEndpoint(),\n" + + " this.getServiceVersion().getVersion(), accept, this.getKnowledgeBaseName(), " + + "contentType,\n" + + " retrievalRequest, querySourceAuthorization, requestOptions, context));\n" + "}\n"; + delegate = "{\n return retrieveWithResponseAsync(retrievalRequest, null, requestOptions);\n}"; + } else { + overloadSource = signature + + " return service.retrieveSync(this.getEndpoint(), this.getServiceVersion().getVersion(),\n" + + " accept, this.getKnowledgeBaseName(), contentType, retrievalRequest,\n" + + " querySourceAuthorization, requestOptions, Context.NONE);\n" + "}\n"; + delegate = "{\n return retrieveWithResponse(retrievalRequest, null, requestOptions);\n}"; + } + MethodDeclaration overload + = StaticJavaParser.parseBodyDeclaration(overloadSource).asMethodDeclaration(); + overload.setJavadocComment("Retrieves relevant data from backing stores.\n\n" + + "@param retrievalRequest The retrieval request to process.\n" + + "@param querySourceAuthorization Token identifying the user for which the query is being " + + "executed. A header set explicitly on requestOptions takes precedence.\n" + + "@param requestOptions The options to configure the HTTP request.\n" + + "@return The retrieval response" + (async ? " as a Mono" : "") + "."); + original.setBody(StaticJavaParser.parseBlock(delegate)); + clazz.addMember(overload); + } + }); + } + + private static boolean isQuerySourceAuthorizationHeaderBlock(Statement statement) { + return statement.isIfStmt() + && "querySourceAuthorization != null".equals(statement.asIfStmt().getCondition().toString()) + && statement.toString().contains("x-ms-query-source-authorization"); + } + + private static String streamEventDocumentation() { + return "Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. " + + "Use a known subtype's {@code getValue()} to access its typed payload, for example " + + "{@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent" + + "#getValue()}. " + "Unrecognized events expose only their names through " + + "{@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; their payloads are not available.\n\n"; + } + + private static void addTypedListingMethod(ClassCustomization customization, String methodName, String itemType, + boolean hasKnowledgeSourceName) { + boolean async = customization.getClassName().endsWith("AsyncClient"); + String pagedType = async ? "PagedFlux" : "PagedIterable"; + String parameters + = hasKnowledgeSourceName ? "String name, RequestOptions requestOptions" : "RequestOptions requestOptions"; + String arguments = hasKnowledgeSourceName ? "name, requestOptions" : "requestOptions"; + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + String[] parameterTypes = hasKnowledgeSourceName + ? new String[] { "String", "RequestOptions" } + : new String[] { "RequestOptions" }; + clazz.getMethodsBySignature(methodName, parameterTypes).forEach(MethodDeclaration::remove); + MethodDeclaration method = StaticJavaParser + .parseMethodDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.COLLECTION)\npublic " + + pagedType + "<" + itemType + "> " + methodName + "(" + parameters + ") {\n" + + " return this.serviceClient." + methodName + (async ? "Async" : "") + "(" + arguments + ")\n" + + " .mapPage(binaryData -> binaryData.toObject(" + itemType + ".class));\n}"); + method.setJavadocComment("Lists matching resources as typed, lazily retrieved pages.\n\n" + + (hasKnowledgeSourceName ? "@param name The name of the knowledge source.\n" : "") + + "@param requestOptions The options to configure the HTTP request, including listing filters.\n" + + "@throws HttpResponseException if the service rejects the request.\n" + + "@return The matching resources as a paginated response with {@link " + pagedType + "}."); + clazz.addMember(method); + })); + } + private static String baseEventSource() { return header("com.azure.search.documents.knowledgebases.models") - + "import com.azure.core.annotation.Generated;\n\n" + "/**\n" - + " * Base type for events emitted by a streaming knowledge base retrieval.\n" + " */\n" - + "public abstract class KnowledgeBaseRetrievalStreamEvent {\n" + " @Generated\n" + + "import com.azure.core.annotation.Generated;\n" + + "import com.azure.search.documents.knowledgebases.implementation." + + "KnowledgeBaseRetrievalStreamEventConverter;\n" + "import java.util.List;\n\n" + "/**\n" + + " * Base for polymorphic events emitted by a streaming knowledge base retrieval.\n" + + " * Known events expose typed payloads through their subtype's {@code getValue()} method.\n" + + " * Unrecognized events expose only their names through\n" + + " * {@link #getEventName()}; their payloads are not available and they are not terminal.\n" + + " * Stream events are envelopes, not JSON payload models; serialize the typed payload instead.\n" + " *\n" + + " * @see KnowledgeBaseRetrievalStartedStreamEvent\n" + " * @see KnowledgeBaseActivityStartedStreamEvent\n" + + " * @see KnowledgeBaseActivityCompletedStreamEvent\n" + + " * @see KnowledgeBaseAnswerCompletedStreamEvent\n" + + " * @see KnowledgeBaseReferencesCompletedStreamEvent\n" + " * @see KnowledgeBaseErrorStreamEvent\n" + + " * @see KnowledgeBaseResponseCompletedStreamEvent\n" + " */\n" + + "public abstract class KnowledgeBaseRetrievalStreamEvent {\n" + " static {\n" + + " KnowledgeBaseRetrievalStreamEventConverter.setConstructorAccessor(\n" + + " new KnowledgeBaseRetrievalStreamEventConverter.ConstructorAccessor() {\n" + + " @Override\n" + + " public KnowledgeBaseRetrievalStreamEvent createEvent(String eventName) {\n" + + " return new KnowledgeBaseRetrievalStreamEvent(eventName) { };\n" + + " }\n\n" + " @Override\n" + + " public KnowledgeBaseRetrievalStartedStreamEvent createRetrievalStarted(\n" + + " KnowledgeBaseRetrievalStartedEvent value) {\n" + + " return new KnowledgeBaseRetrievalStartedStreamEvent(value);\n" + + " }\n\n" + " @Override\n" + + " public KnowledgeBaseActivityStartedStreamEvent createActivityStarted(\n" + + " KnowledgeBaseActivityStartedEvent value) {\n" + + " return new KnowledgeBaseActivityStartedStreamEvent(value);\n" + + " }\n\n" + " @Override\n" + + " public KnowledgeBaseActivityCompletedStreamEvent createActivityCompleted(\n" + + " KnowledgeBaseActivityRecord value) {\n" + + " return new KnowledgeBaseActivityCompletedStreamEvent(value);\n" + + " }\n\n" + " @Override\n" + + " public KnowledgeBaseAnswerCompletedStreamEvent createAnswerCompleted(\n" + + " KnowledgeBaseAnswerCompletedEvent value) {\n" + + " return new KnowledgeBaseAnswerCompletedStreamEvent(value);\n" + + " }\n\n" + " @Override\n" + + " public KnowledgeBaseReferencesCompletedStreamEvent createReferencesCompleted(\n" + + " List value) {\n" + + " return new KnowledgeBaseReferencesCompletedStreamEvent(value);\n" + + " }\n\n" + " @Override\n" + + " public KnowledgeBaseErrorStreamEvent createError(KnowledgeBaseStreamErrorEvent value) {\n" + + " return new KnowledgeBaseErrorStreamEvent(value);\n" + " }\n\n" + + " @Override\n" + + " public KnowledgeBaseResponseCompletedStreamEvent createResponseCompleted(\n" + + " KnowledgeBaseResponseCompletedEvent value) {\n" + + " return new KnowledgeBaseResponseCompletedStreamEvent(value);\n" + + " }\n" + " });\n" + " }\n\n" + " @Generated\n" + " private final String eventName;\n\n" + " /**\n" + " * Creates a stream event.\n" + " *\n" - + " * @param eventName The server-sent event name.\n" + " */\n" - + " @Generated\n" + " protected KnowledgeBaseRetrievalStreamEvent(String eventName) {\n" - + " this.eventName = eventName;\n" + " }\n\n" + " /**\n" - + " * Gets the server-sent event name.\n" + " *\n" + " * @return The event name.\n" - + " */\n" + " @Generated\n" + " public final String getEventName() {\n" - + " return eventName;\n" + " }\n\n" - + " /**\n" + " * Gets whether this event terminates the retrieval stream.\n" + " *\n" + + " * @param eventName The server-sent event name.\n" + " */\n" + " @Generated\n" + + " KnowledgeBaseRetrievalStreamEvent(String eventName) {\n" + " this.eventName = eventName;\n" + + " }\n\n" + " /**\n" + " * Gets the server-sent event name.\n" + " *\n" + + " * @return The event name.\n" + " */\n" + " @Generated\n" + + " public final String getEventName() {\n" + " return eventName;\n" + " }\n\n" + " /**\n" + + " * Gets whether this event terminates the retrieval stream.\n" + " *\n" + " * @return {@code true} if this is a terminal event; otherwise {@code false}.\n" + " */\n" + " @Generated\n" + " public boolean isTerminal() {\n" + " return false;\n" + " }\n" + "}\n"; } - private static String unknownEventSource() { - return header("com.azure.search.documents.knowledgebases.models") - + "import com.azure.core.annotation.Generated;\n" + "import com.azure.core.annotation.Immutable;\n\n" - + "/**\n" - + " * Represents a knowledge base retrieval stream event that is not recognized by this SDK version.\n" - + " */\n" + "@Immutable\n" + "public final class UnknownKnowledgeBaseRetrievalStreamEvent\n" - + " extends KnowledgeBaseRetrievalStreamEvent {\n" + " @Generated\n" - + " private final String data;\n\n" + " /**\n" - + " * Creates an unknown stream event.\n" + " *\n" - + " * @param eventName The server-sent event name.\n" - + " * @param data The raw server-sent event data.\n" + " */\n" - + " @Generated\n" + " public UnknownKnowledgeBaseRetrievalStreamEvent(String eventName, String data) {\n" - + " super(eventName);\n" + " this.data = data;\n" + " }\n\n" + " /**\n" - + " * Gets the raw server-sent event data.\n" + " *\n" + " * @return The raw event data.\n" - + " */\n" + " @Generated\n" + " public String getData() {\n" + " return data;\n" - + " }\n" + "}\n"; - } - - private static String wrapperSource(String className, String payloadType, String eventName, boolean terminal, boolean listPayload) { String valueType = listPayload ? "List<" + payloadType + ">" : payloadType; - String listImport = listPayload ? "import java.util.List;\n" : ""; - String toJson = listPayload - ? " return jsonWriter.writeArray(value, (writer, item) -> item.toJson(writer));\n" - : " return value.toJson(jsonWriter);\n"; - String fromJson = listPayload - ? " return new " + className + "(jsonReader.readArray(reader -> " + payloadType - + ".fromJson(reader)));\n" - : " return new " + className + "(" + payloadType + ".fromJson(jsonReader));\n"; + String listImports = listPayload ? "import java.util.List;\n" : ""; String terminalOverride = terminal ? "\n @Generated\n" + " @Override\n" + " public boolean isTerminal() {\n" + " return true;\n" + " }\n" @@ -611,25 +932,16 @@ private static String wrapperSource(String className, String payloadType, String return header("com.azure.search.documents.knowledgebases.models") + "import com.azure.core.annotation.Generated;\n" + "import com.azure.core.annotation.Immutable;\n" - + "import com.azure.json.JsonReader;\n" - + "import com.azure.json.JsonSerializable;\n" + "import com.azure.json.JsonWriter;\n\n" - + "import java.io.IOException;\n" + listImport + "\n" + "/**\n" + " * Represents the {@code " + eventName - + "} knowledge base retrieval stream event.\n" + " */\n" + "@Immutable\n" + "public final class " + className - + " extends KnowledgeBaseRetrievalStreamEvent\n" + " implements JsonSerializable<" + className + "> {\n" - + " @Generated\n" + " private final " + valueType + " value;\n\n" + " /**\n" - + " * Creates an event wrapper.\n" + " *\n" + " * @param value The event payload.\n" - + " */\n" + " @Generated\n" + " public " + className + "(" + + listImports + "\n" + "/**\n" + " * Represents the {@code " + eventName + + "} knowledge base retrieval stream event.\n" + " * Access the typed payload with {@link #getValue()}.\n" + + " *\n" + " * @see KnowledgeBaseRetrievalStreamEvent\n" + " */\n" + "@Immutable\n" + "public final class " + + className + " extends KnowledgeBaseRetrievalStreamEvent {\n" + " @Generated\n" + " private final " + + valueType + " value;\n\n" + " /**\n" + " * Creates an event wrapper.\n" + " *\n" + + " * @param value The event payload.\n" + " */\n" + " @Generated\n" + " " + className + "(" + valueType + " value) {\n" + " super(\"" + eventName + "\");\n" + " this.value = value;\n" - + " }\n\n" + " /**\n" - + " * Gets the event payload.\n" + " *\n" + " * @return The event payload.\n" + " */\n" - + " @Generated\n" + " public " + valueType + " getValue() {\n" + " return value;\n" - + " }\n\n" + terminalOverride + "\n" + " @Generated\n" + " @Override\n" - + " public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {\n" + toJson + " }\n\n" - + " /**\n" + " * Reads an event wrapper from JSON.\n" + " *\n" - + " * @param jsonReader The reader to read from.\n" + " * @return The parsed event wrapper.\n" - + " * @throws IOException If the event payload cannot be read.\n" + " */\n" + " @Generated\n" - + " public static " + className + " fromJson(JsonReader jsonReader) throws IOException {\n" + fromJson - + " }\n" + "}\n"; + + " }\n\n" + " /**\n" + " * Gets the event payload.\n" + " *\n" + + " * @return The event payload.\n" + " */\n" + " @Generated\n" + " public " + valueType + + " getValue() {\n" + " return value;\n" + " }\n" + terminalOverride + "}\n"; } @@ -749,6 +1061,179 @@ private static void repairAsyncSynonymMapsConvenienceMethod(ClassCustomization c StaticJavaParser.parseBlock("{ return getSynonymMaps(null, null, null, null); }"))))); } + // Adds operation parameters before RequestOptions callbacks without mutating the caller's options. + private static void addGetDocumentOptionsToImpl(ClassCustomization customization) { + customization.customizeAst(ast -> { + ast.addImport("com.azure.core.annotation.Generated"); + ast.addImport("com.azure.search.documents.models.GetDocumentOptions"); + ast.addImport("java.util.Objects"); + ast.addImport("java.util.stream.Collectors"); + com.github.javaparser.ast.body.ClassOrInterfaceDeclaration clazz + = ast.getClassByName(customization.getClassName()) + .orElseThrow(() -> new IllegalStateException("Class not found.")); + + com.github.javaparser.ast.body.ClassOrInterfaceDeclaration service = clazz.getMembers() + .stream() + .filter(member -> member.isClassOrInterfaceDeclaration()) + .map(member -> member.asClassOrInterfaceDeclaration()) + .filter(type -> "SearchClientService".equals(type.getNameAsString())) + .findFirst() + .orElseThrow(() -> new IllegalStateException("SearchClientService not found.")); + int serviceUpdated = 0; + for (String name : Arrays.asList("getDocument", "getDocumentSync")) { + for (MethodDeclaration method : service.getMethodsByName(name)) { + method.getParameters() + .removeIf(p -> "querySourceAuthorization".equals(p.getNameAsString()) + || "enableElevatedRead".equals(p.getNameAsString()) + || "selectedFields".equals(p.getNameAsString())); + int index = -1; + for (int i = 0; i < method.getParameters().size(); i++) { + if ("requestOptions".equals(method.getParameter(i).getNameAsString())) { + index = i; + } + } + if (index < 0) { + throw new IllegalStateException("requestOptions parameter not found in " + name + "."); + } + method.getParameters() + .add(index, StaticJavaParser.parseParameter("@QueryParam(\"$select\") String selectedFields")); + method.getParameters() + .add(index, StaticJavaParser + .parseParameter("@HeaderParam(\"x-ms-enable-elevated-read\") Boolean enableElevatedRead")); + method.getParameters() + .add(index, StaticJavaParser.parseParameter( + "@HeaderParam(\"x-ms-query-source-authorization\") String querySourceAuthorization")); + serviceUpdated++; + } + } + if (serviceUpdated != 2) { + throw new IllegalStateException( + "Expected to update 2 service getDocument methods but updated " + serviceUpdated + "."); + } + + for (boolean async : new boolean[] { true, false }) { + String name = async ? "getDocumentWithResponseAsync" : "getDocumentWithResponse"; + clazz.getMethodsByName(name) + .stream() + .filter(method -> method.getParameters().size() == 3) + .collect(java.util.stream.Collectors.toList()) + .forEach(MethodDeclaration::remove); + MethodDeclaration original = clazz.getMethodsByName(name) + .stream() + .filter(method -> method.getParameters().size() == 2 + && "String".equals(method.getParameter(0).getTypeAsString())) + .findFirst() + .orElseThrow(() -> new IllegalStateException(name + " not found.")); + + String returnType = original.getTypeAsString(); + String signature = "@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\n" + "public " + returnType + + " " + name + "(String key, GetDocumentOptions options, RequestOptions requestOptions) {\n" + + " final String accept = \"application/json;odata.metadata=none\";\n" + + " final String querySourceAuthorization = options == null ? null\n" + + " : options.getQuerySourceAuthorization();\n" + + " final Boolean enableElevatedRead = options == null ? null : options.isEnableElevatedRead();\n" + + " final String selectedFields = options == null || options.getSelectedFields() == null ? null\n" + + " : options.getSelectedFields()\n" + + " .stream()\n" + + " .map(paramItemValue -> Objects.toString(paramItemValue, \"\"))\n" + + " .collect(Collectors.joining(\",\"));\n" + + " final RequestOptions effectiveOptions = requestOptions == null ? new RequestOptions() : requestOptions;\n"; + String overloadSource; + String delegate; + if (async) { + overloadSource = signature + + " return FluxUtil.withContext(context -> service.getDocument(this.getEndpoint(),\n" + + " this.getServiceVersion().getVersion(), this.getIndexName(), accept, key,\n" + + " querySourceAuthorization, enableElevatedRead, selectedFields, effectiveOptions, context));\n" + + "}\n"; + delegate = "{\n return getDocumentWithResponseAsync(key, null, requestOptions);\n}"; + } else { + overloadSource = signature + + " return service.getDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(),\n" + + " this.getIndexName(), accept, key, querySourceAuthorization, enableElevatedRead,\n" + + " selectedFields, effectiveOptions, Context.NONE);\n" + "}\n"; + delegate = "{\n return getDocumentWithResponse(key, null, requestOptions);\n}"; + } + MethodDeclaration overload + = StaticJavaParser.parseBodyDeclaration(overloadSource).asMethodDeclaration(); + original.getJavadocComment().ifPresent(javadoc -> { + String content = removeLookupResponseBodySchema(javadoc.getContent()); + String updated = content.replaceFirst("(\\* @param key [^\\n]*\\n)", + "$1 * @param options The options for the lookup: query source authorization, elevated read " + + "and selected fields. May be null.\n"); + if (updated.equals(content)) { + throw new IllegalStateException("Could not locate key javadoc for " + name + "."); + } + overload.setJavadocComment(updated); + }); + original.setBody(StaticJavaParser.parseBlock(delegate)); + if (!original.getAnnotationByName("Generated").isPresent()) { + original.addMarkerAnnotation("Generated"); + } + clazz.addMember(overload); + } + }); + } + + // Avoid a two-argument options overload so getDocument(key, null) remains source compatible. + private static void addTypedGetDocumentWithOptions(ClassCustomization customization) { + boolean async = customization.getClassName().endsWith("AsyncClient"); + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + ast.addImport("com.azure.search.documents.models.GetDocumentOptions"); + clazz.getMethodsBySignature("getDocumentWithResponse", "String", "RequestOptions") + .forEach(MethodDeclaration::remove); + clazz.getMethodsBySignature("getDocumentWithResponse", "String", "GetDocumentOptions", "RequestOptions") + .forEach(MethodDeclaration::remove); + String returnType = async ? "Mono>" : "Response"; + MethodDeclaration legacy = clazz + .getMethodsBySignature("hiddenGeneratedGetDocumentWithResponse", "String", "RequestOptions") + .stream() + .findFirst() + .orElseThrow(() -> new IllegalStateException("Generated lookup response method not found.")) + .clone(); + legacy.setName("getDocumentWithResponse"); + legacy.setModifiers(Modifier.Keyword.PUBLIC); + legacy.setType(returnType); + legacy.setBody(StaticJavaParser.parseBlock(async + ? "{ return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, requestOptions), " + + "LookupDocument.class); }" + : "{ return convertResponse(this.serviceClient.getDocumentWithResponse(key, requestOptions), " + + "LookupDocument.class); }")); + legacy.getJavadocComment() + .ifPresent(javadoc -> legacy.setJavadocComment(removeLookupResponseBodySchema(javadoc.getContent()))); + clazz.addMember(legacy); + String body = async + ? " return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, options, requestOptions),\n" + + " LookupDocument.class);\n" + : " return convertResponse(this.serviceClient.getDocumentWithResponse(key, options, requestOptions),\n" + + " LookupDocument.class);\n"; + MethodDeclaration method = StaticJavaParser + .parseMethodDeclaration("@Generated\n@ServiceMethod(returns = ReturnType.SINGLE)\npublic " + returnType + + " getDocumentWithResponse(String key, GetDocumentOptions options,\n" + + " RequestOptions requestOptions) {\n" + body + "}"); + method.setJavadocComment("Retrieves a document from the index.\n\n" + + "@param key The key of the document to retrieve.\n" + + "@param options The options for the lookup: query source authorization, elevated read and selected " + + "fields. May be null.\n" + + "@param requestOptions The options to configure the HTTP request before HTTP client sends it. May be " + + "null. Its callbacks run after the operation options are applied, so a header set explicitly " + + "with setHeader overrides the corresponding header from {@code options}. Query parameters added " + + "through RequestOptions are appended to the request, not substituted.\n" + + "@throws HttpResponseException thrown if the request is rejected by server.\n" + + "@throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.\n" + + "@throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.\n" + + "@throws ResourceModifiedException thrown if the request is rejected by server on status code 409.\n" + + "@return a document retrieved via a document lookup operation along with {@link Response}" + + (async ? " on successful completion of {@link Mono}." : ".")); + clazz.addMember(method); + })); + } + + private static String removeLookupResponseBodySchema(String javadoc) { + return javadoc.replaceAll( + "(?s)\\n\\s*\\*

Response Body Schema

.*?(?=\\n\\s*\\* @param key)", "\n *"); + } + // Removes GET equivalents of POST APIs in SearchClient and SearchAsyncClient as we never plan to expose those. private static void removeGetApis(ClassCustomization customization) { List methodPrefixesToRemove = Arrays.asList("searchGet", "suggestGet", "autocompleteGet"); diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index aa8c718ae27d0..3a473b526bab0 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -61,7 +61,7 @@ com.azure azure-core - 1.61.0 + 1.60.0 com.azure @@ -71,7 +71,7 @@ com.azure azure-core-http-netty - 1.17.0 + 1.16.8 + 1.27.0-beta.19 test com.azure azure-identity - 1.19.0 + 1.18.7 test diff --git a/sdk/search/azure-search-documents/preview-feature-coverage.md b/sdk/search/azure-search-documents/preview-feature-coverage.md new file mode 100644 index 0000000000000..2bf8646aae33c --- /dev/null +++ b/sdk/search/azure-search-documents/preview-feature-coverage.md @@ -0,0 +1,142 @@ +# November preview / 26.12 deployment feature coverage + +The contract baseline is +[Azure/azure-rest-api-specs#47300](https://github.com/Azure/azure-rest-api-specs/pull/47300), +commit `b41ba04c0219f6622b7f5214fc020f90bad339ae`, matching `tsp-location.yaml`. +Deployment work items and one-pagers are feature inventories, not substitutes for the pinned wire contract. + +## Coverage matrix + +Existing tests are not evidence that all deployed features have passed live validation. +The offline checks exercise Java request/response handling with fake HTTP responses. +The new live checks are opt-in and have not yet been run against the corrected backend. + +| Feature | Existing coverage before this addition | Added service-behavior check in `PreviewFeatureLiveTests` | Remaining validation | +| --- | --- | --- | --- | +| GraphRAG Zero L1 / Topic Graph | `PreviewApiTests.topicGraphDiscriminatorsRoundTrip`; `FieldBuilderTests` covers `topicGraphProfile` | `topicGraphDiversifiesAndInterleavesWithPureVector`: diverse/balanced modes, single-topic pure-vector control, cross-topic results, mixed queries without duplicate IDs | Provision the controlled topic fixture; validate index/KS creation and server-side rejection of invalid mode-specific fields separately | +| EKG KS ingestion, ontology, cache and status | Basic cache round trip only; Fabric Ontology KS tests are a different feature | `graphIngestionReportsOntologyAndTriplesWithoutReturningCacheSecret`: completed extraction, ontology statistics, positive triple count, GET omits cache secret | Fresh ingestion, cache reuse/reprocessing, grounding correctness, ontology attach/update/detach and failure recovery still require provisioned blob/ontology/cache fixtures | +| EKG retrieval | `PreviewApiTests` covers graph request headers/options, response diagnostics and rejection body | `graphPlansAndExecutesAgainstExtractedEdges`; `graphKnowledgeBaseRetrievalUsesGraphSearchActivity` | Validate provenance hydration, authorization and additional graph-language cases with dedicated fixtures | +| Agentic Direct Search / KR models | `SearchUtilsTests` forwards agentic options; SSE tests deserialize agentic reasoning; Microsoft Retriever model round trip | `agenticSearchReturnsReasoningUsageAndDocuments`; `minimalAndMicrosoftRetrieverKnowledgeBasesRetrieve` | Backend deployment/routing must support both models; check timeout/budget termination and shared accounting separately | +| File KS LRO | Existing legacy upload/update tests require embedding fixtures; `PreviewApiTests` checks operation kind | `fileIngestionSupportsUploadReplacementAndRetainedOperationLookup`: sync upload, async replacement, same file ID, operation GET/list with page size 1, missing-operation 404 | Backend failure/retention scenarios require service-side fault/expiry fixtures; offline polling tests do not prove actual ingestion | +| Durable Operations framework | No separate customer-facing framework API | Covered through File KS operation lifecycle above | No SDK test for internal serverless teardown; framework durability/restart/expiry belongs to backend tests | +| OneLake indexed KS ACLs / OneLake security filtering | `FieldBuilderTests` maps `oneLakeParentFolders`; old OneLake citation deserialization is not ACL coverage | `oneLakePermissionsAllowOneIdentityAndExcludeAnother`: indexed OneLake source, permission schema, two valid identities, restricted sentinel included/excluded with elevated read disabled | Requires a real indexed OneLake fixture and fresh source-authorization tokens; inherited/moved-folder ACLs and revocation propagation remain backend scenarios | +| Random scoring | `PreviewApiTests` checks discriminator, omission of field/boost and classic-scoring compatibility | `randomScoringIsRepeatableForOneSeedAndRotatesForAnother`: identical seed ordering, changed signed 64-bit seed ordering, same document set | Seed validation/error boundaries are contract checks; statistical sampling quality belongs to backend tests | +| KB tools | MCP knowledge-source tests are not KB tool tests | `toolSelectionLimitsSourcesAndRequestDefaultsTakePrecedence`: persisted singular tool selection, source filter isolation, request overrides tool/KB limits, unknown-tool 400 | Multiple tools, invalid source membership, MCP catalog and schema discovery still need additional integration coverage | +| OpenAI-compatible / APIM models | No focused compatible-model test found in the previous test inventory | `compatibleKnowledgeBaseModelsRetrieveThroughBothProtocols`; `compatibleIngestionSkillsAndVectorizersProcessDocuments` | Provision chat and Responses gateways, KBs, embedding/vectorizer, skillset/indexer and ingested KS; APIM traces must verify exact downstream path/query/header behavior | +| GPT-6 via Responses | General extensible model-name handling is not proof of GPT-6 operation | `gpt6KnowledgeBaseProducesAResponse`: persisted GPT-6 model and nonempty retrieval evidence | Requires deployed GPT-6; confirm Responses selection in backend traces, not merely a successful model-name serialization | +| Query hint filter auto-configuration | `PreviewApiTests.automaticFilterHintsSerializeFacetConfiguration`; existing filter/boost retrieval tests do not exercise facet bootstrap | `automaticFilterHintsGroundRetrievalAndRejectExplicitValues`: stored auto-configuration, facet-backed retrieval restricted to a known category, explicit values + auto-configuration rejected | TTL refresh, max facet-count behavior, nonfacetable fields, permission/Purview restrictions and request-time override rejection remain additional cases | + +`PreviewFeatureContractTests` adds 23 offline wire cases alongside the existing tests. +`FileIngestionPollingTests` adds seven offline polling/operation cases. +Its fake responses establish SDK behavior only, not backend feature availability or ranking quality. + +## Contract details that affect the test design + +- The pinned public spelling is `topicGraph`, not the older graph-community naming. + `none`, `diverse` and `balanced` have different allowed fields. +- The 1,000 candidate-pool change is a server default/documentation change, not a new Java constant or a documented + maximum. Do not add a test that invents an upper bound of 1,000. +- The pinned Azure Blob graph settings use `azureBlobParameters.graphExtraction`. + Do not invent an `ingestionParameter.graphParameter` JSON field from the deployment title. +- A secret/write-only TypeSpec annotation describes the service's read/write contract. + The Java request model must still send a supplied cache connection string; deserializing synthetic request JSON + is not evidence of a service secret disclosure. The live GET check tests actual server omission. +- Query hint auto-configuration is present at this pin despite its private/public history. + It is stored KS configuration, not a supported request-time `queryHintOverrides` setting. +- `toolName` is singular. MCP knowledge-source tool configuration is a different API. +- `reasoningTokens` replaces the unreleased Direct Search `rankingTokens` name. +- GPT-6 family names at this pin include `gpt-6-astra`, `gpt-6-sol` and `gpt-6-luna`, not a literal `gpt-6`. + The live fixture checks one configured family member; it does not establish deployment of every model variant. +- LRO tests use the SDK's `SyncPoller` and `PollerFlux`, not a hand-written ingestion poller. + +## Running offline checks + +From the repository root, with a working JDK/Maven: + +```powershell +$env:AZURE_TEST_MODE = 'PLAYBACK' +mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test ` + '-Dtest=PreviewApiTests,PreviewFeatureContractTests,FileIngestionPollingTests,PreviewFeatureLiveTests,GetDocumentOptionsTests' +``` + +The live class must be skipped without live credentials, even if +`SEARCH_RUN_PREVIEW_FEATURE_TESTS=true` is set while test mode remains PLAYBACK. +Check the test reports; a skipped live test is not a passed feature check. + +### Local validation results + +- The broader selection (`PreviewApiTests`, `PreviewFeatureContractTests`, `FileIngestionPollingTests`, + `PreviewFeatureLiveTests`, `FieldBuilderTests`, `SearchUtilsTests`) produced 65 passes and 16 skips: + 14 live methods and two existing FieldBuilder skips. All 30 new offline cases passed. +- After the final assertion changes, `PreviewFeatureContractTests,PreviewFeatureLiveTests` produced + 23 passes and 14 live skips with PLAYBACK mode and the live opt-in flag explicitly enabled. +- Final Checkstyle, SpotBugs and scoped Spotless checks passed with zero violations/warnings. + Test sources compiled for both Java 8 and Java 21. +- On November 9, after the operator's backend routing update and completed bootstrap, the existing LIVE retrieval + suites passed: 99 passes, 14 existing skips and no failures/errors. +- The full package RECORD run and the final full PLAYBACK run each produced 1,157 passes, 132 skips and no + failures/errors. Final PLAYBACK used the default test configuration with all `SEARCH_*` environment variables + removed. Endpoint assertions account for recorded URL sanitization; the two strict pagination fixtures normalize + environment-specific blob-container names. Configured-secret scans, Checkstyle and SpotBugs passed. +- The 14 new opt-in feature methods remain unrun and are included in those 132 RECORD/PLAYBACK skips. + The other 118 skips exactly match the earlier DP11 recording run: 92 disabled cases and 26 existing live-only cases. + Skips are test-execution decisions, not failed HTTP recordings. +- Validated recordings were published as `java/search/azure-search-documents_6950366571`, and `assets.json` was + updated. Restoring that tag reproduced all 2,000 recording JSON files byte-for-byte against the validated manifest. + Package recording success does not close the feature-specific validation gaps in the matrix. + +## Running live checks safely + +Do not execute until the target service is explicitly reserved, the deployment/routing is verified, and the +operator approves the run. These tests create resources and can incur indexing/model costs. +Keep the recording/test host awake. Run this class alone, not alongside older suites whose cleanup deletes +all service knowledge sources/bases. + +```powershell +$env:AZURE_TEST_MODE = 'LIVE' +$env:SEARCH_RUN_PREVIEW_FEATURE_TESTS = 'true' +mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test '-Dtest=PreviewFeatureLiveTests' +``` + +The class uses `@LiveOnly`: it intentionally does not create new recording assets in RECORD mode. +Existing record/playback tests use a separate RECORD/PLAYBACK workflow; they do not execute this live-only class. + +Random scoring, minimal/Microsoft Retriever KBs, KB tools and query hints create fresh small indexes/sources/bases. +Only successfully created resources are tracked for cleanup; no list-all/delete-all cleanup is used. +The file test creates its own KS and files and requires the configured embedding deployment. +External fixtures below are read/queried, not updated or deleted. + +Missing fixture settings cause explicit assumption skips. Once settings are supplied, HTTP/model/assertion failures +are failures, not reasons to skip. A run with prerequisite skips is not complete deployment validation. + +### Shared prerequisites + +Use the existing `SEARCH_SERVICE_ENDPOINT`, Azure test credentials and model/identity settings from `SearchTestBase`. +File ingestion additionally requires `SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME`. +Query-hint planning requires a working `SEARCH_OPENAI_DEPLOYMENT_NAME` / `SEARCH_OPENAI_MODEL_NAME`, and the configured +user-assigned identity must have the required model access. + +### External fixture settings + +| Scenario | Required settings | Fixture contract | +| --- | --- | --- | +| Topic Graph | `SEARCH_PREVIEW_TOPIC_INDEX`, `SEARCH_PREVIEW_TOPIC_QUERY_JSON`, `SEARCH_PREVIEW_TOPIC_FIELD` | JSON is a vector query with `kind`, `vector`, `fields`, `k`; index has Topic Graph configured, retrievable `id` and scalar topic label. Top 10 pure-vector neighbors share one topic; diverse/balanced retrieval spans at least two. The vectors/data must deliberately exercise these contrasts. | +| Graph execution | `SEARCH_PREVIEW_GRAPH_INDEX`, `SEARCH_PREVIEW_GRAPH_GQL`, `SEARCH_PREVIEW_GRAPH_RESULT_FIELD`, `SEARCH_PREVIEW_GRAPH_RESULT_VALUE` | Extracted edge-list graph; GQL supports plan and execution and returns a known string sentinel in the named column. | +| Graph KB | `SEARCH_PREVIEW_GRAPH_KB`, `SEARCH_PREVIEW_GRAPH_KB_QUERY` | Graph-grounded KB with a deterministic question that retrieves evidence and produces `graphSearch` activity. | +| Graph ingestion/status | `SEARCH_PREVIEW_GRAPH_SOURCE` | Azure Blob KS with a named ontology and cache; completed synchronization has extracted triples. Do not place connection strings in this document. | +| Agentic search | `SEARCH_PREVIEW_AGENTIC_INDEX`, `SEARCH_PREVIEW_AGENTIC_QUERY` | Populated index and enabled agentic backend; known question exercises both planning and semantic reasoning. | +| OneLake ACLs | `SEARCH_PREVIEW_ONELAKE_INDEX`, `SEARCH_PREVIEW_ONELAKE_SOURCE`, `SEARCH_PREVIEW_ONELAKE_RESTRICTED_ID`, `SEARCH_PREVIEW_ONELAKE_ALLOWED_TOKEN`, `SEARCH_PREVIEW_ONELAKE_DENIED_TOKEN` | Index uses `id` as key and `oneLakeParentFolders`. The same indexed sentinel is visible to one valid source identity and invisible to another. Supply fresh tokens privately; never commit tokens or put them in screenshots/logs. | +| Compatible KBs | `SEARCH_PREVIEW_COMPATIBLE_CHAT_KB`, `SEARCH_PREVIEW_COMPATIBLE_RESPONSES_KB`, `SEARCH_PREVIEW_COMPATIBLE_QUERY` | Separate preconfigured KBs with `openAICompatible` models whose URI paths end in `/chat/completions` and `/responses`, respectively; known question retrieves evidence. | +| Compatible ingestion/vectorization | `SEARCH_PREVIEW_COMPATIBLE_SOURCE`, `SEARCH_PREVIEW_COMPATIBLE_INDEX`, `SEARCH_PREVIEW_COMPATIBLE_VECTOR_FIELD`, `SEARCH_PREVIEW_COMPATIBLE_SKILLSET`, `SEARCH_PREVIEW_COMPATIBLE_INDEXER` | Blob KS using compatible chat, successfully ingested documents, index with compatible query vectorizer, a URL-based ChatCompletionSkill, successful indexer output and searchable vectors. | +| GPT-6 | `SEARCH_PREVIEW_GPT6_KB`, `SEARCH_PREVIEW_GPT6_QUERY` | Preconfigured Azure OpenAI KB using `gpt-6-astra`, `gpt-6-sol` or `gpt-6-luna`, with known question and supporting documents; routing/deployment must support Responses. | + +## Release gate + +Before claiming all features are tested, record per-feature results, prerequisite skips and backend failures. +Collect request/activity/APIM IDs for failures. Verify routes and actual backend behavior before updating recording +assets; fake-response tests, pre-existing CRUD tests and successful compilation are not substitutes. + +Testing approach follows the +[Java SDK testing guidance](https://azure.github.io/azure-sdk/java_implementation.html#java-testing) +and the repository's [unit testing](https://github.com/Azure/azure-sdk-for-java/blob/main/docs/contributor/unit-testing.md) +and [live testing](https://github.com/Azure/azure-sdk-for-java/blob/main/docs/contributor/live-testing.md) documentation. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java index 61764b818f4ac..50dc273703752 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java @@ -27,6 +27,7 @@ import com.azure.search.documents.implementation.models.SuggestPostRequest; import com.azure.search.documents.models.AutocompleteOptions; import com.azure.search.documents.models.AutocompleteResult; +import com.azure.search.documents.models.GetDocumentOptions; import com.azure.search.documents.models.GraphOptions; import com.azure.search.documents.models.GraphQueryResult; import com.azure.search.documents.models.IndexBatchException; @@ -969,6 +970,7 @@ public Mono> getDocumentCountWithResponse(RequestOptions requestO * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion * of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDocumentWithResponse(String key, RequestOptions requestOptions) { return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, requestOptions), LookupDocument.class); @@ -1285,4 +1287,29 @@ public Mono> graphWithResponse(GraphOptions options, .mapResponse(hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options)), SearchUtils.addGraphHeaders(requestOptions, options)), GraphQueryResult.class); } + + /** + * Retrieves a document from the index. + * + * @param key The key of the document to retrieve. + * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be + * null. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. May be null. Its + * callbacks run after the operation options are applied, so a header set explicitly with setHeader overrides the + * corresponding header from {@code options}. Query parameters added through RequestOptions are appended to the + * request, not substituted. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDocumentWithResponse(String key, GetDocumentOptions options, + RequestOptions requestOptions) { + return mapResponse(this.serviceClient.getDocumentWithResponseAsync(key, options, requestOptions), + LookupDocument.class); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java index 98559c4501e56..5e05719ce86df 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java @@ -27,6 +27,7 @@ import com.azure.search.documents.implementation.models.SuggestPostRequest; import com.azure.search.documents.models.AutocompleteOptions; import com.azure.search.documents.models.AutocompleteResult; +import com.azure.search.documents.models.GetDocumentOptions; import com.azure.search.documents.models.GraphOptions; import com.azure.search.documents.models.GraphQueryResult; import com.azure.search.documents.models.IndexBatchException; @@ -965,6 +966,7 @@ public Response getDocumentCountWithResponse(RequestOptions requestOptions * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a document retrieved via a document lookup operation along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getDocumentWithResponse(String key, RequestOptions requestOptions) { return convertResponse(this.serviceClient.getDocumentWithResponse(key, requestOptions), LookupDocument.class); @@ -1277,4 +1279,28 @@ public Response graphWithResponse(GraphOptions options, Reques SearchUtils.addGraphHeaders(requestOptions, options)), GraphQueryResult.class); } + + /** + * Retrieves a document from the index. + * + * @param key The key of the document to retrieve. + * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be + * null. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. May be null. Its + * callbacks run after the operation options are applied, so a header set explicitly with setHeader overrides the + * corresponding header from {@code options}. Query parameters added through RequestOptions are appended to the + * request, not substituted. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a document retrieved via a document lookup operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDocumentWithResponse(String key, GetDocumentOptions options, + RequestOptions requestOptions) { + return convertResponse(this.serviceClient.getDocumentWithResponse(key, options, requestOptions), + LookupDocument.class); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java index c57469f2ff25d..8816d8ebd1cb3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.search.documents.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; @@ -39,6 +39,7 @@ * Initializes a new instance of the KnowledgeBaseRetrievalClient type. */ public final class KnowledgeBaseRetrievalClientImpl { + /** * The proxy service used to perform REST calls. */ @@ -51,7 +52,7 @@ public final class KnowledgeBaseRetrievalClientImpl { /** * Gets The endpoint URL of the search service. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -65,7 +66,7 @@ public String getEndpoint() { /** * Gets The name of the knowledge base. - * + * * @return the knowledgeBaseName value. */ public String getKnowledgeBaseName() { @@ -79,7 +80,7 @@ public String getKnowledgeBaseName() { /** * Gets Service version. - * + * * @return the serviceVersion value. */ public SearchServiceVersion getServiceVersion() { @@ -93,7 +94,7 @@ public SearchServiceVersion getServiceVersion() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -107,7 +108,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -116,7 +117,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of KnowledgeBaseRetrievalClient client. - * + * * @param endpoint The endpoint URL of the search service. * @param knowledgeBaseName The name of the knowledge base. * @param serviceVersion Service version. @@ -129,7 +130,7 @@ public KnowledgeBaseRetrievalClientImpl(String endpoint, String knowledgeBaseNam /** * Initializes an instance of KnowledgeBaseRetrievalClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint URL of the search service. * @param knowledgeBaseName The name of the knowledge base. @@ -143,7 +144,7 @@ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, String endpoi /** * Initializes an instance of KnowledgeBaseRetrievalClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint URL of the search service. @@ -168,6 +169,7 @@ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, SerializerAda @Host("{endpoint}") @ServiceInterface(name = "KnowledgeBaseRetrievalClient") public interface KnowledgeBaseRetrievalClientService { + @Post("/knowledgebases('{knowledgeBaseName}')/retrieve") @ExpectedResponses({ 200, 206 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -177,7 +179,9 @@ public interface KnowledgeBaseRetrievalClientService { Mono> retrieve(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @PathParam("knowledgeBaseName") String knowledgeBaseName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData retrievalRequest, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData retrievalRequest, + @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, + RequestOptions requestOptions, Context context); @Post("/knowledgebases('{knowledgeBaseName}')/retrieve") @ExpectedResponses({ 200, 206 }) @@ -188,7 +192,9 @@ Mono> retrieve(@HostParam("endpoint") String endpoint, Response retrieveSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @PathParam("knowledgeBaseName") String knowledgeBaseName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData retrievalRequest, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData retrievalRequest, + @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, + RequestOptions requestOptions, Context context); @Post("/knowledgebases('{knowledgeBaseName}')/retrieve") @ExpectedResponses({ 200 }) @@ -227,7 +233,7 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint, * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -274,9 +280,9 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint,
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -338,7 +344,7 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint,
      * }
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -351,11 +357,7 @@ Response retrieveStreamSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> retrieveWithResponseAsync(BinaryData retrievalRequest, RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.retrieve(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - this.getKnowledgeBaseName(), contentType, retrievalRequest, requestOptions, context)); + return retrieveWithResponseAsync(retrievalRequest, null, requestOptions); } /** @@ -372,7 +374,7 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -419,9 +421,9 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -483,7 +485,7 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval
      * }
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -494,16 +496,13 @@ public Mono> retrieveWithResponseAsync(BinaryData retrieval */ @ServiceMethod(returns = ReturnType.SINGLE) public Response retrieveWithResponse(BinaryData retrievalRequest, RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=minimal"; - final String contentType = "application/json"; - return service.retrieveSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - this.getKnowledgeBaseName(), contentType, retrievalRequest, requestOptions, Context.NONE); + return retrieveWithResponse(retrievalRequest, null, requestOptions); } /** * Retrieves relevant data from backing stores and streams progress and results as server-sent * events. - * + * * Process the response incrementally using server-sent event framing. Each event contains an * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated @@ -521,7 +520,7 @@ public Response retrieveWithResponse(BinaryData retrievalRequest, Re * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -568,15 +567,15 @@ public Response retrieveWithResponse(BinaryData retrievalRequest, Re
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * BinaryData
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -598,7 +597,7 @@ public Mono> retrieveStreamWithResponseAsync(BinaryData ret /** * Retrieves relevant data from backing stores and streams progress and results as server-sent * events. - * + * * Process the response incrementally using server-sent event framing. Each event contains an * event name and a JSON-encoded data payload. The stream ends with either a `response.completed` * event or an `error` event. OpenAPI 2.0 represents the response body as a string, so generated @@ -616,7 +615,7 @@ public Mono> retrieveStreamWithResponseAsync(BinaryData ret * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -663,15 +662,15 @@ public Mono> retrieveStreamWithResponseAsync(BinaryData ret
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * BinaryData
      * }
      * 
- * + * * @param retrievalRequest The retrieval request to process. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -687,4 +686,44 @@ public Response retrieveStreamWithResponse(BinaryData retrievalReque return service.retrieveStreamSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, this.getKnowledgeBaseName(), contentType, retrievalRequest, requestOptions, Context.NONE); } + + /** + * Retrieves relevant data from backing stores. + * + * @param retrievalRequest The retrieval request to process. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. A header set + * explicitly on requestOptions takes precedence. + * @param requestOptions The options to configure the HTTP request. + * @return The retrieval response as a Mono. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> retrieveWithResponseAsync(BinaryData retrievalRequest, + String querySourceAuthorization, RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + final String contentType = "application/json"; + return FluxUtil.withContext(context -> service.retrieve(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, this.getKnowledgeBaseName(), contentType, retrievalRequest, + querySourceAuthorization, requestOptions, context)); + } + + /** + * Retrieves relevant data from backing stores. + * + * @param retrievalRequest The retrieval request to process. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. A header set + * explicitly on requestOptions takes precedence. + * @param requestOptions The options to configure the HTTP request. + * @return The retrieval response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retrieveWithResponse(BinaryData retrievalRequest, String querySourceAuthorization, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=minimal"; + final String contentType = "application/json"; + return service.retrieveSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + this.getKnowledgeBaseName(), contentType, retrievalRequest, querySourceAuthorization, requestOptions, + Context.NONE); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java index 0cfa80874168b..670efd5812a93 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchClientImpl.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.search.documents.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; @@ -34,12 +34,16 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.models.GetDocumentOptions; +import java.util.Objects; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** * Initializes a new instance of the SearchClient type. */ public final class SearchClientImpl { + /** * The proxy service used to perform REST calls. */ @@ -52,7 +56,7 @@ public final class SearchClientImpl { /** * Gets The endpoint URL of the search service. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -66,7 +70,7 @@ public String getEndpoint() { /** * Gets The name of the index. - * + * * @return the indexName value. */ public String getIndexName() { @@ -80,7 +84,7 @@ public String getIndexName() { /** * Gets Service version. - * + * * @return the serviceVersion value. */ public SearchServiceVersion getServiceVersion() { @@ -94,7 +98,7 @@ public SearchServiceVersion getServiceVersion() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -108,7 +112,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -117,7 +121,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SearchClient client. - * + * * @param endpoint The endpoint URL of the search service. * @param indexName The name of the index. * @param serviceVersion Service version. @@ -129,7 +133,7 @@ public SearchClientImpl(String endpoint, String indexName, SearchServiceVersion /** * Initializes an instance of SearchClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint URL of the search service. * @param indexName The name of the index. @@ -142,7 +146,7 @@ public SearchClientImpl(HttpPipeline httpPipeline, String endpoint, String index /** * Initializes an instance of SearchClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint URL of the search service. @@ -165,6 +169,7 @@ public SearchClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerA @Host("{endpoint}") @ServiceInterface(name = "SearchClient") public interface SearchClientService { + @Post("/indexes('{indexName}')/docs/search.graph") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -259,8 +264,10 @@ Response searchSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDocument(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("indexName") String indexName, - @HeaderParam("Accept") String accept, @PathParam("key") String key, RequestOptions requestOptions, - Context context); + @HeaderParam("Accept") String accept, @PathParam("key") String key, + @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, + @HeaderParam("x-ms-enable-elevated-read") Boolean enableElevatedRead, + @QueryParam("$select") String selectedFields, RequestOptions requestOptions, Context context); @Get("/indexes('{indexName}')/docs('{key}')") @ExpectedResponses({ 200 }) @@ -270,8 +277,10 @@ Mono> getDocument(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDocumentSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("indexName") String indexName, - @HeaderParam("Accept") String accept, @PathParam("key") String key, RequestOptions requestOptions, - Context context); + @HeaderParam("Accept") String accept, @PathParam("key") String key, + @HeaderParam("x-ms-query-source-authorization") String querySourceAuthorization, + @HeaderParam("x-ms-enable-elevated-read") Boolean enableElevatedRead, + @QueryParam("$select") String selectedFields, RequestOptions requestOptions, Context context); @Get("/indexes('{indexName}')/docs/search.suggest") @ExpectedResponses({ 200 }) @@ -401,7 +410,7 @@ Response autocompleteSync(@HostParam("endpoint") String endpoint, * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -442,9 +451,9 @@ Response autocompleteSync(@HostParam("endpoint") String endpoint,
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -514,7 +523,7 @@ Response autocompleteSync(@HostParam("endpoint") String endpoint,
      * }
      * }
      * 
- * + * * @param graphRequest The graphRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -545,7 +554,7 @@ public Mono> graphWithResponseAsync(BinaryData graphRequest * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -586,9 +595,9 @@ public Mono> graphWithResponseAsync(BinaryData graphRequest
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -658,7 +667,7 @@ public Mono> graphWithResponseAsync(BinaryData graphRequest
      * }
      * }
      * 
- * + * * @param graphRequest The graphRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -678,13 +687,13 @@ public Response graphWithResponse(BinaryData graphRequest, RequestOp /** * Queries the number of documents in the index. *

Response Body Schema

- * + * *
      * {@code
      * long
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -702,13 +711,13 @@ public Mono> getDocumentCountWithResponseAsync(RequestOptio /** * Queries the number of documents in the index. *

Response Body Schema

- * + * *
      * {@code
      * long
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -852,7 +861,7 @@ public Response getDocumentCountWithResponse(RequestOptions requestO * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1066,7 +1075,7 @@ public Response getDocumentCountWithResponse(RequestOptions requestO
      * }
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1211,7 +1220,7 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1425,7 +1434,7 @@ public Mono> searchGetWithResponseAsync(RequestOptions requ
      * }
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1453,7 +1462,7 @@ public Response searchGetWithResponse(RequestOptions requestOptions) * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1531,9 +1540,9 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -1747,7 +1756,7 @@ public Response searchGetWithResponse(RequestOptions requestOptions)
      * }
      * }
      * 
- * + * * @param searchPostRequest The searchPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1779,7 +1788,7 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -1857,9 +1866,9 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2073,7 +2082,7 @@ public Mono> searchWithResponseAsync(BinaryData searchPostR
      * }
      * }
      * 
- * + * * @param searchPostRequest The searchPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2122,7 +2131,7 @@ public Response searchWithResponse(BinaryData searchPostRequest, Req * } * } *
- * + * * @param key The key of the document to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2133,10 +2142,9 @@ public Response searchWithResponse(BinaryData searchPostRequest, Req * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) + @Generated public Mono> getDocumentWithResponseAsync(String key, RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=none"; - return FluxUtil.withContext(context -> service.getDocument(this.getEndpoint(), - this.getServiceVersion().getVersion(), this.getIndexName(), accept, key, requestOptions, context)); + return getDocumentWithResponseAsync(key, null, requestOptions); } /** @@ -2171,7 +2179,7 @@ public Mono> getDocumentWithResponseAsync(String key, Reque * } * } *
- * + * * @param key The key of the document to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2181,10 +2189,9 @@ public Mono> getDocumentWithResponseAsync(String key, Reque * @return a document retrieved via a document lookup operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) + @Generated public Response getDocumentWithResponse(String key, RequestOptions requestOptions) { - final String accept = "application/json;odata.metadata=none"; - return service.getDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), - accept, key, requestOptions, Context.NONE); + return getDocumentWithResponse(key, null, requestOptions); } /** @@ -2223,7 +2230,7 @@ public Response getDocumentWithResponse(String key, RequestOptions r * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2239,7 +2246,7 @@ public Response getDocumentWithResponse(String key, RequestOptions r
      * }
      * }
      * 
- * + * * @param searchText The search text to use to suggest documents. Must be at least 1 character, and no more than 100 * characters. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index @@ -2297,7 +2304,7 @@ public Mono> suggestGetWithResponseAsync(String searchText, * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2313,7 +2320,7 @@ public Mono> suggestGetWithResponseAsync(String searchText,
      * }
      * }
      * 
- * + * * @param searchText The search text to use to suggest documents. Must be at least 1 character, and no more than 100 * characters. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index @@ -2336,7 +2343,7 @@ public Response suggestGetWithResponse(String searchText, String sug /** * Suggests documents in the index that match the given partial query text. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2360,9 +2367,9 @@ public Response suggestGetWithResponse(String searchText, String sug
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2378,7 +2385,7 @@ public Response suggestGetWithResponse(String searchText, String sug
      * }
      * }
      * 
- * + * * @param suggestPostRequest The suggestPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2401,7 +2408,7 @@ public Mono> suggestWithResponseAsync(BinaryData suggestPos /** * Suggests documents in the index that match the given partial query text. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2425,9 +2432,9 @@ public Mono> suggestWithResponseAsync(BinaryData suggestPos
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2443,7 +2450,7 @@ public Mono> suggestWithResponseAsync(BinaryData suggestPos
      * }
      * }
      * 
- * + * * @param suggestPostRequest The suggestPostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2463,7 +2470,7 @@ public Response suggestWithResponse(BinaryData suggestPostRequest, R /** * Sends a batch of document write actions to the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2478,9 +2485,9 @@ public Response suggestWithResponse(BinaryData suggestPostRequest, R
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2495,7 +2502,7 @@ public Response suggestWithResponse(BinaryData suggestPostRequest, R
      * }
      * }
      * 
- * + * * @param batch The batch of index actions. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2516,7 +2523,7 @@ public Mono> indexWithResponseAsync(BinaryData batch, Reque /** * Sends a batch of document write actions to the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2531,9 +2538,9 @@ public Mono> indexWithResponseAsync(BinaryData batch, Reque
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2548,7 +2555,7 @@ public Mono> indexWithResponseAsync(BinaryData batch, Reque
      * }
      * }
      * 
- * + * * @param batch The batch of index actions. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2597,7 +2604,7 @@ public Response indexWithResponse(BinaryData batch, RequestOptions r * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2611,7 +2618,7 @@ public Response indexWithResponse(BinaryData batch, RequestOptions r
      * }
      * }
      * 
- * + * * @param searchText The incomplete term which should be auto-completed. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index * definition. @@ -2662,7 +2669,7 @@ public Mono> autocompleteGetWithResponseAsync(String search * * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2676,7 +2683,7 @@ public Mono> autocompleteGetWithResponseAsync(String search
      * }
      * }
      * 
- * + * * @param searchText The incomplete term which should be auto-completed. * @param suggesterName The name of the suggester as specified in the suggesters collection that's part of the index * definition. @@ -2698,7 +2705,7 @@ public Response autocompleteGetWithResponse(String searchText, Strin /** * Autocompletes incomplete query terms based on input text and matching terms in the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2717,9 +2724,9 @@ public Response autocompleteGetWithResponse(String searchText, Strin
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2733,7 +2740,7 @@ public Response autocompleteGetWithResponse(String searchText, Strin
      * }
      * }
      * 
- * + * * @param autocompletePostRequest The autocompletePostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2755,7 +2762,7 @@ public Mono> autocompleteWithResponseAsync(BinaryData autoc /** * Autocompletes incomplete query terms based on input text and matching terms in the index. *

Request Body Schema

- * + * *
      * {@code
      * {
@@ -2774,9 +2781,9 @@ public Mono> autocompleteWithResponseAsync(BinaryData autoc
      * }
      * }
      * 
- * + * *

Response Body Schema

- * + * *
      * {@code
      * {
@@ -2790,7 +2797,7 @@ public Mono> autocompleteWithResponseAsync(BinaryData autoc
      * }
      * }
      * 
- * + * * @param autocompletePostRequest The autocompletePostRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2807,4 +2814,106 @@ public Response autocompleteWithResponse(BinaryData autocompletePost return service.autocompleteSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), accept, contentType, autocompletePostRequest, requestOptions, Context.NONE); } + + /** + * Retrieves a document from the index. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
$selectList<String>NoList of field names to retrieve for the document; + * Any field not retrieved will be missing from the returned document. In the form of "," separated + * string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which + * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that + * bypass document level permission checks for the query operation.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param key The key of the document to retrieve. + * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be + * null. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDocumentWithResponseAsync(String key, GetDocumentOptions options, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=none"; + final String querySourceAuthorization = options == null ? null : options.getQuerySourceAuthorization(); + final Boolean enableElevatedRead = options == null ? null : options.isEnableElevatedRead(); + final String selectedFields = options == null || options.getSelectedFields() == null + ? null + : options.getSelectedFields() + .stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + final RequestOptions effectiveOptions = requestOptions == null ? new RequestOptions() : requestOptions; + return FluxUtil.withContext(context -> service.getDocument(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getIndexName(), accept, key, querySourceAuthorization, + enableElevatedRead, selectedFields, effectiveOptions, context)); + } + + /** + * Retrieves a document from the index. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
$selectList<String>NoList of field names to retrieve for the document; + * Any field not retrieved will be missing from the returned document. In the form of "," separated + * string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-query-source-authorizationStringNoToken identifying the user for which + * the query is being executed. This token is used to enforce security restrictions on documents.
x-ms-enable-elevated-readBooleanNoA value that enables elevated read that + * bypass document level permission checks for the query operation.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param key The key of the document to retrieve. + * @param options The options for the lookup: query source authorization, elevated read and selected fields. May be + * null. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a document retrieved via a document lookup operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDocumentWithResponse(String key, GetDocumentOptions options, + RequestOptions requestOptions) { + final String accept = "application/json;odata.metadata=none"; + final String querySourceAuthorization = options == null ? null : options.getQuerySourceAuthorization(); + final Boolean enableElevatedRead = options == null ? null : options.isEnableElevatedRead(); + final String selectedFields = options == null || options.getSelectedFields() == null + ? null + : options.getSelectedFields() + .stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + final RequestOptions effectiveOptions = requestOptions == null ? new RequestOptions() : requestOptions; + return service.getDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getIndexName(), + accept, key, querySourceAuthorization, enableElevatedRead, selectedFields, effectiveOptions, Context.NONE); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java index b49f17a46290f..183969a8d3d5e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java @@ -65,6 +65,40 @@ @ServiceClient(builder = SearchIndexClientBuilder.class, isAsync = true) public final class SearchIndexAsyncClient { + /** + * Lists matching synonym maps, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching synonym maps as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSynonymMaps(RequestOptions requestOptions) { + return serviceClient.listSynonymMapsAsync(requestOptions).mapPage(value -> value.toObject(SynonymMap.class)); + } + + /** + * Lists matching indexes with selected properties, following service-provided continuation links. + * + * @param select The top-level properties to retrieve, or {@code null} to use the service default. + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching indexes as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listIndexesWithSelectedProperties(List select, + RequestOptions requestOptions) { + if (requestOptions == null) { + requestOptions = new RequestOptions(); + } + if (select != null) { + requestOptions.addQueryParam("$select", + select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(",")), false); + } + return serviceClient.listIndexesWithSelectedPropertiesAsync(requestOptions) + .mapPage(value -> value.toObject(SearchIndexResponse.class)); + } + @Generated private final SearchIndexClientImpl serviceClient; @@ -5273,7 +5307,7 @@ PagedFlux hiddenGeneratedListKnowledgeSourceFiles(String name, Reque */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteKnowledgeSourceFileWithResponse(String fileId, String name, + public Mono> deleteKnowledgeSourceFileWithResponse(String name, String fileId, RequestOptions requestOptions) { return this.serviceClient.deleteKnowledgeSourceFileWithResponseAsync(name, fileId, requestOptions); } @@ -5332,10 +5366,10 @@ public PagedFlux listKnowledgeSourceFiles(String name) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteKnowledgeSourceFile(String fileId, String name) { + public Mono deleteKnowledgeSourceFile(String name, String fileId) { // Generated convenience method for deleteKnowledgeSourceFileWithResponse RequestOptions requestOptions = new RequestOptions(); - return deleteKnowledgeSourceFileWithResponse(fileId, name, requestOptions).flatMap(FluxUtil::toMono); + return deleteKnowledgeSourceFileWithResponse(name, fileId, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -5484,7 +5518,7 @@ public PagedFlux listKnowledgeSourceFiles(String name, Stri */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateKnowledgeSourceFile(String fileId, String name, + public Mono updateKnowledgeSourceFile(String name, String fileId, UpdateKnowledgeSourceFileRequest body) { // Generated convenience method for updateKnowledgeSourceFileWithResponseInternal RequestOptions requestOptions = new RequestOptions(); @@ -6177,4 +6211,33 @@ public PagedFlux listKnowledgeSourceFileI pagedResponse.getContinuationToken(), null)); }); } + + /** + * Lists matching resources as typed, lazily retrieved pages. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return The matching resources as a paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listIndexStatsSummary(RequestOptions requestOptions) { + return this.serviceClient.listIndexStatsSummaryAsync(requestOptions) + .mapPage(binaryData -> binaryData.toObject(IndexStatisticsSummary.class)); + } + + /** + * Lists matching resources as typed, lazily retrieved pages. + * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return The matching resources as a paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listKnowledgeSourceFiles(String name, RequestOptions requestOptions) { + return this.serviceClient.listKnowledgeSourceFilesAsync(name, requestOptions) + .mapPage(binaryData -> binaryData.toObject(KnowledgeSourceFile.class)); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java index 4b0b23cd018ab..ba2edd28f2163 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java @@ -60,6 +60,40 @@ @ServiceClient(builder = SearchIndexClientBuilder.class) public final class SearchIndexClient { + /** + * Lists matching synonym maps, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching synonym maps as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSynonymMaps(RequestOptions requestOptions) { + return serviceClient.listSynonymMaps(requestOptions).mapPage(value -> value.toObject(SynonymMap.class)); + } + + /** + * Lists matching indexes with selected properties, following service-provided continuation links. + * + * @param select The top-level properties to retrieve, or {@code null} to use the service default. + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching indexes as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listIndexesWithSelectedProperties(List select, + RequestOptions requestOptions) { + if (requestOptions == null) { + requestOptions = new RequestOptions(); + } + if (select != null) { + requestOptions.addQueryParam("$select", + select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(",")), false); + } + return serviceClient.listIndexesWithSelectedProperties(requestOptions) + .mapPage(value -> value.toObject(SearchIndexResponse.class)); + } + @Generated private final SearchIndexClientImpl serviceClient; @@ -5072,7 +5106,7 @@ PagedIterable hiddenGeneratedListKnowledgeSourceFiles(String name, R */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteKnowledgeSourceFileWithResponse(String fileId, String name, + public Response deleteKnowledgeSourceFileWithResponse(String name, String fileId, RequestOptions requestOptions) { return this.serviceClient.deleteKnowledgeSourceFileWithResponse(name, fileId, requestOptions); } @@ -5111,10 +5145,10 @@ public PagedIterable listKnowledgeSourceFiles(String name) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteKnowledgeSourceFile(String fileId, String name) { + public void deleteKnowledgeSourceFile(String name, String fileId) { // Generated convenience method for deleteKnowledgeSourceFileWithResponse RequestOptions requestOptions = new RequestOptions(); - deleteKnowledgeSourceFileWithResponse(fileId, name, requestOptions).getValue(); + deleteKnowledgeSourceFileWithResponse(name, fileId, requestOptions).getValue(); } /** @@ -5204,7 +5238,7 @@ public PagedIterable listKnowledgeSourceFiles(String name, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public KnowledgeSourceFile updateKnowledgeSourceFile(String fileId, String name, + public KnowledgeSourceFile updateKnowledgeSourceFile(String name, String fileId, UpdateKnowledgeSourceFileRequest body) { // Generated convenience method for updateKnowledgeSourceFileWithResponseInternal RequestOptions requestOptions = new RequestOptions(); @@ -5848,4 +5882,33 @@ PagedIterable getSynonymMaps(List select, String search, Int } return serviceClient.listSynonymMaps(requestOptions).mapPage(value -> value.toObject(SynonymMap.class)); } + + /** + * Lists matching resources as typed, lazily retrieved pages. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return The matching resources as a paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listIndexStatsSummary(RequestOptions requestOptions) { + return this.serviceClient.listIndexStatsSummary(requestOptions) + .mapPage(binaryData -> binaryData.toObject(IndexStatisticsSummary.class)); + } + + /** + * Lists matching resources as typed, lazily retrieved pages. + * + * @param name The name of the knowledge source. + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return The matching resources as a paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listKnowledgeSourceFiles(String name, RequestOptions requestOptions) { + return this.serviceClient.listKnowledgeSourceFiles(name, requestOptions) + .mapPage(binaryData -> binaryData.toObject(KnowledgeSourceFile.class)); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java index 34dc920e485e3..7bb7ba796ad69 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java @@ -39,6 +39,44 @@ @ServiceClient(builder = SearchIndexerClientBuilder.class, isAsync = true) public final class SearchIndexerAsyncClient { + /** + * Lists matching data source connections, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching data source connections as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDataSourceConnections(RequestOptions requestOptions) { + return serviceClient.listDataSourceConnectionsAsync(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerDataSourceConnection.class)); + } + + /** + * Lists matching indexers, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching indexers as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listIndexers(RequestOptions requestOptions) { + return serviceClient.listIndexersAsync(requestOptions).mapPage(value -> value.toObject(SearchIndexer.class)); + } + + /** + * Lists matching skillsets, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching skillsets as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkillsets(RequestOptions requestOptions) { + return serviceClient.listSkillsetsAsync(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerSkillset.class)); + } + @Generated private final SearchIndexerClientImpl serviceClient; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java index 9d37df8a64ebc..2e476a4772aa3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java @@ -37,6 +37,44 @@ @ServiceClient(builder = SearchIndexerClientBuilder.class) public final class SearchIndexerClient { + /** + * Lists matching data source connections, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching data source connections as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDataSourceConnections(RequestOptions requestOptions) { + return serviceClient.listDataSourceConnections(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerDataSourceConnection.class)); + } + + /** + * Lists matching indexers, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching indexers as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listIndexers(RequestOptions requestOptions) { + return serviceClient.listIndexers(requestOptions).mapPage(value -> value.toObject(SearchIndexer.class)); + } + + /** + * Lists matching skillsets, following service-provided continuation links. + * + * @param requestOptions The options to configure the HTTP request, including listing filters. + * @throws HttpResponseException if the service rejects the request. + * @return the matching skillsets as a paginated response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkillsets(RequestOptions requestOptions) { + return serviceClient.listSkillsets(requestOptions) + .mapPage(value -> value.toObject(SearchIndexerSkillset.class)); + } + @Generated private final SearchIndexerClientImpl serviceClient; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java index 59b36b124a7b3..1ef0be50be97a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalAsyncClient.java @@ -24,7 +24,6 @@ import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; -import com.azure.search.documents.models.ServerSentEvent; import com.azure.search.documents.models.implementation.sse.ServerSentEventStreams; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -99,7 +98,8 @@ public SearchServiceVersion getServiceVersion() { public Mono> retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) { return mapResponse( - this.serviceClient.retrieveWithResponseAsync(BinaryData.fromObject(retrievalRequest), requestOptions), + this.serviceClient.retrieveWithResponseAsync(BinaryData.fromObject(retrievalRequest), + retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization(), requestOptions), KnowledgeBaseRetrievalResult.class); } @@ -248,7 +248,9 @@ Mono> hiddenGeneratedRetrieveWithResponse(BinaryData retrie /** * KnowledgeBase retrieves relevant data from backing stores. * - * @param retrievalRequest The retrieval request to process. + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -260,8 +262,7 @@ Mono> hiddenGeneratedRetrieveWithResponse(BinaryData retrie @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono retrieve(KnowledgeBaseRetrievalOptions retrievalRequest) { - // Generated convenience method for hiddenGeneratedRetrieveWithResponse - RequestOptions requestOptions = new RequestOptions(); + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeBaseRetrievalResult.class)); @@ -362,9 +363,13 @@ Mono> hiddenGeneratedRetrieveStreamWithResponse(BinaryData /** * KnowledgeBase retrieves relevant data from backing stores. * - * @param retrievalRequest The retrieval request to process. + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -379,12 +384,7 @@ Mono> hiddenGeneratedRetrieveStreamWithResponse(BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, String queryWorkIQSourceAuthorization) { - // Generated convenience method for hiddenGeneratedRetrieveWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (querySourceAuthorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), - querySourceAuthorization); - } + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); if (queryWorkIQSourceAuthorization != null) { requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), queryWorkIQSourceAuthorization); @@ -466,51 +466,130 @@ Mono hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions ret /** * Retrieves relevant data from backing stores and streams progress and results as server-sent events. * + * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known + * subtype's {@code getValue()} to access its typed payload, for example + * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. + * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; + * their payloads are not available. + * * If received, the terminal {@code error} or {@code response.completed} event is emitted before the stream * completes. End-of-stream without a terminal event completes normally. Transport and decoding failures are * propagated through the reactive error path. The client does not reconnect automatically. * - * @param retrievalRequest The retrieval request to process. + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @return A stream of typed knowledge base retrieval events. */ @Generated - public Flux> - retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { - RequestOptions requestOptions = new RequestOptions(); + public Flux retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .flatMapMany(response -> ServerSentEventStreams.toFlux(response, - KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal())); + KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal)); } /** * Retrieves relevant data from backing stores and streams progress and results as server-sent events. * + * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known + * subtype's {@code getValue()} to access its typed payload, for example + * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. + * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; + * their payloads are not available. + * * If received, the terminal {@code error} or {@code response.completed} event is emitted before the stream * completes. End-of-stream without a terminal event completes normally. Transport and decoding failures are * propagated through the reactive error path. The client does not reconnect automatically. * - * @param retrievalRequest The retrieval request to process. + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured - * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. + * on a Work IQ knowledge source. * @return A stream of typed knowledge base retrieval events. */ @Generated - public Flux> retrieveStream( - KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, - String queryWorkIQSourceAuthorization) { - RequestOptions requestOptions = new RequestOptions(); - if (querySourceAuthorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), - querySourceAuthorization); - } + public Flux retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization, String queryWorkIQSourceAuthorization) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); if (queryWorkIQSourceAuthorization != null) { requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), queryWorkIQSourceAuthorization); } return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) .flatMapMany(response -> ServerSentEventStreams.toFlux(response, - KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal())); + KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal)); + } + + /** + * Retrieves relevant data from backing stores and streams progress and results as server-sent events. + * + * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known + * subtype's {@code getValue()} to access its typed payload, for example + * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. + * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; + * their payloads are not available. + * + * If received, the terminal {@code error} or {@code response.completed} event is emitted before the stream + * completes. End-of-stream without a terminal event completes normally. Transport and decoding failures are + * propagated through the reactive error path. The client does not reconnect automatically. + * + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. + * @return A stream of typed knowledge base retrieval events. + */ + @Generated + public Flux retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); + return hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) + .flatMapMany(response -> ServerSentEventStreams.toFlux(response, + KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal)); + } + + /** + * Retrieves relevant data from backing stores. + * + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. + * @return The retrieval result. + * @throws com.azure.core.exception.HttpResponseException if the service rejects the request. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); + return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(KnowledgeBaseRetrievalResult.class)); + } + + @Generated + private static RequestOptions createRetrieveRequestOptions(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization) { + RequestOptions requestOptions = new RequestOptions(); + String authorization = querySourceAuthorization != null + ? querySourceAuthorization + : (retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization()); + if (authorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), authorization); + } + return requestOptions; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java index 6f1a741e10a69..aa7a477e4a5fe 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClient.java @@ -17,13 +17,13 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.CloseableIterableStream; import com.azure.search.documents.SearchServiceVersion; import com.azure.search.documents.implementation.KnowledgeBaseRetrievalClientImpl; import com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; -import com.azure.search.documents.models.ServerSentEventListener; import com.azure.search.documents.models.implementation.sse.ServerSentEventStreams; /** @@ -95,7 +95,8 @@ public SearchServiceVersion getServiceVersion() { public Response retrieveWithResponse(KnowledgeBaseRetrievalOptions retrievalRequest, RequestOptions requestOptions) { return convertResponse( - this.serviceClient.retrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), + this.serviceClient.retrieveWithResponse(BinaryData.fromObject(retrievalRequest), + retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization(), requestOptions), KnowledgeBaseRetrievalResult.class); } @@ -243,7 +244,9 @@ Response hiddenGeneratedRetrieveWithResponse(BinaryData retrievalReq /** * KnowledgeBase retrieves relevant data from backing stores. * - * @param retrievalRequest The retrieval request to process. + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -255,8 +258,7 @@ Response hiddenGeneratedRetrieveWithResponse(BinaryData retrievalReq @Generated @ServiceMethod(returns = ReturnType.SINGLE) public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest) { - // Generated convenience method for hiddenGeneratedRetrieveWithResponse - RequestOptions requestOptions = new RequestOptions(); + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions).getValue() .toObject(KnowledgeBaseRetrievalResult.class); } @@ -356,9 +358,13 @@ Response hiddenGeneratedRetrieveStreamWithResponse(BinaryData retrie /** * KnowledgeBase retrieves relevant data from backing stores. * - * @param retrievalRequest The retrieval request to process. + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -373,12 +379,7 @@ Response hiddenGeneratedRetrieveStreamWithResponse(BinaryData retrie @ServiceMethod(returns = ReturnType.SINGLE) public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, String queryWorkIQSourceAuthorization) { - // Generated convenience method for hiddenGeneratedRetrieveWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (querySourceAuthorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), - querySourceAuthorization); - } + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); if (queryWorkIQSourceAuthorization != null) { requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), queryWorkIQSourceAuthorization); @@ -459,52 +460,146 @@ BinaryData hiddenGeneratedRetrieveStream(KnowledgeBaseRetrievalOptions retrieval /** * Retrieves relevant data from backing stores and streams progress and results as server-sent events. * - * If received, the terminal {@code error} or {@code response.completed} event is delivered before - * {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a terminal event closes normally. - * Transport and decoding failures are reported through {@link ServerSentEventListener#onError(Throwable)}. The - * client does not reconnect automatically. + * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known + * subtype's {@code getValue()} to access its typed payload, for example + * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. + * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; + * their payloads are not available. * - * @param retrievalRequest The retrieval request to process. - * @param listener The listener that receives events and lifecycle notifications. + * Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends + * early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the + * stream is idempotent and may throw {@link java.io.IOException}. + * + * If received, the terminal {@code error} or {@code response.completed} event is emitted before iteration ends. A + * failure while closing after a terminal event is reported by the next iterator access or explicit close, after the + * terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding + * failures are thrown during iteration. The client does not reconnect automatically. + * + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. + * @return A closeable stream of typed knowledge base retrieval events. */ @Generated - public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, - ServerSentEventListener listener) { - RequestOptions requestOptions = new RequestOptions(); - ServerSentEventStreams.listen( + public CloseableIterableStream + retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, null); + return ServerSentEventStreams.toIterableStream( hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), - KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal(), listener); + KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal); } /** * Retrieves relevant data from backing stores and streams progress and results as server-sent events. * - * If received, the terminal {@code error} or {@code response.completed} event is delivered before - * {@link ServerSentEventListener#onClose()} is invoked. End-of-stream without a terminal event closes normally. - * Transport and decoding failures are reported through {@link ServerSentEventListener#onError(Throwable)}. The - * client does not reconnect automatically. + * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known + * subtype's {@code getValue()} to access its typed payload, for example + * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. + * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; + * their payloads are not available. * - * @param retrievalRequest The retrieval request to process. + * Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends + * early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the + * stream is idempotent and may throw {@link java.io.IOException}. + * + * If received, the terminal {@code error} or {@code response.completed} event is emitted before iteration ends. A + * failure while closing after a terminal event is reported by the next iterator access or explicit close, after the + * terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding + * failures are thrown during iteration. The client does not reconnect automatically. + * + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is - * used to enforce security restrictions on documents. + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. + * @return A closeable stream of typed knowledge base retrieval events. + */ + @Generated + public CloseableIterableStream + retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); + return ServerSentEventStreams.toIterableStream( + hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), + KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal); + } + + /** + * Retrieves relevant data from backing stores. + * + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. + * @return The retrieval result. + * @throws com.azure.core.exception.HttpResponseException if the service rejects the request. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public KnowledgeBaseRetrievalResult retrieve(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); + return hiddenGeneratedRetrieveWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions).getValue() + .toObject(KnowledgeBaseRetrievalResult.class); + } + + /** + * Retrieves relevant data from backing stores and streams progress and results as server-sent events. + * + * Events are polymorphic: see {@link KnowledgeBaseRetrievalStreamEvent} for the known subtypes. Use a known + * subtype's {@code getValue()} to access its typed payload, for example + * {@link com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent#getValue()}. + * Unrecognized events expose only their names through {@link KnowledgeBaseRetrievalStreamEvent#getEventName()}; + * their payloads are not available. + * + * Events are decoded lazily by a single iterator. Use try-with-resources to close the stream when iteration ends + * early. The response is also closed on end-of-stream, a terminal event, or an iteration failure. Closing the + * stream is idempotent and may throw {@link java.io.IOException}. + * + * If received, the terminal {@code error} or {@code response.completed} event is emitted before iteration ends. A + * failure while closing after a terminal event is reported by the next iterator access or explicit close, after the + * terminal event is delivered. End-of-stream without a terminal event completes normally. Transport and decoding + * failures are thrown during iteration. The client does not reconnect automatically. + * + * @param retrievalRequest The retrieval request to process. If its + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()} is set, it is sent only as the + * x-ms-query-source-authorization header and is never serialized into the request body. + * @param querySourceAuthorization Token identifying the user for which the query is being executed. This token is + * used to enforce security restrictions on documents. A non-null value overrides + * {@link KnowledgeBaseRetrievalOptions#getQuerySourceAuthorization()}; null falls back to it, and an empty string + * is treated as an explicit value. * @param queryWorkIQSourceAuthorization User assertion token for a customer-owned Entra app registration configured - * on a Work IQ knowledge source. Used for on-behalf-of authentication to the Work IQ API. - * @param listener The listener that receives events and lifecycle notifications. + * on a Work IQ knowledge source. + * @return A closeable stream of typed knowledge base retrieval events. */ @Generated - public void retrieveStream(KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, - String queryWorkIQSourceAuthorization, ServerSentEventListener listener) { - RequestOptions requestOptions = new RequestOptions(); - if (querySourceAuthorization != null) { - requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), - querySourceAuthorization); - } + public CloseableIterableStream retrieveStream( + KnowledgeBaseRetrievalOptions retrievalRequest, String querySourceAuthorization, + String queryWorkIQSourceAuthorization) { + RequestOptions requestOptions = createRetrieveRequestOptions(retrievalRequest, querySourceAuthorization); if (queryWorkIQSourceAuthorization != null) { requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-work-iq-source-authorization"), queryWorkIQSourceAuthorization); } - ServerSentEventStreams.listen( + return ServerSentEventStreams.toIterableStream( hiddenGeneratedRetrieveStreamWithResponse(BinaryData.fromObject(retrievalRequest), requestOptions), - KnowledgeBaseRetrievalStreamEventConverter::convert, event -> event.getData().isTerminal(), listener); + KnowledgeBaseRetrievalStreamEventConverter::convert, KnowledgeBaseRetrievalStreamEvent::isTerminal); + } + + @Generated + private static RequestOptions createRetrieveRequestOptions(KnowledgeBaseRetrievalOptions retrievalRequest, + String querySourceAuthorization) { + RequestOptions requestOptions = new RequestOptions(); + String authorization = querySourceAuthorization != null + ? querySourceAuthorization + : (retrievalRequest == null ? null : retrievalRequest.getQuerySourceAuthorization()); + if (authorization != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-query-source-authorization"), authorization); + } + return requestOptions; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java index efc0394f15c75..f527b3d20a96b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseErrorStreamEvent.java @@ -5,17 +5,15 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonWriter; -import java.io.IOException; /** * Represents the {@code error} knowledge base retrieval stream event. + * Access the typed payload with {@link #getValue()}. + * + * @see KnowledgeBaseRetrievalStreamEvent */ @Immutable -public final class KnowledgeBaseErrorStreamEvent extends KnowledgeBaseRetrievalStreamEvent - implements JsonSerializable { +public final class KnowledgeBaseErrorStreamEvent extends KnowledgeBaseRetrievalStreamEvent { @Generated private final KnowledgeBaseStreamErrorEvent value; @@ -26,7 +24,7 @@ public final class KnowledgeBaseErrorStreamEvent extends KnowledgeBaseRetrievalS * @param value The event payload. */ @Generated - public KnowledgeBaseErrorStreamEvent(KnowledgeBaseStreamErrorEvent value) { + KnowledgeBaseErrorStreamEvent(KnowledgeBaseStreamErrorEvent value) { super("error"); this.value = value; } @@ -41,24 +39,6 @@ public KnowledgeBaseStreamErrorEvent getValue() { return value; } - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - return value.toJson(jsonWriter); - } - - /** - * Reads an event wrapper from JSON. - * - * @param jsonReader The reader to read from. - * @return The parsed event wrapper. - * @throws IOException If the event payload cannot be read. - */ - @Generated - public static KnowledgeBaseErrorStreamEvent fromJson(JsonReader jsonReader) throws IOException { - return new KnowledgeBaseErrorStreamEvent(KnowledgeBaseStreamErrorEvent.fromJson(jsonReader)); - } - @Generated @Override public boolean isTerminal() { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java index 89fc3d5d820fd..7a3a6f7e338e3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseResponseCompletedStreamEvent.java @@ -5,17 +5,15 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonWriter; -import java.io.IOException; /** * Represents the {@code response.completed} knowledge base retrieval stream event. + * Access the typed payload with {@link #getValue()}. + * + * @see KnowledgeBaseRetrievalStreamEvent */ @Immutable -public final class KnowledgeBaseResponseCompletedStreamEvent extends KnowledgeBaseRetrievalStreamEvent - implements JsonSerializable { +public final class KnowledgeBaseResponseCompletedStreamEvent extends KnowledgeBaseRetrievalStreamEvent { @Generated private final KnowledgeBaseResponseCompletedEvent value; @@ -26,7 +24,7 @@ public final class KnowledgeBaseResponseCompletedStreamEvent extends KnowledgeBa * @param value The event payload. */ @Generated - public KnowledgeBaseResponseCompletedStreamEvent(KnowledgeBaseResponseCompletedEvent value) { + KnowledgeBaseResponseCompletedStreamEvent(KnowledgeBaseResponseCompletedEvent value) { super("response.completed"); this.value = value; } @@ -41,24 +39,6 @@ public KnowledgeBaseResponseCompletedEvent getValue() { return value; } - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - return value.toJson(jsonWriter); - } - - /** - * Reads an event wrapper from JSON. - * - * @param jsonReader The reader to read from. - * @return The parsed event wrapper. - * @throws IOException If the event payload cannot be read. - */ - @Generated - public static KnowledgeBaseResponseCompletedStreamEvent fromJson(JsonReader jsonReader) throws IOException { - return new KnowledgeBaseResponseCompletedStreamEvent(KnowledgeBaseResponseCompletedEvent.fromJson(jsonReader)); - } - @Generated @Override public boolean isTerminal() { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java index d4d0be44922bd..c102fcaf5a8c7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalOptions.java @@ -425,4 +425,40 @@ public KnowledgeBaseRetrievalOptions setToolName(String toolName) { this.toolName = toolName; return this; } + + /** + * Token identifying the user for which the query is being executed. Client-only value that is sent as the + * x-ms-query-source-authorization header and is never serialized into the request body. + */ + @Generated + private String querySourceAuthorization; + + /** + * Get the querySourceAuthorization property: Token identifying the user for which the query is being executed. This + * token is used to enforce security restrictions on documents. It is only sent as the + * x-ms-query-source-authorization request header and is never part of the request body. A non-null authorization + * passed explicitly to a retrieve method overrides this value; a null explicit authorization falls back to it. + * + * @return the querySourceAuthorization value. + */ + @Generated + public String getQuerySourceAuthorization() { + return this.querySourceAuthorization; + } + + /** + * Set the querySourceAuthorization property: Token identifying the user for which the query is being executed. This + * token is used to enforce security restrictions on documents. It is only sent as the + * x-ms-query-source-authorization request header and is never part of the request body. A non-null authorization + * passed explicitly to a retrieve method overrides this value; a null explicit authorization falls back to it. An + * empty string is treated as a value. + * + * @param querySourceAuthorization the querySourceAuthorization value to set. + * @return the KnowledgeBaseRetrievalOptions object itself. + */ + @Generated + public KnowledgeBaseRetrievalOptions setQuerySourceAuthorization(String querySourceAuthorization) { + this.querySourceAuthorization = querySourceAuthorization; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/samples/README.md b/sdk/search/azure-search-documents/src/samples/README.md index aacc164566e0c..fd2240effcc03 100644 --- a/sdk/search/azure-search-documents/src/samples/README.md +++ b/sdk/search/azure-search-documents/src/samples/README.md @@ -61,7 +61,7 @@ add the direct dependency to your project as follows. com.azure azure-search-documents - 12.2.0 + 12.3.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -100,53 +100,17 @@ The following sections provide several code snippets covering some of the most c - [Rewrite Request URL to replace OData URL syntax with standard syntax](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchRequestUrlRewriterPolicy.java) - [Vector search using reduced embeddings](https://github.com/Azure/azure-sdk-for-java/blob/40261403b3a75aa56a3eeaf18c2ba0fd071c87a6/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchReducedEmbeddings.java) -### Knowledge bases and knowledge sources - -These samples target the `2026-10-01` GA service API. Knowledge bases, retrieval, and the earlier knowledge source -types already existed in `12.1.1`; the table below identifies the additional `12.2.0` scenarios. - -- [Knowledge base CRUD](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseCrudExample.java) -- [Knowledge source CRUD and source-specific configuration](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java) -- [Knowledge base configuration and request overrides](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseConfigurationExample.java) -- [Retrieval, conversation history, and source-specific parameters](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalExample.java) -- [Response activity and citation URLs](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalResponseExample.java) -- [Typed synchronous and asynchronous streaming](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java) -- [File upload, update, capacity, listing, and deletion](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFileExample.java) - -### New GA feature coverage - -| Feature added since `12.1.1` | Sample and intended flow | -| --- | --- | -| Similar-document queries (`moreLikeThis`) | [SearchOptionsExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchOptionsExample.java) queries a document key without search text and limits search fields to top-level text fields. | -| Permission-aware queries and document lookup | [DocumentPermissionsExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/DocumentPermissionsExample.java) passes the end user's query-source token to search, lookup, and retrieval with elevated reads disabled. | -| Permission schema, SharePoint registration, ACL ingestion, federated identity, and ACL refresh/resynchronization | [DocumentPermissionsExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/DocumentPermissionsExample.java) includes provisioning models and an explicit creation method; supply deployment-specific mappings and roles. Pass `resync` with `SEARCH_INDEXER_NAME` to resynchronize permissions. Created resources are not automatically deleted. | -| Resource pagination, name-prefix filtering, selected properties, aliases, and opaque continuation tokens | [ListIndexesExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexesExample.java), [ListIndexersExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java), and [SynonymMapsCreateExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java). Knowledge resource CRUD samples also use pageable listings. | -| Index statistics summaries and service/indexer runtime | [IndexAndServiceStatisticsExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java) and [ListIndexersExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java) report usage, remaining runtime, and reporting periods. | -| File knowledge sources, file metadata and prefixes, multipart upload/update, deletion, and capacity | [KnowledgeSourceFileExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFileExample.java) checks capacity before uploading and deletes the files and source afterward. | -| Indexed SQL content/embedding mappings and indexed SharePoint container selection | Run [KnowledgeSourceCrudExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java) with `sql` or `sharepoint`; prerequisites are listed in the class JavaDoc. | -| Knowledge ingestion permissions and public/private network configuration | [KnowledgeSourceCrudExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java) configures ingestion, inspects generated Blob resources, and demonstrates permission ingestion for SharePoint. Private connectivity must already be configured. | -| Web language, market, result count, and freshness | Run [KnowledgeSourceCrudExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java) with `web`. | -| Low/medium reasoning, answer/extractive output modes, instructions, CORS, and request precedence | [KnowledgeBaseConfigurationExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseConfigurationExample.java) configures defaults and overrides them per request. | -| Typed asynchronous knowledge resource updates | Run [KnowledgeBaseCrudExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseCrudExample.java) with `async`; the source-specific [KnowledgeSourceCrudExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java) flows inspect typed asynchronous update responses. | -| Conversation messages, role/content constructors, query planning, and per-source result/error controls | [KnowledgeRetrievalExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalExample.java) uses an existing populated knowledge base. Optionally set `SEARCH_IMAGE_URL` for an image-capable model. Pass `file`, `sql`, or `sharepoint` with `KNOWLEDGE_SOURCE_NAME` to use the corresponding retrieval parameters. | -| Typed source/model activities, timestamps, warnings, model/deployment metadata, and citation URLs | [KnowledgeRetrievalResponseExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalResponseExample.java) reads responses without modifying existing resources. Citation URLs are Search-owned and require appropriate Search authorization. | -| Retrieval, activity, answer, reference, error, and completion stream events | [KnowledgeBaseRetrievalStreamExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java) handles typed events and disposes synchronous streams. Pass `sync` for the synchronous flow. | -| Content understanding model/deployment and fixed-size/semantic chunking, including tokens | Run [CreateSkillsetExample](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java) with `content-understanding`; its factory also demonstrates fixed-size character chunks. | -| Additional Azure OpenAI model names | Knowledge base configuration accepts `SEARCH_OPENAI_MODEL_NAME`, including `gpt-5.4`, `gpt-5.5`, `gpt-5.6-sol`, `gpt-5.6-terra`, and `gpt-5.6-luna`. The matching supported deployment must exist. | - -Knowledge source ingestion is asynchronous. The source/file CRUD samples demonstrate resource management and clean -up their resources; they do not assume uploaded content is immediately searchable. Run retrieval examples against an -existing source whose ingestion has completed. The caller needs the appropriate Search management/data roles; -the Search service identity separately needs permission to read source data and invoke configured model deployments. - -The parameterless `SearchResourceEncryptionKey` constructor is also new, but the Java model does not expose the -service-level-key selector referenced by that constructor's JavaDoc, or setters for its key name and vault URL. -It is therefore not demonstrated as a working service-level encryption flow. For customer-managed keys, continue -to use the constructor accepting a key name and Key Vault URL with an authorized identity. - -The sample configurations and response-handling helpers are covered by offline tests in -[SearchGaSamplesTests](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java). All samples are compiled -by the package build; provisioning and ingestion require a live, suitably configured Azure service. +### Knowledge Base & Knowledge Source Preview Samples +- [Knowledge Base configuration (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBasePreviewConfigurationExample.java) +- [Streaming knowledge base retrieval with server-sent events (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java) +- [Knowledge Base retrieval response parsing (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java) +- [Knowledge service statistics (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeServiceStatsPreviewExample.java) +- [Knowledge Source freshness and defaults (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFreshnessPreviewExample.java) +- [File Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java) +- [MCP Server Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceMcpServerPreviewExample.java) +- [Work IQ Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceWorkIqPreviewExample.java) +- [Fabric Ontology Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricOntologyPreviewExample.java) +- [Fabric Data Agent Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricDataAgentPreviewExample.java) ## Troubleshooting Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. @@ -165,3 +129,5 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [SDK_README_KEY_CONCEPTS]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/README.md#key-concepts [SDK_README_DEPENDENCY]: ../../README.md#adding-the-package-to-your-product [azsearch_docs]: https://learn.microsoft.com/azure/search + + diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java index 876e9b745ebee..549aa015f83e6 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java @@ -181,8 +181,6 @@ static void inspectEvent(KnowledgeBaseRetrievalStreamEvent event, AtomicBoolean } if (event instanceof KnowledgeBaseReferencesCompletedStreamEvent) { printEventData(((KnowledgeBaseReferencesCompletedStreamEvent) event).getValue()); - ((KnowledgeBaseReferencesCompletedStreamEvent) event).getValue().forEach(reference -> - System.out.println("Citation URL: " + KnowledgeRetrievalResponseExample.citationUrl(reference))); } if (event instanceof KnowledgeBaseErrorStreamEvent) { printEventData(((KnowledgeBaseErrorStreamEvent) event).getValue()); diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java index 2268fff28cfa1..4faee63ef578e 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java @@ -7,7 +7,6 @@ import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.Configuration; -import com.azure.core.util.CloseableIterableStream; import com.azure.identity.AzureAuthorityHosts; import com.azure.identity.DefaultAzureCredential; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -22,10 +21,7 @@ import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchSuggester; -import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedStreamEvent; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; +import com.azure.search.documents.models.GetDocumentOptions; import com.azure.search.documents.models.IndexAction; import com.azure.search.documents.models.IndexActionType; import com.azure.search.documents.models.IndexDocumentsBatch; @@ -33,8 +29,8 @@ import com.azure.search.documents.models.SearchPagedIterable; import com.azure.search.documents.models.SearchResult; -import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -52,21 +48,6 @@ public class ReadmeSamples { private static final SearchClient SEARCH_CLIENT = new SearchClientBuilder().buildClient(); private static final SearchAsyncClient SEARCH_ASYNC_CLIENT = new SearchClientBuilder().buildAsyncClient(); - public void retrieveKnowledgeBaseStream(KnowledgeBaseRetrievalClient client, - KnowledgeBaseRetrievalOptions request) throws IOException { - // BEGIN: readme-sample-retrieveKnowledgeBaseStream - try (CloseableIterableStream events = client.retrieveStream(request)) { - for (KnowledgeBaseRetrievalStreamEvent event : events) { - System.out.println(event.getEventName()); - if (event instanceof KnowledgeBaseAnswerCompletedStreamEvent) { - KnowledgeBaseAnswerCompletedStreamEvent answer = (KnowledgeBaseAnswerCompletedStreamEvent) event; - System.out.println(answer.getValue().getMessage()); - } - } - } - // END: readme-sample-retrieveKnowledgeBaseStream - } - public void createSearchClient() { // BEGIN: readme-sample-createSearchClient SearchClient searchClient = new SearchClientBuilder() @@ -195,24 +176,6 @@ public void searchWithStronglyType() { // END: readme-sample-searchWithStronglyType } - public void searchMoreLikeThis() { - // BEGIN: readme-sample-searchMoreLikeThis - SearchOptions options = new SearchOptions().setMoreLikeThis("hotel-1") - .setSearchFields("HotelName", "Description") - .setTop(5); - SEARCH_CLIENT.search(options).forEach(result -> System.out.println(result.getAdditionalProperties())); - // END: readme-sample-searchMoreLikeThis - } - - public void searchWithDocumentPermissions(String querySourceToken) { - // BEGIN: readme-sample-searchWithDocumentPermissions - SearchOptions options = new SearchOptions().setSearchText("hotel") - .setQuerySourceAuthorization(querySourceToken) - .setEnableElevatedRead(false); - SEARCH_CLIENT.search(options).forEach(result -> System.out.println(result.getAdditionalProperties())); - // END: readme-sample-searchWithDocumentPermissions - } - public void searchWithSearchOptions() { // BEGIN: readme-sample-searchWithSearchOptions SearchOptions options = new SearchOptions().setSearchText("luxury") @@ -241,6 +204,18 @@ public void retrieveDocuments() { // END: readme-sample-retrieveDocuments } + public void retrieveDocumentWithOptions(String querySourceToken) { + // BEGIN: readme-sample-retrieveDocumentWithOptions + GetDocumentOptions options = new GetDocumentOptions() + .setQuerySourceAuthorization(querySourceToken) + .setEnableElevatedRead(false) + .setSelectedFields(Arrays.asList("Id", "Name")); + Map hotel = SEARCH_CLIENT.getDocumentWithResponse("1", options, null) + .getValue().getAdditionalProperties(); + System.out.printf("This is hotelId %s, and this is hotel name %s.%n", hotel.get("Id"), hotel.get("Name")); + // END: readme-sample-retrieveDocumentWithOptions + } + public void batchDocumentsOperations() { // BEGIN: readme-sample-batchDocumentsOperations Map hotel = new LinkedHashMap<>(); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java new file mode 100644 index 0000000000000..a4a6c19c448d9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.exception.AzureException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpMethod; +import com.azure.core.http.HttpRequest; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.SyncPoller; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.FileUploadMetadata; +import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; +import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; +import com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest; +import com.azure.search.documents.models.ContentFileDetails; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import reactor.core.publisher.Mono; + +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class FileIngestionPollingTests { + private static final String ENDPOINT = "https://example.search.windows.net"; + private static final String OPERATION_PATH = "/knowledgesources('files')/files/operations/op-1"; + private static final String OPERATION_URL = ENDPOINT + OPERATION_PATH + "?api-version=2026-11-01-preview"; + private static final Duration POLL_INTERVAL = Duration.ofMillis(1); + private static final Duration TIMEOUT = Duration.ofSeconds(10); + + @Test + public void uploadPollerFollowsRelativeOperationLocationAndExtractsFileResult() { + AtomicInteger polls = new AtomicInteger(); + SyncPoller poller + = builder(ingestionTransport(false, false, polls)).buildClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .setPollInterval(POLL_INTERVAL); + + PollResponse terminal = poller.waitForCompletion(TIMEOUT); + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, terminal.getStatus()); + assertEquals("op-1", terminal.getValue().getId()); + assertEquals("file-1", terminal.getValue().getResult().getFileId()); + KnowledgeSourceFile file = poller.getFinalResult(); + assertEquals("file-1", file.getFileId()); + assertEquals("notes.txt", file.getFileName()); + assertEquals(2, polls.get(), "Final-result extraction must not issue another resource GET."); + } + + @Test + public void asyncReplacementPollerPreservesFileIdAndExtractsFileResult() { + AtomicInteger polls = new AtomicInteger(); + AsyncPollResponse terminal + = builder(ingestionTransport(true, false, polls)).buildAsyncClient() + .beginIngestKnowledgeSourceFileReplacement("files", "file-1", replacement()) + .setPollInterval(POLL_INTERVAL) + .last() + .block(TIMEOUT); + + assertNotNull(terminal); + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, terminal.getStatus()); + assertEquals("op-1", terminal.getValue().getId()); + KnowledgeSourceFile file = terminal.getFinalResult().block(TIMEOUT); + assertNotNull(file); + assertEquals("file-1", file.getFileId()); + assertEquals("notes.txt", file.getFileName()); + assertEquals(2, polls.get(), "Final-result extraction must use the terminal operation's result."); + } + + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void failedOperationRetainsServiceErrorAndDoesNotReturnAFile(boolean async) { + AtomicInteger polls = new AtomicInteger(); + SearchIndexClientBuilder clientBuilder = builder(ingestionTransport(false, true, polls)); + if (async) { + AsyncPollResponse terminal + = clientBuilder.buildAsyncClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .setPollInterval(POLL_INTERVAL) + .last() + .block(TIMEOUT); + assertNotNull(terminal); + assertEquals(LongRunningOperationStatus.FAILED, terminal.getStatus()); + assertFailure(terminal.getValue()); + assertThrows(AzureException.class, () -> terminal.getFinalResult().block(TIMEOUT)); + } else { + SyncPoller poller = clientBuilder.buildClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .setPollInterval(POLL_INTERVAL); + PollResponse terminal = poller.waitForCompletion(TIMEOUT); + assertEquals(LongRunningOperationStatus.FAILED, terminal.getStatus()); + assertFailure(terminal.getValue()); + assertThrows(AzureException.class, poller::getFinalResult); + } + assertEquals(2, polls.get()); + } + + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void rejectedUploadRoutesHttpErrorWithoutPolling(boolean async) { + AtomicInteger requests = new AtomicInteger(); + SearchIndexClientBuilder clientBuilder = builder(request -> { + requests.incrementAndGet(); + assertEquals(HttpMethod.POST, request.getHttpMethod()); + return Mono.just(response(request, 400, + "{\"error\":{\"code\":\"InvalidFile\",\"message\":\"Unsupported file format\"}}")); + }); + HttpResponseException error = assertThrows(HttpResponseException.class, () -> { + if (async) { + clientBuilder.buildAsyncClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .last() + .block(TIMEOUT); + } else { + clientBuilder.buildClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .waitForCompletion(TIMEOUT); + } + }); + assertEquals(400, error.getResponse().getStatusCode()); + assertTrue(error.getResponse().getBodyAsString().block().contains("Unsupported file format")); + assertEquals(1, requests.get()); + } + + @Test + public void operationGetAndSyncAsyncListsPreserveErrorsResultsAndContinuation() { + AtomicInteger firstPages = new AtomicInteger(); + AtomicInteger nextPages = new AtomicInteger(); + SearchIndexClientBuilder clientBuilder = builder(request -> { + assertEquals(HttpMethod.GET, request.getHttpMethod()); + assertTrue(request.getUrl().getQuery().contains("api-version=2026-11-01-preview")); + String path = request.getUrl().getPath(); + if (path.endsWith("/op-1")) { + return Mono.just(response(request, 200, operation("op-1", "succeeded", false))); + } + assertEquals("/knowledgesources('files')/files/operations", path); + if (request.getUrl().getQuery().contains("continuation=page2")) { + nextPages.incrementAndGet(); + return Mono.just(response(request, 200, "{\"value\":[" + operation("op-2", "failed", true) + "]}")); + } + firstPages.incrementAndGet(); + String next = ENDPOINT + path + "?api-version=2026-11-01-preview&continuation=page2"; + return Mono.just(response(request, 200, + "{\"value\":[" + operation("op-1", "succeeded", false) + "],\"@odata.nextLink\":\"" + next + "\"}")); + }); + + KnowledgeSourceFileIngestionOperation syncFetched + = clientBuilder.buildClient().getKnowledgeSourceFileIngestionOperation("files", "op-1"); + assertEquals("file-1", syncFetched.getResult().getFileId()); + KnowledgeSourceFileIngestionOperation fetched + = clientBuilder.buildAsyncClient().getKnowledgeSourceFileIngestionOperation("files", "op-1").block(TIMEOUT); + assertNotNull(fetched); + assertEquals("file-1", fetched.getResult().getFileId()); + List sync = clientBuilder.buildClient() + .listKnowledgeSourceFileIngestionOperations("files") + .stream() + .collect(Collectors.toList()); + List async = clientBuilder.buildAsyncClient() + .listKnowledgeSourceFileIngestionOperations("files") + .collectList() + .block(TIMEOUT); + assertOperationPages(sync); + assertOperationPages(async); + assertEquals(2, firstPages.get()); + assertEquals(2, nextPages.get()); + } + + private static HttpClient ingestionTransport(boolean replacement, boolean fail, AtomicInteger polls) { + return request -> { + assertTrue(request.getUrl().getQuery().contains("api-version=2026-11-01-preview")); + if (request.getHttpMethod() == HttpMethod.POST) { + String path = replacement + ? "/knowledgesources('files')/files('file-1'):ingest" + : "/knowledgesources('files')/files:ingest"; + assertEquals(path, request.getUrl().getPath()); + assertTrue( + request.getHeaders().getValue(HttpHeaderName.CONTENT_TYPE).startsWith("multipart/form-data")); + String body = request.getBodyAsBinaryData().toString(); + assertTrue(body.contains("name=\"metadata\"")); + assertTrue(body.contains("\"fileName\":\"notes.txt\"")); + assertTrue(body.contains("name=\"content\"")); + assertTrue(body.contains("filename=\"notes.txt\"")); + assertTrue(body.contains("offline file contents")); + HttpHeaders headers = new HttpHeaders() + .set(HttpHeaderName.fromString("Operation-Location"), + replacement ? OPERATION_URL : OPERATION_PATH + "?api-version=2026-11-01-preview") + .set(HttpHeaderName.RETRY_AFTER, "0"); + return Mono.just(new MockHttpResponse(request, 202, headers, + operation("op-1", "notStarted", false).getBytes(StandardCharsets.UTF_8))); + } + assertEquals(HttpMethod.GET, request.getHttpMethod()); + assertEquals(OPERATION_URL, request.getUrl().toString()); + int poll = polls.incrementAndGet(); + assertTrue(poll <= 2, "Polling must stop when the operation reaches a terminal state."); + return Mono.just(response(request, 200, + operation("op-1", poll == 1 ? "running" : fail ? "failed" : "succeeded", fail && poll > 1))); + }; + } + + private static String operation(String id, String status, boolean error) { + String details = error + ? ",\"error\":{\"code\":\"ExtractionFailed\",\"message\":\"Cannot extract document\"}" + : "succeeded".equals(status) ? ",\"result\":{\"fileId\":\"file-1\",\"fileName\":\"notes.txt\"}" : ""; + return "{\"id\":\"" + id + "\",\"kind\":\"knowledgeSourceFileIngestion\",\"status\":\"" + status + "\"" + + details + "}"; + } + + private static void assertFailure(KnowledgeSourceFileIngestionOperation operation) { + assertNotNull(operation.getError()); + assertEquals("ExtractionFailed", operation.getError().getCode()); + assertEquals("Cannot extract document", operation.getError().getMessage()); + } + + private static void assertOperationPages(List operations) { + assertNotNull(operations); + assertEquals(2, operations.size()); + assertEquals("op-1", operations.get(0).getId()); + assertEquals("file-1", operations.get(0).getResult().getFileId()); + assertEquals("op-2", operations.get(1).getId()); + assertFailure(operations.get(1)); + } + + private static UploadKnowledgeSourceFileMultipartRequest upload() { + return new UploadKnowledgeSourceFileMultipartRequest(metadata(), content()); + } + + private static UpdateKnowledgeSourceFileRequest replacement() { + return new UpdateKnowledgeSourceFileRequest(metadata(), content()); + } + + private static FileUploadMetadata metadata() { + return new FileUploadMetadata().setFileName("notes.txt"); + } + + private static ContentFileDetails content() { + return new ContentFileDetails(BinaryData.fromString("offline file contents")).setFilename("notes.txt"); + } + + private static SearchIndexClientBuilder builder(HttpClient transport) { + return new SearchIndexClientBuilder().endpoint(ENDPOINT) + .credential(new AzureKeyCredential("offline-test-key")) + .serviceVersion(SearchServiceVersion.V2026_11_01_PREVIEW) + .httpClient(transport); + } + + private static MockHttpResponse response(HttpRequest request, int status, String body) { + return new MockHttpResponse(request, status, new HttpHeaders().set(HttpHeaderName.RETRY_AFTER, "0"), + body.getBytes(StandardCharsets.UTF_8)); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/GetDocumentOptionsTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/GetDocumentOptionsTests.java index b69a60b29888a..9e470cd579065 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/GetDocumentOptionsTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/GetDocumentOptionsTests.java @@ -19,6 +19,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; import reactor.core.publisher.Mono; @@ -44,24 +45,6 @@ public class GetDocumentOptionsTests { private static final HttpHeaderName ELEVATED_READ = HttpHeaderName.fromString("x-ms-enable-elevated-read"); private static final String DOCUMENT = "{\"id\":\"hotel-1\",\"title\":\"Hotel\"}"; - @Test - public void defaultsAndFluentAccessors() { - GetDocumentOptions options = new GetDocumentOptions(); - assertNull(options.getQuerySourceAuthorization()); - assertNull(options.isEnableElevatedRead()); - assertNull(options.getSelectedFields()); - assertSame(options, options.setQuerySourceAuthorization("query-token")); - assertSame(options, options.setEnableElevatedRead(false)); - assertSame(options, options.setSelectedFields(Arrays.asList("id", "title"))); - assertEquals("query-token", options.getQuerySourceAuthorization()); - assertEquals(Boolean.FALSE, options.isEnableElevatedRead()); - assertEquals(Arrays.asList("id", "title"), options.getSelectedFields()); - options.setQuerySourceAuthorization(null).setEnableElevatedRead(null).setSelectedFields(null); - assertNull(options.getQuerySourceAuthorization()); - assertNull(options.isEnableElevatedRead()); - assertNull(options.getSelectedFields()); - } - @ParameterizedTest @MethodSource("lookupOptions") public void bothClientsForwardLookupOptions(GetDocumentOptions options, String authorization, String elevatedRead, @@ -96,6 +79,19 @@ private static Stream lookupOptions() { "id,,title")); } + @ParameterizedTest + @EnumSource(value = SearchServiceVersion.class, names = { "V2026_10_01", "V2026_11_01_PREVIEW" }) + public void lookupOptionsSupportGaAndPreview(SearchServiceVersion version) { + SearchClientBuilder builder = builder(request -> { + assertEquals("query-token", request.getHeaders().getValue(AUTHORIZATION)); + assertEquals("api-version=" + version.getVersion() + "&$select=id", query(request)); + }).serviceVersion(version); + GetDocumentOptions options = new GetDocumentOptions().setQuerySourceAuthorization("query-token") + .setSelectedFields(Collections.singletonList("id")); + verifyDocument(false, builder, options, null); + verifyDocument(true, builder, options, null); + } + @ParameterizedTest @ValueSource(booleans = { false, true }) public void selectionIsEncodedOnce(boolean async) { @@ -246,6 +242,7 @@ private static SearchClientBuilder builder(Consumer verifyRequest) return new SearchClientBuilder().endpoint("https://example.search.windows.net") .credential(new AzureKeyCredential("key")) .indexName("index") + .serviceVersion(SearchServiceVersion.V2026_10_01) .httpClient(request -> { verifyRequest.accept(request); return Mono.just(new MockHttpResponse(request, 200, diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeBaseTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeBaseTests.java index 0eb526ad570e9..ea94757ed7eba 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeBaseTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeBaseTests.java @@ -2,6 +2,7 @@ // Licensed under the MIT License. package com.azure.search.documents; +import com.azure.core.credential.TokenRequestContext; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; @@ -13,38 +14,50 @@ import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.test.utils.TestProxyUtils; import com.azure.core.util.BinaryData; -import com.azure.core.util.CloseableIterableStream; import com.azure.json.JsonProviders; import com.azure.json.JsonReader; import com.azure.search.documents.indexes.SearchIndexAsyncClient; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSourceParameters; import com.azure.search.documents.indexes.models.AzureOpenAIModelName; import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; import com.azure.search.documents.indexes.models.CorsOptions; +import com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSource; +import com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSource; +import com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSourceParameters; import com.azure.search.documents.indexes.models.FileKnowledgeSource; import com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters; import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel; import com.azure.search.documents.indexes.models.KnowledgeBaseModel; import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFieldValueBoost; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints; +import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; import com.azure.search.documents.indexes.models.SemanticConfiguration; import com.azure.search.documents.indexes.models.SemanticField; import com.azure.search.documents.indexes.models.SemanticPrioritizedFields; import com.azure.search.documents.indexes.models.SemanticSearch; import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalAsyncClient; import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.models.AzureBlobKnowledgeSourceParams; +import com.azure.search.documents.knowledgebases.models.FabricDataAgentKnowledgeSourceParams; +import com.azure.search.documents.knowledgebases.models.FabricOntologyKnowledgeSourceParams; import com.azure.search.documents.knowledgebases.models.FileKnowledgeSourceParams; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseFileReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageTextContent; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelQueryPlanningActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedStreamEvent; @@ -52,14 +65,19 @@ import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedStreamEvent; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalAutoReasoningEffort; import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode; -import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMediumReasoningEffort; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind; import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceParams; +import com.azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo; import com.azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams; +import com.azure.search.documents.models.QueryType; +import com.azure.core.util.CloseableIterableStream; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; @@ -68,7 +86,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; -import org.junit.jupiter.api.parallel.ResourceLock; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.util.function.Tuple2; @@ -98,7 +115,6 @@ * Tests for Knowledge Base operations. */ @Execution(ExecutionMode.SAME_THREAD) -@ResourceLock("search-knowledge-resources") public class KnowledgeBaseTests extends SearchTestBase { private static final String HOTEL_INDEX_NAME = "shared-knowledge-knowledgebase-index"; private static final String HOTEL_KNOWLEDGE_SOURCE_NAME = "shared-knowledge-knowledgebase-source"; @@ -106,7 +122,8 @@ public class KnowledgeBaseTests extends SearchTestBase { private static final KnowledgeBaseAzureOpenAIModel OPEN_AI_KNOWLEDGEBASE_MODEL = new KnowledgeBaseAzureOpenAIModel( new AzureOpenAIVectorizerParameters().setModelName(AzureOpenAIModelName.fromString(OPENAI_MODEL_NAME)) .setDeploymentName(KNOWLEDGEBASE_DEPLOYMENT_NAME) - .setResourceUrl(OPENAI_ENDPOINT)); + .setResourceUrl(OPENAI_ENDPOINT) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY))); private static final KnowledgeBaseModel KNOWLEDGE_BASE_MODEL = OPEN_AI_KNOWLEDGEBASE_MODEL; private static final KnowledgeSourceReference KNOWLEDGE_SOURCE_REFERENCE = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME); @@ -405,6 +422,108 @@ public void updateKnowledgeBaseAsync() { .verifyComplete(); } + @Test + public void knowledgeBaseCostAttributionTagsPersistSync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + Map tags = createCostAttributionTags("FIN-042"); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL) + .setTags(tags); + + KnowledgeBase created = indexClient.createKnowledgeBase(knowledgeBase); + KnowledgeBase retrieved = indexClient.getKnowledgeBase(created.getName()); + KnowledgeBase listed = indexClient.listKnowledgeBases() + .stream() + .filter(item -> created.getName().equals(item.getName())) + .findFirst() + .orElseThrow(() -> new AssertionError("Expected tagged knowledge base in list response")); + + assertEquals(tags, created.getTags()); + assertEquals(tags, retrieved.getTags()); + assertEquals(tags, listed.getTags()); + } + + @Test + public void knowledgeBaseCostAttributionTagsPersistAsync() { + SearchIndexAsyncClient indexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + Map tags = createCostAttributionTags("FIN-042"); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL) + .setTags(tags); + + StepVerifier + .create(indexClient.createKnowledgeBase(knowledgeBase) + .flatMap(created -> indexClient.getKnowledgeBase(created.getName()))) + .assertNext(retrieved -> assertEquals(tags, retrieved.getTags())) + .verifyComplete(); + } + + @Test + public void knowledgeBaseCostAttributionTagsCanBeUpdatedSync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL) + .setTags(createCostAttributionTags("FIN-042")); + indexClient.createKnowledgeBase(knowledgeBase); + Map updatedTags = createCostAttributionTags("FIN-108"); + updatedTags.put("environment", "production"); + + indexClient.createOrUpdateKnowledgeBase(knowledgeBase.setTags(updatedTags)); + + assertEquals(updatedTags, indexClient.getKnowledgeBase(knowledgeBase.getName()).getTags()); + } + + @Test + public void knowledgeBaseCostAttributionTagsCanBeUpdatedAsync() { + SearchIndexAsyncClient indexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL) + .setTags(createCostAttributionTags("FIN-042")); + Map updatedTags = createCostAttributionTags("FIN-108"); + updatedTags.put("environment", "production"); + + StepVerifier + .create(indexClient.createKnowledgeBase(knowledgeBase) + .flatMap(created -> indexClient.createOrUpdateKnowledgeBase(created.setTags(updatedTags))) + .flatMap(updated -> indexClient.getKnowledgeBase(updated.getName()))) + .assertNext(retrieved -> assertEquals(updatedTags, retrieved.getTags())) + .verifyComplete(); + } + + @Test + public void taggedKnowledgeBaseRetrievalRemainsUnchangedSync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL) + .setTags(createCostAttributionTags("FIN-042")); + indexClient.createKnowledgeBase(knowledgeBase); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + KnowledgeBaseRetrievalOptions request = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) + .setIncludeActivity(true); + + KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(request); + + assertNotNull(response.getResponse()); + assertNotNull(response.getActivity()); + assertEquals(createCostAttributionTags("FIN-042"), + indexClient.getKnowledgeBase(knowledgeBase.getName()).getTags()); + } + + @Test + public void knowledgeBaseCostAttributionTagsRoundTripJson() throws IOException { + Map tags = createCostAttributionTags("FIN-042"); + KnowledgeBase knowledgeBase = new KnowledgeBase("capital-markets-kb", KNOWLEDGE_SOURCE_REFERENCE).setTags(tags); + + KnowledgeBase deserialized; + try (JsonReader reader = JsonProviders.createReader(knowledgeBase.toJsonString())) { + deserialized = KnowledgeBase.fromJson(reader); + } + + assertEquals(tags, deserialized.getTags()); + } + @Test public void basicRetrievalSync() { // Test knowledge base retrieval functionality. @@ -461,8 +580,8 @@ public void basicRetrievalWithReasoningEffortSync() { = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() - .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) - .setRetrievalReasoningEffort(new KnowledgeRetrievalMediumReasoningEffort()); + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")); + // .setRetrievalReasoningEffort(KnowledgeRetrievalReasoningEffortKind.MEDIUM); // TODO: Missing enum KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); assertNotNull(response); @@ -483,8 +602,59 @@ public void basicRetrievalWithReasoningEffortAsync() { .buildAsyncClient(); KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() - .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) - .setRetrievalReasoningEffort(new KnowledgeRetrievalMediumReasoningEffort()); + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")); + // .setRetrievalReasoningEffort(KnowledgeRetrievalReasoningEffortKind.MEDIUM); // TODO: Missing enum + + return knowledgeBaseClient.retrieve(retrievalRequest); + }); + + StepVerifier.create(createAndRetrieveMono).assertNext(response -> { + assertNotNull(response); + assertNotNull(response.getResponse()); + }).verifyComplete(); + } + + @Test + public void retrievalWithPersistedAutoReasoningEffortSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL) + .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS) + .setRetrievalReasoningEffort(new KnowledgeRetrievalAutoReasoningEffort()); + KnowledgeBase created = searchIndexClient.createKnowledgeBase(knowledgeBase); + + assertInstanceOf(KnowledgeRetrievalAutoReasoningEffort.class, created.getRetrievalReasoningEffort()); + assertEquals(KnowledgeRetrievalReasoningEffortKind.AUTO, created.getRetrievalReasoningEffort().getKind()); + + KnowledgeBaseRetrievalClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(created.getName()).buildClient(); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Which hotel has an infinity pool, spa, and concierge?")) + .setIncludeActivity(true); + + KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); + + assertNotNull(response); + assertNotNull(response.getResponse()); + assertAutoReasoningActivity(response); + } + + @Test + public void retrievalWithRequestAutoReasoningEffortAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + + Mono createAndRetrieveMono + = searchIndexClient.createKnowledgeBase(knowledgeBase).flatMap(created -> { + KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(created.getName()) + .buildAsyncClient(); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents( + new KnowledgeRetrievalSemanticIntent("Which hotel has an infinity pool, spa, and concierge?")) + .setRetrievalReasoningEffort(new KnowledgeRetrievalAutoReasoningEffort()) + .setIncludeActivity(true); return knowledgeBaseClient.retrieve(retrievalRequest); }); @@ -492,6 +662,7 @@ public void basicRetrievalWithReasoningEffortAsync() { StepVerifier.create(createAndRetrieveMono).assertNext(response -> { assertNotNull(response); assertNotNull(response.getResponse()); + assertAutoReasoningActivity(response); }).verifyComplete(); } @@ -692,6 +863,220 @@ public void retrievalWithKnowledgeSourceParamsAsync() { }).verifyComplete(); } + @Test + public void retrievalNeverQueriesExcludedSourceSync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + String excludedSourceName = randomKnowledgeBaseName() + "-excluded"; + indexClient.createKnowledgeSource(new SearchIndexKnowledgeSource(excludedSourceName, + new SearchIndexKnowledgeSourceParameters(HOTEL_INDEX_NAME))); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME), + new KnowledgeSourceReference(excludedSourceName)).setModels(KNOWLEDGE_BASE_MODEL); + indexClient.createKnowledgeBase(knowledgeBase); + + KnowledgeBaseRetrievalOptions request = createNeverQuerySourceRequest(excludedSourceName); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(request); + + assertNeverQuerySourceResult(response, excludedSourceName); + KnowledgeBase persisted = indexClient.getKnowledgeBase(knowledgeBase.getName()); + assertEquals(2, persisted.getKnowledgeSources().size()); + assertTrue( + persisted.getKnowledgeSources().stream().anyMatch(source -> excludedSourceName.equals(source.getName()))); + } + + @Test + public void retrievalNeverQueriesExcludedSourceAsync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + String excludedSourceName = randomKnowledgeBaseName() + "-excluded"; + indexClient.createKnowledgeSource(new SearchIndexKnowledgeSource(excludedSourceName, + new SearchIndexKnowledgeSourceParameters(HOTEL_INDEX_NAME))); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME), + new KnowledgeSourceReference(excludedSourceName)).setModels(KNOWLEDGE_BASE_MODEL); + indexClient.createKnowledgeBase(knowledgeBase); + KnowledgeBaseRetrievalAsyncClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(knowledgeBase.getName()) + .buildAsyncClient(); + + StepVerifier.create(retrievalClient.retrieve(createNeverQuerySourceRequest(excludedSourceName))) + .assertNext(response -> assertNeverQuerySourceResult(response, excludedSourceName)) + .verifyComplete(); + } + + @Test + public void retrievalRejectsConflictingSourceSelectionSync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + indexClient.createKnowledgeBase(knowledgeBase); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setAlwaysQuerySource(true) + .setNeverQuerySource(true); + KnowledgeBaseRetrievalOptions request = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + HttpResponseException exception + = assertThrows(HttpResponseException.class, () -> retrievalClient.retrieve(request)); + + assertEquals(400, exception.getResponse().getStatusCode()); + assertTrue(exception.getMessage().contains("alwaysQuerySource")); + assertTrue(exception.getMessage().contains("neverQuerySource")); + } + + @Test + public void retrievalRejectsConflictingSourceSelectionAsync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + indexClient.createKnowledgeBase(knowledgeBase); + KnowledgeBaseRetrievalAsyncClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(knowledgeBase.getName()) + .buildAsyncClient(); + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setAlwaysQuerySource(true) + .setNeverQuerySource(true); + KnowledgeBaseRetrievalOptions request = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + StepVerifier.create(retrievalClient.retrieve(request)).verifyErrorSatisfies(error -> { + HttpResponseException exception = assertInstanceOf(HttpResponseException.class, error); + assertEquals(400, exception.getResponse().getStatusCode()); + assertTrue(exception.getMessage().contains("alwaysQuerySource")); + assertTrue(exception.getMessage().contains("neverQuerySource")); + }); + } + + @Test + public void neverQuerySourceRoundTripsThroughPolymorphicModel() throws IOException { + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setNeverQuerySource(true) + .setFailOnError(true); + + KnowledgeSourceParams deserialized + = KnowledgeSourceParams.fromJson(JsonProviders.createReader(sourceParams.toJsonString())); + + SearchIndexKnowledgeSourceParams actual + = assertInstanceOf(SearchIndexKnowledgeSourceParams.class, deserialized); + assertEquals(Boolean.TRUE, actual.isNeverQuerySource()); + assertEquals(Boolean.TRUE, actual.isFailOnError()); + } + + @Test + public void knowledgeSourceResultsProcessingNonePersistsSync() { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + SearchIndexKnowledgeSource knowledgeSource + = createRerankerKnowledgeSource(KnowledgeSourceResultsProcessing.NONE); + + SearchIndexKnowledgeSource created + = assertInstanceOf(SearchIndexKnowledgeSource.class, indexClient.createKnowledgeSource(knowledgeSource)); + SearchIndexKnowledgeSource retrieved + = assertInstanceOf(SearchIndexKnowledgeSource.class, indexClient.getKnowledgeSource(created.getName())); + + assertEquals(KnowledgeSourceResultsProcessing.NONE, created.getResultsProcessing()); + assertEquals(KnowledgeSourceResultsProcessing.NONE, retrieved.getResultsProcessing()); + assertEquals("semantic-config", retrieved.getSearchIndexParameters().getSemanticConfigurationName()); + } + + @Test + public void knowledgeSourceResultsProcessingNonePersistsAsync() { + SearchIndexAsyncClient indexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + SearchIndexKnowledgeSource knowledgeSource + = createRerankerKnowledgeSource(KnowledgeSourceResultsProcessing.NONE); + + StepVerifier.create(indexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> indexClient.getKnowledgeSource(created.getName()))).assertNext(retrieved -> { + SearchIndexKnowledgeSource actual = assertInstanceOf(SearchIndexKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceResultsProcessing.NONE, actual.getResultsProcessing()); + assertEquals("semantic-config", actual.getSearchIndexParameters().getSemanticConfigurationName()); + }).verifyComplete(); + } + + @Test + public void storedResultsProcessingNoneSkipsRerankerSync() { + RerankerTestResources resources = createRerankerTestResources(KnowledgeSourceResultsProcessing.NONE); + KnowledgeBaseRetrievalResult response + = resources.client.retrieve(createRerankerRequest(resources.knowledgeSourceName, null, null)); + + assertRerankerDisabled(response, resources.knowledgeSourceName); + } + + @Test + public void runtimeResultsProcessingNoneOverridesStoredRerankAsync() { + RerankerTestResources resources = createRerankerTestResources(KnowledgeSourceResultsProcessing.RERANK); + KnowledgeBaseRetrievalAsyncClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(resources.knowledgeBaseName) + .buildAsyncClient(); + + StepVerifier + .create(retrievalClient.retrieve( + createRerankerRequest(resources.knowledgeSourceName, KnowledgeSourceResultsProcessing.NONE, null))) + .assertNext(response -> assertRerankerDisabled(response, resources.knowledgeSourceName)) + .verifyComplete(); + } + + @Test + public void runtimeResultsProcessingRerankOverridesStoredNoneSync() { + RerankerTestResources resources = createRerankerTestResources(KnowledgeSourceResultsProcessing.NONE); + KnowledgeBaseRetrievalResult response = resources.client.retrieve( + createRerankerRequest(resources.knowledgeSourceName, KnowledgeSourceResultsProcessing.RERANK, 0.0F)); + + KnowledgeBaseSearchIndexActivityRecord activity + = getSearchIndexActivity(response, resources.knowledgeSourceName); + assertEquals("semantic-config", activity.getSearchIndexArguments().getSemanticConfigurationName()); + } + + @Test + public void rerankerThresholdRejectedWhenStoredProcessingIsNoneSync() { + RerankerTestResources resources = createRerankerTestResources(KnowledgeSourceResultsProcessing.NONE); + + HttpResponseException exception = assertThrows(HttpResponseException.class, + () -> resources.client.retrieve(createRerankerRequest(resources.knowledgeSourceName, null, 2.5F))); + + assertEquals(400, exception.getResponse().getStatusCode()); + assertTrue(exception.getMessage().toLowerCase().contains("rerankerthreshold")); + } + + @Test + public void rerankerThresholdRejectedWhenRuntimeProcessingIsNoneAsync() { + RerankerTestResources resources = createRerankerTestResources(KnowledgeSourceResultsProcessing.RERANK); + KnowledgeBaseRetrievalAsyncClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(resources.knowledgeBaseName) + .buildAsyncClient(); + + StepVerifier + .create(retrievalClient.retrieve( + createRerankerRequest(resources.knowledgeSourceName, KnowledgeSourceResultsProcessing.NONE, 2.5F))) + .verifyErrorSatisfies(error -> { + HttpResponseException exception = assertInstanceOf(HttpResponseException.class, error); + assertEquals(400, exception.getResponse().getStatusCode()); + assertTrue(exception.getMessage().toLowerCase().contains("rerankerthreshold")); + }); + } + + @Test + public void resultsProcessingRoundTripsResourceAndRuntimeModels() throws IOException { + SearchIndexKnowledgeSource source = createRerankerKnowledgeSource(KnowledgeSourceResultsProcessing.NONE); + SearchIndexKnowledgeSourceParams runtimeParams = new SearchIndexKnowledgeSourceParams(source.getName()) + .setResultsProcessing(KnowledgeSourceResultsProcessing.RERANK); + + SearchIndexKnowledgeSource deserializedSource; + try (JsonReader reader = JsonProviders.createReader(source.toJsonString())) { + deserializedSource = SearchIndexKnowledgeSource.fromJson(reader); + } + KnowledgeSourceParams deserializedParams + = KnowledgeSourceParams.fromJson(JsonProviders.createReader(runtimeParams.toJsonString())); + + assertEquals(KnowledgeSourceResultsProcessing.NONE, deserializedSource.getResultsProcessing()); + assertEquals(KnowledgeSourceResultsProcessing.RERANK, deserializedParams.getResultsProcessing()); + } + @Test public void retrievalReturnsCitationUrlWithoutSourceDataSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); @@ -736,7 +1121,7 @@ public void retrievalWithMaxOutputSizeSync() { KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) - .setMaxOutputSizeInTokens(5001) + .setMaxOutputSize(5001) .setMaxOutputDocuments(100); KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); @@ -758,7 +1143,7 @@ public void retrievalWithMaxOutputSizeAsync() { KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) - .setMaxOutputSizeInTokens(5001) + .setMaxOutputSize(5001) .setMaxOutputDocuments(100); return knowledgeBaseClient.retrieve(retrievalRequest); @@ -914,70 +1299,271 @@ public void retrievalWithFilterAddOnAsync() { }).verifyComplete(); } - @Disabled("Requires an embedding model deployment (e.g., text-embedding-3-large) on the AOAI resource") @Test - public void retrievalWithFileKnowledgeSourceParamsSync() { + public void retrievalUsesKnowledgeSourceFilterHintsSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + String knowledgeSourceName = testResourceNamer.randomName("query-hint-source-", 63); + SearchIndexKnowledgeSourceFilterHint filterHint + = new SearchIndexKnowledgeSourceFilterHint("Category", Collections.singletonList("Luxury")) + .setFilterInstructions("Filter by the hotel category requested by the user."); + SearchIndexKnowledgeSourceQueryHints queryHints + = new SearchIndexKnowledgeSourceQueryHints().setFilters(Collections.singletonList(filterHint)); + SearchIndexKnowledgeSource knowledgeSource = new SearchIndexKnowledgeSource(knowledgeSourceName, + new SearchIndexKnowledgeSourceParameters(HOTEL_INDEX_NAME).setQueryHints(queryHints)); + + SearchIndexKnowledgeSource created = assertInstanceOf(SearchIndexKnowledgeSource.class, + searchIndexClient.createKnowledgeSource(knowledgeSource)); + assertNotNull(created.getSearchIndexParameters().getQueryHints()); + assertEquals("Category", created.getSearchIndexParameters().getQueryHints().getFilters().get(0).getField()); - // Create a File KS with required ingestion params using a real AOAI endpoint - String fileKsName = randomKnowledgeBaseName() + "-file-ks"; - FileKnowledgeSourceParameters fileParams = new FileKnowledgeSourceParameters().setIngestionParameters( - new KnowledgeSourceIngestionParameters().setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() - .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) - .setDeploymentName(OPENAI_EMBEDDING_DEPLOYMENT_NAME) - .setModelName(AzureOpenAIModelName.fromString(OPENAI_EMBEDDING_MODEL_NAME))))); - FileKnowledgeSource fileKs = new FileKnowledgeSource(fileKsName, fileParams); - searchIndexClient.createKnowledgeSource(fileKs); - - // Create KB referencing the File KS KnowledgeBase knowledgeBase - = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fileKsName)) + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(knowledgeSourceName)) .setModels(KNOWLEDGE_BASE_MODEL); searchIndexClient.createKnowledgeBase(knowledgeBase); - - KnowledgeBaseRetrievalClient knowledgeBaseClient + KnowledgeBaseRetrievalClient retrievalClient = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); - - // Use FileKnowledgeSourceParams to exercise the runtime params model - FileKnowledgeSourceParams sourceParams = new FileKnowledgeSourceParams(fileKsName).setMaxOutputDocuments(10) - .setIncludeReferences(true) - .setIncludeReferenceSourceData(true); - + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(knowledgeSourceName).setAlwaysQuerySource(true); KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() - .setIntents(new KnowledgeRetrievalSemanticIntent("What documents are available?")) - .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + .setIntents(new KnowledgeRetrievalSemanticIntent("Find a luxury hotel with an infinity pool.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)) + .setIncludeActivity(true); + + KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(retrievalRequest); - // File KS has no uploaded files, so response may be empty but request should succeed - KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); - assertNotNull(response); assertNotNull(response.getResponse()); + KnowledgeBaseSearchIndexActivityRecord activity = getSearchIndexActivity(response, knowledgeSourceName); + assertNotNull(activity.getQueryHintProcessing()); + assertNotNull(activity.getQueryHintProcessing().getGeneratedFilter()); + assertTrue(activity.getQueryHintProcessing().getGeneratedFilter().contains("Luxury")); + assertNotNull(activity.getSearchIndexArguments()); + assertTrue(activity.getSearchIndexArguments().getFilter().contains("Luxury")); } - @Disabled("Requires an embedding model deployment (e.g., text-embedding-3-large) on the AOAI resource") @Test - public void retrievalWithFileKnowledgeSourceParamsAsync() { - SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + public void retrievalUsesQueryHintBoostOverrideSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); - String fileKsName = randomKnowledgeBaseName() + "-file-ks"; - FileKnowledgeSourceParameters fileParams = new FileKnowledgeSourceParameters().setIngestionParameters( - new KnowledgeSourceIngestionParameters().setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() - .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) - .setDeploymentName(OPENAI_EMBEDDING_DEPLOYMENT_NAME) - .setModelName(AzureOpenAIModelName.fromString(OPENAI_EMBEDDING_MODEL_NAME))))); - FileKnowledgeSource fileKs = new FileKnowledgeSource(fileKsName, fileParams); + SearchIndexKnowledgeSourceFieldValueBoost boost = new SearchIndexKnowledgeSourceFieldValueBoost("Category", 2.0) + .setFieldValues(Collections.singletonList("Luxury")) + .setBoostInstructions("Prefer the hotel category requested by the user."); + SearchIndexKnowledgeSourceQueryHints queryHintOverrides + = new SearchIndexKnowledgeSourceQueryHints().setBoosts(Collections.singletonList(boost)); + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setAlwaysQuerySource(true) + .setQueryHintOverrides(queryHintOverrides); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Prefer luxury hotels with an infinity pool.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)) + .setIncludeActivity(true); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); - KnowledgeBase knowledgeBase - = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fileKsName)) - .setModels(KNOWLEDGE_BASE_MODEL); + KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(retrievalRequest); - Mono createAndRetrieveMono = searchIndexClient.createKnowledgeSource(fileKs) - .then(searchIndexClient.createKnowledgeBase(knowledgeBase)) - .flatMap(created -> { - KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient - = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(created.getName()) - .buildAsyncClient(); + assertNotNull(response.getResponse()); + KnowledgeBaseSearchIndexActivityRecord activity = getSearchIndexActivity(response, HOTEL_KNOWLEDGE_SOURCE_NAME); + assertNotNull(activity.getQueryHintProcessing()); + assertNotNull(activity.getQueryHintProcessing().getGeneratedBoost()); + assertTrue(activity.getQueryHintProcessing().getGeneratedBoost().contains("Luxury")); + assertNotNull(activity.getSearchIndexArguments()); + assertEquals(QueryType.FULL, activity.getSearchIndexArguments().getQueryType()); + assertTrue(activity.getSearchIndexArguments().getSearch().contains("Luxury")); + } - FileKnowledgeSourceParams sourceParams + @Test + public void retrievalCombinesQueryHintBoostWithFilterAddOnSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + SearchIndexKnowledgeSourceFieldValueBoost boost = new SearchIndexKnowledgeSourceFieldValueBoost("Category", 2.0) + .setFieldValues(Collections.singletonList("Budget")) + .setBoostInstructions("Prefer the hotel category requested by the user."); + SearchIndexKnowledgeSourceQueryHints queryHintOverrides + = new SearchIndexKnowledgeSourceQueryHints().setBoosts(Collections.singletonList(boost)); + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setAlwaysQuerySource(true) + .setFilterAddOn("ParkingIncluded eq true") + .setQueryHintOverrides(queryHintOverrides); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Find a budget hotel with parking.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)) + .setIncludeActivity(true); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(retrievalRequest); + + assertNotNull(response.getResponse()); + KnowledgeBaseSearchIndexActivityRecord activity = getSearchIndexActivity(response, HOTEL_KNOWLEDGE_SOURCE_NAME); + assertNotNull(activity.getQueryHintProcessing()); + assertNotNull(activity.getQueryHintProcessing().getGeneratedBoost()); + assertTrue(activity.getQueryHintProcessing().getGeneratedBoost().contains("Budget")); + assertNull(activity.getQueryHintProcessing().getGeneratedFilter()); + assertNotNull(activity.getSearchIndexArguments()); + assertEquals(QueryType.FULL, activity.getSearchIndexArguments().getQueryType()); + assertTrue(activity.getSearchIndexArguments().getFilter().contains("ParkingIncluded eq true")); + } + + @Test + public void emptyQueryHintOverrideSuppressesKnowledgeSourceHintsSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + String knowledgeSourceName = testResourceNamer.randomName("query-hint-source-", 63); + SearchIndexKnowledgeSourceFilterHint filterHint + = new SearchIndexKnowledgeSourceFilterHint("Category", Collections.singletonList("Luxury")) + .setFilterInstructions("Filter by the hotel category requested by the user."); + SearchIndexKnowledgeSourceQueryHints queryHints + = new SearchIndexKnowledgeSourceQueryHints().setFilters(Collections.singletonList(filterHint)); + searchIndexClient.createKnowledgeSource(new SearchIndexKnowledgeSource(knowledgeSourceName, + new SearchIndexKnowledgeSourceParameters(HOTEL_INDEX_NAME).setQueryHints(queryHints))); + + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(knowledgeSourceName)) + .setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + SearchIndexKnowledgeSourceQueryHints emptyOverride + = new SearchIndexKnowledgeSourceQueryHints().setFilters(Collections.emptyList()) + .setBoosts(Collections.emptyList()); + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(knowledgeSourceName).setAlwaysQuerySource(true) + .setQueryHintOverrides(emptyOverride); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Find a luxury hotel with an infinity pool.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)) + .setIncludeActivity(true); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(retrievalRequest); + + assertNotNull(response.getResponse()); + KnowledgeBaseSearchIndexActivityRecord activity = getSearchIndexActivity(response, knowledgeSourceName); + assertNotNull(activity.getSearchIndexArguments()); + assertNull(activity.getSearchIndexArguments().getFilter()); + if (activity.getQueryHintProcessing() != null) { + assertNull(activity.getQueryHintProcessing().getGeneratedFilter()); + assertNull(activity.getQueryHintProcessing().getGeneratedBoost()); + } + } + + @Test + public void retrievalRejectsInvalidQueryHintBoostSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + SearchIndexKnowledgeSourceFieldValueBoost invalidBoost + = new SearchIndexKnowledgeSourceFieldValueBoost("Category", 1.0) + .setFieldValues(Collections.singletonList("Luxury")); + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setAlwaysQuerySource(true) + .setQueryHintOverrides( + new SearchIndexKnowledgeSourceQueryHints().setBoosts(Collections.singletonList(invalidBoost))); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Find a luxury hotel.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + HttpResponseException exception + = assertThrows(HttpResponseException.class, () -> retrievalClient.retrieve(retrievalRequest)); + + assertEquals(400, exception.getResponse().getStatusCode()); + } + + @Test + public void queryHintsDeserializePolymorphicBoosts() throws IOException { + SearchIndexKnowledgeSourceFieldValueBoost boost = new SearchIndexKnowledgeSourceFieldValueBoost("Category", 2.0) + .setFieldValues(Collections.singletonList("Luxury")) + .setBoostInstructions("Prefer luxury hotels."); + SearchIndexKnowledgeSourceQueryHints queryHints + = new SearchIndexKnowledgeSourceQueryHints().setBoosts(Collections.singletonList(boost)); + + try (JsonReader reader = JsonProviders.createReader(queryHints.toJsonString())) { + SearchIndexKnowledgeSourceQueryHints deserialized = SearchIndexKnowledgeSourceQueryHints.fromJson(reader); + + assertEquals(1, deserialized.getBoosts().size()); + SearchIndexKnowledgeSourceFieldValueBoost deserializedBoost + = assertInstanceOf(SearchIndexKnowledgeSourceFieldValueBoost.class, deserialized.getBoosts().get(0)); + assertEquals("Category", deserializedBoost.getField()); + assertEquals(Collections.singletonList("Luxury"), deserializedBoost.getFieldValues()); + assertEquals(2.0, deserializedBoost.getBoost()); + assertEquals("Prefer luxury hotels.", deserializedBoost.getBoostInstructions()); + } + } + + @Disabled("Requires an embedding model deployment (e.g., text-embedding-3-large) on the AOAI resource") + @Test + public void retrievalWithFileKnowledgeSourceParamsSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + // Create a File KS with required ingestion params using a real AOAI endpoint + String fileKsName = randomKnowledgeBaseName() + "-file-ks"; + FileKnowledgeSourceParameters fileParams = new FileKnowledgeSourceParameters().setIngestionParameters( + new KnowledgeSourceIngestionParameters().setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName(KNOWLEDGEBASE_DEPLOYMENT_NAME) + .setModelName(AzureOpenAIModelName.fromString(OPENAI_MODEL_NAME)) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY))))); + FileKnowledgeSource fileKs = new FileKnowledgeSource(fileKsName, fileParams); + searchIndexClient.createKnowledgeSource(fileKs); + + // Create KB referencing the File KS + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fileKsName)) + .setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + KnowledgeBaseRetrievalClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + // Use FileKnowledgeSourceParams to exercise the runtime params model + FileKnowledgeSourceParams sourceParams = new FileKnowledgeSourceParams(fileKsName).setMaxOutputDocuments(10) + .setIncludeReferences(true) + .setIncludeReferenceSourceData(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What documents are available?")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + // File KS has no uploaded files, so response may be empty but request should succeed + KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); + assertNotNull(response); + assertNotNull(response.getResponse()); + } + + @Disabled("Requires an embedding model deployment (e.g., text-embedding-3-large) on the AOAI resource") + @Test + public void retrievalWithFileKnowledgeSourceParamsAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + + String fileKsName = randomKnowledgeBaseName() + "-file-ks"; + FileKnowledgeSourceParameters fileParams = new FileKnowledgeSourceParameters().setIngestionParameters( + new KnowledgeSourceIngestionParameters().setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName(KNOWLEDGEBASE_DEPLOYMENT_NAME) + .setModelName(AzureOpenAIModelName.fromString(OPENAI_MODEL_NAME)) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY))))); + FileKnowledgeSource fileKs = new FileKnowledgeSource(fileKsName, fileParams); + + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fileKsName)) + .setModels(KNOWLEDGE_BASE_MODEL); + + Mono createAndRetrieveMono = searchIndexClient.createKnowledgeSource(fileKs) + .then(searchIndexClient.createKnowledgeBase(knowledgeBase)) + .flatMap(created -> { + KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(created.getName()) + .buildAsyncClient(); + + FileKnowledgeSourceParams sourceParams = new FileKnowledgeSourceParams(fileKsName).setMaxOutputDocuments(10) .setIncludeReferences(true) .setIncludeReferenceSourceData(true); @@ -1007,7 +1593,6 @@ public void basicRetrievalStreamSync() throws IOException { .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) .setIncludeActivity(true); List events = new ArrayList<>(); - try (CloseableIterableStream stream = retrievalClient.retrieveStream(request)) { stream.forEach(events::add); @@ -1033,7 +1618,7 @@ public void basicRetrievalStreamAsync() { private static void assertSuccessfulRetrievalStream(List events) { assertFalse(events.isEmpty()); - assertTrue(events.stream().anyMatch(KnowledgeBaseRetrievalStartedStreamEvent.class::isInstance)); + assertTrue(events.stream().anyMatch(event -> event instanceof KnowledgeBaseRetrievalStartedStreamEvent)); KnowledgeBaseResponseCompletedStreamEvent completed = events.stream() .filter(KnowledgeBaseResponseCompletedStreamEvent.class::isInstance) .map(KnowledgeBaseResponseCompletedStreamEvent.class::cast) @@ -1053,14 +1638,9 @@ public void retrievalActivityIncludesModelNameSync() { KnowledgeBaseRetrievalClient knowledgeBaseClient = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); - // Explicit intents bypass query planning; request model-backed retrieval instead. - KnowledgeBaseRetrievalOptions retrievalRequest - = new KnowledgeBaseRetrievalOptions() - .setMessages(Collections.singletonList(new KnowledgeBaseMessage( - new KnowledgeBaseMessageTextContent("What are the pet policies at the hotel?")).setRole("user"))) - .setRetrievalReasoningEffort(new KnowledgeRetrievalMediumReasoningEffort()) - .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS) - .setIncludeActivity(true); + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) + .setIncludeActivity(true); KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); assertNotNull(response); @@ -1078,12 +1658,7 @@ public void retrievalActivityIncludesModelNameSync() { } return false; }); - assertTrue(foundModelName, - () -> "Expected at least one model-backed activity record with modelName set. Actual activity types: " - + response.getActivity() - .stream() - .map(record -> record.getType().toString()) - .collect(Collectors.joining(", "))); + assertTrue(foundModelName, "Expected at least one model-backed activity record with modelName set"); } @Test @@ -1099,11 +1674,7 @@ public void retrievalActivityIncludesModelNameAsync() { .buildAsyncClient(); KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() - .setMessages(Collections.singletonList(new KnowledgeBaseMessage( - new KnowledgeBaseMessageTextContent("What are the pet policies at the hotel?")) - .setRole("user"))) - .setRetrievalReasoningEffort(new KnowledgeRetrievalMediumReasoningEffort()) - .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS) + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) .setIncludeActivity(true); return knowledgeBaseClient.retrieve(retrievalRequest); @@ -1124,15 +1695,278 @@ public void retrievalActivityIncludesModelNameAsync() { } return false; }); - assertTrue(foundModelName, - () -> "Expected at least one model-backed activity record with modelName set. Actual activity types: " - + response.getActivity() - .stream() - .map(record -> record.getType().toString()) - .collect(Collectors.joining(", "))); + assertTrue(foundModelName, "Expected at least one model-backed activity record with modelName set"); }).verifyComplete(); } + // Fabric retrieval tests are disabled until the Fabric workspace/ontology/data-agent are configured + // to accept queries from the search service. The current error is 405 Method Not Allowed from + // the Fabric endpoint. Once permissions are granted, enable these tests and record sessions. + + @Disabled("Requires Fabric workspace configured to accept search-service retrieval queries") + @Test + public void fabricDataAgentRetrievalSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + String fabricKsName = randomKnowledgeBaseName() + "-da-ks"; + FabricDataAgentKnowledgeSource fabricKs = new FabricDataAgentKnowledgeSource(fabricKsName, + new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID)); + searchIndexClient.createKnowledgeSource(fabricKs); + + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fabricKsName)) + .setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + KnowledgeBaseRetrievalClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + FabricDataAgentKnowledgeSourceParams sourceParams = new FabricDataAgentKnowledgeSourceParams(fabricKsName); + sourceParams.setAlwaysQuerySource(true); + sourceParams.setIncludeReferences(true); + sourceParams.setIncludeReferenceSourceData(true); + + KnowledgeBaseRetrievalOptions retrievalRequest + = new KnowledgeBaseRetrievalOptions().setIntents(new KnowledgeRetrievalSemanticIntent("List all data")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + // Fabric sources require x-ms-query-source-authorization header (OBO token) + String querySourceToken = getQuerySourceAuthorizationToken(); + KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest, querySourceToken, null); + assertNotNull(response); + assertNotNull(response.getResponse()); + } + + @Disabled("Requires Fabric workspace configured to accept search-service retrieval queries") + @Test + public void fabricDataAgentRetrievalAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + String authToken = getQuerySourceAuthorizationToken(); + + String fabricKsName = randomKnowledgeBaseName() + "-da-ks"; + FabricDataAgentKnowledgeSource fabricKs = new FabricDataAgentKnowledgeSource(fabricKsName, + new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID)); + + Mono testMono + = searchIndexClient.createKnowledgeSource(fabricKs).then(Mono.defer(() -> { + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fabricKsName)) + .setModels(KNOWLEDGE_BASE_MODEL); + return searchIndexClient.createKnowledgeBase(knowledgeBase); + })).flatMap(createdKb -> { + KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(createdKb.getName()) + .buildAsyncClient(); + + FabricDataAgentKnowledgeSourceParams sourceParams + = new FabricDataAgentKnowledgeSourceParams(fabricKsName); + sourceParams.setAlwaysQuerySource(true); + sourceParams.setIncludeReferences(true); + sourceParams.setIncludeReferenceSourceData(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("List all data")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + return knowledgeBaseClient.retrieve(retrievalRequest, authToken, null); + }); + + StepVerifier.create(testMono).assertNext(response -> { + assertNotNull(response); + assertNotNull(response.getResponse()); + }).verifyComplete(); + } + + @Disabled("Requires Fabric workspace configured to accept search-service retrieval queries") + @Test + public void fabricOntologyRetrievalSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + String fabricKsName = randomKnowledgeBaseName() + "-ont-ks"; + FabricOntologyKnowledgeSource fabricKs = new FabricOntologyKnowledgeSource(fabricKsName, + new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID)); + searchIndexClient.createKnowledgeSource(fabricKs); + + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fabricKsName)) + .setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + KnowledgeBaseRetrievalClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + FabricOntologyKnowledgeSourceParams sourceParams = new FabricOntologyKnowledgeSourceParams(fabricKsName); + sourceParams.setAlwaysQuerySource(true); + sourceParams.setIncludeReferences(true); + sourceParams.setIncludeReferenceSourceData(true); + + KnowledgeBaseRetrievalOptions retrievalRequest + = new KnowledgeBaseRetrievalOptions().setIntents(new KnowledgeRetrievalSemanticIntent("List all data")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + String querySourceToken = getQuerySourceAuthorizationToken(); + KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest, querySourceToken, null); + assertNotNull(response); + assertNotNull(response.getResponse()); + } + + @Disabled("Requires Fabric workspace configured to accept search-service retrieval queries") + @Test + public void fabricOntologyRetrievalAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + String authToken = getQuerySourceAuthorizationToken(); + + String fabricKsName = randomKnowledgeBaseName() + "-ont-ks"; + FabricOntologyKnowledgeSource fabricKs = new FabricOntologyKnowledgeSource(fabricKsName, + new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID)); + + Mono testMono + = searchIndexClient.createKnowledgeSource(fabricKs).then(Mono.defer(() -> { + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(fabricKsName)) + .setModels(KNOWLEDGE_BASE_MODEL); + return searchIndexClient.createKnowledgeBase(knowledgeBase); + })).flatMap(createdKb -> { + KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(createdKb.getName()) + .buildAsyncClient(); + + FabricOntologyKnowledgeSourceParams sourceParams + = new FabricOntologyKnowledgeSourceParams(fabricKsName); + sourceParams.setAlwaysQuerySource(true); + sourceParams.setIncludeReferences(true); + sourceParams.setIncludeReferenceSourceData(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("List all data")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + return knowledgeBaseClient.retrieve(retrievalRequest, authToken, null); + }); + + StepVerifier.create(testMono).assertNext(response -> { + assertNotNull(response); + assertNotNull(response.getResponse()); + }).verifyComplete(); + } + + /** + * Acquires an access token for use as the x-ms-query-source-authorization header + * required by Fabric knowledge sources during retrieval. + */ + private String getQuerySourceAuthorizationToken() { + return TestHelpers.getTestTokenCredential() + .getTokenSync(new TokenRequestContext().addScopes("https://search.azure.com/.default")) + .getToken(); + } + + @Test + public void retrievalResultDeserializesWithSensitivityLabels() throws IOException { + String json = "{" + + "\"response\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Answer text.\"}]}]," + + "\"references\":[" + " {\"type\":\"azureBlob\",\"id\":\"0\",\"activitySource\":1," + + " \"blobUrl\":\"https://contoso.blob.core.windows.net/docs/file1.pdf\"," + " \"rerankerScore\":3.8," + + " \"searchSensitivityLabelInfo\":{" + + " \"sensitivityLabelId\":\"3a4f2b91-c7d8-4e12-9f01-ab34cd56ef78\"," + + " \"displayName\":\"Confidential\"," + " \"isEncrypted\":false," + " \"priority\":2," + + " \"color\":\"#FF0000\"," + " \"toolTip\":\"Confidential content\"" + " }}," + + " {\"type\":\"searchIndex\",\"id\":\"1\",\"activitySource\":1," + + " \"indexName\":\"my-index\",\"documentKey\":\"doc-123\"," + " \"rerankerScore\":3.5," + + " \"searchSensitivityLabelInfo\":{" + + " \"sensitivityLabelId\":\"9c8b7a61-5d4e-43f2-b123-98fedcba4321\"," + + " \"displayName\":\"Highly Confidential\"," + " \"isEncrypted\":true," + " \"priority\":0," + + " \"color\":\"#800080\"," + " \"toolTip\":\"Highly confidential\"" + " }}," + + " {\"type\":\"indexedOneLake\",\"id\":\"2\",\"activitySource\":1," + + " \"searchSensitivityLabelInfo\":{" + " \"sensitivityLabelId\":\"aaa-bbb-ccc\"," + + " \"displayName\":\"Internal\"," + " \"isEncrypted\":false," + " \"priority\":3" + " }}," + + " {\"type\":\"indexedSharePoint\",\"id\":\"3\",\"activitySource\":1," + + " \"searchSensitivityLabelInfo\":{" + " \"sensitivityLabelId\":\"ddd-eee-fff\"," + + " \"displayName\":\"Public\"," + " \"isEncrypted\":false," + " \"priority\":4" + " }}" + + "]," + "\"responseSensitivityLabelInfo\":{" + + " \"sensitivityLabelId\":\"9c8b7a61-5d4e-43f2-b123-98fedcba4321\"," + + " \"displayName\":\"Highly Confidential\"," + " \"isEncrypted\":true," + " \"priority\":0," + + " \"color\":\"#800080\"," + " \"toolTip\":\"Highly confidential\"" + "}" + "}"; + + try (JsonReader reader = JsonProviders.createReader(json)) { + KnowledgeBaseRetrievalResult result = KnowledgeBaseRetrievalResult.fromJson(reader); + + // Verify response-level sensitivity label + PurviewSensitivityLabelInfo responseLabel = result.getResponseSensitivityLabelInfo(); + assertNotNull(responseLabel); + assertEquals("9c8b7a61-5d4e-43f2-b123-98fedcba4321", responseLabel.getSensitivityLabelId()); + assertEquals("Highly Confidential", responseLabel.getDisplayName()); + assertEquals(true, responseLabel.isEncrypted()); + assertEquals(Integer.valueOf(0), responseLabel.getPriority()); + assertEquals("#800080", responseLabel.getColor()); + assertEquals("Highly confidential", responseLabel.getToolTip()); + + // Verify azureBlob reference label + assertNotNull(result.getReferences()); + assertEquals(4, result.getReferences().size()); + + KnowledgeBaseAzureBlobReference blobRef + = assertInstanceOf(KnowledgeBaseAzureBlobReference.class, result.getReferences().get(0)); + PurviewSensitivityLabelInfo blobLabel = blobRef.getSearchSensitivityLabelInfo(); + assertNotNull(blobLabel); + assertEquals("3a4f2b91-c7d8-4e12-9f01-ab34cd56ef78", blobLabel.getSensitivityLabelId()); + assertEquals("Confidential", blobLabel.getDisplayName()); + assertEquals(false, blobLabel.isEncrypted()); + assertEquals(Integer.valueOf(2), blobLabel.getPriority()); + assertEquals("#FF0000", blobLabel.getColor()); + + // Verify searchIndex reference label + KnowledgeBaseSearchIndexReference indexRef + = assertInstanceOf(KnowledgeBaseSearchIndexReference.class, result.getReferences().get(1)); + PurviewSensitivityLabelInfo indexLabel = indexRef.getSearchSensitivityLabelInfo(); + assertNotNull(indexLabel); + assertEquals("9c8b7a61-5d4e-43f2-b123-98fedcba4321", indexLabel.getSensitivityLabelId()); + assertEquals("Highly Confidential", indexLabel.getDisplayName()); + assertEquals(true, indexLabel.isEncrypted()); + + // Verify indexedOneLake reference label + KnowledgeBaseIndexedOneLakeReference oneLakeRef + = assertInstanceOf(KnowledgeBaseIndexedOneLakeReference.class, result.getReferences().get(2)); + PurviewSensitivityLabelInfo oneLakeLabel = oneLakeRef.getSearchSensitivityLabelInfo(); + assertNotNull(oneLakeLabel); + assertEquals("aaa-bbb-ccc", oneLakeLabel.getSensitivityLabelId()); + assertEquals("Internal", oneLakeLabel.getDisplayName()); + + // Verify indexedSharePoint reference label + KnowledgeBaseIndexedSharePointReference spRef + = assertInstanceOf(KnowledgeBaseIndexedSharePointReference.class, result.getReferences().get(3)); + PurviewSensitivityLabelInfo spLabel = spRef.getSearchSensitivityLabelInfo(); + assertNotNull(spLabel); + assertEquals("ddd-eee-fff", spLabel.getSensitivityLabelId()); + assertEquals("Public", spLabel.getDisplayName()); + } + } + + @Test + public void retrievalResultDeserializesWithoutSensitivityLabels() throws IOException { + String json = "{" + + "\"response\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Answer.\"}]}]," + + "\"references\":[" + " {\"type\":\"azureBlob\",\"id\":\"0\",\"activitySource\":1," + + " \"blobUrl\":\"https://contoso.blob.core.windows.net/docs/file1.pdf\"," + " \"rerankerScore\":3.8}," + + " {\"type\":\"searchIndex\",\"id\":\"1\",\"activitySource\":1," + + " \"indexName\":\"my-index\",\"documentKey\":\"doc-123\"," + " \"rerankerScore\":3.5}" + "]" + "}"; + + try (JsonReader reader = JsonProviders.createReader(json)) { + KnowledgeBaseRetrievalResult result = KnowledgeBaseRetrievalResult.fromJson(reader); + + // No response-level label + assertNull(result.getResponseSensitivityLabelInfo()); + + // No per-reference labels + KnowledgeBaseAzureBlobReference blobRef + = assertInstanceOf(KnowledgeBaseAzureBlobReference.class, result.getReferences().get(0)); + assertNull(blobRef.getSearchSensitivityLabelInfo()); + + KnowledgeBaseSearchIndexReference indexRef + = assertInstanceOf(KnowledgeBaseSearchIndexReference.class, result.getReferences().get(1)); + assertNull(indexRef.getSearchSensitivityLabelInfo()); + } + } + @Test public void retrievalResultDeserializesCitationUrls() throws IOException { String citationBaseUrl = "https://contoso.search.windows.net/knowledgesources/source/docs/"; @@ -1264,6 +2098,248 @@ public void createKnowledgeBaseWithoutCorsOptionsAsync() { }).verifyComplete(); } + @Test + public void createKnowledgeBaseWithEnableImageServingSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeSourceReference sourceRef + = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableImageServing(true); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), sourceRef).setModels(KNOWLEDGE_BASE_MODEL); + + KnowledgeBase created = searchIndexClient.createKnowledgeBase(knowledgeBase); + + assertEquals(knowledgeBase.getName(), created.getName()); + assertEquals(1, created.getKnowledgeSources().size()); + KnowledgeSourceReference createdRef = created.getKnowledgeSources().get(0); + assertEquals(HOTEL_KNOWLEDGE_SOURCE_NAME, createdRef.getName()); + assertEquals(true, createdRef.isEnableImageServing()); + } + + @Test + public void createKnowledgeBaseWithEnableImageServingAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + KnowledgeSourceReference sourceRef + = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableImageServing(true); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), sourceRef).setModels(KNOWLEDGE_BASE_MODEL); + + Mono createMono = searchIndexClient.createKnowledgeBase(knowledgeBase); + + StepVerifier.create(createMono).assertNext(created -> { + assertEquals(knowledgeBase.getName(), created.getName()); + assertEquals(1, created.getKnowledgeSources().size()); + KnowledgeSourceReference createdRef = created.getKnowledgeSources().get(0); + assertEquals(HOTEL_KNOWLEDGE_SOURCE_NAME, createdRef.getName()); + assertEquals(true, createdRef.isEnableImageServing()); + }).verifyComplete(); + } + + @Test + public void createKnowledgeBaseWithFreshnessEnabledSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeSourceReference sourceRef + = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableFreshness(true); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), sourceRef).setModels(KNOWLEDGE_BASE_MODEL); + + KnowledgeBase created = searchIndexClient.createKnowledgeBase(knowledgeBase); + + assertEquals(knowledgeBase.getName(), created.getName()); + assertEquals(1, created.getKnowledgeSources().size()); + KnowledgeSourceReference createdRef = created.getKnowledgeSources().get(0); + assertEquals(HOTEL_KNOWLEDGE_SOURCE_NAME, createdRef.getName()); + assertEquals(true, createdRef.isEnableFreshness()); + } + + @Test + public void createKnowledgeBaseWithFreshnessEnabledAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + KnowledgeSourceReference sourceRef + = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableFreshness(true); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), sourceRef).setModels(KNOWLEDGE_BASE_MODEL); + + Mono createMono = searchIndexClient.createKnowledgeBase(knowledgeBase); + + StepVerifier.create(createMono).assertNext(created -> { + assertEquals(knowledgeBase.getName(), created.getName()); + assertEquals(1, created.getKnowledgeSources().size()); + KnowledgeSourceReference createdRef = created.getKnowledgeSources().get(0); + assertEquals(HOTEL_KNOWLEDGE_SOURCE_NAME, createdRef.getName()); + assertEquals(true, createdRef.isEnableFreshness()); + }).verifyComplete(); + } + + @Test + public void createKnowledgeBaseWithFreshnessDisabledSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeSourceReference sourceRef + = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableFreshness(false); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), sourceRef).setModels(KNOWLEDGE_BASE_MODEL); + + KnowledgeBase created = searchIndexClient.createKnowledgeBase(knowledgeBase); + + assertEquals(knowledgeBase.getName(), created.getName()); + assertEquals(1, created.getKnowledgeSources().size()); + KnowledgeSourceReference createdRef = created.getKnowledgeSources().get(0); + assertEquals(HOTEL_KNOWLEDGE_SOURCE_NAME, createdRef.getName()); + assertEquals(false, createdRef.isEnableFreshness()); + } + + @Test + public void createKnowledgeBaseWithFreshnessDisabledAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + KnowledgeSourceReference sourceRef + = new KnowledgeSourceReference(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableFreshness(false); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), sourceRef).setModels(KNOWLEDGE_BASE_MODEL); + + Mono createMono = searchIndexClient.createKnowledgeBase(knowledgeBase); + + StepVerifier.create(createMono).assertNext(created -> { + assertEquals(knowledgeBase.getName(), created.getName()); + assertEquals(1, created.getKnowledgeSources().size()); + KnowledgeSourceReference createdRef = created.getKnowledgeSources().get(0); + assertEquals(HOTEL_KNOWLEDGE_SOURCE_NAME, createdRef.getName()); + assertEquals(false, createdRef.isEnableFreshness()); + }).verifyComplete(); + } + + @Test + public void retrievalWithEnableImageServingSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + KnowledgeBaseRetrievalClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + KnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableImageServing(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Show me architecture diagrams.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); + assertNotNull(response); + assertNotNull(response.getResponse()); + } + + @Test + public void retrievalWithEnableImageServingAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), KNOWLEDGE_SOURCE_REFERENCE).setModels(KNOWLEDGE_BASE_MODEL); + + Mono createAndRetrieveMono + = searchIndexClient.createKnowledgeBase(knowledgeBase).flatMap(created -> { + KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(created.getName()) + .buildAsyncClient(); + + KnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setEnableImageServing(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Show me architecture diagrams.")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + return knowledgeBaseClient.retrieve(retrievalRequest); + }); + + StepVerifier.create(createAndRetrieveMono).assertNext(response -> { + assertNotNull(response); + assertNotNull(response.getResponse()); + }).verifyComplete(); + } + + @Disabled("Requires an Azure Blob Knowledge Source - shared test KS is searchIndex kind") + @Test + public void retrievalWithBlobKnowledgeSourceEnableImageServingSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + // Create a blob KS + AzureBlobKnowledgeSourceParameters blobKsParams = new AzureBlobKnowledgeSourceParameters( + "ResourceId=/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + RESOURCE_GROUP + + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME, + BLOB_CONTAINER_NAME).setIngestionParameters( + new KnowledgeSourceIngestionParameters().setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName("text-embedding-3-large") + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE)))); + String blobKsName = testResourceNamer.randomName("blob-ks-", 63).toLowerCase(); + AzureBlobKnowledgeSource blobKs = new AzureBlobKnowledgeSource(blobKsName, blobKsParams); + searchIndexClient.createKnowledgeSource(blobKs); + + // Create KB referencing the blob KS + KnowledgeSourceReference blobRef = new KnowledgeSourceReference(blobKsName).setEnableImageServing(true); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), blobRef).setModels(KNOWLEDGE_BASE_MODEL); + searchIndexClient.createKnowledgeBase(knowledgeBase); + + // Retrieve with AzureBlobKnowledgeSourceParams + KnowledgeBaseRetrievalClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + + AzureBlobKnowledgeSourceParams blobRetrieveParams = new AzureBlobKnowledgeSourceParams(blobKsName); + blobRetrieveParams.setEnableImageServing(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Show me images from documents.")) + .setKnowledgeSourceParams(Collections.singletonList(blobRetrieveParams)); + + KnowledgeBaseRetrievalResult response = knowledgeBaseClient.retrieve(retrievalRequest); + assertNotNull(response); + assertNotNull(response.getResponse()); + } + + @Disabled("Requires an Azure Blob Knowledge Source - shared test KS is searchIndex kind") + @Test + public void retrievalWithBlobKnowledgeSourceEnableImageServingAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + + // Create a blob KS + AzureBlobKnowledgeSourceParameters blobKsParams = new AzureBlobKnowledgeSourceParameters( + "ResourceId=/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + RESOURCE_GROUP + + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME, + BLOB_CONTAINER_NAME).setIngestionParameters( + new KnowledgeSourceIngestionParameters().setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName("text-embedding-3-large") + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE)))); + String blobKsName = testResourceNamer.randomName("blob-ks-", 63).toLowerCase(); + AzureBlobKnowledgeSource blobKs = new AzureBlobKnowledgeSource(blobKsName, blobKsParams); + + Mono pipeline + = searchIndexClient.createKnowledgeSource(blobKs).flatMap(createdKs -> { + KnowledgeSourceReference blobRef = new KnowledgeSourceReference(blobKsName).setEnableImageServing(true); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), blobRef).setModels(KNOWLEDGE_BASE_MODEL); + return searchIndexClient.createKnowledgeBase(knowledgeBase); + }).flatMap(createdKb -> { + KnowledgeBaseRetrievalAsyncClient knowledgeBaseClient + = getKnowledgeBaseRetrievalClientBuilder(false).knowledgeBaseName(createdKb.getName()) + .buildAsyncClient(); + + AzureBlobKnowledgeSourceParams blobRetrieveParams = new AzureBlobKnowledgeSourceParams(blobKsName); + blobRetrieveParams.setEnableImageServing(true); + + KnowledgeBaseRetrievalOptions retrievalRequest = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Show me images from documents.")) + .setKnowledgeSourceParams(Collections.singletonList(blobRetrieveParams)); + + return knowledgeBaseClient.retrieve(retrievalRequest); + }); + + StepVerifier.create(pipeline).assertNext(response -> { + assertNotNull(response); + assertNotNull(response.getResponse()); + }).verifyComplete(); + } + @Test public void retrieveWithFailOnErrorSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); @@ -1321,6 +2397,139 @@ private String randomKnowledgeBaseName() { return testResourceNamer.randomName("knowledge-base-", 63); } + private static Map createCostAttributionTags(String costCenter) { + Map tags = new java.util.LinkedHashMap<>(); + tags.put("businessUnit", "CapitalMarkets"); + tags.put("costCenter", costCenter); + tags.put("owner", "RBC Capital Markets"); + return tags; + } + + private SearchIndexKnowledgeSource + createRerankerKnowledgeSource(KnowledgeSourceResultsProcessing resultsProcessing) { + return new SearchIndexKnowledgeSource(randomKnowledgeBaseName() + "-source", + new SearchIndexKnowledgeSourceParameters(HOTEL_INDEX_NAME).setSemanticConfigurationName("semantic-config")) + .setResultsProcessing(resultsProcessing); + } + + private RerankerTestResources + createRerankerTestResources(KnowledgeSourceResultsProcessing storedResultsProcessing) { + SearchIndexClient indexClient = getSearchIndexClientBuilder(true).buildClient(); + SearchIndexKnowledgeSource source = createRerankerKnowledgeSource(storedResultsProcessing); + indexClient.createKnowledgeSource(source); + KnowledgeBase knowledgeBase + = new KnowledgeBase(randomKnowledgeBaseName(), new KnowledgeSourceReference(source.getName())) + .setModels(KNOWLEDGE_BASE_MODEL); + indexClient.createKnowledgeBase(knowledgeBase); + KnowledgeBaseRetrievalClient retrievalClient + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(knowledgeBase.getName()).buildClient(); + return new RerankerTestResources(source.getName(), knowledgeBase.getName(), retrievalClient); + } + + private static KnowledgeBaseRetrievalOptions createRerankerRequest(String knowledgeSourceName, + KnowledgeSourceResultsProcessing resultsProcessing, Float rerankerThreshold) { + SearchIndexKnowledgeSourceParams sourceParams + = new SearchIndexKnowledgeSourceParams(knowledgeSourceName).setAlwaysQuerySource(true) + .setIncludeReferences(true) + .setMaxOutputDocuments(50) + .setResultsProcessing(resultsProcessing) + .setRerankerThreshold(rerankerThreshold); + return new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Which hotel has an infinity pool, spa, and concierge?")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)) + .setIncludeActivity(true); + } + + private static void assertRerankerDisabled(KnowledgeBaseRetrievalResult response, String knowledgeSourceName) { + KnowledgeBaseSearchIndexActivityRecord activity = getSearchIndexActivity(response, knowledgeSourceName); + assertNotNull(activity.getSearchIndexArguments()); + assertNull(activity.getSearchIndexArguments().getSemanticConfigurationName()); + assertNotNull(activity.getCount()); + assertNotNull(response.getReferences()); + assertFalse(response.getReferences().isEmpty()); + response.getReferences().forEach(reference -> assertNull(reference.getRerankerScore())); + } + + private static final class RerankerTestResources { + private final String knowledgeSourceName; + private final String knowledgeBaseName; + private final KnowledgeBaseRetrievalClient client; + + private RerankerTestResources(String knowledgeSourceName, String knowledgeBaseName, + KnowledgeBaseRetrievalClient client) { + this.knowledgeSourceName = knowledgeSourceName; + this.knowledgeBaseName = knowledgeBaseName; + this.client = client; + } + } + + private static void assertAutoReasoningActivity(KnowledgeBaseRetrievalResult response) { + assertNotNull(response.getActivity()); + List reasoningActivity = response.getActivity() + .stream() + .filter(KnowledgeBaseAgenticReasoningActivityRecord.class::isInstance) + .map(KnowledgeBaseAgenticReasoningActivityRecord.class::cast) + .collect(Collectors.toList()); + assertFalse(reasoningActivity.isEmpty()); + + reasoningActivity.forEach(record -> { + assertNotNull(record.getLogicalReasoningEffort()); + assertEquals(KnowledgeRetrievalReasoningEffortKind.AUTO, record.getLogicalReasoningEffort().getKind()); + assertNotNull(record.getRetrievalReasoningEffort()); + KnowledgeRetrievalReasoningEffortKind executedKind = record.getRetrievalReasoningEffort().getKind(); + assertTrue(KnowledgeRetrievalReasoningEffortKind.MINIMAL.equals(executedKind) + || KnowledgeRetrievalReasoningEffortKind.LOW.equals(executedKind) + || KnowledgeRetrievalReasoningEffortKind.MEDIUM.equals(executedKind)); + }); + } + + private static KnowledgeBaseRetrievalOptions createNeverQuerySourceRequest(String excludedSourceName) { + SearchIndexKnowledgeSourceParams includedSource + = new SearchIndexKnowledgeSourceParams(HOTEL_KNOWLEDGE_SOURCE_NAME).setAlwaysQuerySource(true) + .setIncludeReferences(true) + .setMaxOutputDocuments(50); + SearchIndexKnowledgeSourceParams excludedSource + = new SearchIndexKnowledgeSourceParams(excludedSourceName).setNeverQuerySource(true).setFailOnError(true); + return new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the pet policies at the hotel?")) + .setKnowledgeSourceParams(java.util.Arrays.asList(includedSource, excludedSource)) + .setIncludeActivity(true); + } + + private static void assertNeverQuerySourceResult(KnowledgeBaseRetrievalResult response, String excludedSourceName) { + assertNotNull(response.getResponse()); + KnowledgeBaseSearchIndexActivityRecord includedActivity + = getSearchIndexActivity(response, HOTEL_KNOWLEDGE_SOURCE_NAME); + assertNotNull(includedActivity.getSearchIndexArguments()); + + KnowledgeBaseSearchIndexActivityRecord excludedActivity = response.getActivity() + .stream() + .filter(KnowledgeBaseSearchIndexActivityRecord.class::isInstance) + .map(KnowledgeBaseSearchIndexActivityRecord.class::cast) + .filter(activity -> excludedSourceName.equals(activity.getKnowledgeSourceName())) + .findFirst() + .orElse(null); + if (excludedActivity != null) { + assertNull(excludedActivity.getSearchIndexArguments()); + if (response.getReferences() != null) { + response.getReferences() + .forEach(reference -> assertFalse(reference.getActivitySource() == excludedActivity.getId())); + } + } + } + + private static KnowledgeBaseSearchIndexActivityRecord getSearchIndexActivity(KnowledgeBaseRetrievalResult response, + String knowledgeSourceName) { + assertNotNull(response.getActivity()); + return response.getActivity() + .stream() + .filter(KnowledgeBaseSearchIndexActivityRecord.class::isInstance) + .map(KnowledgeBaseSearchIndexActivityRecord.class::cast) + .filter(activity -> knowledgeSourceName.equals(activity.getKnowledgeSourceName())) + .findFirst() + .orElseThrow(() -> new AssertionError("Expected search index activity for " + knowledgeSourceName)); + } + private static SearchIndexClient setupIndex() { try (JsonReader jsonReader = JsonProviders.createReader(loadResource(HOTELS_TESTS_INDEX_DATA_JSON))) { SearchIndex baseIndex = SearchIndex.fromJson(jsonReader); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java index 5313b862aeea6..313d2e7b5b91a 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -17,6 +17,9 @@ import com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model; import com.azure.search.documents.indexes.models.KnowledgeBaseModel; import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; +import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.FileUploadMetadata; +import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; import com.azure.search.documents.indexes.models.RandomScoringParameters; import com.azure.search.documents.indexes.models.ScoringFunction; import com.azure.search.documents.indexes.models.MagnitudeScoringFunction; @@ -27,8 +30,10 @@ import com.azure.search.documents.indexes.SearchIndexerClientBuilder; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceCache; import com.azure.search.documents.models.BalancedVectorQueryTopicGraph; +import com.azure.search.documents.models.ContentFileDetails; import com.azure.search.documents.models.DiverseVectorQueryTopicGraph; import com.azure.search.documents.models.GraphOptions; import com.azure.search.documents.models.GraphQueryExecutionMode; @@ -93,15 +98,48 @@ public void existingListConveniencesUseRenamedProtocolOperations() { } @Test - public void fileDeletePreservesExistingParameterOrder() { + public void fileOperationsPreserveGaParameterOrder() { SearchIndexClientBuilder builder = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") .credential(new AzureKeyCredential("key")) .httpClient(request -> { assertTrue(request.getUrl().getPath().contains("/knowledgesources('source')/files('file')")); + if (request.getHttpMethod() == HttpMethod.PUT) { + assertTrue(request.getHeaders().getValue(HttpHeaderName.CONTENT_TYPE).startsWith("multipart/")); + return Mono.just(new MockHttpResponse(request, 200, + "{\"fileId\":\"file\",\"fileName\":\"notes.txt\"}".getBytes(StandardCharsets.UTF_8))); + } + assertEquals(HttpMethod.DELETE, request.getHttpMethod()); return Mono.just(new MockHttpResponse(request, 204)); }); - builder.buildClient().deleteKnowledgeSourceFile("file", "source"); - builder.buildAsyncClient().deleteKnowledgeSourceFile("file", "source").block(); + builder.buildClient().deleteKnowledgeSourceFile("source", "file"); + builder.buildAsyncClient().deleteKnowledgeSourceFile("source", "file").block(); + assertEquals(204, + builder.buildClient().deleteKnowledgeSourceFileWithResponse("source", "file", null).getStatusCode()); + Response deleted + = builder.buildAsyncClient().deleteKnowledgeSourceFileWithResponse("source", "file", null).block(); + assertNotNull(deleted); + assertEquals(204, deleted.getStatusCode()); + UpdateKnowledgeSourceFileRequest update + = new UpdateKnowledgeSourceFileRequest(new FileUploadMetadata().setFileName("notes.txt"), + new ContentFileDetails(BinaryData.fromString("content")).setFilename("notes.txt")); + assertEquals("file", builder.buildClient().updateKnowledgeSourceFile("source", "file", update).getFileId()); + KnowledgeSourceFile updated + = builder.buildAsyncClient().updateKnowledgeSourceFile("source", "file", update).block(); + assertNotNull(updated); + assertEquals("file", updated.getFileId()); + } + + @Test + public void gaSqlDocumentUrlGetterPreservesWireMapping() { + KnowledgeBaseIndexedSqlReference reference = BinaryData + .fromString("{\"type\":\"indexedSql\",\"id\":\"sql\",\"activitySource\":1," + + "\"docUrl\":\"https://example.com/document\",\"citationUrl\":\"https://example.com/citation\"}") + .toObject(KnowledgeBaseIndexedSqlReference.class); + assertEquals("https://example.com/document", reference.getDocumentUrl()); + Map json = BinaryData.fromObject(reference).toObject(Map.class); + assertEquals(reference.getDocumentUrl(), json.get("docUrl")); + assertFalse(json.containsKey("documentUrl")); + assertEquals("https://example.com/citation", json.get("citationUrl")); } @Test diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureContractTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureContractTests.java new file mode 100644 index 0000000000000..4d7337c1e301f --- /dev/null +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureContractTests.java @@ -0,0 +1,611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpMethod; +import com.azure.core.http.HttpRequest; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.SearchIndexerClientBuilder; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.ChatCompletionCommonModelParameters; +import com.azure.search.documents.indexes.models.ChatCompletionSkill; +import com.azure.search.documents.indexes.models.DataSourceCredentials; +import com.azure.search.documents.indexes.models.InputFieldMappingEntry; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model; +import com.azure.search.documents.indexes.models.KnowledgeBaseOpenAICompatibleModel; +import com.azure.search.documents.indexes.models.KnowledgeBaseOpenAICompatibleParameters; +import com.azure.search.documents.indexes.models.KnowledgeBaseTool; +import com.azure.search.documents.indexes.models.KnowledgeBaseToolKnowledgeSourceReference; +import com.azure.search.documents.indexes.models.KnowledgeSourceGraphExtractionParameters; +import com.azure.search.documents.indexes.models.KnowledgeSourceGraphOntology; +import com.azure.search.documents.indexes.models.KnowledgeSourceGraphOntologySourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.OneLakeSecuritySource; +import com.azure.search.documents.indexes.models.OpenAICompatibleVectorizer; +import com.azure.search.documents.indexes.models.OpenAICompatibleVectorizerParameters; +import com.azure.search.documents.indexes.models.OutputFieldMappingEntry; +import com.azure.search.documents.indexes.models.PermissionFilter; +import com.azure.search.documents.indexes.models.RandomScoringFunction; +import com.azure.search.documents.indexes.models.RandomScoringParameters; +import com.azure.search.documents.indexes.models.ScoringProfile; +import com.azure.search.documents.indexes.models.SearchField; +import com.azure.search.documents.indexes.models.SearchFieldDataType; +import com.azure.search.documents.indexes.models.SearchIndex; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints; +import com.azure.search.documents.indexes.models.SearchIndexerDataContainer; +import com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection; +import com.azure.search.documents.indexes.models.SearchIndexerDataSourceType; +import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; +import com.azure.search.documents.indexes.models.SearchIndexerSkillset; +import com.azure.search.documents.indexes.models.VectorSearch; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.AgentRuntimeGraphParams; +import com.azure.search.documents.knowledgebases.models.AzureBlobKnowledgeSourceParams; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchReference; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceCache; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceOpenAICompatibleVectorizer; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatus; +import com.azure.search.documents.models.AgenticSearchOptions; +import com.azure.search.documents.models.BalancedVectorQueryTopicGraph; +import com.azure.search.documents.models.DiverseVectorQueryTopicGraph; +import com.azure.search.documents.models.GraphOptions; +import com.azure.search.documents.models.GraphQueryDiagnostic; +import com.azure.search.documents.models.GraphQueryDiagnosticPhase; +import com.azure.search.documents.models.GraphQueryDiagnosticSeverity; +import com.azure.search.documents.models.GraphQueryResult; +import com.azure.search.documents.models.NoneVectorQueryTopicGraph; +import com.azure.search.documents.models.QueryType; +import com.azure.search.documents.models.SearchOptions; +import com.azure.search.documents.models.SearchPagedResponse; +import com.azure.search.documents.models.VectorQueryTopicGraph; +import com.azure.search.documents.models.VectorizedQuery; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; +import reactor.core.publisher.Mono; + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class PreviewFeatureContractTests { + private static final String ENDPOINT = "https://example.search.windows.net"; + private static final String IDENTITY + = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/offline/providers/" + + "Microsoft.ManagedIdentity/userAssignedIdentities/search"; + private static final String AUDIENCE = "11111111-1111-1111-1111-111111111111"; + private static final String SYNTHETIC_SECRET = "offline-synthetic-secret"; + private static final String ONTOLOGY = "{\"@context\":{\"rdfs\":\"http://www.w3.org/2000/01/rdf-schema#\"}," + + "\"@graph\":[{\"@id\":\"https://example.com/Person\",\"@type\":\"rdfs:Class\"}]}"; + + @ParameterizedTest + @MethodSource("topicGraphQueries") + public void searchOptionsForwardTopicGraphModesAndTheirAllowedPropertySubsets(VectorQueryTopicGraph topicGraph, + String expectedKind, Float diversityFactor, Integer poolSize) { + AtomicInteger requests = new AtomicInteger(); + SearchClientBuilder builder = searchBuilder(request -> { + requests.incrementAndGet(); + assertRequest(request, HttpMethod.POST, "/indexes('preview')/docs/search.post.search"); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("connections", body.get("search")); + Map query = firstMap(body.get("vectorQueries")); + assertEquals("vector", query.get("kind")); + assertEquals("embedding", query.get("fields")); + assertEquals(3, ((Number) query.get("k")).intValue()); + assertEquals(Arrays.asList(0.25, 0.5), query.get("vector")); + Map graph = map(query.get("topicGraph")); + assertEquals(expectedKind, graph.get("kind")); + if (diversityFactor == null) { + assertFalse(graph.containsKey("diversityFactor")); + } else { + assertEquals(diversityFactor.doubleValue(), ((Number) graph.get("diversityFactor")).doubleValue()); + } + if (poolSize == null) { + assertFalse(graph.containsKey("minDiversityPoolSize")); + } else { + assertEquals(poolSize.intValue(), ((Number) graph.get("minDiversityPoolSize")).intValue()); + } + return Mono.just(response(request, 200, "{\"value\":[]}")); + }); + SearchOptions options = new SearchOptions().setSearchText("connections") + .setVectorQueries(new VectorizedQuery(Arrays.asList(0.25F, 0.5F)).setFields("embedding") + .setKNearestNeighbors(3) + .setTopicGraph(topicGraph)); + assertEquals(0, builder.buildClient().search(options).stream().count()); + assertEquals(0, builder.buildAsyncClient().search(options).collectList().block().size()); + assertEquals(2, requests.get()); + } + + private static Stream topicGraphQueries() { + return Stream.of(Arguments.of(new NoneVectorQueryTopicGraph(), "none", null, null), + Arguments.of(new DiverseVectorQueryTopicGraph(), "diverse", null, null), + Arguments.of(new DiverseVectorQueryTopicGraph().setDiversityFactor(0F).setMinDiversityPoolSize(1000), + "diverse", 0F, 1000), + Arguments.of(new DiverseVectorQueryTopicGraph().setDiversityFactor(1F).setMinDiversityPoolSize(1000), + "diverse", 1F, 1000), + Arguments.of(new BalancedVectorQueryTopicGraph().setMinDiversityPoolSize(1000), "balanced", null, 1000)); + } + + @ParameterizedTest + @MethodSource("graphDiagnostics") + public void graphResponsesPreserveDiagnosticSeverityPhaseAndFutureEnumValues(String severity, String phase) { + SearchClientBuilder builder = searchBuilder(request -> Mono.just(response(request, 200, + "{\"value\":[],\"@search.graphDiagnostics\":[{\"code\":\"Diagnostic\",\"severity\":\"" + severity + + "\",\"phase\":\"" + phase + "\"}]}"))); + GraphOptions options = new GraphOptions("MATCH (n) RETURN n").setIncludeDiagnostics(true); + assertDiagnostic(builder.buildClient().graph(options), severity, phase); + assertDiagnostic(builder.buildAsyncClient().graph(options).block(), severity, phase); + } + + private static Stream graphDiagnostics() { + return Stream.of(Arguments.of("info", "planning"), Arguments.of("warning", "validation"), + Arguments.of("error", "execution"), Arguments.of("futureSeverity", "futurePhase")); + } + + private static void assertDiagnostic(GraphQueryResult result, String severity, String phase) { + assertNotNull(result); + GraphQueryDiagnostic diagnostic = result.getDiagnostics().get(0); + assertEquals(GraphQueryDiagnosticSeverity.fromString(severity), diagnostic.getSeverity()); + assertEquals(GraphQueryDiagnosticPhase.fromString(phase), diagnostic.getPhase()); + } + + @Test + public void randomScoringProfileAndSearchSeedReachTheService() { + SearchIndex index = new SearchIndex("preview", new SearchField("id", SearchFieldDataType.STRING).setKey(true)) + .setScoringProfiles(new ScoringProfile("shuffle") + .setFunctions(new RandomScoringFunction().setParameters(new RandomScoringParameters("seed")))); + SearchIndexClientBuilder indexes = indexBuilder(request -> { + assertRequest(request, HttpMethod.POST, "/indexes"); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + Map profile = firstMap(body.get("scoringProfiles")); + assertEquals("shuffle", profile.get("name")); + Map function = firstMap(profile.get("functions")); + assertEquals("random", function.get("type")); + assertEquals("seed", map(function.get("random")).get("seedParameter")); + assertFalse(function.containsKey("parameters")); + assertFalse(function.containsKey("fieldName")); + assertFalse(function.containsKey("boost")); + return Mono.just(response(request, 201, request.getBodyAsBinaryData().toString())); + }); + assertInstanceOf(RandomScoringFunction.class, + indexes.buildClient().createIndex(index).getScoringProfiles().get(0).getFunctions().get(0)); + + SearchClientBuilder search = searchBuilder(request -> { + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("shuffle", body.get("scoringProfile")); + assertEquals(Collections.singletonList("seed:-9223372036854775808"), body.get("scoringParameters")); + return Mono.just(response(request, 200, "{\"value\":[]}")); + }); + SearchOptions options = new SearchOptions().setSearchText("*") + .setScoringProfile("shuffle") + .setScoringParameters("seed:-9223372036854775808"); + assertEquals(0, search.buildClient().search(options).stream().count()); + assertEquals(0, search.buildAsyncClient().search(options).collectList().block().size()); + } + + @ParameterizedTest + @MethodSource("compatibleModels") + public void knowledgeBaseToolsAndCompatibleModelAuthenticationSurviveTypedRequests(AzureOpenAIModelName modelName, + String uri, boolean managedIdentity) { + KnowledgeBaseOpenAICompatibleParameters parameters + = new KnowledgeBaseOpenAICompatibleParameters(uri, modelName); + if (managedIdentity) { + parameters.setManagedIdentityAudience(AUDIENCE) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(IDENTITY)); + } else { + parameters.setHeaders(Collections.singletonMap("X-Offline-Authorization", SYNTHETIC_SECRET)); + } + KnowledgeBaseTool tool = new KnowledgeBaseTool("lookup", "Find source documents", + Collections.singletonList(new KnowledgeBaseToolKnowledgeSourceReference("source").setAlwaysQuerySource(true) + .setFilterAddOn("category eq 'public'") + .setMaxOutputDocuments(3) + .setFailOnError(false))); + KnowledgeBase base = new KnowledgeBase("preview", new KnowledgeSourceReference("source")) + .setModels(new KnowledgeBaseOpenAICompatibleModel(parameters)) + .setTools(Collections.singletonList(tool)); + AtomicInteger requests = new AtomicInteger(); + SearchIndexClientBuilder builder = indexBuilder(request -> { + requests.incrementAndGet(); + assertRequest(request, HttpMethod.POST, "/knowledgebases"); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + Map model = firstMap(body.get("models")); + assertEquals("openAICompatible", model.get("kind")); + Map wireParameters = map(model.get("openAICompatibleParameters")); + assertEquals(uri, wireParameters.get("uri")); + assertEquals(modelName.toString(), wireParameters.get("modelName")); + if (managedIdentity) { + assertEquals(AUDIENCE, wireParameters.get("managedIdentityAudience")); + assertEquals(IDENTITY, map(wireParameters.get("authIdentity")).get("userAssignedIdentity")); + assertFalse(wireParameters.containsKey("headers")); + } else { + assertEquals(SYNTHETIC_SECRET, map(wireParameters.get("headers")).get("X-Offline-Authorization")); + assertFalse(wireParameters.containsKey("managedIdentityAudience")); + assertFalse(wireParameters.containsKey("authIdentity")); + } + Map wireTool = firstMap(body.get("tools")); + assertEquals("lookup", wireTool.get("name")); + Map source = firstMap(wireTool.get("knowledgeSources")); + assertEquals("source", source.get("name")); + assertEquals("category eq 'public'", source.get("filterAddOn")); + assertEquals(Boolean.TRUE, source.get("alwaysQuerySource")); + assertEquals(Boolean.FALSE, source.get("failOnError")); + assertEquals(3, ((Number) source.get("maxOutputDocuments")).intValue()); + String returned = "{\"name\":\"preview\",\"knowledgeSources\":[{\"name\":\"source\"}]," + + "\"models\":[{\"kind\":\"openAICompatible\",\"openAICompatibleParameters\":{\"uri\":\"" + uri + + "\",\"modelName\":\"" + modelName + "\"}}]}"; + return Mono.just(response(request, 201, returned)); + }); + assertRedactedCompatibleModel(builder.buildClient().createKnowledgeBase(base)); + assertRedactedCompatibleModel(builder.buildAsyncClient().createKnowledgeBase(base).block()); + assertEquals(2, requests.get()); + } + + private static Stream compatibleModels() { + return Stream.of( + Arguments.of(AzureOpenAIModelName.GPT4O, "https://example.com/chat/completions?route=offline", false), + Arguments.of(AzureOpenAIModelName.GPT6SOL, "https://example.com/responses?route=offline", false), + Arguments.of(AzureOpenAIModelName.GPT6LUNA, "https://example.com/responses?route=offline", true)); + } + + private static void assertRedactedCompatibleModel(KnowledgeBase base) { + assertNotNull(base); + KnowledgeBaseOpenAICompatibleModel model + = assertInstanceOf(KnowledgeBaseOpenAICompatibleModel.class, base.getModels().get(0)); + assertNull(model.getOpenAICompatibleParameters().getHeaders()); + } + + @Test + public void minimalKnowledgeBaseForwardsMicrosoftRetrieverWithoutAzureOpenAIConfiguration() { + SearchIndexClientBuilder builder = indexBuilder(request -> { + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("minimal", body.get("name")); + Map model = firstMap(body.get("models")); + assertEquals(Collections.singletonMap("kind", "microsoftRetriever1"), model); + assertEquals("minimal", map(body.get("retrievalReasoningEffort")).get("kind")); + assertFalse(body.containsKey("tools")); + return Mono.just(response(request, 201, request.getBodyAsBinaryData().toString())); + }); + KnowledgeBase base = new KnowledgeBase("minimal", new KnowledgeSourceReference("source")) + .setModels(new KnowledgeBaseMicrosoftRetriever1Model()) + .setRetrievalReasoningEffort(new KnowledgeRetrievalMinimalReasoningEffort()); + assertInstanceOf(KnowledgeBaseMicrosoftRetriever1Model.class, + builder.buildClient().createKnowledgeBase(base).getModels().get(0)); + } + + @Test + public void retrievalForwardsSingularToolAndGraphOverridesAndReadsMixedActivityTypes() { + KnowledgeBaseRetrievalClientBuilder builder = new KnowledgeBaseRetrievalClientBuilder().endpoint(ENDPOINT) + .knowledgeBaseName("preview") + .credential(new AzureKeyCredential("offline-test-key")) + .serviceVersion(SearchServiceVersion.V2026_11_01_PREVIEW) + .httpClient(request -> { + assertEquals(HttpMethod.POST, request.getHttpMethod()); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("lookup", body.get("toolName")); + assertFalse(body.containsKey("toolNames")); + Map source = firstMap(body.get("knowledgeSourceParams")); + assertEquals("azureBlob", source.get("kind")); + assertEquals(Boolean.TRUE, map(source.get("graphParameters")).get("includeQuery")); + assertEquals("none", map(source.get("topicGraph")).get("kind")); + assertEquals("offline-source-token", + request.getHeaders().getValue(HttpHeaderName.fromString("x-ms-query-source-authorization"))); + return Mono.just(response(request, 200, + "{\"response\":[],\"activity\":[{\"type\":\"agenticReasoning\",\"id\":1,\"reasoningTokens\":17}," + + "{\"type\":\"graphSearch\",\"id\":2,\"knowledgeSourceName\":\"source\"," + + "\"graphSearchArguments\":{\"gql\":\"MATCH (n) RETURN n\",\"graphIndexName\":\"graph\"," + + "\"outcome\":\"Success\",\"attempts\":1}}]," + + "\"references\":[{\"type\":\"graphSearch\",\"id\":\"ref-1\",\"activitySource\":2," + + "\"graphIndexName\":\"graph\"}]}")); + }); + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions().setToolName("lookup") + .setIncludeActivity(true) + .setQuerySourceAuthorization("offline-source-token") + .setKnowledgeSourceParams(Collections.singletonList(new AzureBlobKnowledgeSourceParams("source") + .setGraphParameters(new AgentRuntimeGraphParams().setIncludeQuery(true)) + .setTopicGraph(new NoneVectorQueryTopicGraph()))); + assertRetrievalActivity(builder.buildClient().retrieve(options)); + assertRetrievalActivity(builder.buildAsyncClient().retrieve(options).block()); + } + + private static void assertRetrievalActivity(KnowledgeBaseRetrievalResult result) { + assertNotNull(result); + KnowledgeBaseAgenticReasoningActivityRecord reasoning + = assertInstanceOf(KnowledgeBaseAgenticReasoningActivityRecord.class, result.getActivity().get(0)); + assertEquals(17, reasoning.getReasoningTokens()); + KnowledgeBaseGraphSearchActivityRecord graph + = assertInstanceOf(KnowledgeBaseGraphSearchActivityRecord.class, result.getActivity().get(1)); + assertEquals("MATCH (n) RETURN n", graph.getGraphSearchArguments().getGql()); + KnowledgeBaseGraphSearchReference reference + = assertInstanceOf(KnowledgeBaseGraphSearchReference.class, result.getReferences().get(0)); + assertEquals("graph", reference.getGraphIndexName()); + } + + @Test + public void directAgenticSearchForwardsOptionsAndReadsRenamedReasoningUsage() { + SearchClientBuilder builder = searchBuilder(request -> { + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("agentic", body.get("queryType")); + assertEquals(30, ((Number) map(body.get("agenticOptions")).get("maxRuntimeInSeconds")).intValue()); + return Mono.just(response(request, 200, + "{\"value\":[],\"@search.debug\":{\"agentic\":{\"terminationReason\":\"completed\"," + + "\"subQueries\":[{\"search\":\"connections\",\"iteration\":1}]," + + "\"usage\":{\"agenticPlanningTokens\":11,\"reasoningTokens\":29}}}}")); + }); + SearchOptions options = new SearchOptions().setSearchText("connections") + .setQueryType(QueryType.AGENTIC) + .setAgenticOptions(new AgenticSearchOptions().setMaxRuntimeInSeconds(30)); + assertAgenticUsage(builder.buildClient().search(options).iterableByPage().iterator().next()); + SearchPagedResponse async = builder.buildAsyncClient().search(options).byPage().blockFirst(); + assertAgenticUsage(async); + } + + private static void assertAgenticUsage(SearchPagedResponse page) { + assertNotNull(page); + assertEquals(11L, page.getDebugInfo().getAgentic().getUsage().getAgenticPlanningTokens()); + assertEquals(29L, page.getDebugInfo().getAgentic().getUsage().getReasoningTokens()); + assertEquals("connections", page.getDebugInfo().getAgentic().getSubQueries().get(0).getSearch()); + } + + @Test + public void knowledgeSourceForwardsGraphExtractionCacheAndCompatibleIngestionModels() { + OpenAICompatibleVectorizerParameters embedding + = new OpenAICompatibleVectorizerParameters("https://example.com/embeddings?route=offline", + AzureOpenAIModelName.TEXT_EMBEDDING3SMALL).setDimensions(1536) + .setHeaders(Collections.singletonMap("X-Offline-Authorization", SYNTHETIC_SECRET)); + KnowledgeSourceIngestionParameters ingestion = new KnowledgeSourceIngestionParameters() + .setCache(new KnowledgeSourceCache("ResourceId=/subscriptions/offline/storageAccounts/cache") + .setEnableReprocessing(true) + .setIdentity(new SearchIndexerDataUserAssignedIdentity(IDENTITY))) + .setEmbeddingModel(new KnowledgeSourceOpenAICompatibleVectorizer(embedding)) + .setChatCompletionModel(new KnowledgeBaseOpenAICompatibleModel(new KnowledgeBaseOpenAICompatibleParameters( + "https://example.com/responses", AzureOpenAIModelName.GPT6SOL) + .setHeaders(Collections.singletonMap("X-Offline-Authorization", SYNTHETIC_SECRET)))); + AzureBlobKnowledgeSource source = new AzureBlobKnowledgeSource("source", + new AzureBlobKnowledgeSourceParameters("ResourceId=/subscriptions/offline/storageAccounts/source", "docs") + .setIngestionParameters(ingestion) + .setGraphExtraction(new KnowledgeSourceGraphExtractionParameters("graph").setOntology( + new KnowledgeSourceGraphOntology(KnowledgeSourceGraphOntologySourceKind.INLINE, ONTOLOGY) + .setName("people")))); + SearchIndexClientBuilder builder = indexBuilder(request -> { + assertRequest(request, HttpMethod.POST, "/knowledgesources"); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + Map blob = map(body.get("azureBlobParameters")); + Map graph = map(blob.get("graphExtraction")); + assertEquals("graph", graph.get("graphName")); + assertEquals("people", map(graph.get("ontology")).get("name")); + assertEquals(ONTOLOGY, map(graph.get("ontology")).get("value")); + Map parameters = map(blob.get("ingestionParameters")); + Map cache = map(parameters.get("cache")); + assertEquals("ResourceId=/subscriptions/offline/storageAccounts/cache", + cache.get("storageConnectionString")); + assertEquals(Boolean.TRUE, cache.get("enableReprocessing")); + assertEquals(IDENTITY, map(cache.get("identity")).get("userAssignedIdentity")); + assertEquals("openAICompatible", map(parameters.get("embeddingModel")).get("kind")); + assertEquals(SYNTHETIC_SECRET, + map(map(map(parameters.get("embeddingModel")).get("openAICompatibleParameters")).get("headers")) + .get("X-Offline-Authorization")); + assertEquals("https://example.com/responses", + map(map(parameters.get("chatCompletionModel")).get("openAICompatibleParameters")).get("uri")); + return Mono.just(response(request, 201, + "{\"name\":\"source\",\"kind\":\"azureBlob\",\"azureBlobParameters\":{\"containerName\":\"docs\"," + + "\"ingestionParameters\":{\"cache\":{\"enableReprocessing\":true}}}}")); + }); + AzureBlobKnowledgeSource returned + = assertInstanceOf(AzureBlobKnowledgeSource.class, builder.buildClient().createKnowledgeSource(source)); + assertNull(returned.getAzureBlobParameters().getIngestionParameters().getCache().getStorageConnectionString()); + assertInstanceOf(AzureBlobKnowledgeSource.class, + builder.buildAsyncClient().createKnowledgeSource(source).block()); + } + + @Test + public void graphOntologyStatisticsAreRetainedThroughKnowledgeSourceStatusResponses() { + SearchIndexClientBuilder builder = indexBuilder(request -> { + assertRequest(request, HttpMethod.GET, "/knowledgesources('source')/status"); + return Mono.just(response(request, 200, + "{\"kind\":\"azureBlob\",\"synchronizationStatus\":\"active\"," + + "\"currentSynchronizationState\":{\"startTime\":\"2026-11-01T00:00:00Z\"," + + "\"itemsUpdatesProcessed\":2,\"itemsUpdatesFailed\":0,\"itemsSkipped\":0," + + "\"graphStatistics\":{\"ontologyName\":\"people\",\"triplesWritten\":42}}," + + "\"lastSynchronizationState\":{\"startTime\":\"2026-11-01T00:00:00Z\"," + + "\"endTime\":\"2026-11-01T00:01:00Z\",\"itemsUpdatesProcessed\":2," + + "\"itemsUpdatesFailed\":0,\"itemsSkipped\":0," + + "\"graphStatistics\":{\"ontologyName\":\"people\",\"triplesWritten\":41}}}")); + }); + assertGraphStatistics(builder.buildClient().getKnowledgeSourceStatus("source")); + assertGraphStatistics(builder.buildAsyncClient().getKnowledgeSourceStatus("source").block()); + } + + private static void assertGraphStatistics(KnowledgeSourceStatus status) { + assertNotNull(status); + assertEquals("people", status.getCurrentSynchronizationState().getGraphStatistics().getOntologyName()); + assertEquals(42L, status.getCurrentSynchronizationState().getGraphStatistics().getTriplesWritten()); + assertEquals(41L, status.getLastSynchronizationState().getGraphStatistics().getTriplesWritten()); + } + + @Test + public void facetBackedFilterHintsAndStoredTopicGraphReachKnowledgeSourceRequests() { + SearchIndexKnowledgeSource source = new SearchIndexKnowledgeSource("source", + new SearchIndexKnowledgeSourceParameters("preview") + .setTopicGraph(new BalancedVectorQueryTopicGraph().setMinDiversityPoolSize(1000)) + .setQueryHints(new SearchIndexKnowledgeSourceQueryHints().setFilters( + Collections.singletonList(new SearchIndexKnowledgeSourceFilterHint("category").setAutoConfiguration( + new SearchIndexKnowledgeSourceFilterHintAutoConfiguration().setCacheTtl(900) + .setMaxFacetValueCount(32)))))); + SearchIndexClientBuilder builder = indexBuilder(request -> { + Map parameters = map(request.getBodyAsBinaryData().toObject(Map.class).get("searchIndexParameters")); + assertEquals("balanced", map(parameters.get("topicGraph")).get("kind")); + Map filter = firstMap(map(parameters.get("queryHints")).get("filters")); + assertEquals("category", filter.get("field")); + Map configuration = map(filter.get("autoConfiguration")); + assertEquals(900, ((Number) configuration.get("cacheTtl")).intValue()); + assertEquals(32, ((Number) configuration.get("maxFacetValueCount")).intValue()); + return Mono.just(response(request, 201, request.getBodyAsBinaryData().toString())); + }); + assertInstanceOf(SearchIndexKnowledgeSource.class, builder.buildClient().createKnowledgeSource(source)); + assertInstanceOf(SearchIndexKnowledgeSource.class, + builder.buildAsyncClient().createKnowledgeSource(source).block()); + } + + @Test + public void compatibleIndexVectorizerAndOneLakePermissionsReachIndexRequests() { + SearchIndex index = new SearchIndex("preview", new SearchField("id", SearchFieldDataType.STRING).setKey(true), + new SearchField("folders", SearchFieldDataType.collection(SearchFieldDataType.STRING)).setFilterable(true) + .setPermissionFilter(PermissionFilter.ONE_LAKE_PARENT_FOLDERS)) + .setOneLakeSecuritySource(new OneLakeSecuritySource("offline-workspace", "offline-lakehouse")) + .setVectorSearch(new VectorSearch().setVectorizers(new OpenAICompatibleVectorizer("compatible", + new OpenAICompatibleVectorizerParameters("https://example.com/embeddings?route=offline", + AzureOpenAIModelName.TEXT_EMBEDDING3SMALL).setDimensions(1536) + .setManagedIdentityAudience(AUDIENCE) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(IDENTITY))))); + SearchIndexClientBuilder builder = indexBuilder(request -> { + Map body = request.getBodyAsBinaryData().toObject(Map.class); + Map folders = map(((List) body.get("fields")).get(1)); + assertEquals("Collection(Edm.String)", folders.get("type")); + assertEquals(Boolean.TRUE, folders.get("filterable")); + assertEquals("oneLakeParentFolders", folders.get("permissionFilter")); + assertEquals("offline-workspace", map(body.get("oneLakeSecuritySource")).get("fabricWorkspaceId")); + Map vectorizer = firstMap(map(body.get("vectorSearch")).get("vectorizers")); + assertEquals("openAICompatible", vectorizer.get("kind")); + Map parameters = map(vectorizer.get("openAICompatibleParameters")); + assertEquals("https://example.com/embeddings?route=offline", parameters.get("uri")); + assertEquals(1536, ((Number) parameters.get("dimensions")).intValue()); + assertEquals(AUDIENCE, parameters.get("managedIdentityAudience")); + assertEquals(IDENTITY, map(parameters.get("authIdentity")).get("userAssignedIdentity")); + assertFalse(parameters.containsKey("headers")); + return Mono.just(response(request, 201, request.getBodyAsBinaryData().toString())); + }); + assertInstanceOf(OpenAICompatibleVectorizer.class, + builder.buildClient().createIndex(index).getVectorSearch().getVectorizers().get(0)); + SearchIndex asyncIndex = builder.buildAsyncClient().createIndex(index).block(); + assertNotNull(asyncIndex); + assertInstanceOf(OpenAICompatibleVectorizer.class, asyncIndex.getVectorSearch().getVectorizers().get(0)); + } + + @Test + public void oneLakeDataSourceUsesItsWireDiscriminator() { + SearchIndexerClientBuilder builder = new SearchIndexerClientBuilder().endpoint(ENDPOINT) + .credential(new AzureKeyCredential("offline-test-key")) + .serviceVersion(SearchServiceVersion.V2026_11_01_PREVIEW) + .httpClient(request -> { + assertRequest(request, HttpMethod.POST, "/datasources"); + Map body = request.getBodyAsBinaryData().toObject(Map.class); + assertEquals("onelake", body.get("type")); + assertEquals("Files/documents", map(body.get("container")).get("name")); + return Mono.just(response(request, 201, request.getBodyAsBinaryData().toString())); + }); + SearchIndexerDataSourceConnection source + = new SearchIndexerDataSourceConnection("onelake", SearchIndexerDataSourceType.ONE_LAKE, + new DataSourceCredentials().setConnectionString("ResourceId=/subscriptions/offline/workspaces/source"), + new SearchIndexerDataContainer("Files/documents")); + assertEquals(SearchIndexerDataSourceType.ONE_LAKE, + builder.buildClient().createDataSourceConnection(source).getType()); + SearchIndexerDataSourceConnection asyncSource + = builder.buildAsyncClient().createDataSourceConnection(source).block(); + assertNotNull(asyncSource); + assertEquals(SearchIndexerDataSourceType.ONE_LAKE, asyncSource.getType()); + } + + @ParameterizedTest + @ValueSource( + strings = { + "https://example.com/chat/completions?route=offline", + "https://example.com/responses?route=offline" }) + public void compatibleSkillForwardsExactUriAuthenticationAndNestedModelParameters(String uri) { + ChatCompletionSkill skill = new ChatCompletionSkill( + Collections.singletonList(new InputFieldMappingEntry("text").setSource("/document/content")), + Collections.singletonList(new OutputFieldMappingEntry("response").setTargetName("generated")), uri) + .setApiKey(SYNTHETIC_SECRET) + .setCommonModelParameters( + new ChatCompletionCommonModelParameters().setModelName(AzureOpenAIModelName.GPT6SOL.toString()) + .setMaxTokens(256)) + .setExtraParameters(Collections.singletonMap("reasoning", Collections.singletonMap("effort", "low"))); + SearchIndexerClientBuilder builder = new SearchIndexerClientBuilder().endpoint(ENDPOINT) + .credential(new AzureKeyCredential("offline-test-key")) + .serviceVersion(SearchServiceVersion.V2026_11_01_PREVIEW) + .httpClient(request -> { + assertRequest(request, HttpMethod.POST, "/skillsets"); + Map wireSkill = firstMap(request.getBodyAsBinaryData().toObject(Map.class).get("skills")); + assertEquals("#Microsoft.Skills.Custom.ChatCompletionSkill", wireSkill.get("@odata.type")); + assertEquals(uri, wireSkill.get("uri")); + assertEquals(SYNTHETIC_SECRET, wireSkill.get("apiKey")); + Map common = map(wireSkill.get("commonModelParameters")); + assertEquals(AzureOpenAIModelName.GPT6SOL.toString(), common.get("model")); + assertEquals(256, ((Number) common.get("maxTokens")).intValue()); + assertEquals("low", map(map(wireSkill.get("extraParameters")).get("reasoning")).get("effort")); + return Mono.just(response(request, 201, request.getBodyAsBinaryData().toString())); + }); + SearchIndexerSkillset skillset = new SearchIndexerSkillset("compatible", skill); + ChatCompletionSkill returned = assertInstanceOf(ChatCompletionSkill.class, + builder.buildClient().createSkillset(skillset).getSkills().get(0)); + assertEquals(uri, returned.getUrl()); + SearchIndexerSkillset asyncSkillset = builder.buildAsyncClient().createSkillset(skillset).block(); + assertNotNull(asyncSkillset); + assertEquals(uri, assertInstanceOf(ChatCompletionSkill.class, asyncSkillset.getSkills().get(0)).getUrl()); + } + + private static SearchClientBuilder searchBuilder(HttpClient transport) { + return new SearchClientBuilder().endpoint(ENDPOINT) + .indexName("preview") + .credential(new AzureKeyCredential("offline-test-key")) + .serviceVersion(SearchServiceVersion.V2026_11_01_PREVIEW) + .httpClient(transport); + } + + private static SearchIndexClientBuilder indexBuilder(HttpClient transport) { + return new SearchIndexClientBuilder().endpoint(ENDPOINT) + .credential(new AzureKeyCredential("offline-test-key")) + .serviceVersion(SearchServiceVersion.V2026_11_01_PREVIEW) + .httpClient(transport); + } + + private static void assertRequest(HttpRequest request, HttpMethod method, String path) { + assertEquals(method, request.getHttpMethod()); + assertEquals(path, request.getUrl().getPath()); + assertTrue(request.getUrl().getQuery().contains("api-version=2026-11-01-preview")); + } + + private static Map map(Object value) { + return assertInstanceOf(Map.class, value); + } + + private static Map firstMap(Object value) { + List list = assertInstanceOf(List.class, value); + assertFalse(list.isEmpty()); + return map(list.get(0)); + } + + private static MockHttpResponse response(HttpRequest request, int status, String body) { + return new MockHttpResponse(request, status, body.getBytes(StandardCharsets.UTF_8)); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java new file mode 100644 index 0000000000000..2557333797a2a --- /dev/null +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java @@ -0,0 +1,632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.SyncPoller; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; +import com.azure.search.documents.indexes.models.ChatCompletionSkill; +import com.azure.search.documents.indexes.models.FileKnowledgeSource; +import com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.FileUploadMetadata; +import com.azure.search.documents.indexes.models.IndexerExecutionResult; +import com.azure.search.documents.indexes.models.IndexerExecutionStatus; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel; +import com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model; +import com.azure.search.documents.indexes.models.KnowledgeBaseOpenAICompatibleModel; +import com.azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults; +import com.azure.search.documents.indexes.models.KnowledgeBaseTool; +import com.azure.search.documents.indexes.models.KnowledgeBaseToolKnowledgeSourceReference; +import com.azure.search.documents.indexes.models.KnowledgeSource; +import com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode; +import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.OpenAICompatibleVectorizer; +import com.azure.search.documents.indexes.models.RandomScoringFunction; +import com.azure.search.documents.indexes.models.RandomScoringParameters; +import com.azure.search.documents.indexes.models.ScoringProfile; +import com.azure.search.documents.indexes.models.SearchIndex; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints; +import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; +import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; +import com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatus; +import com.azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams; +import com.azure.search.documents.models.AgenticSearchDebugInfo; +import com.azure.search.documents.models.AgenticSearchOptions; +import com.azure.search.documents.models.BalancedVectorQueryTopicGraph; +import com.azure.search.documents.models.ContentFileDetails; +import com.azure.search.documents.models.DiverseVectorQueryTopicGraph; +import com.azure.search.documents.models.GraphOptions; +import com.azure.search.documents.models.GraphQueryDiagnosticSeverity; +import com.azure.search.documents.models.GraphQueryExecutionMode; +import com.azure.search.documents.models.GraphQueryResult; +import com.azure.search.documents.models.IndexActionType; +import com.azure.search.documents.models.IndexDocumentsBatch; +import com.azure.search.documents.models.NoneVectorQueryTopicGraph; +import com.azure.search.documents.models.OperationState; +import com.azure.search.documents.models.QueryDebugMode; +import com.azure.search.documents.models.QueryType; +import com.azure.search.documents.models.SearchOptions; +import com.azure.search.documents.models.SearchPagedResponse; +import com.azure.search.documents.models.VectorQueryTopicGraph; +import com.azure.search.documents.models.VectorizableTextQuery; +import com.azure.search.documents.models.VectorizedQuery; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +/** + * Opt-in service-behavior checks. See preview-feature-coverage.md for fixture prerequisites and remaining gaps. + */ +@LiveOnly +@EnabledIfEnvironmentVariable(named = "SEARCH_RUN_PREVIEW_FEATURE_TESTS", matches = "true") +@Timeout(value = 20, unit = TimeUnit.MINUTES) +public class PreviewFeatureLiveTests extends SearchTestBase { + private final List createdIndexes = new ArrayList<>(); + private final List createdSources = new ArrayList<>(); + private final List createdBases = new ArrayList<>(); + + @Override + protected void afterTest() { + try { + if (createdBases.isEmpty() && createdSources.isEmpty() && createdIndexes.isEmpty()) { + return; + } + SearchIndexClient client = getSearchIndexClientBuilder(true).buildClient(); + List failures = new ArrayList<>(); + deleteOwnedResources(createdBases, client::deleteKnowledgeBase, failures); + deleteOwnedResources(createdSources, client::deleteKnowledgeSource, failures); + deleteOwnedResources(createdIndexes, client::deleteIndex, failures); + if (!failures.isEmpty()) { + IllegalStateException failure + = new IllegalStateException("Unable to clean up all owned preview fixtures."); + failures.forEach(failure::addSuppressed); + throw failure; + } + } finally { + super.afterTest(); + } + } + + @Test + public void randomScoringIsRepeatableForOneSeedAndRotatesForAnother() throws InterruptedException { + String index = createSeededIndex(); + SearchClient client = getSearchClientBuilder(index, true).buildClient(); + List first = randomOrder(client, "42"); + assertEquals(first, randomOrder(client, "42")); + List rotated = randomOrder(client, "-9223372036854775808"); + assertEquals(new HashSet<>(first), new HashSet<>(rotated)); + assertEquals(32, first.size()); + assertNotEquals(first, rotated); + } + + @ParameterizedTest + @ValueSource(strings = { "diverse", "balanced" }) + public void topicGraphDiversifiesAndInterleavesWithPureVector(String mode) { + String index = requiredSetting("SEARCH_PREVIEW_TOPIC_INDEX"); + String query = requiredSetting("SEARCH_PREVIEW_TOPIC_QUERY_JSON"); + String topicField = requiredSetting("SEARCH_PREVIEW_TOPIC_FIELD"); + VectorQueryTopicGraph topicGraph = "diverse".equals(mode) + ? new DiverseVectorQueryTopicGraph().setDiversityFactor(1.0f).setMinDiversityPoolSize(1000) + : new BalancedVectorQueryTopicGraph().setMinDiversityPoolSize(1000); + VectorizedQuery diversified = BinaryData.fromString(query).toObject(VectorizedQuery.class); + diversified.setTopicGraph(topicGraph); + VectorizedQuery plain = BinaryData.fromString(query).toObject(VectorizedQuery.class); + plain.setTopicGraph(new NoneVectorQueryTopicGraph()); + SearchClient client = getSearchClientBuilder(index, true).buildClient(); + List> baseline = documents(client, vectorOptions(plain)); + List> results = documents(client, vectorOptions(diversified)); + assertFalse(baseline.isEmpty()); + assertEquals(1, topics(baseline, topicField).size(), + "Fixture must have a single-topic nearest-neighbor baseline."); + assertTrue(topics(results, topicField).size() >= 2, "Fixture must exercise cross-topic retrieval."); + List> interleaved + = documents(client, new SearchOptions().setTop(10).setVectorQueries(diversified, plain)); + assertFalse(interleaved.isEmpty()); + assertTrue(interleaved.size() <= 10); + assertEquals(interleaved.size(), interleaved.stream().map(value -> value.get("id")).distinct().count()); + } + + @Test + public void graphPlansAndExecutesAgainstExtractedEdges() { + String index = requiredSetting("SEARCH_PREVIEW_GRAPH_INDEX"); + String gql = requiredSetting("SEARCH_PREVIEW_GRAPH_GQL"); + String field = requiredSetting("SEARCH_PREVIEW_GRAPH_RESULT_FIELD"); + String expected = requiredSetting("SEARCH_PREVIEW_GRAPH_RESULT_VALUE"); + SearchClient client = getSearchClientBuilder(index, true).buildClient(); + GraphQueryResult plan = client.graph(new GraphOptions(gql).setExecutionMode(GraphQueryExecutionMode.PLAN_ONLY) + .setIncludeStatistics(true) + .setIncludeDiagnostics(true)); + assertNotNull(plan.getStatistics()); + assertEquals(GraphQueryExecutionMode.PLAN_ONLY, plan.getStatistics().getExecutionMode()); + assertNotNull(plan.getDiagnostics()); + assertFalse(plan.getDiagnostics() + .stream() + .anyMatch(diagnostic -> GraphQueryDiagnosticSeverity.ERROR.equals(diagnostic.getSeverity()))); + GraphQueryResult result = client.graph(new GraphOptions(gql).setIncludeStatistics(true)); + assertNotNull(result.getValue()); + assertTrue( + result.getValue().stream().anyMatch(row -> expected.equals(row.getAdditionalProperties().get(field)))); + assertNotNull(result.getStatistics()); + } + + @Test + public void graphKnowledgeBaseRetrievalUsesGraphSearchActivity() { + String base = requiredSetting("SEARCH_PREVIEW_GRAPH_KB"); + String query = requiredSetting("SEARCH_PREVIEW_GRAPH_KB_QUERY"); + KnowledgeBaseRetrievalResult result = retrieve(base, query); + assertRetrieval(result); + assertNotNull(result.getActivity()); + assertTrue(result.getActivity().stream().anyMatch(KnowledgeBaseGraphSearchActivityRecord.class::isInstance)); + } + + @Test + public void graphIngestionReportsOntologyAndTriplesWithoutReturningCacheSecret() { + String source = requiredSetting("SEARCH_PREVIEW_GRAPH_SOURCE"); + AzureBlobKnowledgeSource value = assertInstanceOf(AzureBlobKnowledgeSource.class, + getSearchIndexClientBuilder(true).buildClient().getKnowledgeSource(source)); + assertNotNull(value.getAzureBlobParameters().getGraphExtraction()); + assertNotNull(value.getAzureBlobParameters().getGraphExtraction().getOntology()); + assertNotNull(value.getAzureBlobParameters().getGraphExtraction().getOntology().getName()); + assertNotNull(value.getAzureBlobParameters().getIngestionParameters().getCache()); + assertTrue( + value.getAzureBlobParameters().getIngestionParameters().getCache().getStorageConnectionString() == null, + "A source GET must not return the write-only cache connection string."); + KnowledgeSourceStatus status = getSearchIndexClientBuilder(true).buildClient().getKnowledgeSourceStatus(source); + assertNotNull(status.getLastSynchronizationState()); + assertNotNull(status.getLastSynchronizationState().getGraphStatistics()); + assertEquals(value.getAzureBlobParameters().getGraphExtraction().getOntology().getName(), + status.getLastSynchronizationState().getGraphStatistics().getOntologyName()); + assertTrue(status.getLastSynchronizationState().getGraphStatistics().getTriplesWritten() > 0); + } + + @Test + public void agenticSearchReturnsReasoningUsageAndDocuments() { + String index = requiredSetting("SEARCH_PREVIEW_AGENTIC_INDEX"); + String query = requiredSetting("SEARCH_PREVIEW_AGENTIC_QUERY"); + SearchOptions options = new SearchOptions().setSearchText(query) + .setQueryType(QueryType.fromString("agentic")) + .setAgenticOptions(new AgenticSearchOptions().setMaxRuntimeInSeconds(60)) + .setDebug(QueryDebugMode.fromString("agentic")) + .setTop(10); + SearchPagedResponse page + = getSearchClientBuilder(index, true).buildClient().search(options).iterableByPage().iterator().next(); + assertTrue(page.getElements().iterator().hasNext()); + assertNotNull(page.getDebugInfo()); + AgenticSearchDebugInfo debug = page.getDebugInfo().getAgentic(); + assertNotNull(debug); + assertNotNull(debug.getUsage()); + assertTrue(debug.getUsage().getAgenticPlanningTokens() > 0); + assertTrue(debug.getUsage().getReasoningTokens() > 0); + } + + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void minimalAndMicrosoftRetrieverKnowledgeBasesRetrieve(boolean microsoftRetriever) + throws InterruptedException { + String index = createSeededIndex(); + String source = createSource(new SearchIndexKnowledgeSource(randomName("preview-source"), + new SearchIndexKnowledgeSourceParameters(index).setSemanticConfigurationName("preview-semantic"))) + .getName(); + KnowledgeBase base = new KnowledgeBase(randomName("preview-base"), new KnowledgeSourceReference(source)) + .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA); + if (microsoftRetriever) { + base.setModels(new KnowledgeBaseMicrosoftRetriever1Model()); + } else { + base.setRetrievalReasoningEffort(new KnowledgeRetrievalMinimalReasoningEffort()); + } + createBase(base); + KnowledgeBase persisted = getSearchIndexClientBuilder(true).buildClient().getKnowledgeBase(base.getName()); + if (microsoftRetriever) { + assertInstanceOf(KnowledgeBaseMicrosoftRetriever1Model.class, persisted.getModels().get(0)); + } else { + assertTrue(persisted.getModels() == null || persisted.getModels().isEmpty()); + } + assertRetrieval(retrieve(base.getName(), "Find preview product documents.")); + } + + @Test + public void fileIngestionSupportsUploadReplacementAndRetainedOperationLookup() { + requiredSetting("SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME"); + String source = createSource(new FileKnowledgeSource(randomName("preview-file"), + new FileKnowledgeSourceParameters().setIngestionParameters(new KnowledgeSourceIngestionParameters() + .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL) + .setEmbeddingModel( + new KnowledgeSourceAzureOpenAIVectorizer().setAzureOpenAIParameters(embeddingParameters()))))) + .getName(); + SearchIndexClient client = getSearchIndexClientBuilder(true).buildClient(); + SyncPoller upload + = client.beginIngestKnowledgeSourceFileMultipart(source, new UploadKnowledgeSourceFileMultipartRequest( + new FileUploadMetadata().setFileName("preview.txt"), content("Original preview product."))); + PollResponse uploaded = upload.waitForCompletion(Duration.ofMinutes(15)); + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, uploaded.getStatus()); + KnowledgeSourceFile original = upload.getFinalResult(); + assertNotNull(original); + assertEquals("preview.txt", original.getFileName()); + String uploadId = uploaded.getValue().getId(); + assertEquals(OperationState.SUCCEEDED, + client.getKnowledgeSourceFileIngestionOperation(source, uploadId).getStatus()); + + AsyncPollResponse replacement + = getSearchIndexClientBuilder(false).buildAsyncClient() + .beginIngestKnowledgeSourceFileReplacement(source, original.getFileId(), + new UpdateKnowledgeSourceFileRequest(new FileUploadMetadata().setFileName("preview.txt"), + content("Replacement preview product with changed content."))) + .last() + .block(Duration.ofMinutes(15)); + assertNotNull(replacement); + assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, replacement.getStatus()); + KnowledgeSourceFile updated = replacement.getFinalResult().block(Duration.ofMinutes(1)); + assertNotNull(updated); + assertEquals(original.getFileId(), updated.getFileId()); + assertNotEquals(uploadId, replacement.getValue().getId()); + assertNotNull(original.getFileSizeBytes()); + assertNotNull(updated.getFileSizeBytes()); + assertTrue(updated.getFileSizeBytes() > original.getFileSizeBytes()); + Set operations = client.listKnowledgeSourceFileIngestionOperations(source, 1, null) + .stream() + .map(KnowledgeSourceFileIngestionOperation::getId) + .collect(Collectors.toSet()); + assertTrue(operations.contains(uploadId)); + assertTrue(operations.contains(replacement.getValue().getId())); + HttpResponseException missing = assertThrows(HttpResponseException.class, + () -> client.getKnowledgeSourceFileIngestionOperation(source, "00000000-0000-0000-0000-000000000000")); + assertEquals(404, missing.getResponse().getStatusCode()); + } + + @Test + public void oneLakePermissionsAllowOneIdentityAndExcludeAnother() { + String index = requiredSetting("SEARCH_PREVIEW_ONELAKE_INDEX"); + String source = requiredSetting("SEARCH_PREVIEW_ONELAKE_SOURCE"); + String id = requiredSetting("SEARCH_PREVIEW_ONELAKE_RESTRICTED_ID"); + String allowed = requiredSetting("SEARCH_PREVIEW_ONELAKE_ALLOWED_TOKEN"); + String denied = requiredSetting("SEARCH_PREVIEW_ONELAKE_DENIED_TOKEN"); + assertFalse(allowed.equals(denied), "Use distinct, valid source identities."); + SearchIndexClient indexes = getSearchIndexClientBuilder(true).buildClient(); + assertEquals("indexedOneLake", indexes.getKnowledgeSource(source).getKind().toString()); + assertTrue(indexes.getIndex(index) + .getFields() + .stream() + .anyMatch(field -> field.getPermissionFilter() != null + && "oneLakeParentFolders".equals(field.getPermissionFilter().toString()))); + SearchClient client = getSearchClientBuilder(index, true).buildClient(); + SearchOptions query = new SearchOptions().setFilter("id eq '" + id.replace("'", "''") + "'") + .setQuerySourceAuthorization(allowed) + .setEnableElevatedRead(false); + assertEquals(1, documents(client, query).size(), "Allowed identity must see the restricted sentinel."); + assertEquals(0, documents(client, query.setQuerySourceAuthorization(denied)).size(), + "A valid identity without folder access must not see the same sentinel."); + } + + @Test + public void toolSelectionLimitsSourcesAndRequestDefaultsTakePrecedence() throws InterruptedException { + String index = createSeededIndex(); + String source = createSource(new SearchIndexKnowledgeSource(randomName("preview-tool-source"), + new SearchIndexKnowledgeSourceParameters(index).setSemanticConfigurationName("preview-semantic"))) + .getName(); + KnowledgeBaseTool tool = new KnowledgeBaseTool("red-documents", "Retrieve only red preview products.", + Collections.singletonList( + new KnowledgeBaseToolKnowledgeSourceReference(source).setFilterAddOn("category eq 'red'"))) + .setRetrieveDefaults(new KnowledgeBaseRetrieveDefaults().setMaxOutputDocuments(2)); + KnowledgeBase base = new KnowledgeBase(randomName("preview-tools"), new KnowledgeSourceReference(source)) + .setRetrievalReasoningEffort(new KnowledgeRetrievalMinimalReasoningEffort()) + .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA) + .setRetrieveDefaults(new KnowledgeBaseRetrieveDefaults().setMaxOutputDocuments(4)) + .setTools(Collections.singletonList(tool)); + createBase(base); + assertEquals("red-documents", + getSearchIndexClientBuilder(true).buildClient() + .getKnowledgeBase(base.getName()) + .getTools() + .get(0) + .getName()); + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Find preview product documents.")) + .setToolName("red-documents") + .setMaxOutputDocuments(1) + .setKnowledgeSourceParams( + Collections.singletonList(new SearchIndexKnowledgeSourceParams(source).setIncludeReferences(true) + .setIncludeReferenceSourceData(true))); + KnowledgeBaseRetrievalResult result + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base.getName()) + .buildClient() + .retrieve(options); + assertRetrieval(result); + assertEquals(1, result.getReferences().size()); + assertEquals("red", result.getReferences().get(0).getSourceData().get("category")); + HttpResponseException invalid = assertThrows(HttpResponseException.class, + () -> getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base.getName()) + .buildClient() + .retrieve(options.setToolName("missing-tool"))); + assertEquals(400, invalid.getResponse().getStatusCode()); + } + + @ParameterizedTest + @ValueSource(strings = { "CHAT", "RESPONSES" }) + public void compatibleKnowledgeBaseModelsRetrieveThroughBothProtocols(String protocol) { + String base = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_" + protocol + "_KB"); + String query = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_QUERY"); + KnowledgeBase persisted = getSearchIndexClientBuilder(true).buildClient().getKnowledgeBase(base); + KnowledgeBaseOpenAICompatibleModel model + = assertInstanceOf(KnowledgeBaseOpenAICompatibleModel.class, persisted.getModels().get(0)); + String path = URI.create(model.getOpenAICompatibleParameters().getUri()).getPath(); + assertTrue(path.endsWith("CHAT".equals(protocol) ? "/chat/completions" : "/responses")); + assertRetrieval(retrieve(base, query)); + } + + @Test + public void compatibleIngestionSkillsAndVectorizersProcessDocuments() { + String source = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_SOURCE"); + String index = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_INDEX"); + String vectorField = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_VECTOR_FIELD"); + String skillset = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_SKILLSET"); + String indexer = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_INDEXER"); + SearchIndexClient indexes = getSearchIndexClientBuilder(true).buildClient(); + AzureBlobKnowledgeSource blob + = assertInstanceOf(AzureBlobKnowledgeSource.class, indexes.getKnowledgeSource(source)); + assertInstanceOf(KnowledgeBaseOpenAICompatibleModel.class, + blob.getAzureBlobParameters().getIngestionParameters().getChatCompletionModel()); + KnowledgeSourceStatus status = indexes.getKnowledgeSourceStatus(source); + assertNotNull(status.getLastSynchronizationState()); + assertNotNull(status.getStatistics()); + assertTrue(status.getStatistics().getAverageItemsProcessedPerSynchronization() > 0); + assertTrue(indexes.getIndex(index) + .getVectorSearch() + .getVectorizers() + .stream() + .anyMatch(OpenAICompatibleVectorizer.class::isInstance)); + assertTrue(getSearchIndexerClientBuilder(true).buildClient() + .getSkillset(skillset) + .getSkills() + .stream() + .filter(ChatCompletionSkill.class::isInstance) + .map(ChatCompletionSkill.class::cast) + .anyMatch(skill -> skill.getUrl() != null && skill.getCommonModelParameters() != null)); + IndexerExecutionResult execution + = getSearchIndexerClientBuilder(true).buildClient().getIndexerStatus(indexer).getLastResult(); + assertNotNull(execution); + assertEquals(IndexerExecutionStatus.SUCCESS, execution.getStatus()); + assertEquals(0, execution.getFailedItemCount()); + assertTrue(execution.getItemCount() > 0); + assertFalse(documents(getSearchClientBuilder(index, true).buildClient(), + new SearchOptions().setVectorQueries(new VectorizableTextQuery("preview product").setFields(vectorField))) + .isEmpty()); + } + + @Test + public void gpt6KnowledgeBaseProducesAResponse() { + String base = requiredSetting("SEARCH_PREVIEW_GPT6_KB"); + String query = requiredSetting("SEARCH_PREVIEW_GPT6_QUERY"); + KnowledgeBase persisted = getSearchIndexClientBuilder(true).buildClient().getKnowledgeBase(base); + KnowledgeBaseAzureOpenAIModel model + = assertInstanceOf(KnowledgeBaseAzureOpenAIModel.class, persisted.getModels().get(0)); + AzureOpenAIModelName name = model.getAzureOpenAIParameters().getModelName(); + assertTrue(AzureOpenAIModelName.GPT6ASTRA.equals(name) + || AzureOpenAIModelName.GPT6SOL.equals(name) + || AzureOpenAIModelName.GPT6LUNA.equals(name), "Fixture must use a supported GPT-6 family model."); + assertRetrieval(retrieve(base, query)); + } + + @Test + public void automaticFilterHintsGroundRetrievalAndRejectExplicitValues() throws InterruptedException { + String index = createSeededIndex(); + SearchIndexKnowledgeSourceFilterHint hint = new SearchIndexKnowledgeSourceFilterHint("category") + .setAutoConfiguration( + new SearchIndexKnowledgeSourceFilterHintAutoConfiguration().setCacheTtl(900).setMaxFacetValueCount(4)) + .setFilterInstructions("Use the category filter whenever the request specifies a product category."); + SearchIndexKnowledgeSourceParameters parameters + = new SearchIndexKnowledgeSourceParameters(index).setSemanticConfigurationName("preview-semantic") + .setQueryHints(new SearchIndexKnowledgeSourceQueryHints().setFilters(Collections.singletonList(hint))); + String source = createSource(new SearchIndexKnowledgeSource(randomName("preview-hints"), parameters)).getName(); + SearchIndexKnowledgeSource persisted = assertInstanceOf(SearchIndexKnowledgeSource.class, + getSearchIndexClientBuilder(true).buildClient().getKnowledgeSource(source)); + assertEquals(4, + persisted.getSearchIndexParameters() + .getQueryHints() + .getFilters() + .get(0) + .getAutoConfiguration() + .getMaxFacetValueCount()); + KnowledgeBase base = new KnowledgeBase(randomName("preview-filter-base"), new KnowledgeSourceReference(source)) + .setModels(new KnowledgeBaseAzureOpenAIModel(chatParameters())) + .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA); + createBase(base); + KnowledgeBaseRetrievalResult result + = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base.getName()) + .buildClient() + .retrieve(new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("Find documents in the red product category.")) + .setKnowledgeSourceParams(Collections + .singletonList(new SearchIndexKnowledgeSourceParams(source).setIncludeReferences(true) + .setIncludeReferenceSourceData(true)))); + assertRetrieval(result); + for (com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference reference : result + .getReferences()) { + assertInstanceOf(KnowledgeBaseSearchIndexReference.class, reference); + assertNotNull(reference.getSourceData()); + assertEquals("red", reference.getSourceData().get("category")); + } + hint.setFieldValues(Collections.singletonList("red")); + HttpResponseException invalid = assertThrows(HttpResponseException.class, + () -> createSource(new SearchIndexKnowledgeSource(randomName("preview-invalid-hints"), parameters))); + assertEquals(400, invalid.getResponse().getStatusCode()); + } + + private String createSeededIndex() throws InterruptedException { + String name = randomName("preview-features"); + SearchIndex index = BinaryData.fromString("{\"name\":\"" + name + "\",\"fields\":[" + + "{\"name\":\"id\",\"type\":\"Edm.String\",\"key\":true,\"filterable\":true}," + + "{\"name\":\"content\",\"type\":\"Edm.String\",\"searchable\":true}," + + "{\"name\":\"category\",\"type\":\"Edm.String\",\"filterable\":true,\"facetable\":true}]," + + "\"semantic\":{\"configurations\":[{\"name\":\"preview-semantic\",\"prioritizedFields\":" + + "{\"prioritizedContentFields\":[{\"fieldName\":\"content\"}]}}]}}").toObject(SearchIndex.class); + index.setScoringProfiles(new ScoringProfile("rotate") + .setFunctions(new RandomScoringFunction().setParameters(new RandomScoringParameters("seed")))); + getSearchIndexClientBuilder(true).buildClient().createIndex(index); + createdIndexes.add(name); + List> values = new ArrayList<>(); + for (int i = 0; i < 32; i++) { + Map document = new HashMap<>(); + document.put("id", Integer.toString(i)); + document.put("content", "Preview product document."); + document.put("category", i % 2 == 0 ? "red" : "blue"); + values.add(document); + } + SearchClient client = getSearchClientBuilder(name, true).buildClient(); + assertTrue(client.indexDocuments(new IndexDocumentsBatch(values.stream() + .map(document -> TestHelpers.createIndexAction(IndexActionType.UPLOAD, document)) + .collect(Collectors.toList()))).getResults().stream().allMatch(result -> result.isSucceeded())); + long deadline = System.nanoTime() + Duration.ofMinutes(2).toNanos(); + while (client.getDocumentCount() != values.size() && System.nanoTime() < deadline) { + Thread.sleep(1000); + } + assertEquals(values.size(), client.getDocumentCount(), "The owned fixture did not finish indexing."); + return name; + } + + private KnowledgeSource createSource(KnowledgeSource source) { + KnowledgeSource created = getSearchIndexClientBuilder(true).buildClient().createKnowledgeSource(source); + createdSources.add(created.getName()); + return created; + } + + private static void deleteOwnedResources(List names, Consumer delete, + List failures) { + for (String name : names) { + try { + delete.accept(name); + } catch (RuntimeException failure) { + failures.add(failure); + } + } + } + + private void createBase(KnowledgeBase base) { + KnowledgeBase created = getSearchIndexClientBuilder(true).buildClient().createKnowledgeBase(base); + createdBases.add(created.getName()); + } + + private String randomName(String prefix) { + return testResourceNamer.randomName(prefix, 48); + } + + private static String requiredSetting(String name) { + String value = Configuration.getGlobalConfiguration().get(name); + assumeTrue(value != null && !value.trim().isEmpty(), "Missing preview fixture setting: " + name); + return value; + } + + private static List> documents(SearchClient client, SearchOptions options) { + return client.search(options) + .stream() + .>map(result -> result.getAdditionalProperties()) + .collect(Collectors.toList()); + } + + private static List randomOrder(SearchClient client, String seed) { + return documents(client, + new SearchOptions().setTop(32) + .setScoringProfile("rotate") + .setScoringParameters(Collections.singletonList("seed:" + seed))).stream() + .map(document -> (String) document.get("id")) + .collect(Collectors.toList()); + } + + private static SearchOptions vectorOptions(VectorizedQuery query) { + return new SearchOptions().setTop(10).setVectorQueries(query); + } + + private static Set topics(List> documents, String field) { + Set values = new HashSet<>(); + for (Map document : documents) { + assertNotNull(document.get(field), "Topic fixture documents must expose their topic label."); + values.add(document.get(field)); + } + return values; + } + + private KnowledgeBaseRetrievalResult retrieve(String base, String query) { + return getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base) + .buildClient() + .retrieve(new KnowledgeBaseRetrievalOptions().setIntents(new KnowledgeRetrievalSemanticIntent(query)) + .setIncludeActivity(true)); + } + + private static void assertRetrieval(KnowledgeBaseRetrievalResult result) { + assertNotNull(result); + assertNotNull(result.getResponse()); + assertFalse(result.getResponse().isEmpty()); + assertNotNull(result.getReferences()); + assertFalse(result.getReferences().isEmpty(), + "The seeded request must retrieve evidence, not just an empty answer."); + } + + private static ContentFileDetails content(String value) { + return new ContentFileDetails(BinaryData.fromString(value)).setFilename("preview.txt") + .setContentType("text/plain"); + } + + private static AzureOpenAIVectorizerParameters embeddingParameters() { + return new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName(OPENAI_EMBEDDING_DEPLOYMENT_NAME) + .setModelName(AzureOpenAIModelName.fromString(OPENAI_EMBEDDING_MODEL_NAME)) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY)); + } + + private static AzureOpenAIVectorizerParameters chatParameters() { + return new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName(OPENAI_DEPLOYMENT_NAME) + .setModelName(AzureOpenAIModelName.fromString(OPENAI_MODEL_NAME)) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY)); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexersManagementTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexersManagementTests.java index 449aba9554e62..d0fe73de3146f 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexersManagementTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexersManagementTests.java @@ -5,7 +5,6 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; import com.azure.core.test.models.TestProxySanitizer; @@ -32,6 +31,7 @@ import com.azure.search.documents.indexes.models.SearchIndexerDataContainer; import com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection; import com.azure.search.documents.indexes.models.SearchIndexerDataSourceType; +import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; import com.azure.search.documents.indexes.models.SearchIndexerLimits; import com.azure.search.documents.indexes.models.SearchIndexerSkill; import com.azure.search.documents.indexes.models.SearchIndexerSkillset; @@ -312,42 +312,43 @@ public void canCreateAndListIndexerNamesAsync() { @Test public void canListIndexerResourcesByPrefixAcrossPagesSync() { - normalizeLegacyPaginationIdentity(); + addPaginationSanitizers(); String prefix = testResourceNamer.randomName("paged-indexer-", 24); List expectedIndexerNames = createIndexersForPagination(prefix); List expectedDataSourceNames = createDataSourcesForPagination(prefix); List expectedSkillsetNames = createSkillsetsForPagination(prefix); - RequestOptions options = new RequestOptions().addQueryParam("search", prefix) - .addQueryParam("pageSize", "1") - .addQueryParam("searchType", ListingSearchType.PREFIX.toString()); - assertPagedNames(expectedIndexerNames, searchIndexerClient.listIndexers(options).iterableByPage(), + assertPagedNames(expectedIndexerNames, + searchIndexerClient.getIndexers(null, prefix, 1, ListingSearchType.PREFIX).iterableByPage(), SearchIndexer::getName); assertPagedNames(expectedDataSourceNames, - searchIndexerClient.listDataSourceConnections(options).iterableByPage(), + searchIndexerClient.getDataSourceConnections(null, prefix, 1, ListingSearchType.PREFIX).iterableByPage(), SearchIndexerDataSourceConnection::getName); - assertPagedNames(expectedSkillsetNames, searchIndexerClient.listSkillsets(options).iterableByPage(), + assertPagedNames(expectedSkillsetNames, + searchIndexerClient.getSkillsets(null, prefix, 1, ListingSearchType.PREFIX).iterableByPage(), SearchIndexerSkillset::getName); } @Test public void canListIndexerResourcesByPrefixAcrossPagesAsync() { - normalizeLegacyPaginationIdentity(); + addPaginationSanitizers(); String prefix = testResourceNamer.randomName("paged-indexer-", 24); List expectedIndexerNames = createIndexersForPagination(prefix); List expectedDataSourceNames = createDataSourcesForPagination(prefix); List expectedSkillsetNames = createSkillsetsForPagination(prefix); - RequestOptions options = new RequestOptions().addQueryParam("search", prefix) - .addQueryParam("pageSize", "1") - .addQueryParam("searchType", ListingSearchType.PREFIX.toString()); - StepVerifier.create(Mono.zip(searchIndexerAsyncClient.listIndexers(options).byPage().collectList(), - searchIndexerAsyncClient.listDataSourceConnections(options).byPage().collectList(), - searchIndexerAsyncClient.listSkillsets(options).byPage().collectList())).assertNext(pages -> { + StepVerifier.create(Mono.zip( + searchIndexerAsyncClient.getIndexers(null, prefix, 1, ListingSearchType.PREFIX).byPage().collectList(), + searchIndexerAsyncClient.getDataSourceConnections(null, prefix, 1, ListingSearchType.PREFIX) + .byPage() + .collectList(), + searchIndexerAsyncClient.getSkillsets(null, prefix, 1, ListingSearchType.PREFIX).byPage().collectList())) + .assertNext(pages -> { assertPagedNames(expectedIndexerNames, pages.getT1(), SearchIndexer::getName); assertPagedNames(expectedDataSourceNames, pages.getT2(), SearchIndexerDataSourceConnection::getName); assertPagedNames(expectedSkillsetNames, pages.getT3(), SearchIndexerSkillset::getName); - }).verifyComplete(); + }) + .verifyComplete(); } @Test @@ -1225,16 +1226,13 @@ private static SearchIndexerDataSourceConnection createSharedDataSource() { } private static SearchIndexerDataSourceConnection createDataSource(String name) { - return createDataSource(name, BLOB_CONTAINER_NAME); - } - - private static SearchIndexerDataSourceConnection createDataSource(String name, String containerName) { // create the new data source object for this storage account and container return new SearchIndexerDataSourceConnection(name, SearchIndexerDataSourceType.AZURE_BLOB, new DataSourceCredentials().setConnectionString(String.format( "ResourceId=/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Storage/storageAccounts/%s;", SUBSCRIPTION_ID, RESOURCE_GROUP, STORAGE_ACCOUNT_NAME)), - new SearchIndexerDataContainer(containerName).setQuery("/")).setDescription("real live blob"); + new SearchIndexerDataContainer(BLOB_CONTAINER_NAME).setQuery("/")).setDescription("real live blob") + .setIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY)); } private List createIndexersForPagination(String prefix) { @@ -1247,21 +1245,18 @@ private List createIndexersForPagination(String prefix) { return names; } - private void normalizeLegacyPaginationIdentity() { - if (TEST_MODE == TestMode.PLAYBACK) { - // Pagination recordings predate the switch to system-assigned identity. Only normalize the legacy selector. - interceptorManager.addSanitizers(new TestProxySanitizer( - ",\\\\s*\\\"identity\\\"\\\\s*:\\\\s*\\\\{[^{}]*\\\"#Microsoft.Azure.Search.DataUserAssignedIdentity\\\"[^{}]*\\\\}", - "", TestProxySanitizerType.BODY_REGEX)); + private void addPaginationSanitizers() { + if (!interceptorManager.isLiveMode()) { + interceptorManager.addSanitizers( + new TestProxySanitizer("$..userAssignedIdentity", null, "REDACTED", TestProxySanitizerType.BODY_KEY), + new TestProxySanitizer("$..container.name", null, "searchcontainer", TestProxySanitizerType.BODY_KEY)); } } private List createDataSourcesForPagination(String prefix) { List names = Arrays.asList(prefix + "data-one", prefix + "data-two"); - // These recordings use "test", independently of the local storage configuration. - String containerName = TEST_MODE == TestMode.PLAYBACK ? "test" : BLOB_CONTAINER_NAME; names.forEach(name -> { - searchIndexerClient.createDataSourceConnection(createDataSource(name, containerName)); + searchIndexerClient.createDataSourceConnection(createDataSource(name)); dataSourcesToDelete.add(name); }); return names; diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java index c98c64337fbd9..0f7101d81cd19 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java @@ -54,7 +54,8 @@ public class SearchListingTests { private static final String ENDPOINT = "https://example.search.windows.net"; private static final AzureKeyCredential CREDENTIAL = new AzureKeyCredential("key"); - private static final String NEXT_LINK = ENDPOINT + "/next-page?api-version=2026-10-01&$skiptoken=opaque%2B%2F%3D"; + private static final String NEXT_LINK + = ENDPOINT + "/next-page?api-version=2026-11-01-preview&$skiptoken=opaque%2B%2F%3D"; @ParameterizedTest @MethodSource("listings") diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalStreamTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalStreamTests.java index 89c8b9cc550eb..20c47699308bf 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalStreamTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalStreamTests.java @@ -153,6 +153,38 @@ public void bothClientsForwardAuthorizationForStreamingRetrieval(String option, assertEquals(option, options.getQuerySourceAuthorization()); } + @ParameterizedTest + @MethodSource("authorizationCases") + public void workIqOverloadsPreserveBothAuthorizationHeaders(String option, String explicit, + boolean useExplicitOverload, String expected) throws IOException { + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions().setQuerySourceAuthorization(option); + String authorization = useExplicitOverload ? explicit : null; + KnowledgeBaseRetrievalClientBuilder regular + = authorizationBuilder("{}", expected, false).addPolicy((context, next) -> { + assertEquals("work-iq-token", + context.getHttpRequest().getHeaders().getValue(QUERY_WORK_IQ_SOURCE_AUTHORIZATION)); + return next.process(); + }); + assertNotNull(regular.buildClient().retrieve(options, authorization, "work-iq-token")); + assertNotNull(regular.buildAsyncClient().retrieve(options, authorization, "work-iq-token").block()); + + KnowledgeBaseRetrievalClientBuilder streaming + = authorizationBuilder(frame("response.completed", RESPONSE_COMPLETED_JSON), expected, true) + .addPolicy((context, next) -> { + assertEquals("work-iq-token", + context.getHttpRequest().getHeaders().getValue(QUERY_WORK_IQ_SOURCE_AUTHORIZATION)); + return next.process(); + }); + try (CloseableIterableStream events + = streaming.buildClient().retrieveStream(options, authorization, "work-iq-token")) { + assertEvent(events.iterator().next(), "response.completed", true); + } + StepVerifier.create(streaming.buildAsyncClient().retrieveStream(options, authorization, "work-iq-token")) + .assertNext(event -> assertEvent(event, "response.completed", true)) + .verifyComplete(); + assertEquals(option, options.getQuerySourceAuthorization()); + } + @ParameterizedTest @ValueSource(booleans = { false, true }) public void typedResponsesForwardOptionWithNullRequestOptions(boolean async) { @@ -238,7 +270,7 @@ private static KnowledgeBaseRetrievalClientBuilder authorizationBuilder(String b .knowledgeBaseName("kb") .credential(new AzureKeyCredential("key")) .httpClient(request -> { - assertEquals("api-version=2026-10-01", request.getUrl().getQuery()); + assertEquals("api-version=2026-11-01-preview", request.getUrl().getQuery()); assertEquals(expected, request.getHeaders().getValue(QUERY_SOURCE_AUTHORIZATION)); String json = request.getBodyAsBinaryData().toString(); assertFalse(json.contains("querySourceAuthorization")); @@ -685,7 +717,7 @@ private static KnowledgeBaseRetrievalClientBuilder createBuilder(String response .knowledgeBaseName("kb") .credential(new AzureKeyCredential("key")) .httpClient(request -> { - assertEquals("api-version=2026-10-01", request.getUrl().getQuery()); + assertEquals("api-version=2026-11-01-preview", request.getUrl().getQuery()); assertEquals("text/event-stream", request.getHeaders().getValue(HttpHeaderName.ACCEPT)); assertEquals(querySourceToken, request.getHeaders().getValue(QUERY_SOURCE_AUTHORIZATION)); assertNull(request.getHeaders().getValue(QUERY_WORK_IQ_SOURCE_AUTHORIZATION)); diff --git a/sdk/search/azure-search-perf/pom.xml b/sdk/search/azure-search-perf/pom.xml index aba17f7881572..b0f8f0743a0a4 100644 --- a/sdk/search/azure-search-perf/pom.xml +++ b/sdk/search/azure-search-perf/pom.xml @@ -35,12 +35,12 @@ com.azure azure-core - 1.61.0 + 1.60.0 com.azure azure-core-http-netty - 1.17.0 + 1.16.8 From cbe57f71c9f38bbe5c341671337f17046c9a9596 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 10:16:33 -0800 Subject: [PATCH 06/20] Remove unverified Search preview live tests Remove the 14 supplemental live methods that were never exercised against a real service. Retain the verified offline regression tests and published recordings, and update the coverage inventory to remove stale live-test setup instructions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../preview-feature-coverage.md | 103 +-- .../documents/PreviewFeatureLiveTests.java | 632 ------------------ 2 files changed, 28 insertions(+), 707 deletions(-) delete mode 100644 sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java diff --git a/sdk/search/azure-search-documents/preview-feature-coverage.md b/sdk/search/azure-search-documents/preview-feature-coverage.md index 2bf8646aae33c..a6f6db0fb8fbd 100644 --- a/sdk/search/azure-search-documents/preview-feature-coverage.md +++ b/sdk/search/azure-search-documents/preview-feature-coverage.md @@ -9,22 +9,23 @@ Deployment work items and one-pagers are feature inventories, not substitutes fo Existing tests are not evidence that all deployed features have passed live validation. The offline checks exercise Java request/response handling with fake HTTP responses. -The new live checks are opt-in and have not yet been run against the corrected backend. - -| Feature | Existing coverage before this addition | Added service-behavior check in `PreviewFeatureLiveTests` | Remaining validation | -| --- | --- | --- | --- | -| GraphRAG Zero L1 / Topic Graph | `PreviewApiTests.topicGraphDiscriminatorsRoundTrip`; `FieldBuilderTests` covers `topicGraphProfile` | `topicGraphDiversifiesAndInterleavesWithPureVector`: diverse/balanced modes, single-topic pure-vector control, cross-topic results, mixed queries without duplicate IDs | Provision the controlled topic fixture; validate index/KS creation and server-side rejection of invalid mode-specific fields separately | -| EKG KS ingestion, ontology, cache and status | Basic cache round trip only; Fabric Ontology KS tests are a different feature | `graphIngestionReportsOntologyAndTriplesWithoutReturningCacheSecret`: completed extraction, ontology statistics, positive triple count, GET omits cache secret | Fresh ingestion, cache reuse/reprocessing, grounding correctness, ontology attach/update/detach and failure recovery still require provisioned blob/ontology/cache fixtures | -| EKG retrieval | `PreviewApiTests` covers graph request headers/options, response diagnostics and rejection body | `graphPlansAndExecutesAgainstExtractedEdges`; `graphKnowledgeBaseRetrievalUsesGraphSearchActivity` | Validate provenance hydration, authorization and additional graph-language cases with dedicated fixtures | -| Agentic Direct Search / KR models | `SearchUtilsTests` forwards agentic options; SSE tests deserialize agentic reasoning; Microsoft Retriever model round trip | `agenticSearchReturnsReasoningUsageAndDocuments`; `minimalAndMicrosoftRetrieverKnowledgeBasesRetrieve` | Backend deployment/routing must support both models; check timeout/budget termination and shared accounting separately | -| File KS LRO | Existing legacy upload/update tests require embedding fixtures; `PreviewApiTests` checks operation kind | `fileIngestionSupportsUploadReplacementAndRetainedOperationLookup`: sync upload, async replacement, same file ID, operation GET/list with page size 1, missing-operation 404 | Backend failure/retention scenarios require service-side fault/expiry fixtures; offline polling tests do not prove actual ingestion | -| Durable Operations framework | No separate customer-facing framework API | Covered through File KS operation lifecycle above | No SDK test for internal serverless teardown; framework durability/restart/expiry belongs to backend tests | -| OneLake indexed KS ACLs / OneLake security filtering | `FieldBuilderTests` maps `oneLakeParentFolders`; old OneLake citation deserialization is not ACL coverage | `oneLakePermissionsAllowOneIdentityAndExcludeAnother`: indexed OneLake source, permission schema, two valid identities, restricted sentinel included/excluded with elevated read disabled | Requires a real indexed OneLake fixture and fresh source-authorization tokens; inherited/moved-folder ACLs and revocation propagation remain backend scenarios | -| Random scoring | `PreviewApiTests` checks discriminator, omission of field/boost and classic-scoring compatibility | `randomScoringIsRepeatableForOneSeedAndRotatesForAnother`: identical seed ordering, changed signed 64-bit seed ordering, same document set | Seed validation/error boundaries are contract checks; statistical sampling quality belongs to backend tests | -| KB tools | MCP knowledge-source tests are not KB tool tests | `toolSelectionLimitsSourcesAndRequestDefaultsTakePrecedence`: persisted singular tool selection, source filter isolation, request overrides tool/KB limits, unknown-tool 400 | Multiple tools, invalid source membership, MCP catalog and schema discovery still need additional integration coverage | -| OpenAI-compatible / APIM models | No focused compatible-model test found in the previous test inventory | `compatibleKnowledgeBaseModelsRetrieveThroughBothProtocols`; `compatibleIngestionSkillsAndVectorizersProcessDocuments` | Provision chat and Responses gateways, KBs, embedding/vectorizer, skillset/indexer and ingested KS; APIM traces must verify exact downstream path/query/header behavior | -| GPT-6 via Responses | General extensible model-name handling is not proof of GPT-6 operation | `gpt6KnowledgeBaseProducesAResponse`: persisted GPT-6 model and nonempty retrieval evidence | Requires deployed GPT-6; confirm Responses selection in backend traces, not merely a successful model-name serialization | -| Query hint filter auto-configuration | `PreviewApiTests.automaticFilterHintsSerializeFacetConfiguration`; existing filter/boost retrieval tests do not exercise facet bootstrap | `automaticFilterHintsGroundRetrievalAndRejectExplicitValues`: stored auto-configuration, facet-backed retrieval restricted to a known category, explicit values + auto-configuration rejected | TTL refresh, max facet-count behavior, nonfacetable fields, permission/Purview restrictions and request-time override rejection remain additional cases | +The 14 supplemental live-test methods were removed because they had not been exercised against a real service. +Their removal does not close the service-validation gaps below. + +| Feature | Retained SDK coverage | Remaining service validation | +| --- | --- | --- | +| GraphRAG Zero L1 / Topic Graph | `PreviewApiTests` round trips discriminators; `FieldBuilderTests` covers `topicGraphProfile`; `PreviewFeatureContractTests` checks query modes, allowed fields and stored KS defaults | Controlled-corpus diversity/interleaving, index/KS configuration and rejection of invalid mode-specific fields | +| EKG KS ingestion, ontology, cache and status | `PreviewFeatureContractTests` checks graph extraction/cache requests and ontology/triple statistics in status responses | Real extraction, cache reuse/reprocessing, grounding, secret omission on GET, ontology lifecycle and failure recovery | +| EKG retrieval | `PreviewApiTests` checks graph headers/options, diagnostics and rejection bodies; `PreviewFeatureContractTests` checks graph overrides and mixed activity types | Graph execution, KB graph retrieval, provenance hydration, authorization and graph-language cases | +| Agentic Direct Search / KR models | `SearchUtilsTests` forwards agentic options; SSE tests deserialize reasoning; `PreviewFeatureContractTests` checks renamed usage fields and Microsoft Retriever requests | Real reasoning/retrieval, model routing, timeout/budget termination and shared accounting | +| File KS LRO | Existing legacy upload/update tests; `FileIngestionPollingTests` checks sync/async polling, errors, operation GET/list and continuation | Real ingestion/replacement, retained-operation lookup, backend failure and expiry behavior | +| Durable Operations framework | Customer-facing file-operation polling coverage above | Internal serverless teardown, durability/restart and expiry belong to backend tests | +| OneLake indexed KS ACLs / OneLake security filtering | `FieldBuilderTests` maps `oneLakeParentFolders`; `PreviewFeatureContractTests` checks security metadata and data-source serialization | Two-identity visibility checks, inherited/moved-folder ACLs and revocation propagation | +| Random scoring | `PreviewApiTests` checks discriminator and classic-scoring compatibility; `PreviewFeatureContractTests` checks profile and seed forwarding | Same-seed repeatability, changed-seed ordering, seed rejection boundaries and statistical quality | +| KB tools | `PreviewFeatureContractTests` checks tool configuration and singular request-time selection | Source isolation, request/default precedence, invalid tool/source rejection and MCP discovery | +| OpenAI-compatible / APIM models | `PreviewFeatureContractTests` checks KB authentication, ingestion models, vectorizers and exact skill URI forwarding | Real Chat Completions/Responses retrieval, ingestion/vectorization and downstream APIM path/query/header behavior | +| GPT-6 via Responses | Model-name handling in compatible-model contract cases | Real deployed-model retrieval and backend Responses routing | +| Query hint filter auto-configuration | `PreviewApiTests` and `PreviewFeatureContractTests` check facet-backed configuration serialization | Facet bootstrap, filtering, TTL refresh, limits and rejection/permission boundaries | `PreviewFeatureContractTests` adds 23 offline wire cases alongside the existing tests. `FileIngestionPollingTests` adds seven offline polling/operation cases. @@ -40,13 +41,13 @@ Its fake responses establish SDK behavior only, not backend feature availability Do not invent an `ingestionParameter.graphParameter` JSON field from the deployment title. - A secret/write-only TypeSpec annotation describes the service's read/write contract. The Java request model must still send a supplied cache connection string; deserializing synthetic request JSON - is not evidence of a service secret disclosure. The live GET check tests actual server omission. + is not evidence of a service secret disclosure. Actual server omission still requires a live GET check. - Query hint auto-configuration is present at this pin despite its private/public history. It is stored KS configuration, not a supported request-time `queryHintOverrides` setting. - `toolName` is singular. MCP knowledge-source tool configuration is a different API. - `reasoningTokens` replaces the unreleased Direct Search `rankingTokens` name. - GPT-6 family names at this pin include `gpt-6-astra`, `gpt-6-sol` and `gpt-6-luna`, not a literal `gpt-6`. - The live fixture checks one configured family member; it does not establish deployment of every model variant. + Model-name serialization does not establish deployment or successful retrieval for any model variant. - LRO tests use the SDK's `SyncPoller` and `PollerFlux`, not a hand-written ingestion poller. ## Running offline checks @@ -56,80 +57,32 @@ From the repository root, with a working JDK/Maven: ```powershell $env:AZURE_TEST_MODE = 'PLAYBACK' mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test ` - '-Dtest=PreviewApiTests,PreviewFeatureContractTests,FileIngestionPollingTests,PreviewFeatureLiveTests,GetDocumentOptionsTests' + '-Dtest=PreviewApiTests,PreviewFeatureContractTests,FileIngestionPollingTests,GetDocumentOptionsTests' ``` -The live class must be skipped without live credentials, even if -`SEARCH_RUN_PREVIEW_FEATURE_TESTS=true` is set while test mode remains PLAYBACK. -Check the test reports; a skipped live test is not a passed feature check. +These selected tests use fake HTTP responses and do not require live feature fixtures. ### Local validation results -- The broader selection (`PreviewApiTests`, `PreviewFeatureContractTests`, `FileIngestionPollingTests`, - `PreviewFeatureLiveTests`, `FieldBuilderTests`, `SearchUtilsTests`) produced 65 passes and 16 skips: - 14 live methods and two existing FieldBuilder skips. All 30 new offline cases passed. -- After the final assertion changes, `PreviewFeatureContractTests,PreviewFeatureLiveTests` produced - 23 passes and 14 live skips with PLAYBACK mode and the live opt-in flag explicitly enabled. +- After removing the supplemental live tests on November 10, a clean build and the offline selection above + produced 62 passes with no skips, failures or errors; Checkstyle reported zero violations. +- All 23 cases in `PreviewFeatureContractTests` and seven cases in `FileIngestionPollingTests` passed. - Final Checkstyle, SpotBugs and scoped Spotless checks passed with zero violations/warnings. Test sources compiled for both Java 8 and Java 21. - On November 9, after the operator's backend routing update and completed bootstrap, the existing LIVE retrieval suites passed: 99 passes, 14 existing skips and no failures/errors. -- The full package RECORD run and the final full PLAYBACK run each produced 1,157 passes, 132 skips and no - failures/errors. Final PLAYBACK used the default test configuration with all `SEARCH_*` environment variables +- Before removal of the supplemental live tests, the full package RECORD run and the final full PLAYBACK run + each produced 1,157 passes, 132 skips and no failures/errors. + Final PLAYBACK used the default test configuration with all `SEARCH_*` environment variables removed. Endpoint assertions account for recorded URL sanitization; the two strict pagination fixtures normalize environment-specific blob-container names. Configured-secret scans, Checkstyle and SpotBugs passed. -- The 14 new opt-in feature methods remain unrun and are included in those 132 RECORD/PLAYBACK skips. +- The 14 removed supplemental live methods were unrun and accounted for 14 of those historical skips. The other 118 skips exactly match the earlier DP11 recording run: 92 disabled cases and 26 existing live-only cases. Skips are test-execution decisions, not failed HTTP recordings. - Validated recordings were published as `java/search/azure-search-documents_6950366571`, and `assets.json` was updated. Restoring that tag reproduced all 2,000 recording JSON files byte-for-byte against the validated manifest. Package recording success does not close the feature-specific validation gaps in the matrix. -## Running live checks safely - -Do not execute until the target service is explicitly reserved, the deployment/routing is verified, and the -operator approves the run. These tests create resources and can incur indexing/model costs. -Keep the recording/test host awake. Run this class alone, not alongside older suites whose cleanup deletes -all service knowledge sources/bases. - -```powershell -$env:AZURE_TEST_MODE = 'LIVE' -$env:SEARCH_RUN_PREVIEW_FEATURE_TESTS = 'true' -mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test '-Dtest=PreviewFeatureLiveTests' -``` - -The class uses `@LiveOnly`: it intentionally does not create new recording assets in RECORD mode. -Existing record/playback tests use a separate RECORD/PLAYBACK workflow; they do not execute this live-only class. - -Random scoring, minimal/Microsoft Retriever KBs, KB tools and query hints create fresh small indexes/sources/bases. -Only successfully created resources are tracked for cleanup; no list-all/delete-all cleanup is used. -The file test creates its own KS and files and requires the configured embedding deployment. -External fixtures below are read/queried, not updated or deleted. - -Missing fixture settings cause explicit assumption skips. Once settings are supplied, HTTP/model/assertion failures -are failures, not reasons to skip. A run with prerequisite skips is not complete deployment validation. - -### Shared prerequisites - -Use the existing `SEARCH_SERVICE_ENDPOINT`, Azure test credentials and model/identity settings from `SearchTestBase`. -File ingestion additionally requires `SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME`. -Query-hint planning requires a working `SEARCH_OPENAI_DEPLOYMENT_NAME` / `SEARCH_OPENAI_MODEL_NAME`, and the configured -user-assigned identity must have the required model access. - -### External fixture settings - -| Scenario | Required settings | Fixture contract | -| --- | --- | --- | -| Topic Graph | `SEARCH_PREVIEW_TOPIC_INDEX`, `SEARCH_PREVIEW_TOPIC_QUERY_JSON`, `SEARCH_PREVIEW_TOPIC_FIELD` | JSON is a vector query with `kind`, `vector`, `fields`, `k`; index has Topic Graph configured, retrievable `id` and scalar topic label. Top 10 pure-vector neighbors share one topic; diverse/balanced retrieval spans at least two. The vectors/data must deliberately exercise these contrasts. | -| Graph execution | `SEARCH_PREVIEW_GRAPH_INDEX`, `SEARCH_PREVIEW_GRAPH_GQL`, `SEARCH_PREVIEW_GRAPH_RESULT_FIELD`, `SEARCH_PREVIEW_GRAPH_RESULT_VALUE` | Extracted edge-list graph; GQL supports plan and execution and returns a known string sentinel in the named column. | -| Graph KB | `SEARCH_PREVIEW_GRAPH_KB`, `SEARCH_PREVIEW_GRAPH_KB_QUERY` | Graph-grounded KB with a deterministic question that retrieves evidence and produces `graphSearch` activity. | -| Graph ingestion/status | `SEARCH_PREVIEW_GRAPH_SOURCE` | Azure Blob KS with a named ontology and cache; completed synchronization has extracted triples. Do not place connection strings in this document. | -| Agentic search | `SEARCH_PREVIEW_AGENTIC_INDEX`, `SEARCH_PREVIEW_AGENTIC_QUERY` | Populated index and enabled agentic backend; known question exercises both planning and semantic reasoning. | -| OneLake ACLs | `SEARCH_PREVIEW_ONELAKE_INDEX`, `SEARCH_PREVIEW_ONELAKE_SOURCE`, `SEARCH_PREVIEW_ONELAKE_RESTRICTED_ID`, `SEARCH_PREVIEW_ONELAKE_ALLOWED_TOKEN`, `SEARCH_PREVIEW_ONELAKE_DENIED_TOKEN` | Index uses `id` as key and `oneLakeParentFolders`. The same indexed sentinel is visible to one valid source identity and invisible to another. Supply fresh tokens privately; never commit tokens or put them in screenshots/logs. | -| Compatible KBs | `SEARCH_PREVIEW_COMPATIBLE_CHAT_KB`, `SEARCH_PREVIEW_COMPATIBLE_RESPONSES_KB`, `SEARCH_PREVIEW_COMPATIBLE_QUERY` | Separate preconfigured KBs with `openAICompatible` models whose URI paths end in `/chat/completions` and `/responses`, respectively; known question retrieves evidence. | -| Compatible ingestion/vectorization | `SEARCH_PREVIEW_COMPATIBLE_SOURCE`, `SEARCH_PREVIEW_COMPATIBLE_INDEX`, `SEARCH_PREVIEW_COMPATIBLE_VECTOR_FIELD`, `SEARCH_PREVIEW_COMPATIBLE_SKILLSET`, `SEARCH_PREVIEW_COMPATIBLE_INDEXER` | Blob KS using compatible chat, successfully ingested documents, index with compatible query vectorizer, a URL-based ChatCompletionSkill, successful indexer output and searchable vectors. | -| GPT-6 | `SEARCH_PREVIEW_GPT6_KB`, `SEARCH_PREVIEW_GPT6_QUERY` | Preconfigured Azure OpenAI KB using `gpt-6-astra`, `gpt-6-sol` or `gpt-6-luna`, with known question and supporting documents; routing/deployment must support Responses. | - ## Release gate Before claiming all features are tested, record per-feature results, prerequisite skips and backend failures. diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java deleted file mode 100644 index 2557333797a2a..0000000000000 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewFeatureLiveTests.java +++ /dev/null @@ -1,632 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.test.annotation.LiveOnly; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.search.documents.indexes.SearchIndexClient; -import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource; -import com.azure.search.documents.indexes.models.AzureOpenAIModelName; -import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; -import com.azure.search.documents.indexes.models.ChatCompletionSkill; -import com.azure.search.documents.indexes.models.FileKnowledgeSource; -import com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters; -import com.azure.search.documents.indexes.models.FileUploadMetadata; -import com.azure.search.documents.indexes.models.IndexerExecutionResult; -import com.azure.search.documents.indexes.models.IndexerExecutionStatus; -import com.azure.search.documents.indexes.models.KnowledgeBase; -import com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel; -import com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model; -import com.azure.search.documents.indexes.models.KnowledgeBaseOpenAICompatibleModel; -import com.azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults; -import com.azure.search.documents.indexes.models.KnowledgeBaseTool; -import com.azure.search.documents.indexes.models.KnowledgeBaseToolKnowledgeSourceReference; -import com.azure.search.documents.indexes.models.KnowledgeSource; -import com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode; -import com.azure.search.documents.indexes.models.KnowledgeSourceFile; -import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; -import com.azure.search.documents.indexes.models.KnowledgeSourceReference; -import com.azure.search.documents.indexes.models.OpenAICompatibleVectorizer; -import com.azure.search.documents.indexes.models.RandomScoringFunction; -import com.azure.search.documents.indexes.models.RandomScoringParameters; -import com.azure.search.documents.indexes.models.ScoringProfile; -import com.azure.search.documents.indexes.models.SearchIndex; -import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; -import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; -import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration; -import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; -import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints; -import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; -import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; -import com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference; -import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort; -import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode; -import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatus; -import com.azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams; -import com.azure.search.documents.models.AgenticSearchDebugInfo; -import com.azure.search.documents.models.AgenticSearchOptions; -import com.azure.search.documents.models.BalancedVectorQueryTopicGraph; -import com.azure.search.documents.models.ContentFileDetails; -import com.azure.search.documents.models.DiverseVectorQueryTopicGraph; -import com.azure.search.documents.models.GraphOptions; -import com.azure.search.documents.models.GraphQueryDiagnosticSeverity; -import com.azure.search.documents.models.GraphQueryExecutionMode; -import com.azure.search.documents.models.GraphQueryResult; -import com.azure.search.documents.models.IndexActionType; -import com.azure.search.documents.models.IndexDocumentsBatch; -import com.azure.search.documents.models.NoneVectorQueryTopicGraph; -import com.azure.search.documents.models.OperationState; -import com.azure.search.documents.models.QueryDebugMode; -import com.azure.search.documents.models.QueryType; -import com.azure.search.documents.models.SearchOptions; -import com.azure.search.documents.models.SearchPagedResponse; -import com.azure.search.documents.models.VectorQueryTopicGraph; -import com.azure.search.documents.models.VectorizableTextQuery; -import com.azure.search.documents.models.VectorizedQuery; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; -import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - -import java.net.URI; -import java.time.Duration; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; -import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - -/** - * Opt-in service-behavior checks. See preview-feature-coverage.md for fixture prerequisites and remaining gaps. - */ -@LiveOnly -@EnabledIfEnvironmentVariable(named = "SEARCH_RUN_PREVIEW_FEATURE_TESTS", matches = "true") -@Timeout(value = 20, unit = TimeUnit.MINUTES) -public class PreviewFeatureLiveTests extends SearchTestBase { - private final List createdIndexes = new ArrayList<>(); - private final List createdSources = new ArrayList<>(); - private final List createdBases = new ArrayList<>(); - - @Override - protected void afterTest() { - try { - if (createdBases.isEmpty() && createdSources.isEmpty() && createdIndexes.isEmpty()) { - return; - } - SearchIndexClient client = getSearchIndexClientBuilder(true).buildClient(); - List failures = new ArrayList<>(); - deleteOwnedResources(createdBases, client::deleteKnowledgeBase, failures); - deleteOwnedResources(createdSources, client::deleteKnowledgeSource, failures); - deleteOwnedResources(createdIndexes, client::deleteIndex, failures); - if (!failures.isEmpty()) { - IllegalStateException failure - = new IllegalStateException("Unable to clean up all owned preview fixtures."); - failures.forEach(failure::addSuppressed); - throw failure; - } - } finally { - super.afterTest(); - } - } - - @Test - public void randomScoringIsRepeatableForOneSeedAndRotatesForAnother() throws InterruptedException { - String index = createSeededIndex(); - SearchClient client = getSearchClientBuilder(index, true).buildClient(); - List first = randomOrder(client, "42"); - assertEquals(first, randomOrder(client, "42")); - List rotated = randomOrder(client, "-9223372036854775808"); - assertEquals(new HashSet<>(first), new HashSet<>(rotated)); - assertEquals(32, first.size()); - assertNotEquals(first, rotated); - } - - @ParameterizedTest - @ValueSource(strings = { "diverse", "balanced" }) - public void topicGraphDiversifiesAndInterleavesWithPureVector(String mode) { - String index = requiredSetting("SEARCH_PREVIEW_TOPIC_INDEX"); - String query = requiredSetting("SEARCH_PREVIEW_TOPIC_QUERY_JSON"); - String topicField = requiredSetting("SEARCH_PREVIEW_TOPIC_FIELD"); - VectorQueryTopicGraph topicGraph = "diverse".equals(mode) - ? new DiverseVectorQueryTopicGraph().setDiversityFactor(1.0f).setMinDiversityPoolSize(1000) - : new BalancedVectorQueryTopicGraph().setMinDiversityPoolSize(1000); - VectorizedQuery diversified = BinaryData.fromString(query).toObject(VectorizedQuery.class); - diversified.setTopicGraph(topicGraph); - VectorizedQuery plain = BinaryData.fromString(query).toObject(VectorizedQuery.class); - plain.setTopicGraph(new NoneVectorQueryTopicGraph()); - SearchClient client = getSearchClientBuilder(index, true).buildClient(); - List> baseline = documents(client, vectorOptions(plain)); - List> results = documents(client, vectorOptions(diversified)); - assertFalse(baseline.isEmpty()); - assertEquals(1, topics(baseline, topicField).size(), - "Fixture must have a single-topic nearest-neighbor baseline."); - assertTrue(topics(results, topicField).size() >= 2, "Fixture must exercise cross-topic retrieval."); - List> interleaved - = documents(client, new SearchOptions().setTop(10).setVectorQueries(diversified, plain)); - assertFalse(interleaved.isEmpty()); - assertTrue(interleaved.size() <= 10); - assertEquals(interleaved.size(), interleaved.stream().map(value -> value.get("id")).distinct().count()); - } - - @Test - public void graphPlansAndExecutesAgainstExtractedEdges() { - String index = requiredSetting("SEARCH_PREVIEW_GRAPH_INDEX"); - String gql = requiredSetting("SEARCH_PREVIEW_GRAPH_GQL"); - String field = requiredSetting("SEARCH_PREVIEW_GRAPH_RESULT_FIELD"); - String expected = requiredSetting("SEARCH_PREVIEW_GRAPH_RESULT_VALUE"); - SearchClient client = getSearchClientBuilder(index, true).buildClient(); - GraphQueryResult plan = client.graph(new GraphOptions(gql).setExecutionMode(GraphQueryExecutionMode.PLAN_ONLY) - .setIncludeStatistics(true) - .setIncludeDiagnostics(true)); - assertNotNull(plan.getStatistics()); - assertEquals(GraphQueryExecutionMode.PLAN_ONLY, plan.getStatistics().getExecutionMode()); - assertNotNull(plan.getDiagnostics()); - assertFalse(plan.getDiagnostics() - .stream() - .anyMatch(diagnostic -> GraphQueryDiagnosticSeverity.ERROR.equals(diagnostic.getSeverity()))); - GraphQueryResult result = client.graph(new GraphOptions(gql).setIncludeStatistics(true)); - assertNotNull(result.getValue()); - assertTrue( - result.getValue().stream().anyMatch(row -> expected.equals(row.getAdditionalProperties().get(field)))); - assertNotNull(result.getStatistics()); - } - - @Test - public void graphKnowledgeBaseRetrievalUsesGraphSearchActivity() { - String base = requiredSetting("SEARCH_PREVIEW_GRAPH_KB"); - String query = requiredSetting("SEARCH_PREVIEW_GRAPH_KB_QUERY"); - KnowledgeBaseRetrievalResult result = retrieve(base, query); - assertRetrieval(result); - assertNotNull(result.getActivity()); - assertTrue(result.getActivity().stream().anyMatch(KnowledgeBaseGraphSearchActivityRecord.class::isInstance)); - } - - @Test - public void graphIngestionReportsOntologyAndTriplesWithoutReturningCacheSecret() { - String source = requiredSetting("SEARCH_PREVIEW_GRAPH_SOURCE"); - AzureBlobKnowledgeSource value = assertInstanceOf(AzureBlobKnowledgeSource.class, - getSearchIndexClientBuilder(true).buildClient().getKnowledgeSource(source)); - assertNotNull(value.getAzureBlobParameters().getGraphExtraction()); - assertNotNull(value.getAzureBlobParameters().getGraphExtraction().getOntology()); - assertNotNull(value.getAzureBlobParameters().getGraphExtraction().getOntology().getName()); - assertNotNull(value.getAzureBlobParameters().getIngestionParameters().getCache()); - assertTrue( - value.getAzureBlobParameters().getIngestionParameters().getCache().getStorageConnectionString() == null, - "A source GET must not return the write-only cache connection string."); - KnowledgeSourceStatus status = getSearchIndexClientBuilder(true).buildClient().getKnowledgeSourceStatus(source); - assertNotNull(status.getLastSynchronizationState()); - assertNotNull(status.getLastSynchronizationState().getGraphStatistics()); - assertEquals(value.getAzureBlobParameters().getGraphExtraction().getOntology().getName(), - status.getLastSynchronizationState().getGraphStatistics().getOntologyName()); - assertTrue(status.getLastSynchronizationState().getGraphStatistics().getTriplesWritten() > 0); - } - - @Test - public void agenticSearchReturnsReasoningUsageAndDocuments() { - String index = requiredSetting("SEARCH_PREVIEW_AGENTIC_INDEX"); - String query = requiredSetting("SEARCH_PREVIEW_AGENTIC_QUERY"); - SearchOptions options = new SearchOptions().setSearchText(query) - .setQueryType(QueryType.fromString("agentic")) - .setAgenticOptions(new AgenticSearchOptions().setMaxRuntimeInSeconds(60)) - .setDebug(QueryDebugMode.fromString("agentic")) - .setTop(10); - SearchPagedResponse page - = getSearchClientBuilder(index, true).buildClient().search(options).iterableByPage().iterator().next(); - assertTrue(page.getElements().iterator().hasNext()); - assertNotNull(page.getDebugInfo()); - AgenticSearchDebugInfo debug = page.getDebugInfo().getAgentic(); - assertNotNull(debug); - assertNotNull(debug.getUsage()); - assertTrue(debug.getUsage().getAgenticPlanningTokens() > 0); - assertTrue(debug.getUsage().getReasoningTokens() > 0); - } - - @ParameterizedTest - @ValueSource(booleans = { false, true }) - public void minimalAndMicrosoftRetrieverKnowledgeBasesRetrieve(boolean microsoftRetriever) - throws InterruptedException { - String index = createSeededIndex(); - String source = createSource(new SearchIndexKnowledgeSource(randomName("preview-source"), - new SearchIndexKnowledgeSourceParameters(index).setSemanticConfigurationName("preview-semantic"))) - .getName(); - KnowledgeBase base = new KnowledgeBase(randomName("preview-base"), new KnowledgeSourceReference(source)) - .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA); - if (microsoftRetriever) { - base.setModels(new KnowledgeBaseMicrosoftRetriever1Model()); - } else { - base.setRetrievalReasoningEffort(new KnowledgeRetrievalMinimalReasoningEffort()); - } - createBase(base); - KnowledgeBase persisted = getSearchIndexClientBuilder(true).buildClient().getKnowledgeBase(base.getName()); - if (microsoftRetriever) { - assertInstanceOf(KnowledgeBaseMicrosoftRetriever1Model.class, persisted.getModels().get(0)); - } else { - assertTrue(persisted.getModels() == null || persisted.getModels().isEmpty()); - } - assertRetrieval(retrieve(base.getName(), "Find preview product documents.")); - } - - @Test - public void fileIngestionSupportsUploadReplacementAndRetainedOperationLookup() { - requiredSetting("SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME"); - String source = createSource(new FileKnowledgeSource(randomName("preview-file"), - new FileKnowledgeSourceParameters().setIngestionParameters(new KnowledgeSourceIngestionParameters() - .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL) - .setEmbeddingModel( - new KnowledgeSourceAzureOpenAIVectorizer().setAzureOpenAIParameters(embeddingParameters()))))) - .getName(); - SearchIndexClient client = getSearchIndexClientBuilder(true).buildClient(); - SyncPoller upload - = client.beginIngestKnowledgeSourceFileMultipart(source, new UploadKnowledgeSourceFileMultipartRequest( - new FileUploadMetadata().setFileName("preview.txt"), content("Original preview product."))); - PollResponse uploaded = upload.waitForCompletion(Duration.ofMinutes(15)); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, uploaded.getStatus()); - KnowledgeSourceFile original = upload.getFinalResult(); - assertNotNull(original); - assertEquals("preview.txt", original.getFileName()); - String uploadId = uploaded.getValue().getId(); - assertEquals(OperationState.SUCCEEDED, - client.getKnowledgeSourceFileIngestionOperation(source, uploadId).getStatus()); - - AsyncPollResponse replacement - = getSearchIndexClientBuilder(false).buildAsyncClient() - .beginIngestKnowledgeSourceFileReplacement(source, original.getFileId(), - new UpdateKnowledgeSourceFileRequest(new FileUploadMetadata().setFileName("preview.txt"), - content("Replacement preview product with changed content."))) - .last() - .block(Duration.ofMinutes(15)); - assertNotNull(replacement); - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, replacement.getStatus()); - KnowledgeSourceFile updated = replacement.getFinalResult().block(Duration.ofMinutes(1)); - assertNotNull(updated); - assertEquals(original.getFileId(), updated.getFileId()); - assertNotEquals(uploadId, replacement.getValue().getId()); - assertNotNull(original.getFileSizeBytes()); - assertNotNull(updated.getFileSizeBytes()); - assertTrue(updated.getFileSizeBytes() > original.getFileSizeBytes()); - Set operations = client.listKnowledgeSourceFileIngestionOperations(source, 1, null) - .stream() - .map(KnowledgeSourceFileIngestionOperation::getId) - .collect(Collectors.toSet()); - assertTrue(operations.contains(uploadId)); - assertTrue(operations.contains(replacement.getValue().getId())); - HttpResponseException missing = assertThrows(HttpResponseException.class, - () -> client.getKnowledgeSourceFileIngestionOperation(source, "00000000-0000-0000-0000-000000000000")); - assertEquals(404, missing.getResponse().getStatusCode()); - } - - @Test - public void oneLakePermissionsAllowOneIdentityAndExcludeAnother() { - String index = requiredSetting("SEARCH_PREVIEW_ONELAKE_INDEX"); - String source = requiredSetting("SEARCH_PREVIEW_ONELAKE_SOURCE"); - String id = requiredSetting("SEARCH_PREVIEW_ONELAKE_RESTRICTED_ID"); - String allowed = requiredSetting("SEARCH_PREVIEW_ONELAKE_ALLOWED_TOKEN"); - String denied = requiredSetting("SEARCH_PREVIEW_ONELAKE_DENIED_TOKEN"); - assertFalse(allowed.equals(denied), "Use distinct, valid source identities."); - SearchIndexClient indexes = getSearchIndexClientBuilder(true).buildClient(); - assertEquals("indexedOneLake", indexes.getKnowledgeSource(source).getKind().toString()); - assertTrue(indexes.getIndex(index) - .getFields() - .stream() - .anyMatch(field -> field.getPermissionFilter() != null - && "oneLakeParentFolders".equals(field.getPermissionFilter().toString()))); - SearchClient client = getSearchClientBuilder(index, true).buildClient(); - SearchOptions query = new SearchOptions().setFilter("id eq '" + id.replace("'", "''") + "'") - .setQuerySourceAuthorization(allowed) - .setEnableElevatedRead(false); - assertEquals(1, documents(client, query).size(), "Allowed identity must see the restricted sentinel."); - assertEquals(0, documents(client, query.setQuerySourceAuthorization(denied)).size(), - "A valid identity without folder access must not see the same sentinel."); - } - - @Test - public void toolSelectionLimitsSourcesAndRequestDefaultsTakePrecedence() throws InterruptedException { - String index = createSeededIndex(); - String source = createSource(new SearchIndexKnowledgeSource(randomName("preview-tool-source"), - new SearchIndexKnowledgeSourceParameters(index).setSemanticConfigurationName("preview-semantic"))) - .getName(); - KnowledgeBaseTool tool = new KnowledgeBaseTool("red-documents", "Retrieve only red preview products.", - Collections.singletonList( - new KnowledgeBaseToolKnowledgeSourceReference(source).setFilterAddOn("category eq 'red'"))) - .setRetrieveDefaults(new KnowledgeBaseRetrieveDefaults().setMaxOutputDocuments(2)); - KnowledgeBase base = new KnowledgeBase(randomName("preview-tools"), new KnowledgeSourceReference(source)) - .setRetrievalReasoningEffort(new KnowledgeRetrievalMinimalReasoningEffort()) - .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA) - .setRetrieveDefaults(new KnowledgeBaseRetrieveDefaults().setMaxOutputDocuments(4)) - .setTools(Collections.singletonList(tool)); - createBase(base); - assertEquals("red-documents", - getSearchIndexClientBuilder(true).buildClient() - .getKnowledgeBase(base.getName()) - .getTools() - .get(0) - .getName()); - KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() - .setIntents(new KnowledgeRetrievalSemanticIntent("Find preview product documents.")) - .setToolName("red-documents") - .setMaxOutputDocuments(1) - .setKnowledgeSourceParams( - Collections.singletonList(new SearchIndexKnowledgeSourceParams(source).setIncludeReferences(true) - .setIncludeReferenceSourceData(true))); - KnowledgeBaseRetrievalResult result - = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base.getName()) - .buildClient() - .retrieve(options); - assertRetrieval(result); - assertEquals(1, result.getReferences().size()); - assertEquals("red", result.getReferences().get(0).getSourceData().get("category")); - HttpResponseException invalid = assertThrows(HttpResponseException.class, - () -> getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base.getName()) - .buildClient() - .retrieve(options.setToolName("missing-tool"))); - assertEquals(400, invalid.getResponse().getStatusCode()); - } - - @ParameterizedTest - @ValueSource(strings = { "CHAT", "RESPONSES" }) - public void compatibleKnowledgeBaseModelsRetrieveThroughBothProtocols(String protocol) { - String base = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_" + protocol + "_KB"); - String query = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_QUERY"); - KnowledgeBase persisted = getSearchIndexClientBuilder(true).buildClient().getKnowledgeBase(base); - KnowledgeBaseOpenAICompatibleModel model - = assertInstanceOf(KnowledgeBaseOpenAICompatibleModel.class, persisted.getModels().get(0)); - String path = URI.create(model.getOpenAICompatibleParameters().getUri()).getPath(); - assertTrue(path.endsWith("CHAT".equals(protocol) ? "/chat/completions" : "/responses")); - assertRetrieval(retrieve(base, query)); - } - - @Test - public void compatibleIngestionSkillsAndVectorizersProcessDocuments() { - String source = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_SOURCE"); - String index = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_INDEX"); - String vectorField = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_VECTOR_FIELD"); - String skillset = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_SKILLSET"); - String indexer = requiredSetting("SEARCH_PREVIEW_COMPATIBLE_INDEXER"); - SearchIndexClient indexes = getSearchIndexClientBuilder(true).buildClient(); - AzureBlobKnowledgeSource blob - = assertInstanceOf(AzureBlobKnowledgeSource.class, indexes.getKnowledgeSource(source)); - assertInstanceOf(KnowledgeBaseOpenAICompatibleModel.class, - blob.getAzureBlobParameters().getIngestionParameters().getChatCompletionModel()); - KnowledgeSourceStatus status = indexes.getKnowledgeSourceStatus(source); - assertNotNull(status.getLastSynchronizationState()); - assertNotNull(status.getStatistics()); - assertTrue(status.getStatistics().getAverageItemsProcessedPerSynchronization() > 0); - assertTrue(indexes.getIndex(index) - .getVectorSearch() - .getVectorizers() - .stream() - .anyMatch(OpenAICompatibleVectorizer.class::isInstance)); - assertTrue(getSearchIndexerClientBuilder(true).buildClient() - .getSkillset(skillset) - .getSkills() - .stream() - .filter(ChatCompletionSkill.class::isInstance) - .map(ChatCompletionSkill.class::cast) - .anyMatch(skill -> skill.getUrl() != null && skill.getCommonModelParameters() != null)); - IndexerExecutionResult execution - = getSearchIndexerClientBuilder(true).buildClient().getIndexerStatus(indexer).getLastResult(); - assertNotNull(execution); - assertEquals(IndexerExecutionStatus.SUCCESS, execution.getStatus()); - assertEquals(0, execution.getFailedItemCount()); - assertTrue(execution.getItemCount() > 0); - assertFalse(documents(getSearchClientBuilder(index, true).buildClient(), - new SearchOptions().setVectorQueries(new VectorizableTextQuery("preview product").setFields(vectorField))) - .isEmpty()); - } - - @Test - public void gpt6KnowledgeBaseProducesAResponse() { - String base = requiredSetting("SEARCH_PREVIEW_GPT6_KB"); - String query = requiredSetting("SEARCH_PREVIEW_GPT6_QUERY"); - KnowledgeBase persisted = getSearchIndexClientBuilder(true).buildClient().getKnowledgeBase(base); - KnowledgeBaseAzureOpenAIModel model - = assertInstanceOf(KnowledgeBaseAzureOpenAIModel.class, persisted.getModels().get(0)); - AzureOpenAIModelName name = model.getAzureOpenAIParameters().getModelName(); - assertTrue(AzureOpenAIModelName.GPT6ASTRA.equals(name) - || AzureOpenAIModelName.GPT6SOL.equals(name) - || AzureOpenAIModelName.GPT6LUNA.equals(name), "Fixture must use a supported GPT-6 family model."); - assertRetrieval(retrieve(base, query)); - } - - @Test - public void automaticFilterHintsGroundRetrievalAndRejectExplicitValues() throws InterruptedException { - String index = createSeededIndex(); - SearchIndexKnowledgeSourceFilterHint hint = new SearchIndexKnowledgeSourceFilterHint("category") - .setAutoConfiguration( - new SearchIndexKnowledgeSourceFilterHintAutoConfiguration().setCacheTtl(900).setMaxFacetValueCount(4)) - .setFilterInstructions("Use the category filter whenever the request specifies a product category."); - SearchIndexKnowledgeSourceParameters parameters - = new SearchIndexKnowledgeSourceParameters(index).setSemanticConfigurationName("preview-semantic") - .setQueryHints(new SearchIndexKnowledgeSourceQueryHints().setFilters(Collections.singletonList(hint))); - String source = createSource(new SearchIndexKnowledgeSource(randomName("preview-hints"), parameters)).getName(); - SearchIndexKnowledgeSource persisted = assertInstanceOf(SearchIndexKnowledgeSource.class, - getSearchIndexClientBuilder(true).buildClient().getKnowledgeSource(source)); - assertEquals(4, - persisted.getSearchIndexParameters() - .getQueryHints() - .getFilters() - .get(0) - .getAutoConfiguration() - .getMaxFacetValueCount()); - KnowledgeBase base = new KnowledgeBase(randomName("preview-filter-base"), new KnowledgeSourceReference(source)) - .setModels(new KnowledgeBaseAzureOpenAIModel(chatParameters())) - .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA); - createBase(base); - KnowledgeBaseRetrievalResult result - = getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base.getName()) - .buildClient() - .retrieve(new KnowledgeBaseRetrievalOptions() - .setIntents(new KnowledgeRetrievalSemanticIntent("Find documents in the red product category.")) - .setKnowledgeSourceParams(Collections - .singletonList(new SearchIndexKnowledgeSourceParams(source).setIncludeReferences(true) - .setIncludeReferenceSourceData(true)))); - assertRetrieval(result); - for (com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference reference : result - .getReferences()) { - assertInstanceOf(KnowledgeBaseSearchIndexReference.class, reference); - assertNotNull(reference.getSourceData()); - assertEquals("red", reference.getSourceData().get("category")); - } - hint.setFieldValues(Collections.singletonList("red")); - HttpResponseException invalid = assertThrows(HttpResponseException.class, - () -> createSource(new SearchIndexKnowledgeSource(randomName("preview-invalid-hints"), parameters))); - assertEquals(400, invalid.getResponse().getStatusCode()); - } - - private String createSeededIndex() throws InterruptedException { - String name = randomName("preview-features"); - SearchIndex index = BinaryData.fromString("{\"name\":\"" + name + "\",\"fields\":[" - + "{\"name\":\"id\",\"type\":\"Edm.String\",\"key\":true,\"filterable\":true}," - + "{\"name\":\"content\",\"type\":\"Edm.String\",\"searchable\":true}," - + "{\"name\":\"category\",\"type\":\"Edm.String\",\"filterable\":true,\"facetable\":true}]," - + "\"semantic\":{\"configurations\":[{\"name\":\"preview-semantic\",\"prioritizedFields\":" - + "{\"prioritizedContentFields\":[{\"fieldName\":\"content\"}]}}]}}").toObject(SearchIndex.class); - index.setScoringProfiles(new ScoringProfile("rotate") - .setFunctions(new RandomScoringFunction().setParameters(new RandomScoringParameters("seed")))); - getSearchIndexClientBuilder(true).buildClient().createIndex(index); - createdIndexes.add(name); - List> values = new ArrayList<>(); - for (int i = 0; i < 32; i++) { - Map document = new HashMap<>(); - document.put("id", Integer.toString(i)); - document.put("content", "Preview product document."); - document.put("category", i % 2 == 0 ? "red" : "blue"); - values.add(document); - } - SearchClient client = getSearchClientBuilder(name, true).buildClient(); - assertTrue(client.indexDocuments(new IndexDocumentsBatch(values.stream() - .map(document -> TestHelpers.createIndexAction(IndexActionType.UPLOAD, document)) - .collect(Collectors.toList()))).getResults().stream().allMatch(result -> result.isSucceeded())); - long deadline = System.nanoTime() + Duration.ofMinutes(2).toNanos(); - while (client.getDocumentCount() != values.size() && System.nanoTime() < deadline) { - Thread.sleep(1000); - } - assertEquals(values.size(), client.getDocumentCount(), "The owned fixture did not finish indexing."); - return name; - } - - private KnowledgeSource createSource(KnowledgeSource source) { - KnowledgeSource created = getSearchIndexClientBuilder(true).buildClient().createKnowledgeSource(source); - createdSources.add(created.getName()); - return created; - } - - private static void deleteOwnedResources(List names, Consumer delete, - List failures) { - for (String name : names) { - try { - delete.accept(name); - } catch (RuntimeException failure) { - failures.add(failure); - } - } - } - - private void createBase(KnowledgeBase base) { - KnowledgeBase created = getSearchIndexClientBuilder(true).buildClient().createKnowledgeBase(base); - createdBases.add(created.getName()); - } - - private String randomName(String prefix) { - return testResourceNamer.randomName(prefix, 48); - } - - private static String requiredSetting(String name) { - String value = Configuration.getGlobalConfiguration().get(name); - assumeTrue(value != null && !value.trim().isEmpty(), "Missing preview fixture setting: " + name); - return value; - } - - private static List> documents(SearchClient client, SearchOptions options) { - return client.search(options) - .stream() - .>map(result -> result.getAdditionalProperties()) - .collect(Collectors.toList()); - } - - private static List randomOrder(SearchClient client, String seed) { - return documents(client, - new SearchOptions().setTop(32) - .setScoringProfile("rotate") - .setScoringParameters(Collections.singletonList("seed:" + seed))).stream() - .map(document -> (String) document.get("id")) - .collect(Collectors.toList()); - } - - private static SearchOptions vectorOptions(VectorizedQuery query) { - return new SearchOptions().setTop(10).setVectorQueries(query); - } - - private static Set topics(List> documents, String field) { - Set values = new HashSet<>(); - for (Map document : documents) { - assertNotNull(document.get(field), "Topic fixture documents must expose their topic label."); - values.add(document.get(field)); - } - return values; - } - - private KnowledgeBaseRetrievalResult retrieve(String base, String query) { - return getKnowledgeBaseRetrievalClientBuilder(true).knowledgeBaseName(base) - .buildClient() - .retrieve(new KnowledgeBaseRetrievalOptions().setIntents(new KnowledgeRetrievalSemanticIntent(query)) - .setIncludeActivity(true)); - } - - private static void assertRetrieval(KnowledgeBaseRetrievalResult result) { - assertNotNull(result); - assertNotNull(result.getResponse()); - assertFalse(result.getResponse().isEmpty()); - assertNotNull(result.getReferences()); - assertFalse(result.getReferences().isEmpty(), - "The seeded request must retrieve evidence, not just an empty answer."); - } - - private static ContentFileDetails content(String value) { - return new ContentFileDetails(BinaryData.fromString(value)).setFilename("preview.txt") - .setContentType("text/plain"); - } - - private static AzureOpenAIVectorizerParameters embeddingParameters() { - return new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) - .setDeploymentName(OPENAI_EMBEDDING_DEPLOYMENT_NAME) - .setModelName(AzureOpenAIModelName.fromString(OPENAI_EMBEDDING_MODEL_NAME)) - .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY)); - } - - private static AzureOpenAIVectorizerParameters chatParameters() { - return new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) - .setDeploymentName(OPENAI_DEPLOYMENT_NAME) - .setModelName(AzureOpenAIModelName.fromString(OPENAI_MODEL_NAME)) - .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY)); - } -} From 055a41835605626f3404094dfdbe39106058c949 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 14:29:31 -0800 Subject: [PATCH 07/20] Restore Search GA test authentication and regression coverage Match DP10 GA credential selection in LIVE and RECORD, restore applicable offline GA regressions, and correct isolated-service and recording guidance. Customer-facing SDK code is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../preview-feature-coverage.md | 6 + .../azure-search-documents/src/test/README.md | 180 ++++++-------- .../documents/SearchGaSamplesTests.java | 175 +------------- .../azure/search/documents/SearchGaTests.java | 221 +++--------------- 4 files changed, 107 insertions(+), 475 deletions(-) diff --git a/sdk/search/azure-search-documents/preview-feature-coverage.md b/sdk/search/azure-search-documents/preview-feature-coverage.md index a6f6db0fb8fbd..84c0a93dda754 100644 --- a/sdk/search/azure-search-documents/preview-feature-coverage.md +++ b/sdk/search/azure-search-documents/preview-feature-coverage.md @@ -64,6 +64,12 @@ These selected tests use fake HTTP responses and do not require live feature fix ### Local validation results +- After restoring DP10 GA test authentication and applicable GA regressions on November 10, full package PLAYBACK + produced 1,193 passes, 118 existing skips and no failures/errors. The focused restored-test selection produced + 37 passes with no skips. Strict Revapi against the exact October GA `12.2.0` artifact from commit + `c0866c2b2364a855cda5e78e30f4fed8af795415` passed without semantic-version masking. Checkstyle, enabled SpotBugs, + scoped Spotless and snippet verification passed. This follow-up changed test code and documentation only; + it did not change customer-facing SDK code or call Azure services. - After removing the supplemental live tests on November 10, a clean build and the offline selection above produced 62 passes with no skips, failures or errors; Checkstyle reported zero violations. - All 23 cases in `PreviewFeatureContractTests` and seven cases in `FileIngestionPollingTests` passed. diff --git a/sdk/search/azure-search-documents/src/test/README.md b/sdk/search/azure-search-documents/src/test/README.md index 82d04fa87f1e5..3cfec07933f10 100644 --- a/sdk/search/azure-search-documents/src/test/README.md +++ b/sdk/search/azure-search-documents/src/test/README.md @@ -1,143 +1,93 @@ # Azure AI Search tests -Integration tests extend [SearchTestBase](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java). -`RECORD` calls Azure and records HTTP traffic; `LIVE` calls Azure without recording; `PLAYBACK` uses existing -recordings and needs no Azure resources. Mock-based tests do not need resources or recordings. +Integration tests extend +[SearchTestBase](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java). -## Local environment +| Mode | Behavior | +| --- | --- | +| `PLAYBACK` (default) | Replays published recordings through the local test proxy; no Azure credentials or resources are required. | +| `RECORD` | Calls real Azure resources and records HTTP traffic. | +| `LIVE` | Calls real Azure resources without recording. | -From the repository root, copy the example once, then edit your private copy: +Mock-based tests use fake HTTP responses and need no Azure resources. +Disabled tests remain skipped in every mode; live-only tests are skipped in playback. -```powershell -Copy-Item ./sdk/search/azure-search-documents/Set-TestEnvironment.example.ps1 ` - ./sdk/search/azure-search-documents/Set-TestEnvironment.local.ps1 -``` +## Run existing tests in playback -The [example](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/Set-TestEnvironment.example.ps1) contains only `$env:` assignments and works with Windows -PowerShell 5.1 or PowerShell 7. There is no dotenv loader, resource validation, or provisioning. -The local copy is git-ignored; do not overwrite an existing local configuration. -Uncomment and fill in only the settings needed by the tests you choose. - -Run the local script and Maven in the **same PowerShell terminal** so Maven inherits the variables: +From the repository root, with a working JDK/Maven: ```powershell -az login -az account set --subscription '' -& ./sdk/search/azure-search-documents/Set-TestEnvironment.local.ps1 - -# Run all package tests and record service calls. -$env:AZURE_TEST_MODE = 'RECORD' -mvn -f sdk/search/azure-search-documents/pom.xml --batch-mode test +$env:AZURE_TEST_MODE = 'PLAYBACK' +mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test ``` -The example defaults to `PLAYBACK`. Change the mode in your local script or override it after running the script. -Invoking the setup through a separate `powershell.exe` or `pwsh` process cannot change your current terminal's -environment. No API keys or client secrets are needed. +The test framework restores recording assets using +[assets.json](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/assets.json). +You do not need to run RECORD first, supply client secrets, or copy recordings into the source tree. +Initial test-proxy setup and asset restoration can require network access, but playback does not call Azure services. -To run one test instead of the entire package: +To run focused offline regressions: ```powershell -mvn -f sdk/search/azure-search-documents/pom.xml --batch-mode ` - '-Dtest=IndexManagementTests#createAndGetIndexReturnsCorrectDefinitionSync' test +mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test ` + '-Dtest=SearchAuthenticationTests,SearchGaTests,SearchGaSamplesTests,PreviewApiTests,PreviewFeatureContractTests,FileIngestionPollingTests,GetDocumentOptionsTests' ``` -## Resource settings - -| Tests using | Variables | -| --- | --- | -| Search | `SEARCH_SERVICE_ENDPOINT` | -| Azure OpenAI retrieval | `SEARCH_OPENAI_ENDPOINT`, `SEARCH_OPENAI_DEPLOYMENT_NAME`, `SEARCH_OPENAI_MODEL_NAME` | -| Embeddings | `SEARCH_OPENAI_ENDPOINT`, `SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME`, `SEARCH_OPENAI_EMBEDDING_MODEL_NAME` | -| Blob storage | `SEARCH_STORAGE_ACCOUNT_NAME`, `SEARCH_STORAGE_CONTAINER_NAME`, `SEARCH_SUBSCRIPTION_ID`, `SEARCH_RESOURCE_GROUP` | -| AI Services / Content Understanding | `SEARCH_AI_SERVICES_ENDPOINT` | - -These are test variables, not necessarily the names used by runnable samples. -Deployments and resources must already exist, and networking must allow access. -Disabled tests remain skipped even in `RECORD` or `LIVE`. - -### Standard file extraction - -Set `SEARCH_AI_SERVICES_ENDPOINT` explicitly to the Foundry resource's AI Services endpoint -(`https://.cognitiveservices.azure.com/`), not its `services.ai.azure.com` endpoint or a project URL. -Use a Foundry resource of kind `AIServices` with Content Understanding configured in a supported region. -The Search service's managed identity needs `Cognitive Services User` access to that resource. -See the [file knowledge source prerequisites](https://learn.microsoft.com/azure/search/agentic-knowledge-source-how-to-file#prerequisites). - -After editing the local environment script, run it again in the same terminal as Maven; an existing process -does not pick up changes to the script automatically. Standard extraction setup failures can return HTTP 502. -The tests already retry transient failures, so inspect the resource configuration before increasing retries. +## Real-service testing requires an isolated service -### Model activity metadata +**Never point integration tests at production or shared bug-bash resources.** +RECORD and LIVE use the service configured in `SEARCH_SERVICE_ENDPOINT`; they do not create an isolated Search service. +Tests create, update and delete resources. In particular, `KnowledgeBaseTests` and `KnowledgeSourceTests` cleanup +enumerates knowledge bases and knowledge sources across that service and can delete resources the test did not create. +Do not run separate test processes against the same service. -`KnowledgeBaseTests.retrievalActivityIncludesModelNameSync` and its async counterpart require a model-backed -retrieval: they send `messages` with medium reasoning effort and explicitly request `answerSynthesis` output. -Supplying `intents` bypasses model query planning, so an extractive retrieval can succeed without returning any -model activity or model name. Configuring a model on the knowledge base alone does not force it to be used. +Before an authorized real-service run, configure an isolated test environment and its permissions. +The [Search provisioning template](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/test-resources.bicep) +and [live-testing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/docs/contributor/live-testing.md) +describe provisioning. Do not deploy, modify or clean up shared resources to satisfy a test prerequisite. -The mock-based `SearchGaTests.retrievalDeserializesActivityModelMetadata` test independently verifies that both -clients preserve `model.modelName` and `model.deploymentId` in query-planning, answer-synthesis, and -web-summarization activity records without calling Azure. +### Caller authentication -## Authentication and permissions +For both RECORD and LIVE, +[TestHelpers](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java) +uses `AzurePipelinesCredential` when `AZURESUBSCRIPTION_SERVICE_CONNECTION_ID` is configured, and +`AzureCliCredential` otherwise. Pipeline authentication also requires `AZURESUBSCRIPTION_CLIENT_ID`, +`AZURESUBSCRIPTION_TENANT_ID`, `SYSTEM_ACCESSTOKEN`, and the Azure Pipelines OIDC request configuration. +For local runs, authenticate with `az login` using the intended tenant/subscription. +Unrelated `AZURE_CLIENT_*` settings do not replace the CLI identity. No client secret is needed for this path. -[TestHelpers](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java) uses the federated pipeline identity when -`AZURESUBSCRIPTION_SERVICE_CONNECTION_ID` is configured, and your `az login` identity otherwise, for `RECORD` and `LIVE`. -Your computer does not need a managed identity. Search separately uses its own system-assigned managed identity -to access storage, OpenAI, and AI Services without keys. +The caller needs Search Service Contributor and Search Index Data Contributor on the isolated Search service. +Search separately authenticates to storage, OpenAI and AI Services; configure the identity and roles required by +the selected test fixture. Some file-ingestion fixtures explicitly use `SEARCH_USER_ASSIGNED_IDENTITY`. -| Principal | Resource | Role | -| --- | --- | --- | -| Your Azure CLI login | Search | Search Service Contributor and Search Index Data Contributor | -| Your Azure CLI login | Test storage, when tests manage source content | Storage Blob Data Contributor | -| Search system-assigned identity | Source storage | Storage Blob Data Reader | -| Search system-assigned identity | Azure OpenAI | Cognitive Services OpenAI User | -| Search system-assigned identity | AI Services | Cognitive Services User | +### Fixture settings -Configure these identities and roles on your existing resources. No Bicep deployment is needed for local setup. -The [streaming example](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseRetrievalStreamExample.java) -uses `DefaultAzureCredential` for Search and the Search service's system-assigned identity for Azure OpenAI. -Run `az login` locally and enable RBAC authentication on Search. Set `SEARCH_SERVICE_ENDPOINT`, `SEARCH_OPENAI_ENDPOINT`, -`SEARCH_OPENAI_DEPLOYMENT_NAME`, and `SEARCH_OPENAI_MODEL_NAME`; API keys are not required. -The unchanged [provisioning template](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/test-resources.bicep) uses user-assigned identity and does not configure -the system-assigned workflow described here. +Configure only the settings needed by the selected tests, in the same terminal that starts Maven. -**Use an isolated test service:** integration tests create, update, and delete resources, and some cleanup enumerates -knowledge resources on the service. Never use production resources or commit private configuration. - -`KnowledgeBaseTests` and `KnowledgeSourceTests` share an exclusive JUnit resource lock because their cleanup -enumerates knowledge resources across the service. `SAME_THREAD` alone only serializes tests within each class; -it does not protect one class's shared knowledge source from the other class's cleanup. The lock does not -coordinate separate Maven processes, so do not run these classes in separate processes against the same service. - -Analyzer tests create indexes concurrently. An HTTP 429 reporting the service's index quota is a resource-capacity -failure, not a serialization error. Retry with available capacity and bounded test parallelism. In playback, -such a response is replayed from the recording and is not a fresh Azure request. - -`SearchIndexerClientBuilderTests.asyncListingHelpersPreserveContinuationPages` uses mock HTTP responses to -verify that the async data source, indexer, and skillset listing helpers preserve typed items and continuation -pages after regeneration or merge changes. It does not require Azure resources or recordings. - -## Playback and recording assets - -The indexer prefix-pagination tests use the recorded container name `test` in playback. Live and record runs -continue to use `SEARCH_STORAGE_CONTAINER_NAME`; no storage-container environment override is needed for playback. +| Fixture | Variables | +| --- | --- | +| Search | `SEARCH_SERVICE_ENDPOINT` | +| Azure OpenAI retrieval | `SEARCH_OPENAI_ENDPOINT`, `SEARCH_OPENAI_DEPLOYMENT_NAME`, `SEARCH_OPENAI_MODEL_NAME` | +| Embeddings | `SEARCH_OPENAI_ENDPOINT`, `SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME`, `SEARCH_OPENAI_EMBEDDING_MODEL_NAME` | +| Blob storage | `SEARCH_STORAGE_ACCOUNT_NAME`, `SEARCH_STORAGE_CONTAINER_NAME`, `SEARCH_SUBSCRIPTION_ID`, `SEARCH_RESOURCE_GROUP` | +| AI Services / Content Understanding | `SEARCH_AI_SERVICES_ENDPOINT` | +| User-assigned fixture identity | `SEARCH_USER_ASSIGNED_IDENTITY` | -Run all tests without Azure calls: +Deployments must already exist, networking must permit access, and each identity must have the appropriate roles. +For standard file extraction, use the AI Services endpoint (`https://.cognitiveservices.azure.com/`), +not a Foundry project URL. Search needs access to a resource configured for Content Understanding. -```powershell -$env:AZURE_TEST_MODE = 'PLAYBACK' -mvn -f sdk/search/azure-search-documents/pom.xml --batch-mode test -``` +Model-activity tests send `messages` and request answer synthesis to exercise model-backed retrieval. +An intent-only request can bypass model planning, so a successful retrieval need not include model activity. -Recordings use [assets.json](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/assets.json) and an external, git-excluded assets checkout. -The test framework normally starts the test proxy automatically. To inspect and publish recordings with the -[test-proxy CLI](https://github.com/Azure/azure-sdk-for-java/blob/main/docs/test-proxy-migration.md#test-proxy-cli-commands): +## Recording assets and validation limits -```powershell -test-proxy config locate -a sdk/search/azure-search-documents/assets.json -# Inspect recordings and confirm secrets and private data are sanitized before pushing. -test-proxy push -a sdk/search/azure-search-documents/assets.json -``` +Record only against an authorized isolated environment, with `AZURE_TEST_MODE=RECORD` in the Maven process. +Use the repository's +[test-proxy asset workflow](https://github.com/Azure/azure-sdk-for-java/blob/main/eng/common/testproxy/onboarding/README.md) +to review, sanitize and publish recordings, then update `assets.json`. Do not re-record to hide an SDK or test failure. -Pushing requires assets-repository write access and updates the recording tag in `assets.json`. -Include that tag update in your PR, not private scripts or raw recordings. +Passing playback verifies the SDK against recorded responses, not current backend behavior or every preview feature. +See the +[preview feature coverage matrix](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/preview-feature-coverage.md) +for the remaining service-validation gaps. diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java index 97f3c1abd096c..a4be053b6d4ca 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java @@ -3,55 +3,24 @@ package com.azure.search.documents; -import com.azure.core.util.BinaryData; -import com.azure.search.documents.indexes.CreateSkillsetExample; -import com.azure.search.documents.indexes.models.AzureOpenAIModelName; -import com.azure.search.documents.indexes.models.ContentUnderstandingSkill; -import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingUnit; -import com.azure.search.documents.indexes.models.DataSourceCredentials; -import com.azure.search.documents.indexes.models.IndexedSharePointContainerName; -import com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSource; -import com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSource; -import com.azure.search.documents.indexes.models.IndexerPermissionOption; -import com.azure.search.documents.indexes.models.IndexerResyncOption; -import com.azure.search.documents.indexes.models.KnowledgeSourceIngestionPermissionOption; -import com.azure.search.documents.indexes.models.PermissionFilter; -import com.azure.search.documents.indexes.models.SearchIndex; -import com.azure.search.documents.indexes.models.SearchIndexPermissionFilterOption; -import com.azure.search.documents.indexes.models.SearchIndexerDataContainer; -import com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection; -import com.azure.search.documents.indexes.models.SearchIndexerDataSourceType; -import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; -import com.azure.search.documents.indexes.models.WebKnowledgeSourceParameters; import com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; -import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceNetworkAccessMode; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceParams; -import com.azure.search.documents.models.ContentUnderstandingSkillChunkingMethod; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.api.parallel.ResourceLock; +import org.junit.jupiter.api.parallel.Resources; -import java.io.IOException; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.PrintStream; import java.nio.charset.StandardCharsets; -import java.util.Arrays; import java.util.concurrent.atomic.AtomicBoolean; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; public class SearchGaSamplesTests { @Test - @org.junit.jupiter.api.parallel.ResourceLock(org.junit.jupiter.api.parallel.Resources.SYSTEM_OUT) + @ResourceLock(Resources.SYSTEM_OUT) public void streamSampleLogsErrorPayloadBeforeThrowing() throws IOException { KnowledgeBaseRetrievalStreamEvent error = KnowledgeBaseRetrievalStreamEventConverter.convert("error", "{\"error\":{\"code\":\"BadRequest\",\"message\":\"invalid request\"}}"); @@ -72,119 +41,7 @@ public void streamSampleLogsErrorPayloadBeforeThrowing() throws IOException { } @Test - public void permissionSampleConfiguresSchemaIngestionAndFederation() throws IOException { - SearchIndex index = DocumentPermissionsExample.permissionIndex("permissions", "application", "federation"); - assertEquals(SearchIndexPermissionFilterOption.ENABLED, index.getPermissionFilterOption()); - assertEquals(3, index.getFields().stream().filter(field -> field.getPermissionFilter() != null).count()); - assertTrue(index.getFields() - .stream() - .anyMatch(field -> PermissionFilter.USER_IDS.equals(field.getPermissionFilter()))); - assertTrue( - index.getFields().stream().anyMatch(field -> Boolean.TRUE.equals(field.isOrganizationAccessExpiration()))); - assertTrue(index.getFields().stream().anyMatch(field -> Boolean.TRUE.equals(field.isSharepointSiteUrl()))); - assertEquals("federation", index.getSharePointConnectorAppRegistration().getFederatedCredentialId()); - - SearchIndexerDataSourceConnection source - = new SearchIndexerDataSourceConnection("source", SearchIndexerDataSourceType.fromString("sharepoint"), - new DataSourceCredentials().setConnectionString("test"), - new SearchIndexerDataContainer("defaultSiteLibrary")); - DocumentPermissionsExample.permissionDataSource(source, "/subscriptions/test/identities/search", "client"); - assertEquals(Arrays.asList(IndexerPermissionOption.USER_IDS, IndexerPermissionOption.GROUP_IDS), - source.getIndexerPermissionOptions()); - assertEquals("client", assertInstanceOf(SearchIndexerDataUserAssignedIdentity.class, source.getIdentity()) - .getFederatedIdentityClientId()); - assertTrue(DocumentPermissionsExample.permissionIndexer("indexer", "source", "permissions") - .getParameters() - .getConfiguration() - .isRefreshAllAcls()); - assertTrue(index.toJsonString().contains("\"permissionFilterOption\":\"enabled\"")); - } - - @Test - public void sqlAndSharePointSamplesConfigureTypedSources() throws IOException { - KnowledgeSourceIngestionParameters ingestion - = new KnowledgeSourceIngestionParameters().setNetworkAccessMode(KnowledgeSourceNetworkAccessMode.PRIVATE) - .setIngestionPermissionOptions(KnowledgeSourceIngestionPermissionOption.USER_IDS, - KnowledgeSourceIngestionPermissionOption.GROUP_IDS); - IndexedSqlKnowledgeSource sql = KnowledgeSourceCrudExample.sqlSource("sql", "test", "dbo.Documents", ingestion); - assertEquals("LastModified", sql.getIndexedSqlParameters().getHighWaterMarkColumnName()); - assertEquals(2, sql.getIndexedSqlParameters().getContentColumns().size()); - assertEquals("Content", sql.getIndexedSqlParameters().getEmbeddingColumns().get(0).getSourceField()); - assertTrue(sql.toJsonString().contains("\"embeddingColumns\"")); - IndexedSharePointKnowledgeSource sharePoint - = KnowledgeSourceCrudExample.sharePointSource("sharepoint", "test", ingestion); - assertEquals(IndexedSharePointContainerName.DEFAULT_SITE_LIBRARY, - sharePoint.getIndexedSharePointParameters().getContainerName()); - assertEquals(2, - sharePoint.getIndexedSharePointParameters() - .getIngestionParameters() - .getIngestionPermissionOptions() - .size()); - } - - @Test - public void webSampleIncludesRetrievalDefaults() { - WebKnowledgeSourceParameters parameters = KnowledgeSourceCrudExample.webSource("web").getWebParameters(); - assertEquals("en", parameters.getLanguage()); - assertEquals("en-US", parameters.getMarket()); - assertEquals(5, parameters.getCount()); - assertEquals("Month", parameters.getFreshness()); - assertEquals("learn.microsoft.com", parameters.getDomains().getAllowedDomains().get(0).getAddress()); - } - - @Test - public void conversationSampleIncludesHistoryAndQueryPlanning() throws IOException { - KnowledgeBaseRetrievalOptions request = KnowledgeRetrievalExample.conversationRequest(null); - assertEquals(3, request.getMessages().size()); - assertEquals("assistant", request.getMessages().get(1).getRole()); - assertInstanceOf(KnowledgeRetrievalLowReasoningEffort.class, request.getRetrievalReasoningEffort()); - assertEquals(5, request.getMaxOutputDocuments()); - assertTrue(request.toJsonString().contains("\"messages\"")); - } - - @Test - public void permissionResyncAndImageConversationSamplesUseTypedModels() throws IOException { - assertEquals(Arrays.asList(IndexerResyncOption.PERMISSIONS), - DocumentPermissionsExample.permissionResync().getOptions()); - KnowledgeBaseRetrievalOptions request - = KnowledgeRetrievalExample.conversationRequest("https://example.com/hotel.jpg"); - assertEquals(2, request.getMessages().get(2).getContent().size()); - assertTrue(request.toJsonString().contains("https://example.com/hotel.jpg")); - } - - @ParameterizedTest - @ValueSource(strings = { "file", "sql", "sharepoint" }) - public void sourceRetrievalSampleIncludesSourceControls(String kind) { - KnowledgeSourceParams parameters = KnowledgeRetrievalExample.sourceParameters(kind, "source"); - assertTrue(parameters.isAlwaysQuerySource()); - assertEquals(3, parameters.getMaxOutputDocuments()); - assertEquals("source", parameters.getKnowledgeSourceName()); - } - - @ParameterizedTest - @ValueSource(strings = { "searchIndex", "azureBlob", "indexedOneLake", "indexedSharePoint", "indexedSql", "file" }) - public void responseSampleReadsEverySearchOwnedCitation(String type) { - KnowledgeBaseReference reference = BinaryData - .fromString("{\"type\":\"" + type + "\",\"id\":\"ref\"," - + "\"activitySource\":0,\"citationUrl\":\"https://example.search.windows.net/documents/ref\"}") - .toObject(KnowledgeBaseReference.class); - assertEquals("https://example.search.windows.net/documents/ref", - KnowledgeRetrievalResponseExample.citationUrl(reference)); - } - - @Test - public void responseSampleHandlesSourceAndModelActivities() { - KnowledgeBaseRetrievalResult result = BinaryData.fromString("{\"response\":[],\"references\":[],\"activity\":[" - + "{\"id\":0,\"type\":\"searchIndex\",\"knowledgeSourceName\":\"source\",\"count\":1}," - + "{\"id\":1,\"type\":\"modelQueryPlanning\",\"model\":{\"modelName\":\"gpt-5.4\",\"deploymentId\":\"planner\"}}," - + "{\"id\":2,\"type\":\"modelAnswerSynthesis\",\"model\":{\"modelName\":\"gpt-5.4\",\"deploymentId\":\"answer\"}}," - + "{\"id\":3,\"type\":\"modelWebSummarization\",\"model\":{\"modelName\":\"gpt-5.4\"}}]}") - .toObject(KnowledgeBaseRetrievalResult.class); - assertEquals(4, result.getActivity().size()); - KnowledgeRetrievalResponseExample.inspectResponse(result); - } - - @Test + @ResourceLock(Resources.SYSTEM_OUT) public void streamSampleHandlesProgressCompletionAndErrors() { AtomicBoolean started = new AtomicBoolean(); AtomicBoolean completed = new AtomicBoolean(); @@ -214,26 +71,4 @@ public void streamSampleHandlesProgressCompletionAndErrors() { assertThrows(IllegalStateException.class, () -> KnowledgeBaseRetrievalStreamExample.inspectEvent(error, started, completed)); } - - @ParameterizedTest - @ValueSource(booleans = { false, true }) - public void skillSampleSelectsSemanticTokensOrFixedSizeCharacters(boolean semantic) throws IOException { - ContentUnderstandingSkill skill = CreateSkillsetExample.contentUnderstandingSkill("gpt-4.1", "content", - semantic - ? ContentUnderstandingSkillChunkingMethod.SEMANTIC - : ContentUnderstandingSkillChunkingMethod.FIXED_SIZE); - assertEquals( - semantic ? ContentUnderstandingSkillChunkingUnit.TOKENS : ContentUnderstandingSkillChunkingUnit.CHARACTERS, - skill.getChunkingProperties().getUnit()); - assertEquals("content", skill.getModelDeployment()); - assertTrue(skill.toJsonString().contains(semantic ? "\"method\":\"semantic\"" : "\"method\":\"fixedSize\"")); - } - - @Test - public void newlySupportedModelNamesAreAvailableToConfigurationSamples() { - assertEquals(Arrays.asList("gpt-5.4", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"), - Arrays.asList(AzureOpenAIModelName.GPT54.toString(), AzureOpenAIModelName.GPT55.toString(), - AzureOpenAIModelName.GPT56SOL.toString(), AzureOpenAIModelName.GPT56TERRA.toString(), - AzureOpenAIModelName.GPT56LUNA.toString())); - } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaTests.java index 5ae5ad9f0ac43..170e7bbab3857 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaTests.java @@ -11,13 +11,12 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.test.http.MockHttpResponse; -import com.azure.core.util.FluxUtil; import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; import com.azure.json.JsonProviders; import com.azure.json.JsonReader; import com.azure.search.documents.implementation.SearchUtils; import com.azure.search.documents.indexes.SearchIndexClientBuilder; -import com.azure.search.documents.indexes.SearchIndexerClientBuilder; import com.azure.search.documents.indexes.models.ContentUnderstandingSkill; import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingProperties; import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingUnit; @@ -28,23 +27,20 @@ import com.azure.search.documents.indexes.models.FileUploadMetadata; import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSource; +import com.azure.search.documents.indexes.models.KnowledgeSourceFile; import com.azure.search.documents.indexes.models.KnowledgeSourceFileCapacity; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; import com.azure.search.documents.indexes.models.KnowledgeSourceReference; -import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchResourceEncryptionKey; -import com.azure.search.documents.indexes.models.KnowledgeSourceFile; import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; import com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest; import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageTextContent; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelQueryPlanningActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelWebSummarizationActivityRecord; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort; @@ -56,14 +52,10 @@ import com.azure.search.documents.models.SearchOptions; import com.azure.search.documents.models.SearchRequest; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; -import org.junit.jupiter.api.parallel.ResourceAccessMode; -import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ValueSource; import reactor.core.publisher.Mono; @@ -74,46 +66,18 @@ import java.util.Collections; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Consumer; import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -@Execution(ExecutionMode.CONCURRENT) public class SearchGaTests { private static final String ENDPOINT = "https://example.search.windows.net"; private static final AzureKeyCredential CREDENTIAL = new AzureKeyCredential("key"); - @Test - public void knowledgeResourceCleanupIsMutuallyExclusive() { - ResourceLock baseLock = KnowledgeBaseTests.class.getAnnotation(ResourceLock.class); - ResourceLock sourceLock = KnowledgeSourceTests.class.getAnnotation(ResourceLock.class); - assertNotNull(baseLock); - assertNotNull(sourceLock); - assertEquals(baseLock.value(), sourceLock.value()); - assertEquals(ResourceAccessMode.READ_WRITE, baseLock.mode()); - assertEquals(ResourceAccessMode.READ_WRITE, sourceLock.mode()); - } - - @Test - public void latestServiceVersionIsGa() { - assertEquals(SearchServiceVersion.V2026_10_01, SearchServiceVersion.getLatest()); - assertEquals("2026-10-01", SearchServiceVersion.getLatest().getVersion()); - for (SearchServiceVersion version : SearchServiceVersion.values()) { - assertFalse(version.getVersion().contains("preview")); - } - } - - @Test - public void encryptionKeyRequiresNameAndVaultUrl() { - assertThrows(NoSuchMethodException.class, () -> SearchResourceEncryptionKey.class.getConstructor()); - } - @Test public void encryptionKeyPreservesWireProperties() throws IOException { SearchResourceEncryptionKey key @@ -135,24 +99,6 @@ public void encryptionKeyPreservesWireProperties() throws IOException { } } - @Test - public void indexedSqlReferencePreservesDocUrlWireProperty() throws IOException { - String documentUrl = "https://example.test/document"; - String json - = "{\"type\":\"indexedSql\",\"id\":\"sql-1\",\"activitySource\":1,\"docUrl\":\"" + documentUrl + "\"}"; - KnowledgeBaseIndexedSqlReference reference; - try (JsonReader reader = JsonProviders.createReader(json)) { - reference - = assertInstanceOf(KnowledgeBaseIndexedSqlReference.class, KnowledgeBaseReference.fromJson(reader)); - } - assertEquals(documentUrl, reference.getDocumentUrl()); - try (JsonReader reader = JsonProviders.createReader(reference.toJsonString())) { - Map properties = reader.readMap(JsonReader::readUntyped); - assertEquals(documentUrl, properties.get("docUrl")); - assertFalse(properties.containsKey("documentUrl")); - } - } - @Test public void searchOptionsForwardEveryGeneratedRequestProperty() throws IOException, ReflectiveOperationException { String json = "{\"count\":false,\"facets\":[\"category\"],\"filter\":\"category eq 'Hotel'\"," @@ -164,7 +110,10 @@ public void searchOptionsForwardEveryGeneratedRequestProperty() throws IOExcepti + "\"skip\":0,\"top\":5,\"semanticConfiguration\":\"semantic\",\"semanticErrorHandling\":\"partial\"," + "\"semanticMaxWaitInMilliseconds\":1000,\"semanticQuery\":\"Find hotels\",\"answers\":\"extractive\"," + "\"captions\":\"extractive\",\"vectorQueries\":[{\"kind\":\"vector\",\"vector\":[0.1,0.2]," - + "\"fields\":\"vector\",\"k\":3}],\"vectorFilterMode\":\"preFilter\"}"; + + "\"fields\":\"vector\",\"k\":3}],\"vectorFilterMode\":\"preFilter\"," + + "\"queryLanguage\":\"en-us\",\"speller\":\"lexicon\",\"queryRewrites\":\"generative\"," + + "\"semanticFields\":\"title,content\",\"hybridSearch\":{\"maxTextRecallSize\":100}," + + "\"agenticOptions\":{\"maxRuntimeInSeconds\":30}}"; SearchRequest expected; try (JsonReader reader = JsonProviders.createReader(json)) { expected = SearchRequest.fromJson(reader); @@ -182,7 +131,6 @@ public void searchOptionsForwardEveryGeneratedRequestProperty() throws IOExcepti String property = getter.getName().substring(getter.getName().startsWith("is") ? 2 : 3); SearchOptions.class.getMethod("set" + property, getter.getReturnType()).invoke(options, value); } - assertEquals(expected.toJsonString(), SearchUtils.fromSearchOptions(options).toJsonString()); } @@ -201,6 +149,7 @@ public void bothSearchClientsSendMoreLikeThis() { SearchClientBuilder builder = new SearchClientBuilder().endpoint(ENDPOINT) .credential(CREDENTIAL) .indexName("index") + .serviceVersion(SearchServiceVersion.V2026_10_01) .httpClient(httpClient); SearchOptions options = new SearchOptions().setMoreLikeThis("hotel-1"); @@ -231,6 +180,7 @@ public void bothSearchClientsForwardAuthorizationOnEveryPage(SearchOptions optio SearchClientBuilder builder = new SearchClientBuilder().endpoint(ENDPOINT) .credential(CREDENTIAL) .indexName("index") + .serviceVersion(SearchServiceVersion.V2026_10_01) .httpClient(httpClient); assertEquals(2, builder.buildClient().search(options, requestOptions).stream().count()); @@ -250,92 +200,8 @@ private static Stream searchAuthorizationOptions() { new RequestOptions(), "query-token", "false")); } - @ParameterizedTest(name = "{0}") - @MethodSource("defaultClientRequests") - public void defaultClientsSendGaApiVersion(String clientName, Consumer sendRequest) { - AtomicInteger requestCount = new AtomicInteger(); - HttpClient httpClient = request -> { - assertEquals("api-version=2026-10-01", request.getUrl().getQuery()); - requestCount.incrementAndGet(); - return Mono.just(new MockHttpResponse(request, 200, new HttpHeaders(), - "{\"value\":[],\"response\":[],\"activity\":[],\"references\":[]}".getBytes(StandardCharsets.UTF_8))); - }; - - sendRequest.accept(httpClient); - assertEquals(1, requestCount.get(), clientName); - } - - private static Stream defaultClientRequests() { - return Stream.of( - Arguments.of("search sync", - (Consumer) httpClient -> new SearchClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .indexName("index") - .httpClient(httpClient) - .buildClient() - .search(new SearchOptions().setSearchText("hotel")) - .stream() - .count()), - Arguments.of("search async", - (Consumer) httpClient -> new SearchClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .indexName("index") - .httpClient(httpClient) - .buildAsyncClient() - .search(new SearchOptions().setSearchText("hotel")) - .collectList() - .block()), - Arguments.of("index sync", - (Consumer) httpClient -> new SearchIndexClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .httpClient(httpClient) - .buildClient() - .listIndexes() - .stream() - .count()), - Arguments.of("index async", - (Consumer) httpClient -> new SearchIndexClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .httpClient(httpClient) - .buildAsyncClient() - .listIndexes() - .collectList() - .block()), - Arguments.of("indexer sync", - (Consumer) httpClient -> new SearchIndexerClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .httpClient(httpClient) - .buildClient() - .listIndexers() - .stream() - .count()), - Arguments.of("indexer async", - (Consumer) httpClient -> new SearchIndexerClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .httpClient(httpClient) - .buildAsyncClient() - .listIndexers() - .collectList() - .block()), - Arguments.of("retrieval sync", - (Consumer) httpClient -> new KnowledgeBaseRetrievalClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .knowledgeBaseName("kb") - .httpClient(httpClient) - .buildClient() - .retrieve(retrievalOptions())), - Arguments.of("retrieval async", - (Consumer) httpClient -> new KnowledgeBaseRetrievalClientBuilder().endpoint(ENDPOINT) - .credential(CREDENTIAL) - .knowledgeBaseName("kb") - .httpClient(httpClient) - .buildAsyncClient() - .retrieve(retrievalOptions()) - .block())); - } - @ParameterizedTest - @EnumSource(SearchServiceVersion.class) + @EnumSource(value = SearchServiceVersion.class, mode = EnumSource.Mode.EXCLUDE, names = "V2026_11_01_PREVIEW") public void explicitGaVersionsRemainSupported(SearchServiceVersion version) { AtomicInteger requestCount = new AtomicInteger(); HttpClient httpClient = request -> { @@ -357,7 +223,11 @@ public void explicitGaVersionsRemainSupported(SearchServiceVersion version) { @Test public void retrievalOptionsUseGaTokenLimitWireName() throws IOException { - KnowledgeBaseRetrievalOptions options = retrievalOptions(); + KnowledgeBaseRetrievalOptions options + = new KnowledgeBaseRetrievalOptions().setIntents(new KnowledgeRetrievalSemanticIntent("Find hotels.")) + .setMaxOutputSizeInTokens(5001) + .setMaxOutputDocuments(5) + .setRetrievalReasoningEffort(new KnowledgeRetrievalLowReasoningEffort()); try (JsonReader reader = JsonProviders.createReader(options.toJsonString())) { Map json = reader.readMap(JsonReader::readUntyped); assertEquals(5001, ((Number) json.get("maxOutputSizeInTokens")).intValue()); @@ -388,15 +258,18 @@ public void retrievalDeserializesActivityModelMetadata(boolean async) { assertEquals(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS, options.getOutputMode()); assertTrue(options.isIncludeActivity()); } - String response = "{\"response\":[],\"activity\":[" - + "{\"id\":0,\"type\":\"modelQueryPlanning\",\"model\":{\"modelName\":\"gpt-4.1\",\"deploymentId\":\"planner\"}}," - + "{\"id\":1,\"type\":\"modelAnswerSynthesis\",\"model\":{\"modelName\":\"gpt-4.1\",\"deploymentId\":\"answer\"}}," - + "{\"id\":2,\"type\":\"modelWebSummarization\",\"model\":{\"modelName\":\"gpt-4.1\",\"deploymentId\":\"web\"}}]}"; + String response = "{\"response\":[],\"activity\":[" + "{\"id\":0,\"type\":\"modelQueryPlanning\"," + + "\"model\":{\"modelName\":\"gpt-4.1\",\"deploymentId\":\"planner\"}}," + + "{\"id\":1,\"type\":\"modelAnswerSynthesis\"," + + "\"model\":{\"modelName\":\"gpt-4.1\",\"deploymentId\":\"answer\"}}," + + "{\"id\":2,\"type\":\"modelWebSummarization\"," + + "\"model\":{\"modelName\":\"gpt-4.1\",\"deploymentId\":\"web\"}}]}"; return new MockHttpResponse(request, 200, new HttpHeaders(), response.getBytes(StandardCharsets.UTF_8)); })); KnowledgeBaseRetrievalClientBuilder builder = new KnowledgeBaseRetrievalClientBuilder().endpoint(ENDPOINT) .credential(CREDENTIAL) .knowledgeBaseName("kb") + .serviceVersion(SearchServiceVersion.V2026_10_01) .httpClient(httpClient); KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() @@ -478,11 +351,10 @@ public void knowledgeSourceStatusExposesFileCapacity(boolean async) { HttpClient httpClient = request -> { assertEquals("/knowledgesources('files')/status", request.getUrl().getPath()); return Mono.just(new MockHttpResponse(request, 200, new HttpHeaders(), - ("{\"fileCapacity\":{\"maxFileCount\":100,\"remainingFileCount\":75,\"maxFileSizeBytes\":1048576}}") + "{\"fileCapacity\":{\"maxFileCount\":100,\"remainingFileCount\":75,\"maxFileSizeBytes\":1048576}}" .getBytes(StandardCharsets.UTF_8))); }; - SearchIndexClientBuilder builder - = new SearchIndexClientBuilder().endpoint(ENDPOINT).credential(CREDENTIAL).httpClient(httpClient); + SearchIndexClientBuilder builder = indexes(httpClient); KnowledgeSourceStatus status = async ? builder.buildAsyncClient().getKnowledgeSourceStatus("files").block() : builder.buildClient().getKnowledgeSourceStatus("files"); @@ -518,8 +390,7 @@ public void fileOperationsUseKnowledgeSourceNameBeforeFileId(boolean async) { "{\"fileId\":\"file-id\",\"fileName\":\"notes.md\"}".getBytes(StandardCharsets.UTF_8)); }); }; - SearchIndexClientBuilder builder - = new SearchIndexClientBuilder().endpoint(ENDPOINT).credential(CREDENTIAL).httpClient(httpClient); + SearchIndexClientBuilder builder = indexes(httpClient); FileUploadMetadata metadata = new FileUploadMetadata().setFileName("notes.md"); UploadKnowledgeSourceFileMultipartRequest upload = new UploadKnowledgeSourceFileMultipartRequest(metadata, new ContentFileDetails(BinaryData.fromString("original contents")).setFilename("notes.md")); @@ -556,7 +427,6 @@ public void contentUnderstandingSkillRoundTripsGaConfiguration() throws IOExcept .setOverlapLength(100)) .setModelName("gpt-4.1") .setModelDeployment("content-model"); - try (JsonReader reader = JsonProviders.createReader(skill.toJsonString())) { ContentUnderstandingSkill roundTrip = ContentUnderstandingSkill.fromJson(reader); assertEquals(skill.getExtractionOptions(), roundTrip.getExtractionOptions()); @@ -568,40 +438,11 @@ public void contentUnderstandingSkillRoundTripsGaConfiguration() throws IOExcept } } - @Test - public void indexUpdatesDropExcludedPreviewProperties() throws IOException { - SearchIndex index; - try (JsonReader reader = JsonProviders.createReader("{\"name\":\"hotels\",\"purviewEnabled\":false," - + "\"fields\":[{\"name\":\"id\",\"type\":\"Edm.String\",\"key\":true}]}")) { - index = SearchIndex.fromJson(reader); - } - AtomicInteger requestCount = new AtomicInteger(); - HttpClient httpClient = request -> FluxUtil.collectBytesInByteBufferStream(request.getBody()) - .flatMap(body -> Mono.fromCallable(() -> { - assertEquals("api-version=2026-10-01", request.getUrl().getQuery()); - try (JsonReader reader = JsonProviders.createReader(body)) { - Map json = reader.readMap(JsonReader::readUntyped); - assertFalse(json.containsKey("purviewEnabled")); - assertEquals("hotels", json.get("name")); - assertNotNull(json.get("fields")); - } - requestCount.incrementAndGet(); - return new MockHttpResponse(request, 200, new HttpHeaders(), body); - })); - SearchIndexClientBuilder builder - = new SearchIndexClientBuilder().endpoint(ENDPOINT).credential(CREDENTIAL).httpClient(httpClient); - - assertEquals("hotels", builder.buildClient().createOrUpdateIndex(index).getName()); - assertEquals("hotels", builder.buildAsyncClient().createOrUpdateIndex(index).block().getName()); - assertEquals(2, requestCount.get()); - } - @Test public void typedKnowledgeResourceConveniencesRoundTripSyncAndAsync() { HttpClient httpClient = request -> FluxUtil.collectBytesInByteBufferStream(request.getBody()) .map(body -> new MockHttpResponse(request, 200, new HttpHeaders(), body)); - SearchIndexClientBuilder builder - = new SearchIndexClientBuilder().endpoint(ENDPOINT).credential(CREDENTIAL).httpClient(httpClient); + SearchIndexClientBuilder builder = indexes(httpClient); KnowledgeBase knowledgeBase = new KnowledgeBase("kb", new KnowledgeSourceReference("files")); FileKnowledgeSource source = new FileKnowledgeSource("files", new FileKnowledgeSourceParameters()); @@ -623,10 +464,10 @@ public void typedKnowledgeResourceConveniencesRoundTripSyncAndAsync() { assertInstanceOf(FileKnowledgeSource.class, knowledgeSourceResponse.getValue()); } - private static KnowledgeBaseRetrievalOptions retrievalOptions() { - return new KnowledgeBaseRetrievalOptions().setIntents(new KnowledgeRetrievalSemanticIntent("Find hotels.")) - .setMaxOutputSizeInTokens(5001) - .setMaxOutputDocuments(5) - .setRetrievalReasoningEffort(new KnowledgeRetrievalLowReasoningEffort()); + private static SearchIndexClientBuilder indexes(HttpClient httpClient) { + return new SearchIndexClientBuilder().endpoint(ENDPOINT) + .credential(CREDENTIAL) + .serviceVersion(SearchServiceVersion.V2026_10_01) + .httpClient(httpClient); } } From 285f7b7bbc60de0dd62a45765a9306b2ab2b098e Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:02:56 -0800 Subject: [PATCH 08/20] Preserve Search preview integration when rebasing onto GA main Restore the validated preview implementation and fixtures after GA-main conflict resolution. Preserve main release history and additive GA samples, and align Search dependency baselines with main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 91 + sdk/search/azure-search-documents/pom.xml | 8 +- .../models/AIFoundryModelCatalogName.java | 92 ++ .../models/AIServicesVisionParameters.java | 182 ++ .../models/AIServicesVisionVectorizer.java | 125 ++ .../models/AzureBlobKnowledgeSource.java | 16 + .../AzureMachineLearningParameters.java | 264 +++ .../models/AzureMachineLearningSkill.java | 365 ++++ .../AzureMachineLearningVectorizer.java | 123 ++ .../indexes/models/AzureOpenAIModelName.java | 48 + .../AzureOpenAITokenizerParameters.java | 133 ++ .../models/EntraAppAuthentication.java | 145 ++ .../FabricDataAgentKnowledgeSource.java | 173 ++ ...ricDataAgentKnowledgeSourceParameters.java | 105 ++ .../models/FabricOntologyKnowledgeSource.java | 173 ++ ...bricOntologyKnowledgeSourceParameters.java | 105 ++ .../indexes/models/FileKnowledgeSource.java | 16 + .../models/IndexedOneLakeKnowledgeSource.java | 16 + .../IndexedSharePointKnowledgeSource.java | 16 + .../models/IndexedSqlKnowledgeSource.java | 16 + .../indexes/models/IndexerCurrentState.java | 236 +++ .../models/IndexerExecutionResult.java | 37 + .../models/IndexerExecutionStatusDetail.java | 57 + .../indexes/models/IndexingMode.java | 64 + .../models/KnowledgeBaseRetrieveDefaults.java | 160 ++ .../indexes/models/KnowledgeSource.java | 47 + ...wledgeSourceIngestionPermissionOption.java | 6 + .../indexes/models/KnowledgeSourceKind.java | 30 + .../models/KnowledgeSourceReference.java | 81 +- .../KnowledgeSourceResultsProcessing.java | 57 + .../models/McpServerAuthentication.java | 108 ++ .../models/McpServerAuthenticationKind.java | 57 + .../models/McpServerAutoOutputParsing.java | 79 + ...ServerFoundryConnectionAuthentication.java | 105 ++ .../McpServerFoundryConnectionParameters.java | 92 ++ .../indexes/models/McpServerHeaders.java | 97 ++ .../models/McpServerJsonOutputParsing.java | 105 ++ .../models/McpServerKnowledgeSource.java | 172 ++ .../McpServerKnowledgeSourceParameters.java | 140 ++ .../models/McpServerNoneOutputParsing.java | 79 + .../models/McpServerOutputParsing.java | 111 ++ .../McpServerOutputParsingJsonParameters.java | 120 ++ .../models/McpServerOutputParsingKind.java | 69 + ...McpServerOutputParsingSplitParameters.java | 222 +++ .../models/McpServerSplitOutputParsing.java | 111 ++ .../McpServerStoredHeadersAuthentication.java | 105 ++ .../McpServerStoredHeadersParameters.java | 91 + .../indexes/models/McpServerTool.java | 189 +++ .../RemoteSharePointKnowledgeSource.java | 184 +++ ...teSharePointKnowledgeSourceParameters.java | 165 ++ .../documents/indexes/models/SearchIndex.java | 33 + .../models/SearchIndexKnowledgeSource.java | 16 + .../SearchIndexKnowledgeSourceBoost.java | 141 ++ .../SearchIndexKnowledgeSourceBoostKind.java | 58 + ...chIndexKnowledgeSourceFieldValueBoost.java | 176 ++ ...owledgeSourceMultiWordExpressionBoost.java | 155 ++ .../SearchIndexKnowledgeSourceQueryHints.java | 132 ++ .../indexes/models/SearchIndexer.java | 36 + .../indexes/models/SearchIndexerCache.java | 194 +++ .../SearchIndexerDataSourceConnection.java | 22 + .../models/SearchIndexerKnowledgeStore.java | 36 + ...SearchIndexerKnowledgeStoreParameters.java | 139 ++ .../indexes/models/SearchIndexerSkill.java | 4 + .../indexes/models/SearchIndexerStatus.java | 18 + .../models/SearchResourceEncryptionKey.java | 48 +- .../indexes/models/SearchServiceCounters.java | 50 +- .../indexes/models/SearchServiceLimits.java | 21 + .../indexes/models/SemanticConfiguration.java | 35 + .../documents/indexes/models/SplitSkill.java | 78 + .../models/SplitSkillEncoderModelName.java | 70 + .../indexes/models/SplitSkillUnit.java | 57 + .../models/VectorSearchVectorizer.java | 4 + .../indexes/models/VisionVectorizeSkill.java | 166 ++ .../indexes/models/WebKnowledgeSource.java | 16 + .../indexes/models/WorkIQKnowledgeSource.java | 173 ++ .../WorkIQKnowledgeSourceParameters.java | 88 + .../knowledgebases/models/AssetStore.java | 105 ++ .../FabricDataAgentKnowledgeSourceParams.java | 228 +++ .../FabricOntologyKnowledgeSourceParams.java | 228 +++ .../models/FreshnessPolicy.java | 93 ++ .../models/ImageServingStatistics.java | 158 ++ .../models/KnowledgeBaseActivityRecord.java | 10 + .../KnowledgeBaseActivityRecordType.java | 30 + ...dgeBaseAgenticReasoningActivityRecord.java | 44 + .../KnowledgeBaseAzureBlobActivityRecord.java | 21 + .../KnowledgeBaseAzureBlobReference.java | 21 + ...eBaseFabricDataAgentActivityArguments.java | 80 + ...edgeBaseFabricDataAgentActivityRecord.java | 229 +++ ...KnowledgeBaseFabricDataAgentReference.java | 147 ++ ...geBaseFabricOntologyActivityArguments.java | 80 + ...ledgeBaseFabricOntologyActivityRecord.java | 229 +++ .../KnowledgeBaseFabricOntologyReference.java | 147 ++ .../KnowledgeBaseFileActivityRecord.java | 21 + ...ledgeBaseIndexedOneLakeActivityRecord.java | 21 + .../KnowledgeBaseIndexedOneLakeReference.java | 21 + ...geBaseIndexedSharePointActivityRecord.java | 21 + ...owledgeBaseIndexedSharePointReference.java | 21 + ...KnowledgeBaseIndexedSqlActivityRecord.java | 21 + ...owledgeBaseMcpServerActivityArguments.java | 102 ++ .../KnowledgeBaseMcpServerActivityRecord.java | 229 +++ .../KnowledgeBaseMcpServerReference.java | 147 ++ .../KnowledgeBaseQueryHintProcessing.java | 98 ++ .../models/KnowledgeBaseReference.java | 10 + .../models/KnowledgeBaseReferenceType.java | 30 + ...BaseRemoteSharePointActivityArguments.java | 100 ++ ...dgeBaseRemoteSharePointActivityRecord.java | 230 +++ ...nowledgeBaseRemoteSharePointReference.java | 147 ++ .../models/KnowledgeBaseRetrievalResult.java | 20 + ...ledgeBaseSearchIndexActivityArguments.java | 22 + ...nowledgeBaseSearchIndexActivityRecord.java | 42 + .../KnowledgeBaseSearchIndexReference.java | 21 + .../KnowledgeBaseWebActivityRecord.java | 21 + .../KnowledgeBaseWorkIQActivityArguments.java | 80 + .../KnowledgeBaseWorkIQActivityRecord.java | 229 +++ .../models/KnowledgeBaseWorkIQReference.java | 126 ++ ...KnowledgeRetrievalAutoReasoningEffort.java | 81 + .../KnowledgeRetrievalReasoningEffort.java | 2 + ...KnowledgeRetrievalReasoningEffortKind.java | 7 + .../KnowledgeSourceIngestionParameters.java | 62 + .../models/KnowledgeSourceParams.java | 123 ++ .../McpServerKnowledgeSourceParams.java | 227 +++ .../models/PurviewSensitivityLabelInfo.java | 173 ++ ...RemoteSharePointKnowledgeSourceParams.java | 267 +++ .../knowledgebases/models/ServedImage.java | 128 ++ .../models/WebKnowledgeSourceParams.java | 47 + .../models/WorkIQKnowledgeSourceParams.java | 227 +++ .../documents/models/DocumentDebugInfo.java | 43 +- .../search/documents/models/FacetResult.java | 114 ++ .../models/HybridCountAndFacetMode.java | 60 + .../search/documents/models/HybridSearch.java | 137 ++ .../documents/models/QueryLanguage.java | 477 ++++++ .../models/QueryResultDocumentInnerHit.java | 101 ++ .../QueryResultDocumentRerankerInput.java | 116 ++ .../QueryResultDocumentSemanticField.java | 98 ++ .../models/QueryRewritesDebugInfo.java | 98 ++ .../documents/models/QueryRewritesType.java | 60 + .../models/QueryRewritesValuesDebugInfo.java | 99 ++ .../documents/models/QuerySpellerType.java | 58 + .../models/SearchDocumentsResult.java | 37 + .../documents/models/SearchOptions.java | 141 +- .../documents/models/SearchRequest.java | 165 +- .../models/SearchScoreThreshold.java | 104 ++ .../documents/models/SemanticDebugInfo.java | 139 ++ .../documents/models/SemanticFieldState.java | 63 + .../SemanticQueryRewritesResultType.java | 52 + .../documents/models/VectorFilterMode.java | 7 + .../documents/models/VectorQueryKind.java | 12 + .../models/VectorSimilarityThreshold.java | 110 ++ .../documents/models/VectorThreshold.java | 107 ++ .../documents/models/VectorThresholdKind.java | 61 + .../IndexAndServiceStatisticsExample.java | 13 - .../documents/KnowledgeBaseCrudExample.java | 39 +- ...wledgeBasePreviewConfigurationExample.java | 217 +++ .../documents/KnowledgeRetrievalExample.java | 67 +- ...wledgeRetrievalPreviewResponseExample.java | 106 ++ .../KnowledgeServiceStatsPreviewExample.java | 60 + .../documents/KnowledgeSourceCrudExample.java | 140 +- ...geSourceFabricDataAgentPreviewExample.java | 74 + ...dgeSourceFabricOntologyPreviewExample.java | 74 + .../KnowledgeSourceFilePreviewExample.java | 175 ++ ...nowledgeSourceFreshnessPreviewExample.java | 105 ++ ...nowledgeSourceMcpServerPreviewExample.java | 81 + .../KnowledgeSourceWorkIqPreviewExample.java | 116 ++ .../documents/SearchOptionsExample.java | 8 - .../documents/SynonymMapsCreateExample.java | 5 - .../indexes/CreateSkillsetExample.java | 45 - .../indexes/ListIndexersExample.java | 26 +- .../documents/indexes/ListIndexesExample.java | 18 - .../documents/KnowledgeSourceTests.java | 1464 ++++++++++++++++- .../search/documents/SearchTestBase.java | 20 +- .../indexes/IndexManagementTests.java | 61 + .../SearchIndexerClientBuilderTests.java | 54 - .../documents/indexes/SearchServiceTests.java | 41 + .../indexes/SkillsetManagementTests.java | 10 +- .../indexes/SynonymMapManagementTests.java | 12 +- sdk/search/azure-search-perf/pom.xml | 4 +- 176 files changed, 17341 insertions(+), 481 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIFoundryModelCatalogName.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionVectorizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAITokenizerParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntraAppAuthentication.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSourceParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSourceParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerCurrentState.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatusDetail.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexingMode.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseRetrieveDefaults.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceResultsProcessing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthentication.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthenticationKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAutoOutputParsing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionAuthentication.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerHeaders.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerJsonOutputParsing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSourceParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerNoneOutputParsing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingJsonParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingSplitParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerSplitOutputParsing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersAuthentication.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerTool.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSourceParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoost.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoostKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFieldValueBoost.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceMultiWordExpressionBoost.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceQueryHints.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerCache.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SplitSkillEncoderModelName.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SplitSkillUnit.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VisionVectorizeSkill.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSource.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSourceParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AssetStore.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricDataAgentKnowledgeSourceParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricOntologyKnowledgeSourceParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FreshnessPolicy.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ImageServingStatistics.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityArguments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityRecord.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityArguments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityRecord.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityArguments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityRecord.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseQueryHintProcessing.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityArguments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityRecord.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityArguments.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityRecord.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQReference.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalAutoReasoningEffort.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/McpServerKnowledgeSourceParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/PurviewSensitivityLabelInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/RemoteSharePointKnowledgeSourceParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ServedImage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WorkIQKnowledgeSourceParams.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridCountAndFacetMode.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridSearch.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryLanguage.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentInnerHit.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentRerankerInput.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentSemanticField.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesDebugInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesValuesDebugInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QuerySpellerType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchScoreThreshold.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticDebugInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticFieldState.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticQueryRewritesResultType.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSimilarityThreshold.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThreshold.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThresholdKind.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBasePreviewConfigurationExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeServiceStatsPreviewExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricDataAgentPreviewExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricOntologyPreviewExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFreshnessPreviewExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceMcpServerPreviewExample.java create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceWorkIqPreviewExample.java diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 8ba44cab821e7..9b632b29c4bbf 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -33,6 +33,97 @@ - Deprecated `BasicField.isSensitivityLabel()`, which has no effect when building search fields. Use `isSensitivityLabelId()` for sensitivity label ID filtering or `isSensitivityLabelName()` for sensitivity label names. The legacy member and its default remain unchanged for compatibility. +#### Dependency Updates + +- Carried forward the GA dependency baselines: `azure-core` 1.61.0 and `azure-core-http-netty` 1.17.0. + +## 12.2.0 (2026-11-13) + +These release notes compare `12.2.0` with the previous GA release, `12.1.1`. Changes that apply only when upgrading +from a preview release are not included. + +### Features Added + +- Added support for the `2026-10-01` GA service version, which is now the default service version. +- Added `SearchOptions.moreLikeThis` to find documents similar to an existing document. +- Added `GetDocumentOptions` and three-argument `getDocumentWithResponse` overloads on `SearchClient` and + `SearchAsyncClient` to group document lookup authorization, elevated-read, and selected-field options while + preserving existing overloads, including `getDocument(key, null)`. +- Added query-source authorization and elevated-read controls to `SearchOptions` and document lookup overloads, and + query-source authorization overloads and a header-only `KnowledgeBaseRetrievalOptions.querySourceAuthorization` + option to knowledge base retrieval. Non-null explicit authorization arguments override the option; null falls + back to the option. +- Added document-level permission configuration through `SearchField.permissionFilter`, `organizationAccessExpiration`, + and `sharepointSiteUrl`, `SearchIndex.permissionFilterOption`, and `SharePointConnectorAppRegistration`. +- Added `SearchIndexerDataSourceConnection.indexerPermissionOptions`, + `IndexingParametersConfiguration.refreshAllAcls`, and + `SearchIndexerDataUserAssignedIdentity.federatedIdentityClientId` for permission ingestion and federated identity. +- Added `SearchIndexerClient.resync` and `SearchIndexerAsyncClient.resync` to resynchronize indexed permissions. +- Added `SearchIndexerStatus.runtime` and `SearchServiceStatistics.indexersRuntime`, including used and remaining + runtime and the reporting period. +- Added service-driven pagination and name-prefix filtering for resource listings, with `ListingSearchType` and + `search`, `searchType`, and `pageSize` query parameters. Added typed request-options overloads for synonym maps, + indexers, data sources, skillsets, and indexes with selected properties. +- Added pageable index statistics through `listIndexStatsSummary` and `IndexStatisticsSummary`. +- Added file knowledge sources and multipart file upload, update, listing, and deletion APIs on `SearchIndexClient` + and `SearchIndexAsyncClient`, with file metadata, directory-like prefixes, parsing and extraction modes, and + retrieval parameter, reference, and activity models. +- Added `KnowledgeSourceFileCapacity` and `KnowledgeSourceStatus.fileCapacity` for maximum file size, maximum file + count, and remaining file count. +- Added indexed SQL and indexed SharePoint knowledge sources, their retrieval parameter, reference, and activity + models, SQL content and embedding column mappings, and SharePoint container selection. +- Added knowledge source ingestion permission options and network access mode, and + `SearchIndexKnowledgeSourceParameters.baseFilter`. +- Added low and medium retrieval reasoning effort, answer-synthesis and extractive-data output modes, retrieval and + answer instructions, and CORS configuration on knowledge bases. +- Added model-based `createOrUpdateKnowledgeBase` and typed knowledge base/source update response overloads on + `SearchIndexAsyncClient`. +- Added conversation messages, reasoning effort, output mode, and maximum output document counts to knowledge + retrieval requests. Added constructors for message content and image URLs, and a writable message role. +- Added `alwaysQuerySource`, `failOnError`, and `maxOutputDocuments` to knowledge source retrieval parameters, and + `language`, `market`, `count`, and `freshness` to web knowledge source configuration. +- Added typed source, query-planning, and answer-synthesis activity records, activity timestamps and warnings, model + and deployment details, and citation URLs on search-index, Azure Blob, and indexed OneLake references. +- Added typed `retrieveStream` APIs returning `CloseableIterableStream` on the + synchronous retrieval client and `Flux` on the asynchronous client. Events + include retrieval start, activity start and completion, answers, references, errors, and response completion. + Response-completion events expose their numeric status code as `Integer`, including unknown status values. +- Added `modelName` and `modelDeployment` to `ContentUnderstandingSkill`, fixed-size and semantic chunking method + selection, and token-based chunking units. +- Added `GPT54`, `GPT55`, `GPT56SOL`, `GPT56TERRA`, and `GPT56LUNA` to `AzureOpenAIModelName`. + +### Breaking Changes + +These removals correct preview-only APIs accidentally exposed by the GA specification. The corresponding features +were not supported by the previous GA service API. The specification correction was signed off as a bug fix in +[Azure/azure-rest-api-specs#47112](https://github.com/Azure/azure-rest-api-specs/pull/47112). +Removing these published Java APIs remains a source and binary compatibility break, despite the lack of supported +service behavior. + +The following APIs were public in GA `12.1.1` and have been removed in `12.2.0`: + +- Removed `AIFoundryModelCatalogName`, `AzureMachineLearningParameters`, and `AzureMachineLearningVectorizer`. +- Removed `VectorizableImageBinaryQuery` and `VectorizableImageUrlQuery`, along with `VectorQueryKind.IMAGE_BINARY` + and `VectorQueryKind.IMAGE_URL`. +- Removed `VectorFilterMode.STRICT_POST_FILTER`. +- Removed `KnowledgeBaseAgenticReasoningActivityRecord.getRetrievalReasoningEffort()`. For streaming retrieval, + the effective reasoning effort is available through + `KnowledgeBaseRetrievalStartedStreamEvent.getValue().getReasoningEffort()`. + +### Bugs Fixed + +- Fixed knowledge source status deserialization for compact synchronization intervals such as `1d`, while + preserving the existing Java `Duration` API. + +## 12.1.1 (2026-11-02) + +### Other Changes + +#### Dependency Updates + +- Upgraded `azure-core` from `1.60.0` to version `1.61.0`. +- Upgraded `azure-core-http-netty` from `1.16.8` to version `1.17.0`. + ## 12.1.0-beta.2 (2026-08-28) ### Features Added diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index 3a473b526bab0..aa8c718ae27d0 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -61,7 +61,7 @@ com.azure azure-core - 1.60.0 + 1.61.0 com.azure @@ -71,7 +71,7 @@ com.azure azure-core-http-netty - 1.16.8 + 1.17.0 + 1.27.0-beta.20 test com.azure azure-identity - 1.18.7 + 1.19.0 test diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIFoundryModelCatalogName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIFoundryModelCatalogName.java new file mode 100644 index 0000000000000..c7ab7e9fbd478 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIFoundryModelCatalogName.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The name of the embedding model from the Azure AI Foundry Catalog that will be called. + */ +public final class AIFoundryModelCatalogName extends ExpandableStringEnum { + + /** + * Cohere embed v4 model for generating embeddings from both text and images. + */ + @Generated + public static final AIFoundryModelCatalogName COHERE_EMBED_V4 = fromString("Cohere-embed-v4"); + + /** + * Creates a new instance of AIFoundryModelCatalogName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AIFoundryModelCatalogName() { + } + + /** + * Creates or finds a AIFoundryModelCatalogName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AIFoundryModelCatalogName. + */ + @Generated + public static AIFoundryModelCatalogName fromString(String name) { + return fromString(name, AIFoundryModelCatalogName.class); + } + + /** + * Gets known AIFoundryModelCatalogName values. + * + * @return known AIFoundryModelCatalogName values. + */ + @Generated + public static Collection values() { + return values(AIFoundryModelCatalogName.class); + } + + /** + * OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32. + */ + @Generated + public static final AIFoundryModelCatalogName OPEN_AI_CLIP_IMAGE_TEXT_EMBEDDINGS_VIT_BASE_PATCH32 + = fromString("OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32"); + + /** + * OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336. + */ + @Generated + public static final AIFoundryModelCatalogName OPEN_AI_CLIP_IMAGE_TEXT_EMBEDDINGS_VIT_LARGE_PATCH14_336 + = fromString("OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336"); + + /** + * Facebook-DinoV2-Image-Embeddings-ViT-Base. + */ + @Generated + public static final AIFoundryModelCatalogName FACEBOOK_DINO_V2_IMAGE_EMBEDDINGS_VIT_BASE + = fromString("Facebook-DinoV2-Image-Embeddings-ViT-Base"); + + /** + * Facebook-DinoV2-Image-Embeddings-ViT-Giant. + */ + @Generated + public static final AIFoundryModelCatalogName FACEBOOK_DINO_V2_IMAGE_EMBEDDINGS_VIT_GIANT + = fromString("Facebook-DinoV2-Image-Embeddings-ViT-Giant"); + + /** + * Cohere-embed-v3-english. + */ + @Generated + public static final AIFoundryModelCatalogName COHERE_EMBED_V3_ENGLISH = fromString("Cohere-embed-v3-english"); + + /** + * Cohere-embed-v3-multilingual. + */ + @Generated + public static final AIFoundryModelCatalogName COHERE_EMBED_V3_MULTILINGUAL + = fromString("Cohere-embed-v3-multilingual"); +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionParameters.java new file mode 100644 index 0000000000000..68f5205a57ae0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionParameters.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies the AI Services Vision parameters for vectorizing a query image or text. + */ +@Fluent +public final class AIServicesVisionParameters implements JsonSerializable { + + /* + * The version of the model to use when calling the AI Services Vision service. It will default to the latest + * available when not specified. + */ + @Generated + private final String modelVersion; + + /* + * The resource URI of the AI Services resource. + */ + @Generated + private final String resourceUrl; + + /* + * API key of the designated AI Services resource. + */ + @Generated + private String apiKey; + + /* + * 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 index, if the identity is unspecified, + * the value remains unchanged. If set to "none", the value of this property is cleared. + */ + @Generated + private SearchIndexerDataIdentity authIdentity; + + /** + * Creates an instance of AIServicesVisionParameters class. + * + * @param modelVersion the modelVersion value to set. + * @param resourceUrl the resourceUrl value to set. + */ + @Generated + public AIServicesVisionParameters(String modelVersion, String resourceUrl) { + this.modelVersion = modelVersion; + this.resourceUrl = resourceUrl; + } + + /** + * Get the modelVersion property: The version of the model to use when calling the AI Services Vision service. It + * will default to the latest available when not specified. + * + * @return the modelVersion value. + */ + @Generated + public String getModelVersion() { + return this.modelVersion; + } + + /** + * Get the resourceUrl property: The resource URI of the AI Services resource. + * + * @return the resourceUrl value. + */ + @Generated + public String getResourceUrl() { + return this.resourceUrl; + } + + /** + * Get the apiKey property: API key of the designated AI Services resource. + * + * @return the apiKey value. + */ + @Generated + public String getApiKey() { + return this.apiKey; + } + + /** + * Set the apiKey property: API key of the designated AI Services resource. + * + * @param apiKey the apiKey value to set. + * @return the AIServicesVisionParameters object itself. + */ + @Generated + public AIServicesVisionParameters setApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get the authIdentity property: 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 index, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this + * property is cleared. + * + * @return the authIdentity value. + */ + @Generated + public SearchIndexerDataIdentity getAuthIdentity() { + return this.authIdentity; + } + + /** + * Set the authIdentity property: 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 index, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this + * property is cleared. + * + * @param authIdentity the authIdentity value to set. + * @return the AIServicesVisionParameters object itself. + */ + @Generated + public AIServicesVisionParameters setAuthIdentity(SearchIndexerDataIdentity authIdentity) { + this.authIdentity = authIdentity; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modelVersion", this.modelVersion); + jsonWriter.writeStringField("resourceUri", this.resourceUrl); + jsonWriter.writeStringField("apiKey", this.apiKey); + jsonWriter.writeJsonField("authIdentity", this.authIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AIServicesVisionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AIServicesVisionParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AIServicesVisionParameters. + */ + @Generated + public static AIServicesVisionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String modelVersion = null; + String resourceUrl = null; + String apiKey = null; + SearchIndexerDataIdentity authIdentity = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("modelVersion".equals(fieldName)) { + modelVersion = reader.getString(); + } else if ("resourceUri".equals(fieldName)) { + resourceUrl = reader.getString(); + } else if ("apiKey".equals(fieldName)) { + apiKey = reader.getString(); + } else if ("authIdentity".equals(fieldName)) { + authIdentity = SearchIndexerDataIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AIServicesVisionParameters deserializedAIServicesVisionParameters + = new AIServicesVisionParameters(modelVersion, resourceUrl); + deserializedAIServicesVisionParameters.apiKey = apiKey; + deserializedAIServicesVisionParameters.authIdentity = authIdentity; + return deserializedAIServicesVisionParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionVectorizer.java new file mode 100644 index 0000000000000..441a243db993d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AIServicesVisionVectorizer.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Clears the identity property of a datasource. + */ +@Fluent +public final class AIServicesVisionVectorizer extends VectorSearchVectorizer { + + /* + * Type of VectorSearchVectorizer. + */ + @Generated + private VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.AISERVICES_VISION; + + /* + * Contains the parameters specific to AI Services Vision embedding vectorization. + */ + @Generated + private AIServicesVisionParameters aiServicesVisionParameters; + + /** + * Creates an instance of AIServicesVisionVectorizer class. + * + * @param vectorizerName the vectorizerName value to set. + */ + @Generated + public AIServicesVisionVectorizer(String vectorizerName) { + super(vectorizerName); + } + + /** + * Get the kind property: Type of VectorSearchVectorizer. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchVectorizerKind getKind() { + return this.kind; + } + + /** + * Get the aiServicesVisionParameters property: Contains the parameters specific to AI Services Vision embedding + * vectorization. + * + * @return the aiServicesVisionParameters value. + */ + @Generated + public AIServicesVisionParameters getAiServicesVisionParameters() { + return this.aiServicesVisionParameters; + } + + /** + * Set the aiServicesVisionParameters property: Contains the parameters specific to AI Services Vision embedding + * vectorization. + * + * @param aiServicesVisionParameters the aiServicesVisionParameters value to set. + * @return the AIServicesVisionVectorizer object itself. + */ + @Generated + public AIServicesVisionVectorizer + setAiServicesVisionParameters(AIServicesVisionParameters aiServicesVisionParameters) { + this.aiServicesVisionParameters = aiServicesVisionParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getVectorizerName()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("aiServicesVisionParameters", this.aiServicesVisionParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AIServicesVisionVectorizer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AIServicesVisionVectorizer if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AIServicesVisionVectorizer. + */ + @Generated + public static AIServicesVisionVectorizer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String vectorizerName = null; + VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.AISERVICES_VISION; + AIServicesVisionParameters aiServicesVisionParameters = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + vectorizerName = reader.getString(); + } else if ("kind".equals(fieldName)) { + kind = VectorSearchVectorizerKind.fromString(reader.getString()); + } else if ("aiServicesVisionParameters".equals(fieldName)) { + aiServicesVisionParameters = AIServicesVisionParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AIServicesVisionVectorizer deserializedAIServicesVisionVectorizer + = new AIServicesVisionVectorizer(vectorizerName); + deserializedAIServicesVisionVectorizer.kind = kind; + deserializedAIServicesVisionVectorizer.aiServicesVisionParameters = aiServicesVisionParameters; + return deserializedAIServicesVisionVectorizer; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSource.java index 05d62f5e17e45..cb57a19ac61c6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureBlobKnowledgeSource.java @@ -100,6 +100,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeJsonField("azureBlobParameters", this.azureBlobParameters); @@ -121,6 +123,7 @@ public static AzureBlobKnowledgeSource fromJson(JsonReader jsonReader) throws IO return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; AzureBlobKnowledgeSourceParameters azureBlobParameters = null; @@ -132,6 +135,8 @@ public static AzureBlobKnowledgeSource fromJson(JsonReader jsonReader) throws IO name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -147,10 +152,21 @@ public static AzureBlobKnowledgeSource fromJson(JsonReader jsonReader) throws IO AzureBlobKnowledgeSource deserializedAzureBlobKnowledgeSource = new AzureBlobKnowledgeSource(name, azureBlobParameters); deserializedAzureBlobKnowledgeSource.setDescription(description); + deserializedAzureBlobKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedAzureBlobKnowledgeSource.setETag(eTag); deserializedAzureBlobKnowledgeSource.setEncryptionKey(encryptionKey); deserializedAzureBlobKnowledgeSource.kind = kind; return deserializedAzureBlobKnowledgeSource; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureBlobKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java new file mode 100644 index 0000000000000..c275a3dc2beb5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; + +/** + * Specifies the properties for connecting to an AML vectorizer. + */ +@Fluent +public final class AzureMachineLearningParameters implements JsonSerializable { + + /* + * (Required for key authentication) The key for the AML service. + */ + @Generated + private String authenticationKey; + + /* + * (Required for token authentication). The Azure Resource Manager resource ID of the AML service. It should be in + * the format + * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace + * -name}/services/{service_name}. + */ + @Generated + private String resourceId; + + /* + * (Optional) When specified, indicates the timeout for the http client making the API call. + */ + @Generated + private Duration timeout; + + /* + * (Optional for token authentication). The region the AML service is deployed in. + */ + @Generated + private String region; + + /* + * The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the provided endpoint. + */ + @Generated + private AIFoundryModelCatalogName modelName; + + /** + * Creates an instance of AzureMachineLearningParameters class. + * + * @param scoringUrl the scoringUrl value to set. + */ + @Generated + public AzureMachineLearningParameters(String scoringUrl) { + this.scoringUrl = scoringUrl; + } + + /** + * Get the authenticationKey property: (Required for key authentication) The key for the AML service. + * + * @return the authenticationKey value. + */ + @Generated + public String getAuthenticationKey() { + return this.authenticationKey; + } + + /** + * Set the authenticationKey property: (Required for key authentication) The key for the AML service. + * + * @param authenticationKey the authenticationKey value to set. + * @return the AzureMachineLearningParameters object itself. + */ + @Generated + public AzureMachineLearningParameters setAuthenticationKey(String authenticationKey) { + this.authenticationKey = authenticationKey; + return this; + } + + /** + * Get the resourceId property: (Required for token authentication). The Azure Resource Manager resource ID of the + * AML service. It should be in the format + * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: (Required for token authentication). The Azure Resource Manager resource ID of the + * AML service. It should be in the format + * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. + * + * @param resourceId the resourceId value to set. + * @return the AzureMachineLearningParameters object itself. + */ + @Generated + public AzureMachineLearningParameters setResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the timeout property: (Optional) When specified, indicates the timeout for the http client making the API + * call. + * + * @return the timeout value. + */ + @Generated + public Duration getTimeout() { + return this.timeout; + } + + /** + * Set the timeout property: (Optional) When specified, indicates the timeout for the http client making the API + * call. + * + * @param timeout the timeout value to set. + * @return the AzureMachineLearningParameters object itself. + */ + @Generated + public AzureMachineLearningParameters setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the region property: (Optional for token authentication). The region the AML service is deployed in. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Set the region property: (Optional for token authentication). The region the AML service is deployed in. + * + * @param region the region value to set. + * @return the AzureMachineLearningParameters object itself. + */ + @Generated + public AzureMachineLearningParameters setRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the modelName property: The name of the embedding model from the Azure AI Foundry Catalog that is deployed at + * the provided endpoint. + * + * @return the modelName value. + */ + @Generated + public AIFoundryModelCatalogName getModelName() { + return this.modelName; + } + + /** + * Set the modelName property: The name of the embedding model from the Azure AI Foundry Catalog that is deployed at + * the provided endpoint. + * + * @param modelName the modelName value to set. + * @return the AzureMachineLearningParameters object itself. + */ + @Generated + public AzureMachineLearningParameters setModelName(AIFoundryModelCatalogName modelName) { + this.modelName = modelName; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.scoringUrl); + jsonWriter.writeStringField("key", this.authenticationKey); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("modelName", this.modelName == null ? null : this.modelName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureMachineLearningParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureMachineLearningParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureMachineLearningParameters. + */ + @Generated + public static AzureMachineLearningParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String scoringUrl = null; + String authenticationKey = null; + String resourceId = null; + Duration timeout = null; + String region = null; + AIFoundryModelCatalogName modelName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("uri".equals(fieldName)) { + scoringUrl = reader.getString(); + } else if ("key".equals(fieldName)) { + authenticationKey = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + resourceId = reader.getString(); + } else if ("timeout".equals(fieldName)) { + timeout = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("region".equals(fieldName)) { + region = reader.getString(); + } else if ("modelName".equals(fieldName)) { + modelName = AIFoundryModelCatalogName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + AzureMachineLearningParameters deserializedAzureMachineLearningParameters + = new AzureMachineLearningParameters(scoringUrl); + deserializedAzureMachineLearningParameters.authenticationKey = authenticationKey; + deserializedAzureMachineLearningParameters.resourceId = resourceId; + deserializedAzureMachineLearningParameters.timeout = timeout; + deserializedAzureMachineLearningParameters.region = region; + deserializedAzureMachineLearningParameters.modelName = modelName; + return deserializedAzureMachineLearningParameters; + }); + } + + /* + * (Required for no authentication or key authentication) The scoring URI of the AML service to which the JSON + * payload will be sent. Only the https URI scheme is allowed. + */ + @Generated + private final String scoringUrl; + + /** + * Get the scoringUrl property: (Required for no authentication or key authentication) The scoring URI of the AML + * service to which the JSON payload will be sent. Only the https URI scheme is allowed. + * + * @return the scoringUrl value. + */ + @Generated + public String getScoringUrl() { + return this.scoringUrl; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningSkill.java new file mode 100644 index 0000000000000..d350642446754 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningSkill.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.List; + +/** + * The AML skill allows you to extend AI enrichment with a custom Azure Machine Learning (AML) model. Once an AML model + * is trained and deployed, an AML skill integrates it into AI enrichment. + */ +@Fluent +public final class AzureMachineLearningSkill extends SearchIndexerSkill { + + /* + * The discriminator for derived types. + */ + @Generated + private String odataType = "#Microsoft.Skills.Custom.AmlSkill"; + + /* + * (Required for no authentication or key authentication) The scoring URI of the AML service to which the JSON + * payload will be sent. Only the https URI scheme is allowed. + */ + @Generated + private String scoringUrl; + + /* + * (Required for key authentication) The key for the AML service. + */ + @Generated + private String authenticationKey; + + /* + * (Required for token authentication). The Azure Resource Manager resource ID of the AML service. It should be in + * the format + * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace + * -name}/services/{service_name}. + */ + @Generated + private String resourceId; + + /* + * (Optional) When specified, indicates the timeout for the http client making the API call. + */ + @Generated + private Duration timeout; + + /* + * (Optional for token authentication). The region the AML service is deployed in. + */ + @Generated + private String region; + + /* + * (Optional) When specified, indicates the number of calls the indexer will make in parallel to the endpoint you + * have provided. You can decrease this value if your endpoint is failing under too high of a request load, or raise + * it if your endpoint is able to accept more requests and you would like an increase in the performance of the + * indexer. If not set, a default value of 5 is used. The degreeOfParallelism can be set to a maximum of 10 and a + * minimum of 1. + */ + @Generated + private Integer degreeOfParallelism; + + /** + * Creates an instance of AzureMachineLearningSkill class. + * + * @param inputs the inputs value to set. + * @param outputs the outputs value to set. + */ + @Generated + public AzureMachineLearningSkill(List inputs, List outputs) { + super(inputs, outputs); + } + + /** + * Get the odataType property: The discriminator for derived types. + * + * @return the odataType value. + */ + @Generated + @Override + public String getOdataType() { + return this.odataType; + } + + /** + * Get the scoringUrl property: (Required for no authentication or key authentication) The scoring URI of the AML + * service to which the JSON payload will be sent. Only the https URI scheme is allowed. + * + * @return the scoringUrl value. + */ + @Generated + public String getScoringUrl() { + return this.scoringUrl; + } + + /** + * Set the scoringUrl property: (Required for no authentication or key authentication) The scoring URI of the AML + * service to which the JSON payload will be sent. Only the https URI scheme is allowed. + * + * @param scoringUrl the scoringUrl value to set. + * @return the AzureMachineLearningSkill object itself. + */ + @Generated + public AzureMachineLearningSkill setScoringUrl(String scoringUrl) { + this.scoringUrl = scoringUrl; + return this; + } + + /** + * Get the authenticationKey property: (Required for key authentication) The key for the AML service. + * + * @return the authenticationKey value. + */ + @Generated + public String getAuthenticationKey() { + return this.authenticationKey; + } + + /** + * Set the authenticationKey property: (Required for key authentication) The key for the AML service. + * + * @param authenticationKey the authenticationKey value to set. + * @return the AzureMachineLearningSkill object itself. + */ + @Generated + public AzureMachineLearningSkill setAuthenticationKey(String authenticationKey) { + this.authenticationKey = authenticationKey; + return this; + } + + /** + * Get the resourceId property: (Required for token authentication). The Azure Resource Manager resource ID of the + * AML service. It should be in the format + * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: (Required for token authentication). The Azure Resource Manager resource ID of the + * AML service. It should be in the format + * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. + * + * @param resourceId the resourceId value to set. + * @return the AzureMachineLearningSkill object itself. + */ + @Generated + public AzureMachineLearningSkill setResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the timeout property: (Optional) When specified, indicates the timeout for the http client making the API + * call. + * + * @return the timeout value. + */ + @Generated + public Duration getTimeout() { + return this.timeout; + } + + /** + * Set the timeout property: (Optional) When specified, indicates the timeout for the http client making the API + * call. + * + * @param timeout the timeout value to set. + * @return the AzureMachineLearningSkill object itself. + */ + @Generated + public AzureMachineLearningSkill setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the region property: (Optional for token authentication). The region the AML service is deployed in. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Set the region property: (Optional for token authentication). The region the AML service is deployed in. + * + * @param region the region value to set. + * @return the AzureMachineLearningSkill object itself. + */ + @Generated + public AzureMachineLearningSkill setRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the degreeOfParallelism property: (Optional) When specified, indicates the number of calls the indexer will + * make in parallel to the endpoint you have provided. You can decrease this value if your endpoint is failing under + * too high of a request load, or raise it if your endpoint is able to accept more requests and you would like an + * increase in the performance of the indexer. If not set, a default value of 5 is used. The degreeOfParallelism can + * be set to a maximum of 10 and a minimum of 1. + * + * @return the degreeOfParallelism value. + */ + @Generated + public Integer getDegreeOfParallelism() { + return this.degreeOfParallelism; + } + + /** + * Set the degreeOfParallelism property: (Optional) When specified, indicates the number of calls the indexer will + * make in parallel to the endpoint you have provided. You can decrease this value if your endpoint is failing under + * too high of a request load, or raise it if your endpoint is able to accept more requests and you would like an + * increase in the performance of the indexer. If not set, a default value of 5 is used. The degreeOfParallelism can + * be set to a maximum of 10 and a minimum of 1. + * + * @param degreeOfParallelism the degreeOfParallelism value to set. + * @return the AzureMachineLearningSkill object itself. + */ + @Generated + public AzureMachineLearningSkill setDegreeOfParallelism(Integer degreeOfParallelism) { + this.degreeOfParallelism = degreeOfParallelism; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureMachineLearningSkill setName(String name) { + super.setName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureMachineLearningSkill setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public AzureMachineLearningSkill setContext(String context) { + super.setContext(context); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("inputs", getInputs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("outputs", getOutputs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("context", getContext()); + jsonWriter.writeStringField("@odata.type", this.odataType); + jsonWriter.writeStringField("uri", this.scoringUrl); + jsonWriter.writeStringField("key", this.authenticationKey); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("timeout", CoreUtils.durationToStringWithDays(this.timeout)); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeNumberField("degreeOfParallelism", this.degreeOfParallelism); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureMachineLearningSkill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureMachineLearningSkill if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureMachineLearningSkill. + */ + @Generated + public static AzureMachineLearningSkill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List inputs = null; + List outputs = null; + String name = null; + String description = null; + String context = null; + String odataType = "#Microsoft.Skills.Custom.AmlSkill"; + String scoringUrl = null; + String authenticationKey = null; + String resourceId = null; + Duration timeout = null; + String region = null; + Integer degreeOfParallelism = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("inputs".equals(fieldName)) { + inputs = reader.readArray(reader1 -> InputFieldMappingEntry.fromJson(reader1)); + } else if ("outputs".equals(fieldName)) { + outputs = reader.readArray(reader1 -> OutputFieldMappingEntry.fromJson(reader1)); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("context".equals(fieldName)) { + context = reader.getString(); + } else if ("@odata.type".equals(fieldName)) { + odataType = reader.getString(); + } else if ("uri".equals(fieldName)) { + scoringUrl = reader.getString(); + } else if ("key".equals(fieldName)) { + authenticationKey = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + resourceId = reader.getString(); + } else if ("timeout".equals(fieldName)) { + timeout = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("region".equals(fieldName)) { + region = reader.getString(); + } else if ("degreeOfParallelism".equals(fieldName)) { + degreeOfParallelism = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + AzureMachineLearningSkill deserializedAzureMachineLearningSkill + = new AzureMachineLearningSkill(inputs, outputs); + deserializedAzureMachineLearningSkill.setName(name); + deserializedAzureMachineLearningSkill.setDescription(description); + deserializedAzureMachineLearningSkill.setContext(context); + deserializedAzureMachineLearningSkill.odataType = odataType; + deserializedAzureMachineLearningSkill.scoringUrl = scoringUrl; + deserializedAzureMachineLearningSkill.authenticationKey = authenticationKey; + deserializedAzureMachineLearningSkill.resourceId = resourceId; + deserializedAzureMachineLearningSkill.timeout = timeout; + deserializedAzureMachineLearningSkill.region = region; + deserializedAzureMachineLearningSkill.degreeOfParallelism = degreeOfParallelism; + return deserializedAzureMachineLearningSkill; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java new file mode 100644 index 0000000000000..c2166f2611a3a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog for generating the + * vector embedding of a query string. + */ +@Fluent +public final class AzureMachineLearningVectorizer extends VectorSearchVectorizer { + + /* + * Type of VectorSearchVectorizer. + */ + @Generated + private VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.AML; + + /** + * Creates an instance of AzureMachineLearningVectorizer class. + * + * @param vectorizerName the vectorizerName value to set. + */ + @Generated + public AzureMachineLearningVectorizer(String vectorizerName) { + super(vectorizerName); + } + + /** + * Get the kind property: Type of VectorSearchVectorizer. + * + * @return the kind value. + */ + @Generated + @Override + public VectorSearchVectorizerKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getVectorizerName()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("amlParameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureMachineLearningVectorizer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureMachineLearningVectorizer if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureMachineLearningVectorizer. + */ + @Generated + public static AzureMachineLearningVectorizer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String vectorizerName = null; + VectorSearchVectorizerKind kind = VectorSearchVectorizerKind.AML; + AzureMachineLearningParameters parameters = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + vectorizerName = reader.getString(); + } else if ("kind".equals(fieldName)) { + kind = VectorSearchVectorizerKind.fromString(reader.getString()); + } else if ("amlParameters".equals(fieldName)) { + parameters = AzureMachineLearningParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + AzureMachineLearningVectorizer deserializedAzureMachineLearningVectorizer + = new AzureMachineLearningVectorizer(vectorizerName); + deserializedAzureMachineLearningVectorizer.kind = kind; + deserializedAzureMachineLearningVectorizer.parameters = parameters; + return deserializedAzureMachineLearningVectorizer; + }); + } + + /* + * Specifies the properties of the AML vectorizer. + */ + @Generated + private AzureMachineLearningParameters parameters; + + /** + * Get the parameters property: Specifies the properties of the AML vectorizer. + * + * @return the parameters value. + */ + @Generated + public AzureMachineLearningParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Specifies the properties of the AML vectorizer. + * + * @param parameters the parameters value to set. + * @return the AzureMachineLearningVectorizer object itself. + */ + @Generated + public AzureMachineLearningVectorizer setParameters(AzureMachineLearningParameters parameters) { + this.parameters = parameters; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java index 85c0ae98292a2..eb6e8dfcbcf55 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAIModelName.java @@ -85,6 +85,54 @@ public static Collection values() { @Generated public static final AzureOpenAIModelName GPT54NANO = fromString("gpt-5.4-nano"); + /** + * Gpt4o model. + */ + @Generated + public static final AzureOpenAIModelName GPT4O = fromString("gpt-4o"); + + /** + * Gpt4oMini model. + */ + @Generated + public static final AzureOpenAIModelName GPT4O_MINI = fromString("gpt-4o-mini"); + + /** + * Gpt41 model. + */ + @Generated + public static final AzureOpenAIModelName GPT41 = fromString("gpt-4.1"); + + /** + * Gpt41Mini model. + */ + @Generated + public static final AzureOpenAIModelName GPT41MINI = fromString("gpt-4.1-mini"); + + /** + * Gpt41Nano model. + */ + @Generated + public static final AzureOpenAIModelName GPT41NANO = fromString("gpt-4.1-nano"); + + /** + * Gpt5 model. + */ + @Generated + public static final AzureOpenAIModelName GPT5 = fromString("gpt-5"); + + /** + * Gpt51 model. + */ + @Generated + public static final AzureOpenAIModelName GPT51 = fromString("gpt-5.1"); + + /** + * Gpt52 model. + */ + @Generated + public static final AzureOpenAIModelName GPT52 = fromString("gpt-5.2"); + /** * Gpt54 model. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAITokenizerParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAITokenizerParameters.java new file mode 100644 index 0000000000000..4484309a05677 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureOpenAITokenizerParameters.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure OpenAI Tokenizer parameters. + */ +@Fluent +public final class AzureOpenAITokenizerParameters implements JsonSerializable { + + /* + * Only applies if the unit is set to azureOpenAITokens. Options include 'R50k_base', 'P50k_base', 'P50k_edit' and + * 'CL100k_base'. The default value is 'CL100k_base'. + */ + @Generated + private SplitSkillEncoderModelName encoderModelName; + + /* + * (Optional) Only applies if the unit is set to azureOpenAITokens. This parameter defines a collection of special + * tokens that are permitted within the tokenization process. + */ + @Generated + private List allowedSpecialTokens; + + /** + * Creates an instance of AzureOpenAITokenizerParameters class. + */ + @Generated + public AzureOpenAITokenizerParameters() { + } + + /** + * Get the encoderModelName property: Only applies if the unit is set to azureOpenAITokens. Options include + * 'R50k_base', 'P50k_base', 'P50k_edit' and 'CL100k_base'. The default value is 'CL100k_base'. + * + * @return the encoderModelName value. + */ + @Generated + public SplitSkillEncoderModelName getEncoderModelName() { + return this.encoderModelName; + } + + /** + * Set the encoderModelName property: Only applies if the unit is set to azureOpenAITokens. Options include + * 'R50k_base', 'P50k_base', 'P50k_edit' and 'CL100k_base'. The default value is 'CL100k_base'. + * + * @param encoderModelName the encoderModelName value to set. + * @return the AzureOpenAITokenizerParameters object itself. + */ + @Generated + public AzureOpenAITokenizerParameters setEncoderModelName(SplitSkillEncoderModelName encoderModelName) { + this.encoderModelName = encoderModelName; + return this; + } + + /** + * Get the allowedSpecialTokens property: (Optional) Only applies if the unit is set to azureOpenAITokens. This + * parameter defines a collection of special tokens that are permitted within the tokenization process. + * + * @return the allowedSpecialTokens value. + */ + @Generated + public List getAllowedSpecialTokens() { + return this.allowedSpecialTokens; + } + + /** + * Set the allowedSpecialTokens property: (Optional) Only applies if the unit is set to azureOpenAITokens. This + * parameter defines a collection of special tokens that are permitted within the tokenization process. + * + * @param allowedSpecialTokens the allowedSpecialTokens value to set. + * @return the AzureOpenAITokenizerParameters object itself. + */ + @Generated + public AzureOpenAITokenizerParameters setAllowedSpecialTokens(List allowedSpecialTokens) { + this.allowedSpecialTokens = allowedSpecialTokens; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("encoderModelName", + this.encoderModelName == null ? null : this.encoderModelName.toString()); + jsonWriter.writeArrayField("allowedSpecialTokens", this.allowedSpecialTokens, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureOpenAITokenizerParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureOpenAITokenizerParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureOpenAITokenizerParameters. + */ + @Generated + public static AzureOpenAITokenizerParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureOpenAITokenizerParameters deserializedAzureOpenAITokenizerParameters + = new AzureOpenAITokenizerParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("encoderModelName".equals(fieldName)) { + deserializedAzureOpenAITokenizerParameters.encoderModelName + = SplitSkillEncoderModelName.fromString(reader.getString()); + } else if ("allowedSpecialTokens".equals(fieldName)) { + List allowedSpecialTokens = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureOpenAITokenizerParameters.allowedSpecialTokens = allowedSpecialTokens; + } else { + reader.skipChildren(); + } + } + return deserializedAzureOpenAITokenizerParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntraAppAuthentication.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntraAppAuthentication.java new file mode 100644 index 0000000000000..22244bd8e965e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntraAppAuthentication.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for a customer-owned Microsoft Entra app registration used for federated credential-based on-behalf-of + * authentication. + */ +@Fluent +public final class EntraAppAuthentication implements JsonSerializable { + + /* + * The application (client) ID of the customer-owned Entra app registration. + */ + @Generated + private final String applicationId; + + /* + * The federated credential ID configured on the app registration, enabling the search service to authenticate as + * the app without a stored client secret. + */ + @Generated + private final String federatedCredentialId; + + /* + * The tenant ID of the app registration. Required when the app registration is in a different tenant than the + * search service. If omitted, the search service's tenant is used. + */ + @Generated + private String tenantId; + + /** + * Creates an instance of EntraAppAuthentication class. + * + * @param applicationId the applicationId value to set. + * @param federatedCredentialId the federatedCredentialId value to set. + */ + @Generated + public EntraAppAuthentication(String applicationId, String federatedCredentialId) { + this.applicationId = applicationId; + this.federatedCredentialId = federatedCredentialId; + } + + /** + * Get the applicationId property: The application (client) ID of the customer-owned Entra app registration. + * + * @return the applicationId value. + */ + @Generated + public String getApplicationId() { + return this.applicationId; + } + + /** + * Get the federatedCredentialId property: The federated credential ID configured on the app registration, enabling + * the search service to authenticate as the app without a stored client secret. + * + * @return the federatedCredentialId value. + */ + @Generated + public String getFederatedCredentialId() { + return this.federatedCredentialId; + } + + /** + * Get the tenantId property: The tenant ID of the app registration. Required when the app registration is in a + * different tenant than the search service. If omitted, the search service's tenant is used. + * + * @return the tenantId value. + */ + @Generated + public String getTenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID of the app registration. Required when the app registration is in a + * different tenant than the search service. If omitted, the search service's tenant is used. + * + * @param tenantId the tenantId value to set. + * @return the EntraAppAuthentication object itself. + */ + @Generated + public EntraAppAuthentication setTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationId", this.applicationId); + jsonWriter.writeStringField("federatedCredentialId", this.federatedCredentialId); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntraAppAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntraAppAuthentication if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntraAppAuthentication. + */ + @Generated + public static EntraAppAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String applicationId = null; + String federatedCredentialId = null; + String tenantId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("applicationId".equals(fieldName)) { + applicationId = reader.getString(); + } else if ("federatedCredentialId".equals(fieldName)) { + federatedCredentialId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + EntraAppAuthentication deserializedEntraAppAuthentication + = new EntraAppAuthentication(applicationId, federatedCredentialId); + deserializedEntraAppAuthentication.tenantId = tenantId; + return deserializedEntraAppAuthentication; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSource.java new file mode 100644 index 0000000000000..867273fa06f5e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSource.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for Fabric Data Agent knowledge source. + */ +@Fluent +public final class FabricDataAgentKnowledgeSource extends KnowledgeSource { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_DATA_AGENT; + + /* + * The parameters for the Fabric Data Agent knowledge source. + */ + @Generated + private final FabricDataAgentKnowledgeSourceParameters fabricDataAgentParameters; + + /** + * Creates an instance of FabricDataAgentKnowledgeSource class. + * + * @param name the name value to set. + * @param fabricDataAgentParameters the fabricDataAgentParameters value to set. + */ + @Generated + public FabricDataAgentKnowledgeSource(String name, + FabricDataAgentKnowledgeSourceParameters fabricDataAgentParameters) { + super(name); + this.fabricDataAgentParameters = fabricDataAgentParameters; + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * Get the fabricDataAgentParameters property: The parameters for the Fabric Data Agent knowledge source. + * + * @return the fabricDataAgentParameters value. + */ + @Generated + public FabricDataAgentKnowledgeSourceParameters getFabricDataAgentParameters() { + return this.fabricDataAgentParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSource setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSource setETag(String eTag) { + super.setETag(eTag); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSource setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + super.setEncryptionKey(encryptionKey); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeStringField("@odata.etag", getETag()); + jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); + jsonWriter.writeJsonField("fabricDataAgentParameters", this.fabricDataAgentParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricDataAgentKnowledgeSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricDataAgentKnowledgeSource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricDataAgentKnowledgeSource. + */ + @Generated + public static FabricDataAgentKnowledgeSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + String eTag = null; + SearchResourceEncryptionKey encryptionKey = null; + FabricDataAgentKnowledgeSourceParameters fabricDataAgentParameters = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_DATA_AGENT; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("@odata.etag".equals(fieldName)) { + eTag = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + encryptionKey = SearchResourceEncryptionKey.fromJson(reader); + } else if ("fabricDataAgentParameters".equals(fieldName)) { + fabricDataAgentParameters = FabricDataAgentKnowledgeSourceParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FabricDataAgentKnowledgeSource deserializedFabricDataAgentKnowledgeSource + = new FabricDataAgentKnowledgeSource(name, fabricDataAgentParameters); + deserializedFabricDataAgentKnowledgeSource.setDescription(description); + deserializedFabricDataAgentKnowledgeSource.setResultsProcessing(resultsProcessing); + deserializedFabricDataAgentKnowledgeSource.setETag(eTag); + deserializedFabricDataAgentKnowledgeSource.setEncryptionKey(encryptionKey); + deserializedFabricDataAgentKnowledgeSource.kind = kind; + return deserializedFabricDataAgentKnowledgeSource; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSourceParameters.java new file mode 100644 index 0000000000000..26af26a95979b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricDataAgentKnowledgeSourceParameters.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for Fabric Data Agent knowledge source. + */ +@Immutable +public final class FabricDataAgentKnowledgeSourceParameters + implements JsonSerializable { + + /* + * Fabric workspace ID. + */ + @Generated + private final String workspaceId; + + /* + * Specifies which Fabric Data Agent to access. + */ + @Generated + private final String dataAgentId; + + /** + * Creates an instance of FabricDataAgentKnowledgeSourceParameters class. + * + * @param workspaceId the workspaceId value to set. + * @param dataAgentId the dataAgentId value to set. + */ + @Generated + public FabricDataAgentKnowledgeSourceParameters(String workspaceId, String dataAgentId) { + this.workspaceId = workspaceId; + this.dataAgentId = dataAgentId; + } + + /** + * Get the workspaceId property: Fabric workspace ID. + * + * @return the workspaceId value. + */ + @Generated + public String getWorkspaceId() { + return this.workspaceId; + } + + /** + * Get the dataAgentId property: Specifies which Fabric Data Agent to access. + * + * @return the dataAgentId value. + */ + @Generated + public String getDataAgentId() { + return this.dataAgentId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("dataAgentId", this.dataAgentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricDataAgentKnowledgeSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricDataAgentKnowledgeSourceParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricDataAgentKnowledgeSourceParameters. + */ + @Generated + public static FabricDataAgentKnowledgeSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String workspaceId = null; + String dataAgentId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("workspaceId".equals(fieldName)) { + workspaceId = reader.getString(); + } else if ("dataAgentId".equals(fieldName)) { + dataAgentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new FabricDataAgentKnowledgeSourceParameters(workspaceId, dataAgentId); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSource.java new file mode 100644 index 0000000000000..e295dcfeb67ef --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSource.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for Fabric Ontology knowledge source. + */ +@Fluent +public final class FabricOntologyKnowledgeSource extends KnowledgeSource { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_ONTOLOGY; + + /* + * The parameters for the Fabric Ontology knowledge source. + */ + @Generated + private final FabricOntologyKnowledgeSourceParameters fabricOntologyParameters; + + /** + * Creates an instance of FabricOntologyKnowledgeSource class. + * + * @param name the name value to set. + * @param fabricOntologyParameters the fabricOntologyParameters value to set. + */ + @Generated + public FabricOntologyKnowledgeSource(String name, + FabricOntologyKnowledgeSourceParameters fabricOntologyParameters) { + super(name); + this.fabricOntologyParameters = fabricOntologyParameters; + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * Get the fabricOntologyParameters property: The parameters for the Fabric Ontology knowledge source. + * + * @return the fabricOntologyParameters value. + */ + @Generated + public FabricOntologyKnowledgeSourceParameters getFabricOntologyParameters() { + return this.fabricOntologyParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSource setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSource setETag(String eTag) { + super.setETag(eTag); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSource setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + super.setEncryptionKey(encryptionKey); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeStringField("@odata.etag", getETag()); + jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); + jsonWriter.writeJsonField("fabricOntologyParameters", this.fabricOntologyParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricOntologyKnowledgeSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricOntologyKnowledgeSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricOntologyKnowledgeSource. + */ + @Generated + public static FabricOntologyKnowledgeSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + String eTag = null; + SearchResourceEncryptionKey encryptionKey = null; + FabricOntologyKnowledgeSourceParameters fabricOntologyParameters = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_ONTOLOGY; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("@odata.etag".equals(fieldName)) { + eTag = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + encryptionKey = SearchResourceEncryptionKey.fromJson(reader); + } else if ("fabricOntologyParameters".equals(fieldName)) { + fabricOntologyParameters = FabricOntologyKnowledgeSourceParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FabricOntologyKnowledgeSource deserializedFabricOntologyKnowledgeSource + = new FabricOntologyKnowledgeSource(name, fabricOntologyParameters); + deserializedFabricOntologyKnowledgeSource.setDescription(description); + deserializedFabricOntologyKnowledgeSource.setResultsProcessing(resultsProcessing); + deserializedFabricOntologyKnowledgeSource.setETag(eTag); + deserializedFabricOntologyKnowledgeSource.setEncryptionKey(encryptionKey); + deserializedFabricOntologyKnowledgeSource.kind = kind; + return deserializedFabricOntologyKnowledgeSource; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSourceParameters.java new file mode 100644 index 0000000000000..ce27e6c7a6324 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FabricOntologyKnowledgeSourceParameters.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for Fabric Ontology knowledge source. + */ +@Immutable +public final class FabricOntologyKnowledgeSourceParameters + implements JsonSerializable { + + /* + * The Fabric workspace ID containing the ontology. + */ + @Generated + private final String workspaceId; + + /* + * The ID of the ontology to use from the Fabric workspace. + */ + @Generated + private final String ontologyId; + + /** + * Creates an instance of FabricOntologyKnowledgeSourceParameters class. + * + * @param workspaceId the workspaceId value to set. + * @param ontologyId the ontologyId value to set. + */ + @Generated + public FabricOntologyKnowledgeSourceParameters(String workspaceId, String ontologyId) { + this.workspaceId = workspaceId; + this.ontologyId = ontologyId; + } + + /** + * Get the workspaceId property: The Fabric workspace ID containing the ontology. + * + * @return the workspaceId value. + */ + @Generated + public String getWorkspaceId() { + return this.workspaceId; + } + + /** + * Get the ontologyId property: The ID of the ontology to use from the Fabric workspace. + * + * @return the ontologyId value. + */ + @Generated + public String getOntologyId() { + return this.ontologyId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("ontologyId", this.ontologyId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricOntologyKnowledgeSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricOntologyKnowledgeSourceParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricOntologyKnowledgeSourceParameters. + */ + @Generated + public static FabricOntologyKnowledgeSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String workspaceId = null; + String ontologyId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("workspaceId".equals(fieldName)) { + workspaceId = reader.getString(); + } else if ("ontologyId".equals(fieldName)) { + ontologyId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new FabricOntologyKnowledgeSourceParameters(workspaceId, ontologyId); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSource.java index 9f0e2f68d5a52..ca5c9cfed5142 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/FileKnowledgeSource.java @@ -100,6 +100,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeJsonField("fileParameters", this.fileParameters); @@ -122,6 +124,7 @@ public static FileKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcep return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; FileKnowledgeSourceParameters fileParameters = null; @@ -134,6 +137,8 @@ public static FileKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcep name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -150,6 +155,7 @@ public static FileKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcep } FileKnowledgeSource deserializedFileKnowledgeSource = new FileKnowledgeSource(name, fileParameters); deserializedFileKnowledgeSource.setDescription(description); + deserializedFileKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedFileKnowledgeSource.setETag(eTag); deserializedFileKnowledgeSource.setEncryptionKey(encryptionKey); deserializedFileKnowledgeSource.kind = kind; @@ -188,4 +194,14 @@ public FileKnowledgeSource setCorsOptions(CorsOptions corsOptions) { this.corsOptions = corsOptions; return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FileKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSource.java index 6e98cfe5ee593..4e5c1bdbe1617 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedOneLakeKnowledgeSource.java @@ -101,6 +101,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeJsonField("indexedOneLakeParameters", this.indexedOneLakeParameters); @@ -122,6 +124,7 @@ public static IndexedOneLakeKnowledgeSource fromJson(JsonReader jsonReader) thro return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; IndexedOneLakeKnowledgeSourceParameters indexedOneLakeParameters = null; @@ -133,6 +136,8 @@ public static IndexedOneLakeKnowledgeSource fromJson(JsonReader jsonReader) thro name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -148,10 +153,21 @@ public static IndexedOneLakeKnowledgeSource fromJson(JsonReader jsonReader) thro IndexedOneLakeKnowledgeSource deserializedIndexedOneLakeKnowledgeSource = new IndexedOneLakeKnowledgeSource(name, indexedOneLakeParameters); deserializedIndexedOneLakeKnowledgeSource.setDescription(description); + deserializedIndexedOneLakeKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedIndexedOneLakeKnowledgeSource.setETag(eTag); deserializedIndexedOneLakeKnowledgeSource.setEncryptionKey(encryptionKey); deserializedIndexedOneLakeKnowledgeSource.kind = kind; return deserializedIndexedOneLakeKnowledgeSource; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedOneLakeKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSource.java index b2659d668b35c..f35d15529227b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSharePointKnowledgeSource.java @@ -101,6 +101,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeJsonField("indexedSharePointParameters", this.indexedSharePointParameters); @@ -122,6 +124,7 @@ public static IndexedSharePointKnowledgeSource fromJson(JsonReader jsonReader) t return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; IndexedSharePointKnowledgeSourceParameters indexedSharePointParameters = null; @@ -133,6 +136,8 @@ public static IndexedSharePointKnowledgeSource fromJson(JsonReader jsonReader) t name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -148,10 +153,21 @@ public static IndexedSharePointKnowledgeSource fromJson(JsonReader jsonReader) t IndexedSharePointKnowledgeSource deserializedIndexedSharePointKnowledgeSource = new IndexedSharePointKnowledgeSource(name, indexedSharePointParameters); deserializedIndexedSharePointKnowledgeSource.setDescription(description); + deserializedIndexedSharePointKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedIndexedSharePointKnowledgeSource.setETag(eTag); deserializedIndexedSharePointKnowledgeSource.setEncryptionKey(encryptionKey); deserializedIndexedSharePointKnowledgeSource.kind = kind; return deserializedIndexedSharePointKnowledgeSource; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSharePointKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSource.java index def1b5fef5434..c637efb009141 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexedSqlKnowledgeSource.java @@ -100,6 +100,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeJsonField("indexedSqlParameters", this.indexedSqlParameters); @@ -121,6 +123,7 @@ public static IndexedSqlKnowledgeSource fromJson(JsonReader jsonReader) throws I return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; IndexedSqlKnowledgeSourceParameters indexedSqlParameters = null; @@ -132,6 +135,8 @@ public static IndexedSqlKnowledgeSource fromJson(JsonReader jsonReader) throws I name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -147,10 +152,21 @@ public static IndexedSqlKnowledgeSource fromJson(JsonReader jsonReader) throws I IndexedSqlKnowledgeSource deserializedIndexedSqlKnowledgeSource = new IndexedSqlKnowledgeSource(name, indexedSqlParameters); deserializedIndexedSqlKnowledgeSource.setDescription(description); + deserializedIndexedSqlKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedIndexedSqlKnowledgeSource.setETag(eTag); deserializedIndexedSqlKnowledgeSource.setEncryptionKey(encryptionKey); deserializedIndexedSqlKnowledgeSource.kind = kind; return deserializedIndexedSqlKnowledgeSource; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public IndexedSqlKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerCurrentState.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerCurrentState.java new file mode 100644 index 0000000000000..9ad0bfe12e07e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerCurrentState.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents all of the state that defines and dictates the indexer's current execution. + */ +@Immutable +public final class IndexerCurrentState implements JsonSerializable { + + /* + * The mode the indexer is running in. + */ + @Generated + private IndexingMode mode; + + /* + * Change tracking state used when indexing starts on all documents in the datasource. + */ + @Generated + private String allDocsInitialTrackingState; + + /* + * Change tracking state value when indexing finishes on all documents in the datasource. + */ + @Generated + private String allDocsFinalTrackingState; + + /* + * Change tracking state used when indexing starts on select, reset documents in the datasource. + */ + @Generated + private String resetDocsInitialTrackingState; + + /* + * Change tracking state value when indexing finishes on select, reset documents in the datasource. + */ + @Generated + private String resetDocsFinalTrackingState; + + /* + * Change tracking state used when indexing starts on selective options from the datasource. + */ + @Generated + private String resyncInitialTrackingState; + + /* + * Change tracking state value when indexing finishes on selective options from the datasource. + */ + @Generated + private String resyncFinalTrackingState; + + /* + * The list of document keys that have been reset. The document key is the document's unique identifier for the data + * in the search index. The indexer will prioritize selectively re-ingesting these keys. + */ + @Generated + private List resetDocumentKeys; + + /* + * The list of datasource document ids that have been reset. The datasource document id is the unique identifier for + * the data in the datasource. The indexer will prioritize selectively re-ingesting these ids. + */ + @Generated + private List resetDatasourceDocumentIds; + + /** + * Creates an instance of IndexerCurrentState class. + */ + @Generated + private IndexerCurrentState() { + } + + /** + * Get the mode property: The mode the indexer is running in. + * + * @return the mode value. + */ + @Generated + public IndexingMode getMode() { + return this.mode; + } + + /** + * Get the allDocsInitialTrackingState property: Change tracking state used when indexing starts on all documents in + * the datasource. + * + * @return the allDocsInitialTrackingState value. + */ + @Generated + public String getAllDocsInitialTrackingState() { + return this.allDocsInitialTrackingState; + } + + /** + * Get the allDocsFinalTrackingState property: Change tracking state value when indexing finishes on all documents + * in the datasource. + * + * @return the allDocsFinalTrackingState value. + */ + @Generated + public String getAllDocsFinalTrackingState() { + return this.allDocsFinalTrackingState; + } + + /** + * Get the resetDocsInitialTrackingState property: Change tracking state used when indexing starts on select, reset + * documents in the datasource. + * + * @return the resetDocsInitialTrackingState value. + */ + @Generated + public String getResetDocsInitialTrackingState() { + return this.resetDocsInitialTrackingState; + } + + /** + * Get the resetDocsFinalTrackingState property: Change tracking state value when indexing finishes on select, reset + * documents in the datasource. + * + * @return the resetDocsFinalTrackingState value. + */ + @Generated + public String getResetDocsFinalTrackingState() { + return this.resetDocsFinalTrackingState; + } + + /** + * Get the resyncInitialTrackingState property: Change tracking state used when indexing starts on selective options + * from the datasource. + * + * @return the resyncInitialTrackingState value. + */ + @Generated + public String getResyncInitialTrackingState() { + return this.resyncInitialTrackingState; + } + + /** + * Get the resyncFinalTrackingState property: Change tracking state value when indexing finishes on selective + * options from the datasource. + * + * @return the resyncFinalTrackingState value. + */ + @Generated + public String getResyncFinalTrackingState() { + return this.resyncFinalTrackingState; + } + + /** + * Get the resetDocumentKeys property: The list of document keys that have been reset. The document key is the + * document's unique identifier for the data in the search index. The indexer will prioritize selectively + * re-ingesting these keys. + * + * @return the resetDocumentKeys value. + */ + @Generated + public List getResetDocumentKeys() { + return this.resetDocumentKeys; + } + + /** + * Get the resetDatasourceDocumentIds property: The list of datasource document ids that have been reset. The + * datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize + * selectively re-ingesting these ids. + * + * @return the resetDatasourceDocumentIds value. + */ + @Generated + public List getResetDatasourceDocumentIds() { + return this.resetDatasourceDocumentIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndexerCurrentState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndexerCurrentState if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IndexerCurrentState. + */ + @Generated + public static IndexerCurrentState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndexerCurrentState deserializedIndexerCurrentState = new IndexerCurrentState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("mode".equals(fieldName)) { + deserializedIndexerCurrentState.mode = IndexingMode.fromString(reader.getString()); + } else if ("allDocsInitialTrackingState".equals(fieldName)) { + deserializedIndexerCurrentState.allDocsInitialTrackingState = reader.getString(); + } else if ("allDocsFinalTrackingState".equals(fieldName)) { + deserializedIndexerCurrentState.allDocsFinalTrackingState = reader.getString(); + } else if ("resetDocsInitialTrackingState".equals(fieldName)) { + deserializedIndexerCurrentState.resetDocsInitialTrackingState = reader.getString(); + } else if ("resetDocsFinalTrackingState".equals(fieldName)) { + deserializedIndexerCurrentState.resetDocsFinalTrackingState = reader.getString(); + } else if ("resyncInitialTrackingState".equals(fieldName)) { + deserializedIndexerCurrentState.resyncInitialTrackingState = reader.getString(); + } else if ("resyncFinalTrackingState".equals(fieldName)) { + deserializedIndexerCurrentState.resyncFinalTrackingState = reader.getString(); + } else if ("resetDocumentKeys".equals(fieldName)) { + List resetDocumentKeys = reader.readArray(reader1 -> reader1.getString()); + deserializedIndexerCurrentState.resetDocumentKeys = resetDocumentKeys; + } else if ("resetDatasourceDocumentIds".equals(fieldName)) { + List resetDatasourceDocumentIds = reader.readArray(reader1 -> reader1.getString()); + deserializedIndexerCurrentState.resetDatasourceDocumentIds = resetDatasourceDocumentIds; + } else { + reader.skipChildren(); + } + } + return deserializedIndexerCurrentState; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionResult.java index 68f83180b038b..eff177df245d6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionResult.java @@ -228,6 +228,11 @@ public static IndexerExecutionResult fromJson(JsonReader jsonReader) throws IOEx deserializedIndexerExecutionResult.itemCount = reader.getInt(); } else if ("itemsFailed".equals(fieldName)) { deserializedIndexerExecutionResult.failedItemCount = reader.getInt(); + } else if ("statusDetail".equals(fieldName)) { + deserializedIndexerExecutionResult.statusDetail + = IndexerExecutionStatusDetail.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedIndexerExecutionResult.mode = IndexingMode.fromString(reader.getString()); } else if ("errorMessage".equals(fieldName)) { deserializedIndexerExecutionResult.errorMessage = reader.getString(); } else if ("startTime".equals(fieldName)) { @@ -247,4 +252,36 @@ public static IndexerExecutionResult fromJson(JsonReader jsonReader) throws IOEx return deserializedIndexerExecutionResult; }); } + + /* + * The outcome of this indexer execution. + */ + @Generated + private IndexerExecutionStatusDetail statusDetail; + + /* + * The mode the indexer is running in. + */ + @Generated + private IndexingMode mode; + + /** + * Get the statusDetail property: The outcome of this indexer execution. + * + * @return the statusDetail value. + */ + @Generated + public IndexerExecutionStatusDetail getStatusDetail() { + return this.statusDetail; + } + + /** + * Get the mode property: The mode the indexer is running in. + * + * @return the mode value. + */ + @Generated + public IndexingMode getMode() { + return this.mode; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatusDetail.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatusDetail.java new file mode 100644 index 0000000000000..bd505ea497052 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexerExecutionStatusDetail.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Details the status of an individual indexer execution. + */ +public final class IndexerExecutionStatusDetail extends ExpandableStringEnum { + + /** + * Indicates that the reset that occurred was for a call to ResetDocs. + */ + @Generated + public static final IndexerExecutionStatusDetail RESET_DOCS = fromString("resetDocs"); + + /** + * Indicates to selectively resync based on option(s) from data source. + */ + @Generated + public static final IndexerExecutionStatusDetail RESYNC = fromString("resync"); + + /** + * Creates a new instance of IndexerExecutionStatusDetail value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public IndexerExecutionStatusDetail() { + } + + /** + * Creates or finds a IndexerExecutionStatusDetail from its string representation. + * + * @param name a name to look for. + * @return the corresponding IndexerExecutionStatusDetail. + */ + @Generated + public static IndexerExecutionStatusDetail fromString(String name) { + return fromString(name, IndexerExecutionStatusDetail.class); + } + + /** + * Gets known IndexerExecutionStatusDetail values. + * + * @return known IndexerExecutionStatusDetail values. + */ + @Generated + public static Collection values() { + return values(IndexerExecutionStatusDetail.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexingMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexingMode.java new file mode 100644 index 0000000000000..f3330dcbb59e0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexingMode.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the mode the indexer is executing in. + */ +public final class IndexingMode extends ExpandableStringEnum { + + /** + * The indexer is indexing all documents in the datasource. + */ + @Generated + public static final IndexingMode INDEXING_ALL_DOCS = fromString("indexingAllDocs"); + + /** + * The indexer is indexing selective, reset documents in the datasource. The documents being indexed are defined on + * indexer status. + */ + @Generated + public static final IndexingMode INDEXING_RESET_DOCS = fromString("indexingResetDocs"); + + /** + * The indexer is resyncing and indexing selective option(s) from the datasource. + */ + @Generated + public static final IndexingMode INDEXING_RESYNC = fromString("indexingResync"); + + /** + * Creates a new instance of IndexingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public IndexingMode() { + } + + /** + * Creates or finds a IndexingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IndexingMode. + */ + @Generated + public static IndexingMode fromString(String name) { + return fromString(name, IndexingMode.class); + } + + /** + * Gets known IndexingMode values. + * + * @return known IndexingMode values. + */ + @Generated + public static Collection values() { + return values(IndexingMode.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseRetrieveDefaults.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseRetrieveDefaults.java new file mode 100644 index 0000000000000..41683334122de --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeBaseRetrieveDefaults.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Persisted request-wide defaults for knowledge base retrieve requests. Each value provides the default for the + * matching retrieve-request field; service defaults apply when unset, and request-time values take precedence when + * present. + */ +@Fluent +public final class KnowledgeBaseRetrieveDefaults implements JsonSerializable { + + /* + * The default maximum runtime in seconds for a retrieve request. + */ + @Generated + private Integer maxRuntimeInSeconds; + + /* + * The default maximum number of documents in the retrieve output. + */ + @Generated + private Integer maxOutputDocuments; + + /* + * The default maximum size, in tokens, of the content in the retrieve output. + */ + @Generated + private Integer maxOutputSizeInTokens; + + /** + * Creates an instance of KnowledgeBaseRetrieveDefaults class. + */ + @Generated + public KnowledgeBaseRetrieveDefaults() { + } + + /** + * Get the maxRuntimeInSeconds property: The default maximum runtime in seconds for a retrieve request. + * + * @return the maxRuntimeInSeconds value. + */ + @Generated + public Integer getMaxRuntimeInSeconds() { + return this.maxRuntimeInSeconds; + } + + /** + * Set the maxRuntimeInSeconds property: The default maximum runtime in seconds for a retrieve request. + * + * @param maxRuntimeInSeconds the maxRuntimeInSeconds value to set. + * @return the KnowledgeBaseRetrieveDefaults object itself. + */ + @Generated + public KnowledgeBaseRetrieveDefaults setMaxRuntimeInSeconds(Integer maxRuntimeInSeconds) { + this.maxRuntimeInSeconds = maxRuntimeInSeconds; + return this; + } + + /** + * Get the maxOutputDocuments property: The default maximum number of documents in the retrieve output. + * + * @return the maxOutputDocuments value. + */ + @Generated + public Integer getMaxOutputDocuments() { + return this.maxOutputDocuments; + } + + /** + * Set the maxOutputDocuments property: The default maximum number of documents in the retrieve output. + * + * @param maxOutputDocuments the maxOutputDocuments value to set. + * @return the KnowledgeBaseRetrieveDefaults object itself. + */ + @Generated + public KnowledgeBaseRetrieveDefaults setMaxOutputDocuments(Integer maxOutputDocuments) { + this.maxOutputDocuments = maxOutputDocuments; + return this; + } + + /** + * Get the maxOutputSizeInTokens property: The default maximum size, in tokens, of the content in the retrieve + * output. + * + * @return the maxOutputSizeInTokens value. + */ + @Generated + public Integer getMaxOutputSizeInTokens() { + return this.maxOutputSizeInTokens; + } + + /** + * Set the maxOutputSizeInTokens property: The default maximum size, in tokens, of the content in the retrieve + * output. + * + * @param maxOutputSizeInTokens the maxOutputSizeInTokens value to set. + * @return the KnowledgeBaseRetrieveDefaults object itself. + */ + @Generated + public KnowledgeBaseRetrieveDefaults setMaxOutputSizeInTokens(Integer maxOutputSizeInTokens) { + this.maxOutputSizeInTokens = maxOutputSizeInTokens; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRuntimeInSeconds", this.maxRuntimeInSeconds); + jsonWriter.writeNumberField("maxOutputDocuments", this.maxOutputDocuments); + jsonWriter.writeNumberField("maxOutputSizeInTokens", this.maxOutputSizeInTokens); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseRetrieveDefaults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseRetrieveDefaults if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseRetrieveDefaults. + */ + @Generated + public static KnowledgeBaseRetrieveDefaults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseRetrieveDefaults deserializedKnowledgeBaseRetrieveDefaults + = new KnowledgeBaseRetrieveDefaults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("maxRuntimeInSeconds".equals(fieldName)) { + deserializedKnowledgeBaseRetrieveDefaults.maxRuntimeInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("maxOutputDocuments".equals(fieldName)) { + deserializedKnowledgeBaseRetrieveDefaults.maxOutputDocuments + = reader.getNullable(JsonReader::getInt); + } else if ("maxOutputSizeInTokens".equals(fieldName)) { + deserializedKnowledgeBaseRetrieveDefaults.maxOutputSizeInTokens + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseRetrieveDefaults; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSource.java index d620d392c874b..ca85249cf69b8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSource.java @@ -171,6 +171,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("resultsProcessing", + this.resultsProcessing == null ? null : this.resultsProcessing.toString()); jsonWriter.writeStringField("@odata.etag", this.eTag); jsonWriter.writeJsonField("encryptionKey", this.encryptionKey); return jsonWriter.writeEndObject(); @@ -217,6 +219,16 @@ public static KnowledgeSource fromJson(JsonReader jsonReader) throws IOException return FileKnowledgeSource.fromJson(readerToUse.reset()); } else if ("web".equals(discriminatorValue)) { return WebKnowledgeSource.fromJson(readerToUse.reset()); + } else if ("remoteSharePoint".equals(discriminatorValue)) { + return RemoteSharePointKnowledgeSource.fromJson(readerToUse.reset()); + } else if ("workIQ".equals(discriminatorValue)) { + return WorkIQKnowledgeSource.fromJson(readerToUse.reset()); + } else if ("mcpServer".equals(discriminatorValue)) { + return McpServerKnowledgeSource.fromJson(readerToUse.reset()); + } else if ("fabricDataAgent".equals(discriminatorValue)) { + return FabricDataAgentKnowledgeSource.fromJson(readerToUse.reset()); + } else if ("fabricOntology".equals(discriminatorValue)) { + return FabricOntologyKnowledgeSource.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -230,6 +242,7 @@ static KnowledgeSource fromJsonKnownDiscriminator(JsonReader jsonReader) throws String name = null; KnowledgeSourceKind kind = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -241,6 +254,8 @@ static KnowledgeSource fromJsonKnownDiscriminator(JsonReader jsonReader) throws kind = KnowledgeSourceKind.fromString(reader.getString()); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -252,9 +267,41 @@ static KnowledgeSource fromJsonKnownDiscriminator(JsonReader jsonReader) throws KnowledgeSource deserializedKnowledgeSource = new KnowledgeSource(name); deserializedKnowledgeSource.kind = kind; deserializedKnowledgeSource.description = description; + deserializedKnowledgeSource.resultsProcessing = resultsProcessing; deserializedKnowledgeSource.eTag = eTag; deserializedKnowledgeSource.encryptionKey = encryptionKey; return deserializedKnowledgeSource; }); } + + /* + * Controls whether results from this knowledge source are reranked before they are included in the final result + * set. Defaults to 'rerank' when not specified. + */ + @Generated + private KnowledgeSourceResultsProcessing resultsProcessing; + + /** + * Get the resultsProcessing property: Controls whether results from this knowledge source are reranked before they + * are included in the final result set. Defaults to 'rerank' when not specified. + * + * @return the resultsProcessing value. + */ + @Generated + public KnowledgeSourceResultsProcessing getResultsProcessing() { + return this.resultsProcessing; + } + + /** + * Set the resultsProcessing property: Controls whether results from this knowledge source are reranked before they + * are included in the final result set. Defaults to 'rerank' when not specified. + * + * @param resultsProcessing the resultsProcessing value to set. + * @return the KnowledgeSource object itself. + */ + @Generated + public KnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + this.resultsProcessing = resultsProcessing; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java index cf86c5fd4bb3e..3de6e8a9fbf0c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceIngestionPermissionOption.java @@ -31,6 +31,12 @@ public final class KnowledgeSourceIngestionPermissionOption @Generated public static final KnowledgeSourceIngestionPermissionOption RBAC_SCOPE = fromString("rbacScope"); + /** + * Ingest Microsoft Purview sensitivity labels alongside document content. + */ + @Generated + public static final KnowledgeSourceIngestionPermissionOption SENSITIVITY_LABELS = fromString("sensitivityLabels"); + /** * Creates a new instance of KnowledgeSourceIngestionPermissionOption value. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceKind.java index 30df0c1812a43..54d1f571d8c8c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceKind.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceKind.java @@ -80,9 +80,39 @@ public static Collection values() { @Generated public static final KnowledgeSourceKind INDEXED_SQL = fromString("indexedSql"); + /** + * A knowledge source that reads data from remote SharePoint. + */ + @Generated + public static final KnowledgeSourceKind REMOTE_SHARE_POINT = fromString("remoteSharePoint"); + + /** + * A knowledge source that reads data from work IQ. + */ + @Generated + public static final KnowledgeSourceKind WORK_IQ = fromString("workIQ"); + /** * A knowledge source that supports direct file upload and indexing. */ @Generated public static final KnowledgeSourceKind FILE = fromString("file"); + + /** + * A knowledge source backed by an MCP (Model Context Protocol) server. + */ + @Generated + public static final KnowledgeSourceKind MCP_SERVER = fromString("mcpServer"); + + /** + * A knowledge source that retrieves data from a Fabric Data Agent. + */ + @Generated + public static final KnowledgeSourceKind FABRIC_DATA_AGENT = fromString("fabricDataAgent"); + + /** + * A knowledge source that retrieves data from Microsoft Fabric Ontology ontologies. + */ + @Generated + public static final KnowledgeSourceKind FABRIC_ONTOLOGY = fromString("fabricOntology"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceReference.java index 77496d74439ee..96a77da440f23 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceReference.java @@ -3,8 +3,8 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.search.documents.indexes.models; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Reference to a knowledge source. */ -@Immutable +@Fluent public final class KnowledgeSourceReference implements JsonSerializable { /* @@ -51,6 +51,8 @@ public String getName() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("enableImageServing", this.enableImageServing); + jsonWriter.writeBooleanField("enableFreshness", this.enableFreshness); return jsonWriter.writeEndObject(); } @@ -67,16 +69,89 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static KnowledgeSourceReference fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String name = null; + Boolean enableImageServing = null; + Boolean enableFreshness = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("name".equals(fieldName)) { name = reader.getString(); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); + } else if ("enableFreshness".equals(fieldName)) { + enableFreshness = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } } - return new KnowledgeSourceReference(name); + KnowledgeSourceReference deserializedKnowledgeSourceReference = new KnowledgeSourceReference(name); + deserializedKnowledgeSourceReference.enableImageServing = enableImageServing; + deserializedKnowledgeSourceReference.enableFreshness = enableFreshness; + return deserializedKnowledgeSourceReference; }); } + + /* + * Indicates whether image serving should be enabled for this knowledge source. When true, images extracted during + * ingestion are delivered to downstream models at query time. + */ + @Generated + private Boolean enableImageServing; + + /* + * Indicates whether freshness-aware retrieval should be enabled for this knowledge source. When true, a freshness + * scoring profile is applied during retrieval to bias results toward newer documents. + */ + @Generated + private Boolean enableFreshness; + + /** + * Get the enableImageServing property: Indicates whether image serving should be enabled for this knowledge source. + * When true, images extracted during ingestion are delivered to downstream models at query time. + * + * @return the enableImageServing value. + */ + @Generated + public Boolean isEnableImageServing() { + return this.enableImageServing; + } + + /** + * Set the enableImageServing property: Indicates whether image serving should be enabled for this knowledge source. + * When true, images extracted during ingestion are delivered to downstream models at query time. + * + * @param enableImageServing the enableImageServing value to set. + * @return the KnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeSourceReference setEnableImageServing(Boolean enableImageServing) { + this.enableImageServing = enableImageServing; + return this; + } + + /** + * Get the enableFreshness property: Indicates whether freshness-aware retrieval should be enabled for this + * knowledge source. When true, a freshness scoring profile is applied during retrieval to bias results toward newer + * documents. + * + * @return the enableFreshness value. + */ + @Generated + public Boolean isEnableFreshness() { + return this.enableFreshness; + } + + /** + * Set the enableFreshness property: Indicates whether freshness-aware retrieval should be enabled for this + * knowledge source. When true, a freshness scoring profile is applied during retrieval to bias results toward newer + * documents. + * + * @param enableFreshness the enableFreshness value to set. + * @return the KnowledgeSourceReference object itself. + */ + @Generated + public KnowledgeSourceReference setEnableFreshness(Boolean enableFreshness) { + this.enableFreshness = enableFreshness; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceResultsProcessing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceResultsProcessing.java new file mode 100644 index 0000000000000..b8444bb3edfa0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/KnowledgeSourceResultsProcessing.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Controls whether a knowledge source's results are reranked. + */ +public final class KnowledgeSourceResultsProcessing extends ExpandableStringEnum { + + /** + * Results from this knowledge source go through the reranking pipeline. This is the default behavior. + */ + @Generated + public static final KnowledgeSourceResultsProcessing RERANK = fromString("rerank"); + + /** + * Results from this knowledge source bypass reranking and preserve their underlying order. + */ + @Generated + public static final KnowledgeSourceResultsProcessing NONE = fromString("none"); + + /** + * Creates a new instance of KnowledgeSourceResultsProcessing value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public KnowledgeSourceResultsProcessing() { + } + + /** + * Creates or finds a KnowledgeSourceResultsProcessing from its string representation. + * + * @param name a name to look for. + * @return the corresponding KnowledgeSourceResultsProcessing. + */ + @Generated + public static KnowledgeSourceResultsProcessing fromString(String name) { + return fromString(name, KnowledgeSourceResultsProcessing.class); + } + + /** + * Gets known KnowledgeSourceResultsProcessing values. + * + * @return known KnowledgeSourceResultsProcessing values. + */ + @Generated + public static Collection values() { + return values(KnowledgeSourceResultsProcessing.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthentication.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthentication.java new file mode 100644 index 0000000000000..174dda77cd18e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthentication.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Authentication configuration for an MCP server knowledge source. + */ +@Immutable +public class McpServerAuthentication implements JsonSerializable { + + /* + * The kind of authentication to use. + */ + @Generated + private McpServerAuthenticationKind kind = McpServerAuthenticationKind.fromString("McpServerAuthentication"); + + /** + * Creates an instance of McpServerAuthentication class. + */ + @Generated + public McpServerAuthentication() { + } + + /** + * Get the kind property: The kind of authentication to use. + * + * @return the kind value. + */ + @Generated + public McpServerAuthenticationKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerAuthentication if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerAuthentication. + */ + @Generated + public static McpServerAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("foundryConnection".equals(discriminatorValue)) { + return McpServerFoundryConnectionAuthentication.fromJson(readerToUse.reset()); + } else if ("storedHeaders".equals(discriminatorValue)) { + return McpServerStoredHeadersAuthentication.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static McpServerAuthentication fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerAuthentication deserializedMcpServerAuthentication = new McpServerAuthentication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedMcpServerAuthentication.kind + = McpServerAuthenticationKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerAuthentication; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthenticationKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthenticationKind.java new file mode 100644 index 0000000000000..a35b989972b96 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAuthenticationKind.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of authentication for an MCP server. + */ +public final class McpServerAuthenticationKind extends ExpandableStringEnum { + + /** + * Authenticate using an Azure AI Foundry connection. + */ + @Generated + public static final McpServerAuthenticationKind FOUNDRY_CONNECTION = fromString("foundryConnection"); + + /** + * Authenticate using stored HTTP headers. + */ + @Generated + public static final McpServerAuthenticationKind STORED_HEADERS = fromString("storedHeaders"); + + /** + * Creates a new instance of McpServerAuthenticationKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public McpServerAuthenticationKind() { + } + + /** + * Creates or finds a McpServerAuthenticationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding McpServerAuthenticationKind. + */ + @Generated + public static McpServerAuthenticationKind fromString(String name) { + return fromString(name, McpServerAuthenticationKind.class); + } + + /** + * Gets known McpServerAuthenticationKind values. + * + * @return known McpServerAuthenticationKind values. + */ + @Generated + public static Collection values() { + return values(McpServerAuthenticationKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAutoOutputParsing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAutoOutputParsing.java new file mode 100644 index 0000000000000..75f33e2af3df4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerAutoOutputParsing.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Automatically detect the output format and parse accordingly. + */ +@Immutable +public final class McpServerAutoOutputParsing extends McpServerOutputParsing { + + /* + * The kind of output parsing to apply. + */ + @Generated + private McpServerOutputParsingKind kind = McpServerOutputParsingKind.AUTO; + + /** + * Creates an instance of McpServerAutoOutputParsing class. + */ + @Generated + public McpServerAutoOutputParsing() { + } + + /** + * Get the kind property: The kind of output parsing to apply. + * + * @return the kind value. + */ + @Generated + @Override + public McpServerOutputParsingKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerAutoOutputParsing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerAutoOutputParsing if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerAutoOutputParsing. + */ + @Generated + public static McpServerAutoOutputParsing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerAutoOutputParsing deserializedMcpServerAutoOutputParsing = new McpServerAutoOutputParsing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedMcpServerAutoOutputParsing.kind + = McpServerOutputParsingKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerAutoOutputParsing; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionAuthentication.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionAuthentication.java new file mode 100644 index 0000000000000..cf56260ee5bc5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionAuthentication.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Authentication using an Azure AI Foundry connection. + */ +@Immutable +public final class McpServerFoundryConnectionAuthentication extends McpServerAuthentication { + + /* + * The kind of authentication to use. + */ + @Generated + private McpServerAuthenticationKind kind = McpServerAuthenticationKind.FOUNDRY_CONNECTION; + + /* + * Parameters for Foundry connection authentication. + */ + @Generated + private final McpServerFoundryConnectionParameters foundryConnectionParameters; + + /** + * Creates an instance of McpServerFoundryConnectionAuthentication class. + * + * @param foundryConnectionParameters the foundryConnectionParameters value to set. + */ + @Generated + public McpServerFoundryConnectionAuthentication(McpServerFoundryConnectionParameters foundryConnectionParameters) { + this.foundryConnectionParameters = foundryConnectionParameters; + } + + /** + * Get the kind property: The kind of authentication to use. + * + * @return the kind value. + */ + @Generated + @Override + public McpServerAuthenticationKind getKind() { + return this.kind; + } + + /** + * Get the foundryConnectionParameters property: Parameters for Foundry connection authentication. + * + * @return the foundryConnectionParameters value. + */ + @Generated + public McpServerFoundryConnectionParameters getFoundryConnectionParameters() { + return this.foundryConnectionParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("foundryConnectionParameters", this.foundryConnectionParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerFoundryConnectionAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerFoundryConnectionAuthentication if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerFoundryConnectionAuthentication. + */ + @Generated + public static McpServerFoundryConnectionAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerFoundryConnectionParameters foundryConnectionParameters = null; + McpServerAuthenticationKind kind = McpServerAuthenticationKind.FOUNDRY_CONNECTION; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("foundryConnectionParameters".equals(fieldName)) { + foundryConnectionParameters = McpServerFoundryConnectionParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = McpServerAuthenticationKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + McpServerFoundryConnectionAuthentication deserializedMcpServerFoundryConnectionAuthentication + = new McpServerFoundryConnectionAuthentication(foundryConnectionParameters); + deserializedMcpServerFoundryConnectionAuthentication.kind = kind; + return deserializedMcpServerFoundryConnectionAuthentication; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionParameters.java new file mode 100644 index 0000000000000..52e9ae878d811 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerFoundryConnectionParameters.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for Foundry connection authentication. + */ +@Fluent +public final class McpServerFoundryConnectionParameters + implements JsonSerializable { + + /* + * The Azure AI Foundry connection identifier. + */ + @Generated + private String connectionId; + + /** + * Creates an instance of McpServerFoundryConnectionParameters class. + */ + @Generated + public McpServerFoundryConnectionParameters() { + } + + /** + * Get the connectionId property: The Azure AI Foundry connection identifier. + * + * @return the connectionId value. + */ + @Generated + public String getConnectionId() { + return this.connectionId; + } + + /** + * Set the connectionId property: The Azure AI Foundry connection identifier. + * + * @param connectionId the connectionId value to set. + * @return the McpServerFoundryConnectionParameters object itself. + */ + @Generated + public McpServerFoundryConnectionParameters setConnectionId(String connectionId) { + this.connectionId = connectionId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectionId", this.connectionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerFoundryConnectionParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerFoundryConnectionParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerFoundryConnectionParameters. + */ + @Generated + public static McpServerFoundryConnectionParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerFoundryConnectionParameters deserializedMcpServerFoundryConnectionParameters + = new McpServerFoundryConnectionParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("connectionId".equals(fieldName)) { + deserializedMcpServerFoundryConnectionParameters.connectionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerFoundryConnectionParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerHeaders.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerHeaders.java new file mode 100644 index 0000000000000..d21a470d7de16 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerHeaders.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * A dictionary of HTTP header names and values. + */ +@Fluent +public final class McpServerHeaders implements JsonSerializable { + + /* + * A dictionary of HTTP header names and values. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of McpServerHeaders class. + */ + @Generated + public McpServerHeaders() { + } + + /** + * Get the additionalProperties property: A dictionary of HTTP header names and values. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: A dictionary of HTTP header names and values. + * + * @param additionalProperties the additionalProperties value to set. + * @return the McpServerHeaders object itself. + */ + @Generated + public McpServerHeaders setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerHeaders from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerHeaders if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerHeaders. + */ + @Generated + public static McpServerHeaders fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerHeaders deserializedMcpServerHeaders = new McpServerHeaders(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.getString()); + } + deserializedMcpServerHeaders.additionalProperties = additionalProperties; + return deserializedMcpServerHeaders; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerJsonOutputParsing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerJsonOutputParsing.java new file mode 100644 index 0000000000000..b104a3edb6e7b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerJsonOutputParsing.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parse the output as a JSON document using the configured JSON parameters. + */ +@Immutable +public final class McpServerJsonOutputParsing extends McpServerOutputParsing { + + /* + * The kind of output parsing to apply. + */ + @Generated + private McpServerOutputParsingKind kind = McpServerOutputParsingKind.JSON; + + /* + * Parameters for JSON output parsing. Required when kind is 'json'. + */ + @Generated + private final McpServerOutputParsingJsonParameters jsonParameters; + + /** + * Creates an instance of McpServerJsonOutputParsing class. + * + * @param jsonParameters the jsonParameters value to set. + */ + @Generated + public McpServerJsonOutputParsing(McpServerOutputParsingJsonParameters jsonParameters) { + this.jsonParameters = jsonParameters; + } + + /** + * Get the kind property: The kind of output parsing to apply. + * + * @return the kind value. + */ + @Generated + @Override + public McpServerOutputParsingKind getKind() { + return this.kind; + } + + /** + * Get the jsonParameters property: Parameters for JSON output parsing. Required when kind is 'json'. + * + * @return the jsonParameters value. + */ + @Generated + public McpServerOutputParsingJsonParameters getJsonParameters() { + return this.jsonParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("jsonParameters", this.jsonParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerJsonOutputParsing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerJsonOutputParsing if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerJsonOutputParsing. + */ + @Generated + public static McpServerJsonOutputParsing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerOutputParsingJsonParameters jsonParameters = null; + McpServerOutputParsingKind kind = McpServerOutputParsingKind.JSON; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("jsonParameters".equals(fieldName)) { + jsonParameters = McpServerOutputParsingJsonParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = McpServerOutputParsingKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + McpServerJsonOutputParsing deserializedMcpServerJsonOutputParsing + = new McpServerJsonOutputParsing(jsonParameters); + deserializedMcpServerJsonOutputParsing.kind = kind; + return deserializedMcpServerJsonOutputParsing; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSource.java new file mode 100644 index 0000000000000..f8689a3cac568 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSource.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for a knowledge source backed by an MCP (Model Context Protocol) server. + */ +@Fluent +public final class McpServerKnowledgeSource extends KnowledgeSource { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.MCP_SERVER; + + /* + * The parameters for the MCP server knowledge source. + */ + @Generated + private final McpServerKnowledgeSourceParameters mcpServerParameters; + + /** + * Creates an instance of McpServerKnowledgeSource class. + * + * @param name the name value to set. + * @param mcpServerParameters the mcpServerParameters value to set. + */ + @Generated + public McpServerKnowledgeSource(String name, McpServerKnowledgeSourceParameters mcpServerParameters) { + super(name); + this.mcpServerParameters = mcpServerParameters; + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * Get the mcpServerParameters property: The parameters for the MCP server knowledge source. + * + * @return the mcpServerParameters value. + */ + @Generated + public McpServerKnowledgeSourceParameters getMcpServerParameters() { + return this.mcpServerParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSource setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSource setETag(String eTag) { + super.setETag(eTag); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSource setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + super.setEncryptionKey(encryptionKey); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeStringField("@odata.etag", getETag()); + jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); + jsonWriter.writeJsonField("mcpServerParameters", this.mcpServerParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerKnowledgeSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerKnowledgeSource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerKnowledgeSource. + */ + @Generated + public static McpServerKnowledgeSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + String eTag = null; + SearchResourceEncryptionKey encryptionKey = null; + McpServerKnowledgeSourceParameters mcpServerParameters = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.MCP_SERVER; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("@odata.etag".equals(fieldName)) { + eTag = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + encryptionKey = SearchResourceEncryptionKey.fromJson(reader); + } else if ("mcpServerParameters".equals(fieldName)) { + mcpServerParameters = McpServerKnowledgeSourceParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + McpServerKnowledgeSource deserializedMcpServerKnowledgeSource + = new McpServerKnowledgeSource(name, mcpServerParameters); + deserializedMcpServerKnowledgeSource.setDescription(description); + deserializedMcpServerKnowledgeSource.setResultsProcessing(resultsProcessing); + deserializedMcpServerKnowledgeSource.setETag(eTag); + deserializedMcpServerKnowledgeSource.setEncryptionKey(encryptionKey); + deserializedMcpServerKnowledgeSource.kind = kind; + return deserializedMcpServerKnowledgeSource; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSourceParameters.java new file mode 100644 index 0000000000000..87e086835cd8b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerKnowledgeSourceParameters.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for an MCP server knowledge source. + */ +@Fluent +public final class McpServerKnowledgeSourceParameters implements JsonSerializable { + + /* + * The URL of the MCP server endpoint. + */ + @Generated + private final String serverURL; + + /* + * The authentication configuration for the MCP server. + */ + @Generated + private McpServerAuthentication authentication; + + /* + * The list of tools to invoke on the MCP server. + */ + @Generated + private final List tools; + + /** + * Creates an instance of McpServerKnowledgeSourceParameters class. + * + * @param serverURL the serverURL value to set. + * @param tools the tools value to set. + */ + @Generated + public McpServerKnowledgeSourceParameters(String serverURL, List tools) { + this.serverURL = serverURL; + this.tools = tools; + } + + /** + * Get the serverURL property: The URL of the MCP server endpoint. + * + * @return the serverURL value. + */ + @Generated + public String getServerURL() { + return this.serverURL; + } + + /** + * Get the authentication property: The authentication configuration for the MCP server. + * + * @return the authentication value. + */ + @Generated + public McpServerAuthentication getAuthentication() { + return this.authentication; + } + + /** + * Set the authentication property: The authentication configuration for the MCP server. + * + * @param authentication the authentication value to set. + * @return the McpServerKnowledgeSourceParameters object itself. + */ + @Generated + public McpServerKnowledgeSourceParameters setAuthentication(McpServerAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the tools property: The list of tools to invoke on the MCP server. + * + * @return the tools value. + */ + @Generated + public List getTools() { + return this.tools; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serverURL", this.serverURL); + jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("authentication", this.authentication); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerKnowledgeSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerKnowledgeSourceParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerKnowledgeSourceParameters. + */ + @Generated + public static McpServerKnowledgeSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String serverURL = null; + List tools = null; + McpServerAuthentication authentication = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("serverURL".equals(fieldName)) { + serverURL = reader.getString(); + } else if ("tools".equals(fieldName)) { + tools = reader.readArray(reader1 -> McpServerTool.fromJson(reader1)); + } else if ("authentication".equals(fieldName)) { + authentication = McpServerAuthentication.fromJson(reader); + } else { + reader.skipChildren(); + } + } + McpServerKnowledgeSourceParameters deserializedMcpServerKnowledgeSourceParameters + = new McpServerKnowledgeSourceParameters(serverURL, tools); + deserializedMcpServerKnowledgeSourceParameters.authentication = authentication; + return deserializedMcpServerKnowledgeSourceParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerNoneOutputParsing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerNoneOutputParsing.java new file mode 100644 index 0000000000000..10dc9b1138074 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerNoneOutputParsing.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Treat the output as a single block without any parsing. + */ +@Immutable +public final class McpServerNoneOutputParsing extends McpServerOutputParsing { + + /* + * The kind of output parsing to apply. + */ + @Generated + private McpServerOutputParsingKind kind = McpServerOutputParsingKind.NONE; + + /** + * Creates an instance of McpServerNoneOutputParsing class. + */ + @Generated + public McpServerNoneOutputParsing() { + } + + /** + * Get the kind property: The kind of output parsing to apply. + * + * @return the kind value. + */ + @Generated + @Override + public McpServerOutputParsingKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerNoneOutputParsing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerNoneOutputParsing if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerNoneOutputParsing. + */ + @Generated + public static McpServerNoneOutputParsing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerNoneOutputParsing deserializedMcpServerNoneOutputParsing = new McpServerNoneOutputParsing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedMcpServerNoneOutputParsing.kind + = McpServerOutputParsingKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerNoneOutputParsing; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsing.java new file mode 100644 index 0000000000000..2793b1cc4ecc0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsing.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output parsing configuration for an MCP server tool. + */ +@Immutable +public class McpServerOutputParsing implements JsonSerializable { + + /* + * The kind of output parsing to apply. + */ + @Generated + private McpServerOutputParsingKind kind = McpServerOutputParsingKind.fromString("McpServerOutputParsing"); + + /** + * Creates an instance of McpServerOutputParsing class. + */ + @Generated + public McpServerOutputParsing() { + } + + /** + * Get the kind property: The kind of output parsing to apply. + * + * @return the kind value. + */ + @Generated + public McpServerOutputParsingKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerOutputParsing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerOutputParsing if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerOutputParsing. + */ + @Generated + public static McpServerOutputParsing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("auto".equals(discriminatorValue)) { + return McpServerAutoOutputParsing.fromJson(readerToUse.reset()); + } else if ("json".equals(discriminatorValue)) { + return McpServerJsonOutputParsing.fromJson(readerToUse.reset()); + } else if ("split".equals(discriminatorValue)) { + return McpServerSplitOutputParsing.fromJson(readerToUse.reset()); + } else if ("none".equals(discriminatorValue)) { + return McpServerNoneOutputParsing.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static McpServerOutputParsing fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerOutputParsing deserializedMcpServerOutputParsing = new McpServerOutputParsing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedMcpServerOutputParsing.kind = McpServerOutputParsingKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerOutputParsing; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingJsonParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingJsonParameters.java new file mode 100644 index 0000000000000..32e725e6edbae --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingJsonParameters.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for JSON output parsing. + */ +@Fluent +public final class McpServerOutputParsingJsonParameters + implements JsonSerializable { + + /* + * The JSON path to the array of documents in the tool output. + */ + @Generated + private final String documentsPath; + + /* + * Whether to include surrounding context from the JSON output alongside extracted documents. + */ + @Generated + private Boolean includeContext; + + /** + * Creates an instance of McpServerOutputParsingJsonParameters class. + * + * @param documentsPath the documentsPath value to set. + */ + @Generated + public McpServerOutputParsingJsonParameters(String documentsPath) { + this.documentsPath = documentsPath; + } + + /** + * Get the documentsPath property: The JSON path to the array of documents in the tool output. + * + * @return the documentsPath value. + */ + @Generated + public String getDocumentsPath() { + return this.documentsPath; + } + + /** + * Get the includeContext property: Whether to include surrounding context from the JSON output alongside extracted + * documents. + * + * @return the includeContext value. + */ + @Generated + public Boolean isIncludeContext() { + return this.includeContext; + } + + /** + * Set the includeContext property: Whether to include surrounding context from the JSON output alongside extracted + * documents. + * + * @param includeContext the includeContext value to set. + * @return the McpServerOutputParsingJsonParameters object itself. + */ + @Generated + public McpServerOutputParsingJsonParameters setIncludeContext(Boolean includeContext) { + this.includeContext = includeContext; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("documentsPath", this.documentsPath); + jsonWriter.writeBooleanField("includeContext", this.includeContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerOutputParsingJsonParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerOutputParsingJsonParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerOutputParsingJsonParameters. + */ + @Generated + public static McpServerOutputParsingJsonParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String documentsPath = null; + Boolean includeContext = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("documentsPath".equals(fieldName)) { + documentsPath = reader.getString(); + } else if ("includeContext".equals(fieldName)) { + includeContext = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + McpServerOutputParsingJsonParameters deserializedMcpServerOutputParsingJsonParameters + = new McpServerOutputParsingJsonParameters(documentsPath); + deserializedMcpServerOutputParsingJsonParameters.includeContext = includeContext; + return deserializedMcpServerOutputParsingJsonParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingKind.java new file mode 100644 index 0000000000000..c64346e8827b3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingKind.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of output parsing for an MCP server tool. + */ +public final class McpServerOutputParsingKind extends ExpandableStringEnum { + + /** + * Automatically detect the output format and parse accordingly. + */ + @Generated + public static final McpServerOutputParsingKind AUTO = fromString("auto"); + + /** + * Parse the output as a JSON document using the configured JSON parameters. + */ + @Generated + public static final McpServerOutputParsingKind JSON = fromString("json"); + + /** + * Split the output into pages using the configured split parameters. + */ + @Generated + public static final McpServerOutputParsingKind SPLIT = fromString("split"); + + /** + * Treat the output as a single block without any parsing. + */ + @Generated + public static final McpServerOutputParsingKind NONE = fromString("none"); + + /** + * Creates a new instance of McpServerOutputParsingKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public McpServerOutputParsingKind() { + } + + /** + * Creates or finds a McpServerOutputParsingKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding McpServerOutputParsingKind. + */ + @Generated + public static McpServerOutputParsingKind fromString(String name) { + return fromString(name, McpServerOutputParsingKind.class); + } + + /** + * Gets known McpServerOutputParsingKind values. + * + * @return known McpServerOutputParsingKind values. + */ + @Generated + public static Collection values() { + return values(McpServerOutputParsingKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingSplitParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingSplitParameters.java new file mode 100644 index 0000000000000..4137dadfa7448 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerOutputParsingSplitParameters.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for split output parsing. + */ +@Fluent +public final class McpServerOutputParsingSplitParameters + implements JsonSerializable { + + /* + * The text split mode to use. + */ + @Generated + private TextSplitMode textSplitMode; + + /* + * The maximum number of characters per page. + */ + @Generated + private Integer maximumPageLength; + + /* + * The number of characters to overlap between pages. + */ + @Generated + private Integer pageOverlapLength; + + /* + * The maximum number of pages to take from the output. + */ + @Generated + private Integer maximumPagesToTake; + + /* + * A value indicating which language code to use. Default is `en`. + */ + @Generated + private SplitSkillLanguage defaultLanguageCode; + + /** + * Creates an instance of McpServerOutputParsingSplitParameters class. + */ + @Generated + public McpServerOutputParsingSplitParameters() { + } + + /** + * Get the textSplitMode property: The text split mode to use. + * + * @return the textSplitMode value. + */ + @Generated + public TextSplitMode getTextSplitMode() { + return this.textSplitMode; + } + + /** + * Set the textSplitMode property: The text split mode to use. + * + * @param textSplitMode the textSplitMode value to set. + * @return the McpServerOutputParsingSplitParameters object itself. + */ + @Generated + public McpServerOutputParsingSplitParameters setTextSplitMode(TextSplitMode textSplitMode) { + this.textSplitMode = textSplitMode; + return this; + } + + /** + * Get the maximumPageLength property: The maximum number of characters per page. + * + * @return the maximumPageLength value. + */ + @Generated + public Integer getMaximumPageLength() { + return this.maximumPageLength; + } + + /** + * Set the maximumPageLength property: The maximum number of characters per page. + * + * @param maximumPageLength the maximumPageLength value to set. + * @return the McpServerOutputParsingSplitParameters object itself. + */ + @Generated + public McpServerOutputParsingSplitParameters setMaximumPageLength(Integer maximumPageLength) { + this.maximumPageLength = maximumPageLength; + return this; + } + + /** + * Get the pageOverlapLength property: The number of characters to overlap between pages. + * + * @return the pageOverlapLength value. + */ + @Generated + public Integer getPageOverlapLength() { + return this.pageOverlapLength; + } + + /** + * Set the pageOverlapLength property: The number of characters to overlap between pages. + * + * @param pageOverlapLength the pageOverlapLength value to set. + * @return the McpServerOutputParsingSplitParameters object itself. + */ + @Generated + public McpServerOutputParsingSplitParameters setPageOverlapLength(Integer pageOverlapLength) { + this.pageOverlapLength = pageOverlapLength; + return this; + } + + /** + * Get the maximumPagesToTake property: The maximum number of pages to take from the output. + * + * @return the maximumPagesToTake value. + */ + @Generated + public Integer getMaximumPagesToTake() { + return this.maximumPagesToTake; + } + + /** + * Set the maximumPagesToTake property: The maximum number of pages to take from the output. + * + * @param maximumPagesToTake the maximumPagesToTake value to set. + * @return the McpServerOutputParsingSplitParameters object itself. + */ + @Generated + public McpServerOutputParsingSplitParameters setMaximumPagesToTake(Integer maximumPagesToTake) { + this.maximumPagesToTake = maximumPagesToTake; + return this; + } + + /** + * Get the defaultLanguageCode property: A value indicating which language code to use. Default is `en`. + * + * @return the defaultLanguageCode value. + */ + @Generated + public SplitSkillLanguage getDefaultLanguageCode() { + return this.defaultLanguageCode; + } + + /** + * Set the defaultLanguageCode property: A value indicating which language code to use. Default is `en`. + * + * @param defaultLanguageCode the defaultLanguageCode value to set. + * @return the McpServerOutputParsingSplitParameters object itself. + */ + @Generated + public McpServerOutputParsingSplitParameters setDefaultLanguageCode(SplitSkillLanguage defaultLanguageCode) { + this.defaultLanguageCode = defaultLanguageCode; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("textSplitMode", this.textSplitMode == null ? null : this.textSplitMode.toString()); + jsonWriter.writeNumberField("maximumPageLength", this.maximumPageLength); + jsonWriter.writeNumberField("pageOverlapLength", this.pageOverlapLength); + jsonWriter.writeNumberField("maximumPagesToTake", this.maximumPagesToTake); + jsonWriter.writeStringField("defaultLanguageCode", + this.defaultLanguageCode == null ? null : this.defaultLanguageCode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerOutputParsingSplitParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerOutputParsingSplitParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerOutputParsingSplitParameters. + */ + @Generated + public static McpServerOutputParsingSplitParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerOutputParsingSplitParameters deserializedMcpServerOutputParsingSplitParameters + = new McpServerOutputParsingSplitParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("textSplitMode".equals(fieldName)) { + deserializedMcpServerOutputParsingSplitParameters.textSplitMode + = TextSplitMode.fromString(reader.getString()); + } else if ("maximumPageLength".equals(fieldName)) { + deserializedMcpServerOutputParsingSplitParameters.maximumPageLength + = reader.getNullable(JsonReader::getInt); + } else if ("pageOverlapLength".equals(fieldName)) { + deserializedMcpServerOutputParsingSplitParameters.pageOverlapLength + = reader.getNullable(JsonReader::getInt); + } else if ("maximumPagesToTake".equals(fieldName)) { + deserializedMcpServerOutputParsingSplitParameters.maximumPagesToTake + = reader.getNullable(JsonReader::getInt); + } else if ("defaultLanguageCode".equals(fieldName)) { + deserializedMcpServerOutputParsingSplitParameters.defaultLanguageCode + = SplitSkillLanguage.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerOutputParsingSplitParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerSplitOutputParsing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerSplitOutputParsing.java new file mode 100644 index 0000000000000..467a9f964c3b0 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerSplitOutputParsing.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Split the output into pages using the configured split parameters. + */ +@Fluent +public final class McpServerSplitOutputParsing extends McpServerOutputParsing { + + /* + * The kind of output parsing to apply. + */ + @Generated + private McpServerOutputParsingKind kind = McpServerOutputParsingKind.SPLIT; + + /* + * Parameters for split output parsing. + */ + @Generated + private McpServerOutputParsingSplitParameters splitParameters; + + /** + * Creates an instance of McpServerSplitOutputParsing class. + */ + @Generated + public McpServerSplitOutputParsing() { + } + + /** + * Get the kind property: The kind of output parsing to apply. + * + * @return the kind value. + */ + @Generated + @Override + public McpServerOutputParsingKind getKind() { + return this.kind; + } + + /** + * Get the splitParameters property: Parameters for split output parsing. + * + * @return the splitParameters value. + */ + @Generated + public McpServerOutputParsingSplitParameters getSplitParameters() { + return this.splitParameters; + } + + /** + * Set the splitParameters property: Parameters for split output parsing. + * + * @param splitParameters the splitParameters value to set. + * @return the McpServerSplitOutputParsing object itself. + */ + @Generated + public McpServerSplitOutputParsing setSplitParameters(McpServerOutputParsingSplitParameters splitParameters) { + this.splitParameters = splitParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("splitParameters", this.splitParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerSplitOutputParsing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerSplitOutputParsing if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerSplitOutputParsing. + */ + @Generated + public static McpServerSplitOutputParsing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerSplitOutputParsing deserializedMcpServerSplitOutputParsing = new McpServerSplitOutputParsing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedMcpServerSplitOutputParsing.kind + = McpServerOutputParsingKind.fromString(reader.getString()); + } else if ("splitParameters".equals(fieldName)) { + deserializedMcpServerSplitOutputParsing.splitParameters + = McpServerOutputParsingSplitParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerSplitOutputParsing; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersAuthentication.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersAuthentication.java new file mode 100644 index 0000000000000..ed7b2af90be67 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersAuthentication.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Authentication using stored HTTP headers. + */ +@Immutable +public final class McpServerStoredHeadersAuthentication extends McpServerAuthentication { + + /* + * The kind of authentication to use. + */ + @Generated + private McpServerAuthenticationKind kind = McpServerAuthenticationKind.STORED_HEADERS; + + /* + * Parameters for stored headers authentication. + */ + @Generated + private final McpServerStoredHeadersParameters storedHeadersParameters; + + /** + * Creates an instance of McpServerStoredHeadersAuthentication class. + * + * @param storedHeadersParameters the storedHeadersParameters value to set. + */ + @Generated + public McpServerStoredHeadersAuthentication(McpServerStoredHeadersParameters storedHeadersParameters) { + this.storedHeadersParameters = storedHeadersParameters; + } + + /** + * Get the kind property: The kind of authentication to use. + * + * @return the kind value. + */ + @Generated + @Override + public McpServerAuthenticationKind getKind() { + return this.kind; + } + + /** + * Get the storedHeadersParameters property: Parameters for stored headers authentication. + * + * @return the storedHeadersParameters value. + */ + @Generated + public McpServerStoredHeadersParameters getStoredHeadersParameters() { + return this.storedHeadersParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storedHeadersParameters", this.storedHeadersParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerStoredHeadersAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerStoredHeadersAuthentication if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerStoredHeadersAuthentication. + */ + @Generated + public static McpServerStoredHeadersAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerStoredHeadersParameters storedHeadersParameters = null; + McpServerAuthenticationKind kind = McpServerAuthenticationKind.STORED_HEADERS; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("storedHeadersParameters".equals(fieldName)) { + storedHeadersParameters = McpServerStoredHeadersParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = McpServerAuthenticationKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + McpServerStoredHeadersAuthentication deserializedMcpServerStoredHeadersAuthentication + = new McpServerStoredHeadersAuthentication(storedHeadersParameters); + deserializedMcpServerStoredHeadersAuthentication.kind = kind; + return deserializedMcpServerStoredHeadersAuthentication; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersParameters.java new file mode 100644 index 0000000000000..f979a8ebecfb3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerStoredHeadersParameters.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for stored headers authentication. + */ +@Fluent +public final class McpServerStoredHeadersParameters implements JsonSerializable { + + /* + * The stored HTTP headers to include in MCP server requests. + */ + @Generated + private McpServerHeaders headers; + + /** + * Creates an instance of McpServerStoredHeadersParameters class. + */ + @Generated + public McpServerStoredHeadersParameters() { + } + + /** + * Get the headers property: The stored HTTP headers to include in MCP server requests. + * + * @return the headers value. + */ + @Generated + public McpServerHeaders getHeaders() { + return this.headers; + } + + /** + * Set the headers property: The stored HTTP headers to include in MCP server requests. + * + * @param headers the headers value to set. + * @return the McpServerStoredHeadersParameters object itself. + */ + @Generated + public McpServerStoredHeadersParameters setHeaders(McpServerHeaders headers) { + this.headers = headers; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("headers", this.headers); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerStoredHeadersParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerStoredHeadersParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerStoredHeadersParameters. + */ + @Generated + public static McpServerStoredHeadersParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerStoredHeadersParameters deserializedMcpServerStoredHeadersParameters + = new McpServerStoredHeadersParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("headers".equals(fieldName)) { + deserializedMcpServerStoredHeadersParameters.headers = McpServerHeaders.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerStoredHeadersParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerTool.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerTool.java new file mode 100644 index 0000000000000..ea44d6e6cc9f7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/McpServerTool.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a single tool within an MCP server knowledge source. + */ +@Fluent +public final class McpServerTool implements JsonSerializable { + + /* + * The name of the MCP tool to invoke. + */ + @Generated + private String name; + + /* + * Optional configuration for parsing the tool's output. + */ + @Generated + private McpServerOutputParsing outputParsing; + + /* + * Optional post-parsing token cap for this tool's output. Must be greater than 0 when specified. + */ + @Generated + private Integer maxOutputTokens; + + /** + * Creates an instance of McpServerTool class. + */ + @Generated + public McpServerTool() { + } + + /** + * Get the name property: The name of the MCP tool to invoke. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The name of the MCP tool to invoke. + * + * @param name the name value to set. + * @return the McpServerTool object itself. + */ + @Generated + public McpServerTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the outputParsing property: Optional configuration for parsing the tool's output. + * + * @return the outputParsing value. + */ + @Generated + public McpServerOutputParsing getOutputParsing() { + return this.outputParsing; + } + + /** + * Set the outputParsing property: Optional configuration for parsing the tool's output. + * + * @param outputParsing the outputParsing value to set. + * @return the McpServerTool object itself. + */ + @Generated + public McpServerTool setOutputParsing(McpServerOutputParsing outputParsing) { + this.outputParsing = outputParsing; + return this; + } + + /** + * Get the maxOutputTokens property: Optional post-parsing token cap for this tool's output. Must be greater than 0 + * when specified. + * + * @return the maxOutputTokens value. + */ + @Generated + public Integer getMaxOutputTokens() { + return this.maxOutputTokens; + } + + /** + * Set the maxOutputTokens property: Optional post-parsing token cap for this tool's output. Must be greater than 0 + * when specified. + * + * @param maxOutputTokens the maxOutputTokens value to set. + * @return the McpServerTool object itself. + */ + @Generated + public McpServerTool setMaxOutputTokens(Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("outputParsing", this.outputParsing); + jsonWriter.writeStringField("resultsProcessing", + this.resultsProcessing == null ? null : this.resultsProcessing.toString()); + jsonWriter.writeNumberField("maxOutputTokens", this.maxOutputTokens); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerTool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerTool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the McpServerTool. + */ + @Generated + public static McpServerTool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + McpServerTool deserializedMcpServerTool = new McpServerTool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedMcpServerTool.name = reader.getString(); + } else if ("outputParsing".equals(fieldName)) { + deserializedMcpServerTool.outputParsing = McpServerOutputParsing.fromJson(reader); + } else if ("resultsProcessing".equals(fieldName)) { + deserializedMcpServerTool.resultsProcessing + = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("maxOutputTokens".equals(fieldName)) { + deserializedMcpServerTool.maxOutputTokens = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedMcpServerTool; + }); + } + + /* + * Controls whether the parsed results from this tool are reranked. Defaults to 'rerank' when not specified. + */ + @Generated + private KnowledgeSourceResultsProcessing resultsProcessing; + + /** + * Get the resultsProcessing property: Controls whether the parsed results from this tool are reranked. Defaults to + * 'rerank' when not specified. + * + * @return the resultsProcessing value. + */ + @Generated + public KnowledgeSourceResultsProcessing getResultsProcessing() { + return this.resultsProcessing; + } + + /** + * Set the resultsProcessing property: Controls whether the parsed results from this tool are reranked. Defaults to + * 'rerank' when not specified. + * + * @param resultsProcessing the resultsProcessing value to set. + * @return the McpServerTool object itself. + */ + @Generated + public McpServerTool setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + this.resultsProcessing = resultsProcessing; + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSource.java new file mode 100644 index 0000000000000..7a3d0c3ea4610 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSource.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for remote SharePoint knowledge source. + */ +@Fluent +public final class RemoteSharePointKnowledgeSource extends KnowledgeSource { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.REMOTE_SHARE_POINT; + + /* + * The parameters for the remote SharePoint knowledge source. + */ + @Generated + private RemoteSharePointKnowledgeSourceParameters remoteSharePointParameters; + + /** + * Creates an instance of RemoteSharePointKnowledgeSource class. + * + * @param name the name value to set. + */ + @Generated + public RemoteSharePointKnowledgeSource(String name) { + super(name); + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * Get the remoteSharePointParameters property: The parameters for the remote SharePoint knowledge source. + * + * @return the remoteSharePointParameters value. + */ + @Generated + public RemoteSharePointKnowledgeSourceParameters getRemoteSharePointParameters() { + return this.remoteSharePointParameters; + } + + /** + * Set the remoteSharePointParameters property: The parameters for the remote SharePoint knowledge source. + * + * @param remoteSharePointParameters the remoteSharePointParameters value to set. + * @return the RemoteSharePointKnowledgeSource object itself. + */ + @Generated + public RemoteSharePointKnowledgeSource + setRemoteSharePointParameters(RemoteSharePointKnowledgeSourceParameters remoteSharePointParameters) { + this.remoteSharePointParameters = remoteSharePointParameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSource setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSource setETag(String eTag) { + super.setETag(eTag); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSource setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + super.setEncryptionKey(encryptionKey); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeStringField("@odata.etag", getETag()); + jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("remoteSharePointParameters", this.remoteSharePointParameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteSharePointKnowledgeSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteSharePointKnowledgeSource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RemoteSharePointKnowledgeSource. + */ + @Generated + public static RemoteSharePointKnowledgeSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + String eTag = null; + SearchResourceEncryptionKey encryptionKey = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.REMOTE_SHARE_POINT; + RemoteSharePointKnowledgeSourceParameters remoteSharePointParameters = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("@odata.etag".equals(fieldName)) { + eTag = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + encryptionKey = SearchResourceEncryptionKey.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else if ("remoteSharePointParameters".equals(fieldName)) { + remoteSharePointParameters = RemoteSharePointKnowledgeSourceParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + RemoteSharePointKnowledgeSource deserializedRemoteSharePointKnowledgeSource + = new RemoteSharePointKnowledgeSource(name); + deserializedRemoteSharePointKnowledgeSource.setDescription(description); + deserializedRemoteSharePointKnowledgeSource.setResultsProcessing(resultsProcessing); + deserializedRemoteSharePointKnowledgeSource.setETag(eTag); + deserializedRemoteSharePointKnowledgeSource.setEncryptionKey(encryptionKey); + deserializedRemoteSharePointKnowledgeSource.kind = kind; + deserializedRemoteSharePointKnowledgeSource.remoteSharePointParameters = remoteSharePointParameters; + return deserializedRemoteSharePointKnowledgeSource; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSourceParameters.java new file mode 100644 index 0000000000000..884fe37757353 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/RemoteSharePointKnowledgeSourceParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for remote SharePoint knowledge source. + */ +@Fluent +public final class RemoteSharePointKnowledgeSourceParameters + implements JsonSerializable { + + /* + * Keyword Query Language (KQL) expression with queryable SharePoint properties and attributes to scope the + * retrieval before the query runs. + */ + @Generated + private String filterExpression; + + /* + * A list of metadata fields to be returned for each item in the response. Only retrievable metadata properties can + * be included in this list. By default, no metadata is returned. + */ + @Generated + private List resourceMetadata; + + /* + * Container ID for SharePoint Embedded connection. When this is null, it will use SharePoint Online. + */ + @Generated + private String containerTypeId; + + /** + * Creates an instance of RemoteSharePointKnowledgeSourceParameters class. + */ + @Generated + public RemoteSharePointKnowledgeSourceParameters() { + } + + /** + * Get the filterExpression property: Keyword Query Language (KQL) expression with queryable SharePoint properties + * and attributes to scope the retrieval before the query runs. + * + * @return the filterExpression value. + */ + @Generated + public String getFilterExpression() { + return this.filterExpression; + } + + /** + * Set the filterExpression property: Keyword Query Language (KQL) expression with queryable SharePoint properties + * and attributes to scope the retrieval before the query runs. + * + * @param filterExpression the filterExpression value to set. + * @return the RemoteSharePointKnowledgeSourceParameters object itself. + */ + @Generated + public RemoteSharePointKnowledgeSourceParameters setFilterExpression(String filterExpression) { + this.filterExpression = filterExpression; + return this; + } + + /** + * Get the resourceMetadata property: A list of metadata fields to be returned for each item in the response. Only + * retrievable metadata properties can be included in this list. By default, no metadata is returned. + * + * @return the resourceMetadata value. + */ + @Generated + public List getResourceMetadata() { + return this.resourceMetadata; + } + + /** + * Set the resourceMetadata property: A list of metadata fields to be returned for each item in the response. Only + * retrievable metadata properties can be included in this list. By default, no metadata is returned. + * + * @param resourceMetadata the resourceMetadata value to set. + * @return the RemoteSharePointKnowledgeSourceParameters object itself. + */ + @Generated + public RemoteSharePointKnowledgeSourceParameters setResourceMetadata(List resourceMetadata) { + this.resourceMetadata = resourceMetadata; + return this; + } + + /** + * Get the containerTypeId property: Container ID for SharePoint Embedded connection. When this is null, it will use + * SharePoint Online. + * + * @return the containerTypeId value. + */ + @Generated + public String getContainerTypeId() { + return this.containerTypeId; + } + + /** + * Set the containerTypeId property: Container ID for SharePoint Embedded connection. When this is null, it will use + * SharePoint Online. + * + * @param containerTypeId the containerTypeId value to set. + * @return the RemoteSharePointKnowledgeSourceParameters object itself. + */ + @Generated + public RemoteSharePointKnowledgeSourceParameters setContainerTypeId(String containerTypeId) { + this.containerTypeId = containerTypeId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterExpression", this.filterExpression); + jsonWriter.writeArrayField("resourceMetadata", this.resourceMetadata, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("containerTypeId", this.containerTypeId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteSharePointKnowledgeSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteSharePointKnowledgeSourceParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RemoteSharePointKnowledgeSourceParameters. + */ + @Generated + public static RemoteSharePointKnowledgeSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemoteSharePointKnowledgeSourceParameters deserializedRemoteSharePointKnowledgeSourceParameters + = new RemoteSharePointKnowledgeSourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("filterExpression".equals(fieldName)) { + deserializedRemoteSharePointKnowledgeSourceParameters.filterExpression = reader.getString(); + } else if ("resourceMetadata".equals(fieldName)) { + List resourceMetadata = reader.readArray(reader1 -> reader1.getString()); + deserializedRemoteSharePointKnowledgeSourceParameters.resourceMetadata = resourceMetadata; + } else if ("containerTypeId".equals(fieldName)) { + deserializedRemoteSharePointKnowledgeSourceParameters.containerTypeId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedRemoteSharePointKnowledgeSourceParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java index a162b73e2ab67..d5f1afae435b0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java @@ -627,6 +627,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("vectorSearch", this.vectorSearch); jsonWriter.writeStringField("permissionFilterOption", this.permissionFilterOption == null ? null : this.permissionFilterOption.toString()); + jsonWriter.writeBooleanField("purviewEnabled", this.purviewEnabled); jsonWriter.writeJsonField("sharePointConnectorAppRegistration", this.sharePointConnectorAppRegistration); jsonWriter.writeJsonField("oneLakeSecuritySource", this.oneLakeSecuritySource); jsonWriter.writeStringField("@odata.etag", this.eTag); @@ -663,6 +664,7 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { SemanticSearch semanticSearch = null; VectorSearch vectorSearch = null; SearchIndexPermissionFilterOption permissionFilterOption = null; + Boolean purviewEnabled = null; SharePointConnectorAppRegistration sharePointConnectorAppRegistration = null; OneLakeSecuritySource oneLakeSecuritySource = null; String eTag = null; @@ -705,6 +707,8 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { vectorSearch = VectorSearch.fromJson(reader); } else if ("permissionFilterOption".equals(fieldName)) { permissionFilterOption = SearchIndexPermissionFilterOption.fromString(reader.getString()); + } else if ("purviewEnabled".equals(fieldName)) { + purviewEnabled = reader.getNullable(JsonReader::getBoolean); } else if ("sharePointConnectorAppRegistration".equals(fieldName)) { sharePointConnectorAppRegistration = SharePointConnectorAppRegistration.fromJson(reader); } else if ("oneLakeSecuritySource".equals(fieldName)) { @@ -732,6 +736,7 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { deserializedSearchIndex.semanticSearch = semanticSearch; deserializedSearchIndex.vectorSearch = vectorSearch; deserializedSearchIndex.permissionFilterOption = permissionFilterOption; + deserializedSearchIndex.purviewEnabled = purviewEnabled; deserializedSearchIndex.sharePointConnectorAppRegistration = sharePointConnectorAppRegistration; deserializedSearchIndex.oneLakeSecuritySource = oneLakeSecuritySource; deserializedSearchIndex.eTag = eTag; @@ -745,6 +750,12 @@ public static SearchIndex fromJson(JsonReader jsonReader) throws IOException { @Generated private SearchIndexPermissionFilterOption permissionFilterOption; + /* + * A value indicating whether Purview is enabled for the index. + */ + @Generated + private Boolean purviewEnabled; + /* * Configures a SharePoint connector app registration for the index, enabling document-level permissions from * SharePoint. If provided, the applicationId and federatedCredentialId properties are required. @@ -776,6 +787,28 @@ public SearchIndex setPermissionFilterOption(SearchIndexPermissionFilterOption p return this; } + /** + * Get the purviewEnabled property: A value indicating whether Purview is enabled for the index. + * + * @return the purviewEnabled value. + */ + @Generated + public Boolean isPurviewEnabled() { + return this.purviewEnabled; + } + + /** + * Set the purviewEnabled property: A value indicating whether Purview is enabled for the index. + * + * @param purviewEnabled the purviewEnabled value to set. + * @return the SearchIndex object itself. + */ + @Generated + public SearchIndex setPurviewEnabled(Boolean purviewEnabled) { + this.purviewEnabled = purviewEnabled; + return this; + } + /** * Get the sharePointConnectorAppRegistration property: Configures a SharePoint connector app registration for the * index, enabling document-level permissions from SharePoint. If provided, the applicationId and diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSource.java index b471220fbd939..45c6a83efaa74 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSource.java @@ -100,6 +100,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeJsonField("searchIndexParameters", this.searchIndexParameters); @@ -121,6 +123,7 @@ public static SearchIndexKnowledgeSource fromJson(JsonReader jsonReader) throws return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; SearchIndexKnowledgeSourceParameters searchIndexParameters = null; @@ -132,6 +135,8 @@ public static SearchIndexKnowledgeSource fromJson(JsonReader jsonReader) throws name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -147,10 +152,21 @@ public static SearchIndexKnowledgeSource fromJson(JsonReader jsonReader) throws SearchIndexKnowledgeSource deserializedSearchIndexKnowledgeSource = new SearchIndexKnowledgeSource(name, searchIndexParameters); deserializedSearchIndexKnowledgeSource.setDescription(description); + deserializedSearchIndexKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedSearchIndexKnowledgeSource.setETag(eTag); deserializedSearchIndexKnowledgeSource.setEncryptionKey(encryptionKey); deserializedSearchIndexKnowledgeSource.kind = kind; return deserializedSearchIndexKnowledgeSource; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SearchIndexKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoost.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoost.java new file mode 100644 index 0000000000000..42d00591e232f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoost.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A hint that identifies a condition the query planner can use to influence document ranking. + */ +@Fluent +public class SearchIndexKnowledgeSourceBoost implements JsonSerializable { + + /* + * The kind of boost hint. + */ + @Generated + private SearchIndexKnowledgeSourceBoostKind kind + = SearchIndexKnowledgeSourceBoostKind.fromString("SearchIndexKnowledgeSourceBoost"); + + /* + * Natural-language instructions that explain when and how to apply the boost. + */ + @Generated + private String boostInstructions; + + /** + * Creates an instance of SearchIndexKnowledgeSourceBoost class. + */ + @Generated + public SearchIndexKnowledgeSourceBoost() { + } + + /** + * Get the kind property: The kind of boost hint. + * + * @return the kind value. + */ + @Generated + public SearchIndexKnowledgeSourceBoostKind getKind() { + return this.kind; + } + + /** + * Get the boostInstructions property: Natural-language instructions that explain when and how to apply the boost. + * + * @return the boostInstructions value. + */ + @Generated + public String getBoostInstructions() { + return this.boostInstructions; + } + + /** + * Set the boostInstructions property: Natural-language instructions that explain when and how to apply the boost. + * + * @param boostInstructions the boostInstructions value to set. + * @return the SearchIndexKnowledgeSourceBoost object itself. + */ + @Generated + public SearchIndexKnowledgeSourceBoost setBoostInstructions(String boostInstructions) { + this.boostInstructions = boostInstructions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("boostInstructions", this.boostInstructions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexKnowledgeSourceBoost from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexKnowledgeSourceBoost if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SearchIndexKnowledgeSourceBoost. + */ + @Generated + public static SearchIndexKnowledgeSourceBoost fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("fieldValue".equals(discriminatorValue)) { + return SearchIndexKnowledgeSourceFieldValueBoost.fromJson(readerToUse.reset()); + } else if ("multiWordExpression".equals(discriminatorValue)) { + return SearchIndexKnowledgeSourceMultiWordExpressionBoost.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static SearchIndexKnowledgeSourceBoost fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SearchIndexKnowledgeSourceBoost deserializedSearchIndexKnowledgeSourceBoost + = new SearchIndexKnowledgeSourceBoost(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedSearchIndexKnowledgeSourceBoost.kind + = SearchIndexKnowledgeSourceBoostKind.fromString(reader.getString()); + } else if ("boostInstructions".equals(fieldName)) { + deserializedSearchIndexKnowledgeSourceBoost.boostInstructions = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedSearchIndexKnowledgeSourceBoost; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoostKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoostKind.java new file mode 100644 index 0000000000000..21b08e027286c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceBoostKind.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of boost hint for a search index knowledge source. + */ +public final class SearchIndexKnowledgeSourceBoostKind + extends ExpandableStringEnum { + + /** + * Boost documents based on a field value. + */ + @Generated + public static final SearchIndexKnowledgeSourceBoostKind FIELD_VALUE = fromString("fieldValue"); + + /** + * Boost documents based on a multi-word expression. + */ + @Generated + public static final SearchIndexKnowledgeSourceBoostKind MULTI_WORD_EXPRESSION = fromString("multiWordExpression"); + + /** + * Creates a new instance of SearchIndexKnowledgeSourceBoostKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SearchIndexKnowledgeSourceBoostKind() { + } + + /** + * Creates or finds a SearchIndexKnowledgeSourceBoostKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SearchIndexKnowledgeSourceBoostKind. + */ + @Generated + public static SearchIndexKnowledgeSourceBoostKind fromString(String name) { + return fromString(name, SearchIndexKnowledgeSourceBoostKind.class); + } + + /** + * Gets known SearchIndexKnowledgeSourceBoostKind values. + * + * @return known SearchIndexKnowledgeSourceBoostKind values. + */ + @Generated + public static Collection values() { + return values(SearchIndexKnowledgeSourceBoostKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFieldValueBoost.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFieldValueBoost.java new file mode 100644 index 0000000000000..84bd35f8aa7d6 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceFieldValueBoost.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A hint that boosts documents based on a field value. + */ +@Fluent +public final class SearchIndexKnowledgeSourceFieldValueBoost extends SearchIndexKnowledgeSourceBoost { + + /* + * The kind of boost hint. + */ + @Generated + private SearchIndexKnowledgeSourceBoostKind kind = SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE; + + /* + * The name of the search index field. + */ + @Generated + private final String field; + + /* + * Representative values for the field. + */ + @Generated + private List fieldValues; + + /* + * A multiplier for the document score. Must be a positive number not equal to 1.0. + */ + @Generated + private final double boost; + + /** + * Creates an instance of SearchIndexKnowledgeSourceFieldValueBoost class. + * + * @param field the field value to set. + * @param boost the boost value to set. + */ + @Generated + public SearchIndexKnowledgeSourceFieldValueBoost(String field, double boost) { + this.field = field; + this.boost = boost; + } + + /** + * Get the kind property: The kind of boost hint. + * + * @return the kind value. + */ + @Generated + @Override + public SearchIndexKnowledgeSourceBoostKind getKind() { + return this.kind; + } + + /** + * Get the field property: The name of the search index field. + * + * @return the field value. + */ + @Generated + public String getField() { + return this.field; + } + + /** + * Get the fieldValues property: Representative values for the field. + * + * @return the fieldValues value. + */ + @Generated + public List getFieldValues() { + return this.fieldValues; + } + + /** + * Set the fieldValues property: Representative values for the field. + * + * @param fieldValues the fieldValues value to set. + * @return the SearchIndexKnowledgeSourceFieldValueBoost object itself. + */ + @Generated + public SearchIndexKnowledgeSourceFieldValueBoost setFieldValues(List fieldValues) { + this.fieldValues = fieldValues; + return this; + } + + /** + * Get the boost property: A multiplier for the document score. Must be a positive number not equal to 1.0. + * + * @return the boost value. + */ + @Generated + public double getBoost() { + return this.boost; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SearchIndexKnowledgeSourceFieldValueBoost setBoostInstructions(String boostInstructions) { + super.setBoostInstructions(boostInstructions); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("boostInstructions", getBoostInstructions()); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeDoubleField("boost", this.boost); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("fieldValues", this.fieldValues, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexKnowledgeSourceFieldValueBoost from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexKnowledgeSourceFieldValueBoost if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SearchIndexKnowledgeSourceFieldValueBoost. + */ + @Generated + public static SearchIndexKnowledgeSourceFieldValueBoost fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String boostInstructions = null; + String field = null; + double boost = 0.0; + SearchIndexKnowledgeSourceBoostKind kind = SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE; + List fieldValues = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("boostInstructions".equals(fieldName)) { + boostInstructions = reader.getString(); + } else if ("field".equals(fieldName)) { + field = reader.getString(); + } else if ("boost".equals(fieldName)) { + boost = reader.getDouble(); + } else if ("kind".equals(fieldName)) { + kind = SearchIndexKnowledgeSourceBoostKind.fromString(reader.getString()); + } else if ("fieldValues".equals(fieldName)) { + fieldValues = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + SearchIndexKnowledgeSourceFieldValueBoost deserializedSearchIndexKnowledgeSourceFieldValueBoost + = new SearchIndexKnowledgeSourceFieldValueBoost(field, boost); + deserializedSearchIndexKnowledgeSourceFieldValueBoost.setBoostInstructions(boostInstructions); + deserializedSearchIndexKnowledgeSourceFieldValueBoost.kind = kind; + deserializedSearchIndexKnowledgeSourceFieldValueBoost.fieldValues = fieldValues; + return deserializedSearchIndexKnowledgeSourceFieldValueBoost; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceMultiWordExpressionBoost.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceMultiWordExpressionBoost.java new file mode 100644 index 0000000000000..fcfbd3259b8b1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceMultiWordExpressionBoost.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A hint that boosts documents based on a multi-word expression. + */ +@Fluent +public final class SearchIndexKnowledgeSourceMultiWordExpressionBoost extends SearchIndexKnowledgeSourceBoost { + + /* + * The kind of boost hint. + */ + @Generated + private SearchIndexKnowledgeSourceBoostKind kind = SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION; + + /* + * Representative values for the boost. + */ + @Generated + private List fieldValues; + + /* + * A multiplier for the document score. Must be a positive number not equal to 1.0. + */ + @Generated + private final double boost; + + /** + * Creates an instance of SearchIndexKnowledgeSourceMultiWordExpressionBoost class. + * + * @param boost the boost value to set. + */ + @Generated + public SearchIndexKnowledgeSourceMultiWordExpressionBoost(double boost) { + this.boost = boost; + } + + /** + * Get the kind property: The kind of boost hint. + * + * @return the kind value. + */ + @Generated + @Override + public SearchIndexKnowledgeSourceBoostKind getKind() { + return this.kind; + } + + /** + * Get the fieldValues property: Representative values for the boost. + * + * @return the fieldValues value. + */ + @Generated + public List getFieldValues() { + return this.fieldValues; + } + + /** + * Set the fieldValues property: Representative values for the boost. + * + * @param fieldValues the fieldValues value to set. + * @return the SearchIndexKnowledgeSourceMultiWordExpressionBoost object itself. + */ + @Generated + public SearchIndexKnowledgeSourceMultiWordExpressionBoost setFieldValues(List fieldValues) { + this.fieldValues = fieldValues; + return this; + } + + /** + * Get the boost property: A multiplier for the document score. Must be a positive number not equal to 1.0. + * + * @return the boost value. + */ + @Generated + public double getBoost() { + return this.boost; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SearchIndexKnowledgeSourceMultiWordExpressionBoost setBoostInstructions(String boostInstructions) { + super.setBoostInstructions(boostInstructions); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("boostInstructions", getBoostInstructions()); + jsonWriter.writeDoubleField("boost", this.boost); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("fieldValues", this.fieldValues, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexKnowledgeSourceMultiWordExpressionBoost from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexKnowledgeSourceMultiWordExpressionBoost if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SearchIndexKnowledgeSourceMultiWordExpressionBoost. + */ + @Generated + public static SearchIndexKnowledgeSourceMultiWordExpressionBoost fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + String boostInstructions = null; + double boost = 0.0; + SearchIndexKnowledgeSourceBoostKind kind = SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION; + List fieldValues = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("boostInstructions".equals(fieldName)) { + boostInstructions = reader.getString(); + } else if ("boost".equals(fieldName)) { + boost = reader.getDouble(); + } else if ("kind".equals(fieldName)) { + kind = SearchIndexKnowledgeSourceBoostKind.fromString(reader.getString()); + } else if ("fieldValues".equals(fieldName)) { + fieldValues = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + SearchIndexKnowledgeSourceMultiWordExpressionBoost deserializedSearchIndexKnowledgeSourceMultiWordExpressionBoost + = new SearchIndexKnowledgeSourceMultiWordExpressionBoost(boost); + deserializedSearchIndexKnowledgeSourceMultiWordExpressionBoost.setBoostInstructions(boostInstructions); + deserializedSearchIndexKnowledgeSourceMultiWordExpressionBoost.kind = kind; + deserializedSearchIndexKnowledgeSourceMultiWordExpressionBoost.fieldValues = fieldValues; + return deserializedSearchIndexKnowledgeSourceMultiWordExpressionBoost; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceQueryHints.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceQueryHints.java new file mode 100644 index 0000000000000..396e554965022 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexKnowledgeSourceQueryHints.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Hints that guide query planning toward useful filters and boosts for a search index knowledge source. + */ +@Fluent +public final class SearchIndexKnowledgeSourceQueryHints + implements JsonSerializable { + + /* + * Filter hints that identify fields and representative values the query planner can use when constructing filters. + */ + @Generated + private List filters; + + /* + * Boost hints that identify conditions the query planner can use to influence document ranking. + */ + @Generated + private List boosts; + + /** + * Creates an instance of SearchIndexKnowledgeSourceQueryHints class. + */ + @Generated + public SearchIndexKnowledgeSourceQueryHints() { + } + + /** + * Get the filters property: Filter hints that identify fields and representative values the query planner can use + * when constructing filters. + * + * @return the filters value. + */ + @Generated + public List getFilters() { + return this.filters; + } + + /** + * Set the filters property: Filter hints that identify fields and representative values the query planner can use + * when constructing filters. + * + * @param filters the filters value to set. + * @return the SearchIndexKnowledgeSourceQueryHints object itself. + */ + @Generated + public SearchIndexKnowledgeSourceQueryHints setFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the boosts property: Boost hints that identify conditions the query planner can use to influence document + * ranking. + * + * @return the boosts value. + */ + @Generated + public List getBoosts() { + return this.boosts; + } + + /** + * Set the boosts property: Boost hints that identify conditions the query planner can use to influence document + * ranking. + * + * @param boosts the boosts value to set. + * @return the SearchIndexKnowledgeSourceQueryHints object itself. + */ + @Generated + public SearchIndexKnowledgeSourceQueryHints setBoosts(List boosts) { + this.boosts = boosts; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("boosts", this.boosts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexKnowledgeSourceQueryHints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexKnowledgeSourceQueryHints if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SearchIndexKnowledgeSourceQueryHints. + */ + @Generated + public static SearchIndexKnowledgeSourceQueryHints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SearchIndexKnowledgeSourceQueryHints deserializedSearchIndexKnowledgeSourceQueryHints + = new SearchIndexKnowledgeSourceQueryHints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("filters".equals(fieldName)) { + List filters + = reader.readArray(reader1 -> SearchIndexKnowledgeSourceFilterHint.fromJson(reader1)); + deserializedSearchIndexKnowledgeSourceQueryHints.filters = filters; + } else if ("boosts".equals(fieldName)) { + List boosts + = reader.readArray(reader1 -> SearchIndexKnowledgeSourceBoost.fromJson(reader1)); + deserializedSearchIndexKnowledgeSourceQueryHints.boosts = boosts; + } else { + reader.skipChildren(); + } + } + return deserializedSearchIndexKnowledgeSourceQueryHints; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java index ee3e23d6b6e02..162e1999a0191 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java @@ -401,6 +401,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("disabled", this.isDisabled); jsonWriter.writeStringField("@odata.etag", this.eTag); jsonWriter.writeJsonField("encryptionKey", this.encryptionKey); + jsonWriter.writeJsonField("cache", this.cache); return jsonWriter.writeEndObject(); } @@ -428,6 +429,7 @@ public static SearchIndexer fromJson(JsonReader jsonReader) throws IOException { Boolean isDisabled = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; + SearchIndexerCache cache = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -455,6 +457,8 @@ public static SearchIndexer fromJson(JsonReader jsonReader) throws IOException { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { encryptionKey = SearchResourceEncryptionKey.fromJson(reader); + } else if ("cache".equals(fieldName)) { + cache = SearchIndexerCache.fromJson(reader); } else { reader.skipChildren(); } @@ -469,7 +473,39 @@ public static SearchIndexer fromJson(JsonReader jsonReader) throws IOException { deserializedSearchIndexer.isDisabled = isDisabled; deserializedSearchIndexer.eTag = eTag; deserializedSearchIndexer.encryptionKey = encryptionKey; + deserializedSearchIndexer.cache = cache; return deserializedSearchIndexer; }); } + + /* + * Adds caching to an enrichment pipeline to allow for incremental modification steps without having to rebuild the + * index every time. + */ + @Generated + private SearchIndexerCache cache; + + /** + * Get the cache property: Adds caching to an enrichment pipeline to allow for incremental modification steps + * without having to rebuild the index every time. + * + * @return the cache value. + */ + @Generated + public SearchIndexerCache getCache() { + return this.cache; + } + + /** + * Set the cache property: Adds caching to an enrichment pipeline to allow for incremental modification steps + * without having to rebuild the index every time. + * + * @param cache the cache value to set. + * @return the SearchIndexer object itself. + */ + @Generated + public SearchIndexer setCache(SearchIndexerCache cache) { + this.cache = cache; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerCache.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerCache.java new file mode 100644 index 0000000000000..67fde88b85de3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerCache.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The type of the cache. + */ +@Fluent +public final class SearchIndexerCache implements JsonSerializable { + + /* + * A guid for the SearchIndexerCache. + */ + @Generated + private String id; + + /* + * The connection string to the storage account where the cache data will be persisted. + */ + @Generated + private String storageConnectionString; + + /* + * Specifies whether incremental reprocessing is enabled. + */ + @Generated + private Boolean enableReprocessing; + + /* + * 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. + */ + @Generated + private SearchIndexerDataIdentity identity; + + /** + * Creates an instance of SearchIndexerCache class. + */ + @Generated + public SearchIndexerCache() { + } + + /** + * Get the id property: A guid for the SearchIndexerCache. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Set the id property: A guid for the SearchIndexerCache. + * + * @param id the id value to set. + * @return the SearchIndexerCache object itself. + */ + @Generated + public SearchIndexerCache setId(String id) { + this.id = id; + return this; + } + + /** + * Get the storageConnectionString property: The connection string to the storage account where the cache data will + * be persisted. + * + * @return the storageConnectionString value. + */ + @Generated + public String getStorageConnectionString() { + return this.storageConnectionString; + } + + /** + * Set the storageConnectionString property: The connection string to the storage account where the cache data will + * be persisted. + * + * @param storageConnectionString the storageConnectionString value to set. + * @return the SearchIndexerCache object itself. + */ + @Generated + public SearchIndexerCache setStorageConnectionString(String storageConnectionString) { + this.storageConnectionString = storageConnectionString; + return this; + } + + /** + * Get the enableReprocessing property: Specifies whether incremental reprocessing is enabled. + * + * @return the enableReprocessing value. + */ + @Generated + public Boolean isEnableReprocessing() { + return this.enableReprocessing; + } + + /** + * Set the enableReprocessing property: Specifies whether incremental reprocessing is enabled. + * + * @param enableReprocessing the enableReprocessing value to set. + * @return the SearchIndexerCache object itself. + */ + @Generated + public SearchIndexerCache setEnableReprocessing(Boolean enableReprocessing) { + this.enableReprocessing = enableReprocessing; + return this; + } + + /** + * Get the identity property: 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. + * + * @return the identity value. + */ + @Generated + public SearchIndexerDataIdentity getIdentity() { + return this.identity; + } + + /** + * Set the identity property: 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. + * + * @param identity the identity value to set. + * @return the SearchIndexerCache object itself. + */ + @Generated + public SearchIndexerCache setIdentity(SearchIndexerDataIdentity identity) { + this.identity = identity; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("storageConnectionString", this.storageConnectionString); + jsonWriter.writeBooleanField("enableReprocessing", this.enableReprocessing); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexerCache from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexerCache if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SearchIndexerCache. + */ + @Generated + public static SearchIndexerCache fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SearchIndexerCache deserializedSearchIndexerCache = new SearchIndexerCache(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedSearchIndexerCache.id = reader.getString(); + } else if ("storageConnectionString".equals(fieldName)) { + deserializedSearchIndexerCache.storageConnectionString = reader.getString(); + } else if ("enableReprocessing".equals(fieldName)) { + deserializedSearchIndexerCache.enableReprocessing = reader.getNullable(JsonReader::getBoolean); + } else if ("identity".equals(fieldName)) { + deserializedSearchIndexerCache.identity = SearchIndexerDataIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedSearchIndexerCache; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceConnection.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceConnection.java index 860befbeb7463..4f7d362b30994 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceConnection.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerDataSourceConnection.java @@ -332,6 +332,7 @@ public static SearchIndexerDataSourceConnection fromJson(JsonReader jsonReader) DataSourceCredentials credentials = null; SearchIndexerDataContainer container = null; String description = null; + String subType = null; SearchIndexerDataIdentity identity = null; List indexerPermissionOptions = null; DataChangeDetectionPolicy dataChangeDetectionPolicy = null; @@ -351,6 +352,8 @@ public static SearchIndexerDataSourceConnection fromJson(JsonReader jsonReader) container = SearchIndexerDataContainer.fromJson(reader); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("subType".equals(fieldName)) { + subType = reader.getString(); } else if ("identity".equals(fieldName)) { identity = SearchIndexerDataIdentity.fromJson(reader); } else if ("indexerPermissionOptions".equals(fieldName)) { @@ -371,6 +374,7 @@ public static SearchIndexerDataSourceConnection fromJson(JsonReader jsonReader) SearchIndexerDataSourceConnection deserializedSearchIndexerDataSourceConnection = new SearchIndexerDataSourceConnection(name, type, credentials, container); deserializedSearchIndexerDataSourceConnection.description = description; + deserializedSearchIndexerDataSourceConnection.subType = subType; deserializedSearchIndexerDataSourceConnection.identity = identity; deserializedSearchIndexerDataSourceConnection.indexerPermissionOptions = indexerPermissionOptions; deserializedSearchIndexerDataSourceConnection.dataChangeDetectionPolicy = dataChangeDetectionPolicy; @@ -381,12 +385,30 @@ public static SearchIndexerDataSourceConnection fromJson(JsonReader jsonReader) }); } + /* + * A specific type of the data source, in case the resource is capable of different modalities. For example, + * 'MongoDb' for certain 'cosmosDb' accounts. + */ + @Generated + private String subType; + /* * Ingestion options with various types of permission data. */ @Generated private List indexerPermissionOptions; + /** + * Get the subType property: A specific type of the data source, in case the resource is capable of different + * modalities. For example, 'MongoDb' for certain 'cosmosDb' accounts. + * + * @return the subType value. + */ + @Generated + public String getSubType() { + return this.subType; + } + /** * Get the indexerPermissionOptions property: Ingestion options with various types of permission data. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStore.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStore.java index d129b046659cc..c333043e5b558 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStore.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStore.java @@ -124,6 +124,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("storageConnectionString", this.storageConnectionString); jsonWriter.writeArrayField("projections", this.projections, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("parameters", this.parameters); return jsonWriter.writeEndObject(); } @@ -142,6 +143,7 @@ public static SearchIndexerKnowledgeStore fromJson(JsonReader jsonReader) throws String storageConnectionString = null; List projections = null; SearchIndexerDataIdentity identity = null; + SearchIndexerKnowledgeStoreParameters parameters = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -151,6 +153,8 @@ public static SearchIndexerKnowledgeStore fromJson(JsonReader jsonReader) throws projections = reader.readArray(reader1 -> SearchIndexerKnowledgeStoreProjection.fromJson(reader1)); } else if ("identity".equals(fieldName)) { identity = SearchIndexerDataIdentity.fromJson(reader); + } else if ("parameters".equals(fieldName)) { + parameters = SearchIndexerKnowledgeStoreParameters.fromJson(reader); } else { reader.skipChildren(); } @@ -158,7 +162,39 @@ public static SearchIndexerKnowledgeStore fromJson(JsonReader jsonReader) throws SearchIndexerKnowledgeStore deserializedSearchIndexerKnowledgeStore = new SearchIndexerKnowledgeStore(storageConnectionString, projections); deserializedSearchIndexerKnowledgeStore.identity = identity; + deserializedSearchIndexerKnowledgeStore.parameters = parameters; return deserializedSearchIndexerKnowledgeStore; }); } + + /* + * 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. + */ + @Generated + private SearchIndexerKnowledgeStoreParameters parameters; + + /** + * Get the parameters property: 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. + * + * @return the parameters value. + */ + @Generated + public SearchIndexerKnowledgeStoreParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: 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. + * + * @param parameters the parameters value to set. + * @return the SearchIndexerKnowledgeStore object itself. + */ + @Generated + public SearchIndexerKnowledgeStore setParameters(SearchIndexerKnowledgeStoreParameters parameters) { + this.parameters = parameters; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreParameters.java new file mode 100644 index 0000000000000..2092b614c63f3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerKnowledgeStoreParameters.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * 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. + */ +@Fluent +public final class SearchIndexerKnowledgeStoreParameters + implements JsonSerializable { + + /* + * Whether or not projections should synthesize a generated key name if one isn't already present. + */ + @Generated + private Boolean synthesizeGeneratedKeyName; + + /* + * 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. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of SearchIndexerKnowledgeStoreParameters class. + */ + @Generated + public SearchIndexerKnowledgeStoreParameters() { + } + + /** + * Get the synthesizeGeneratedKeyName property: Whether or not projections should synthesize a generated key name if + * one isn't already present. + * + * @return the synthesizeGeneratedKeyName value. + */ + @Generated + public Boolean isSynthesizeGeneratedKeyName() { + return this.synthesizeGeneratedKeyName; + } + + /** + * Set the synthesizeGeneratedKeyName property: Whether or not projections should synthesize a generated key name if + * one isn't already present. + * + * @param synthesizeGeneratedKeyName the synthesizeGeneratedKeyName value to set. + * @return the SearchIndexerKnowledgeStoreParameters object itself. + */ + @Generated + public SearchIndexerKnowledgeStoreParameters setSynthesizeGeneratedKeyName(Boolean synthesizeGeneratedKeyName) { + this.synthesizeGeneratedKeyName = synthesizeGeneratedKeyName; + return this; + } + + /** + * Get the additionalProperties property: 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. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: 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. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SearchIndexerKnowledgeStoreParameters object itself. + */ + @Generated + public SearchIndexerKnowledgeStoreParameters setAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("synthesizeGeneratedKeyName", this.synthesizeGeneratedKeyName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchIndexerKnowledgeStoreParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchIndexerKnowledgeStoreParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SearchIndexerKnowledgeStoreParameters. + */ + @Generated + public static SearchIndexerKnowledgeStoreParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SearchIndexerKnowledgeStoreParameters deserializedSearchIndexerKnowledgeStoreParameters + = new SearchIndexerKnowledgeStoreParameters(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("synthesizeGeneratedKeyName".equals(fieldName)) { + deserializedSearchIndexerKnowledgeStoreParameters.synthesizeGeneratedKeyName + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedSearchIndexerKnowledgeStoreParameters.additionalProperties = additionalProperties; + return deserializedSearchIndexerKnowledgeStoreParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkill.java index 3ae0bac1d9e70..e8614743f8543 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkill.java @@ -252,8 +252,12 @@ public static SearchIndexerSkill fromJson(JsonReader jsonReader) throws IOExcept return DocumentIntelligenceLayoutSkill.fromJson(readerToUse.reset()); } else if ("#Microsoft.Skills.Custom.WebApiSkill".equals(discriminatorValue)) { return WebApiSkill.fromJson(readerToUse.reset()); + } else if ("#Microsoft.Skills.Custom.AmlSkill".equals(discriminatorValue)) { + return AzureMachineLearningSkill.fromJson(readerToUse.reset()); } else if ("#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill".equals(discriminatorValue)) { return AzureOpenAIEmbeddingSkill.fromJson(readerToUse.reset()); + } else if ("#Microsoft.Skills.Vision.VectorizeSkill".equals(discriminatorValue)) { + return VisionVectorizeSkill.fromJson(readerToUse.reset()); } else if ("#Microsoft.Skills.Util.ContentUnderstandingSkill".equals(discriminatorValue)) { return ContentUnderstandingSkill.fromJson(readerToUse.reset()); } else if ("#Microsoft.Skills.Custom.ChatCompletionSkill".equals(discriminatorValue)) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerStatus.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerStatus.java index a6f186971a880..914db07f615be 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerStatus.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerStatus.java @@ -146,6 +146,8 @@ public static SearchIndexerStatus fromJson(JsonReader jsonReader) throws IOExcep deserializedSearchIndexerStatus.runtime = IndexerRuntime.fromJson(reader); } else if ("lastResult".equals(fieldName)) { deserializedSearchIndexerStatus.lastResult = IndexerExecutionResult.fromJson(reader); + } else if ("currentState".equals(fieldName)) { + deserializedSearchIndexerStatus.currentState = IndexerCurrentState.fromJson(reader); } else { reader.skipChildren(); } @@ -160,6 +162,12 @@ public static SearchIndexerStatus fromJson(JsonReader jsonReader) throws IOExcep @Generated private IndexerRuntime runtime; + /* + * All of the state that defines and dictates the indexer's current execution. + */ + @Generated + private IndexerCurrentState currentState; + /** * Get the runtime property: Snapshot of the indexer's cumulative runtime consumption for the service over the * current UTC period. @@ -170,4 +178,14 @@ public static SearchIndexerStatus fromJson(JsonReader jsonReader) throws IOExcep public IndexerRuntime getRuntime() { return this.runtime; } + + /** + * Get the currentState property: All of the state that defines and dictates the indexer's current execution. + * + * @return the currentState value. + */ + @Generated + public IndexerCurrentState getCurrentState() { + return this.currentState; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchResourceEncryptionKey.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchResourceEncryptionKey.java index a013acdf5f140..39ad615e07bde 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchResourceEncryptionKey.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchResourceEncryptionKey.java @@ -22,7 +22,7 @@ public final class SearchResourceEncryptionKey implements JsonSerializable { + + /** + * Refers to a base model trained with a 50,000 token vocabulary, often used in general natural language processing + * tasks. + */ + @Generated + public static final SplitSkillEncoderModelName R50K_BASE = fromString("r50k_base"); + + /** + * A base model with a 50,000 token vocabulary, optimized for prompt-based tasks. + */ + @Generated + public static final SplitSkillEncoderModelName P50K_BASE = fromString("p50k_base"); + + /** + * Similar to p50k_base but fine-tuned for editing or rephrasing tasks with a 50,000 token vocabulary. + */ + @Generated + public static final SplitSkillEncoderModelName P50K_EDIT = fromString("p50k_edit"); + + /** + * A base model with a 100,000 token vocabulary. + */ + @Generated + public static final SplitSkillEncoderModelName CL100K_BASE = fromString("cl100k_base"); + + /** + * Creates a new instance of SplitSkillEncoderModelName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SplitSkillEncoderModelName() { + } + + /** + * Creates or finds a SplitSkillEncoderModelName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SplitSkillEncoderModelName. + */ + @Generated + public static SplitSkillEncoderModelName fromString(String name) { + return fromString(name, SplitSkillEncoderModelName.class); + } + + /** + * Gets known SplitSkillEncoderModelName values. + * + * @return known SplitSkillEncoderModelName values. + */ + @Generated + public static Collection values() { + return values(SplitSkillEncoderModelName.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SplitSkillUnit.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SplitSkillUnit.java new file mode 100644 index 0000000000000..49e29a34ac1d1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SplitSkillUnit.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A value indicating which unit to use. + */ +public final class SplitSkillUnit extends ExpandableStringEnum { + + /** + * The length will be measured by character. + */ + @Generated + public static final SplitSkillUnit CHARACTERS = fromString("characters"); + + /** + * The length will be measured by an AzureOpenAI tokenizer from the tiktoken library. + */ + @Generated + public static final SplitSkillUnit AZURE_OPEN_AITOKENS = fromString("azureOpenAITokens"); + + /** + * Creates a new instance of SplitSkillUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SplitSkillUnit() { + } + + /** + * Creates or finds a SplitSkillUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding SplitSkillUnit. + */ + @Generated + public static SplitSkillUnit fromString(String name) { + return fromString(name, SplitSkillUnit.class); + } + + /** + * Gets known SplitSkillUnit values. + * + * @return known SplitSkillUnit values. + */ + @Generated + public static Collection values() { + return values(SplitSkillUnit.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java index 59ab5dae09404..80d28ccc9a1c5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java @@ -104,6 +104,10 @@ public static VectorSearchVectorizer fromJson(JsonReader jsonReader) throws IOEx return OpenAICompatibleVectorizer.fromJson(readerToUse.reset()); } else if ("customWebApi".equals(discriminatorValue)) { return WebApiVectorizer.fromJson(readerToUse.reset()); + } else if ("aiServicesVision".equals(discriminatorValue)) { + return AIServicesVisionVectorizer.fromJson(readerToUse.reset()); + } else if ("aml".equals(discriminatorValue)) { + return AzureMachineLearningVectorizer.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VisionVectorizeSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VisionVectorizeSkill.java new file mode 100644 index 0000000000000..aabb41bdd6de8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VisionVectorizeSkill.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Allows you to generate a vector embedding for a given image or text input using the Azure AI Services Vision + * Vectorize API. + */ +@Fluent +public final class VisionVectorizeSkill extends SearchIndexerSkill { + + /* + * The discriminator for derived types. + */ + @Generated + private String odataType = "#Microsoft.Skills.Vision.VectorizeSkill"; + + /* + * The version of the model to use when calling the AI Services Vision service. It will default to the latest + * available when not specified. + */ + @Generated + private final String modelVersion; + + /** + * Creates an instance of VisionVectorizeSkill class. + * + * @param inputs the inputs value to set. + * @param outputs the outputs value to set. + * @param modelVersion the modelVersion value to set. + */ + @Generated + public VisionVectorizeSkill(List inputs, List outputs, + String modelVersion) { + super(inputs, outputs); + this.modelVersion = modelVersion; + } + + /** + * Get the odataType property: The discriminator for derived types. + * + * @return the odataType value. + */ + @Generated + @Override + public String getOdataType() { + return this.odataType; + } + + /** + * Get the modelVersion property: The version of the model to use when calling the AI Services Vision service. It + * will default to the latest available when not specified. + * + * @return the modelVersion value. + */ + @Generated + public String getModelVersion() { + return this.modelVersion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VisionVectorizeSkill setName(String name) { + super.setName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VisionVectorizeSkill setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public VisionVectorizeSkill setContext(String context) { + super.setContext(context); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("inputs", getInputs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("outputs", getOutputs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("context", getContext()); + jsonWriter.writeStringField("modelVersion", this.modelVersion); + jsonWriter.writeStringField("@odata.type", this.odataType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VisionVectorizeSkill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VisionVectorizeSkill if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VisionVectorizeSkill. + */ + @Generated + public static VisionVectorizeSkill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List inputs = null; + List outputs = null; + String name = null; + String description = null; + String context = null; + String modelVersion = null; + String odataType = "#Microsoft.Skills.Vision.VectorizeSkill"; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("inputs".equals(fieldName)) { + inputs = reader.readArray(reader1 -> InputFieldMappingEntry.fromJson(reader1)); + } else if ("outputs".equals(fieldName)) { + outputs = reader.readArray(reader1 -> OutputFieldMappingEntry.fromJson(reader1)); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("context".equals(fieldName)) { + context = reader.getString(); + } else if ("modelVersion".equals(fieldName)) { + modelVersion = reader.getString(); + } else if ("@odata.type".equals(fieldName)) { + odataType = reader.getString(); + } else { + reader.skipChildren(); + } + } + VisionVectorizeSkill deserializedVisionVectorizeSkill + = new VisionVectorizeSkill(inputs, outputs, modelVersion); + deserializedVisionVectorizeSkill.setName(name); + deserializedVisionVectorizeSkill.setDescription(description); + deserializedVisionVectorizeSkill.setContext(context); + deserializedVisionVectorizeSkill.odataType = odataType; + return deserializedVisionVectorizeSkill; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSource.java index dbc10ee8ffc11..b70f2aa0a3cb1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSource.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WebKnowledgeSource.java @@ -110,6 +110,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", getName()); jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeStringField("@odata.etag", getETag()); jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); @@ -131,6 +133,7 @@ public static WebKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcept return jsonReader.readObject(reader -> { String name = null; String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; String eTag = null; SearchResourceEncryptionKey encryptionKey = null; KnowledgeSourceKind kind = KnowledgeSourceKind.WEB; @@ -142,6 +145,8 @@ public static WebKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcept name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("@odata.etag".equals(fieldName)) { eTag = reader.getString(); } else if ("encryptionKey".equals(fieldName)) { @@ -156,6 +161,7 @@ public static WebKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcept } WebKnowledgeSource deserializedWebKnowledgeSource = new WebKnowledgeSource(name); deserializedWebKnowledgeSource.setDescription(description); + deserializedWebKnowledgeSource.setResultsProcessing(resultsProcessing); deserializedWebKnowledgeSource.setETag(eTag); deserializedWebKnowledgeSource.setEncryptionKey(encryptionKey); deserializedWebKnowledgeSource.kind = kind; @@ -163,4 +169,14 @@ public static WebKnowledgeSource fromJson(JsonReader jsonReader) throws IOExcept return deserializedWebKnowledgeSource; }); } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WebKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSource.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSource.java new file mode 100644 index 0000000000000..5e74ff9b3845f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSource.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for WorkIQ knowledge source. + */ +@Fluent +public final class WorkIQKnowledgeSource extends KnowledgeSource { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.WORK_IQ; + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSource setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSource setETag(String eTag) { + super.setETag(eTag); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSource setEncryptionKey(SearchResourceEncryptionKey encryptionKey) { + super.setEncryptionKey(encryptionKey); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeStringField("@odata.etag", getETag()); + jsonWriter.writeJsonField("encryptionKey", getEncryptionKey()); + jsonWriter.writeJsonField("workIQParameters", this.workIQParameters); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkIQKnowledgeSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkIQKnowledgeSource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkIQKnowledgeSource. + */ + @Generated + public static WorkIQKnowledgeSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String description = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + String eTag = null; + SearchResourceEncryptionKey encryptionKey = null; + WorkIQKnowledgeSourceParameters workIQParameters = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.WORK_IQ; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("@odata.etag".equals(fieldName)) { + eTag = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + encryptionKey = SearchResourceEncryptionKey.fromJson(reader); + } else if ("workIQParameters".equals(fieldName)) { + workIQParameters = WorkIQKnowledgeSourceParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + WorkIQKnowledgeSource deserializedWorkIQKnowledgeSource = new WorkIQKnowledgeSource(name, workIQParameters); + deserializedWorkIQKnowledgeSource.setDescription(description); + deserializedWorkIQKnowledgeSource.setResultsProcessing(resultsProcessing); + deserializedWorkIQKnowledgeSource.setETag(eTag); + deserializedWorkIQKnowledgeSource.setEncryptionKey(encryptionKey); + deserializedWorkIQKnowledgeSource.kind = kind; + return deserializedWorkIQKnowledgeSource; + }); + } + + /* + * The parameters for the WorkIQ knowledge source, including the customer-owned Entra app configuration used for + * on-behalf-of authentication. + */ + @Generated + private final WorkIQKnowledgeSourceParameters workIQParameters; + + /** + * Creates an instance of WorkIQKnowledgeSource class. + * + * @param name the name value to set. + * @param workIQParameters the workIQParameters value to set. + */ + @Generated + public WorkIQKnowledgeSource(String name, WorkIQKnowledgeSourceParameters workIQParameters) { + super(name); + this.workIQParameters = workIQParameters; + } + + /** + * Get the workIQParameters property: The parameters for the WorkIQ knowledge source, including the customer-owned + * Entra app configuration used for on-behalf-of authentication. + * + * @return the workIQParameters value. + */ + @Generated + public WorkIQKnowledgeSourceParameters getWorkIQParameters() { + return this.workIQParameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSource setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSourceParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSourceParameters.java new file mode 100644 index 0000000000000..357e208640269 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WorkIQKnowledgeSourceParameters.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.indexes.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for a WorkIQ knowledge source. + */ +@Immutable +public final class WorkIQKnowledgeSourceParameters implements JsonSerializable { + + /* + * The customer-owned Microsoft Entra app registration configuration used for on-behalf-of authentication to the + * Work IQ API. The customer registers a tenant-owned Entra app, grants it the WorkIQAgent.Ask delegated permission, + * and configures a federated credential so Azure AI Search can authenticate as that app without a stored client + * secret. + */ + @Generated + private final EntraAppAuthentication entraAppAuthentication; + + /** + * Creates an instance of WorkIQKnowledgeSourceParameters class. + * + * @param entraAppAuthentication the entraAppAuthentication value to set. + */ + @Generated + public WorkIQKnowledgeSourceParameters(EntraAppAuthentication entraAppAuthentication) { + this.entraAppAuthentication = entraAppAuthentication; + } + + /** + * Get the entraAppAuthentication property: The customer-owned Microsoft Entra app registration configuration used + * for on-behalf-of authentication to the Work IQ API. The customer registers a tenant-owned Entra app, grants it + * the WorkIQAgent.Ask delegated permission, and configures a federated credential so Azure AI Search can + * authenticate as that app without a stored client secret. + * + * @return the entraAppAuthentication value. + */ + @Generated + public EntraAppAuthentication getEntraAppAuthentication() { + return this.entraAppAuthentication; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("entraAppAuthentication", this.entraAppAuthentication); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkIQKnowledgeSourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkIQKnowledgeSourceParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkIQKnowledgeSourceParameters. + */ + @Generated + public static WorkIQKnowledgeSourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntraAppAuthentication entraAppAuthentication = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("entraAppAuthentication".equals(fieldName)) { + entraAppAuthentication = EntraAppAuthentication.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new WorkIQKnowledgeSourceParameters(entraAppAuthentication); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AssetStore.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AssetStore.java new file mode 100644 index 0000000000000..de39e71bb6646 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/AssetStore.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for an asset store used to store extracted assets such as images. + */ +@Immutable +public final class AssetStore implements JsonSerializable { + + /* + * The connection string for the asset store. + */ + @Generated + private final String connectionString; + + /* + * The name of the blob container within the asset store where extracted assets (for example, images) are stored. + */ + @Generated + private final String containerName; + + /** + * Creates an instance of AssetStore class. + * + * @param connectionString the connectionString value to set. + * @param containerName the containerName value to set. + */ + @Generated + public AssetStore(String connectionString, String containerName) { + this.connectionString = connectionString; + this.containerName = containerName; + } + + /** + * Get the connectionString property: The connection string for the asset store. + * + * @return the connectionString value. + */ + @Generated + public String getConnectionString() { + return this.connectionString; + } + + /** + * Get the containerName property: The name of the blob container within the asset store where extracted assets (for + * example, images) are stored. + * + * @return the containerName value. + */ + @Generated + public String getContainerName() { + return this.containerName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectionString", this.connectionString); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssetStore from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssetStore if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssetStore. + */ + @Generated + public static AssetStore fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String connectionString = null; + String containerName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("connectionString".equals(fieldName)) { + connectionString = reader.getString(); + } else if ("containerName".equals(fieldName)) { + containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AssetStore(connectionString, containerName); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricDataAgentKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricDataAgentKnowledgeSourceParams.java new file mode 100644 index 0000000000000..7a99cd542c848 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricDataAgentKnowledgeSourceParams.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import java.io.IOException; + +/** + * Specifies runtime parameters for a Fabric Data Agent knowledge source. + */ +@Fluent +public final class FabricDataAgentKnowledgeSourceParams extends KnowledgeSourceParams { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_DATA_AGENT; + + /** + * Creates an instance of FabricDataAgentKnowledgeSourceParams class. + * + * @param knowledgeSourceName the knowledgeSourceName value to set. + */ + @Generated + public FabricDataAgentKnowledgeSourceParams(String knowledgeSourceName) { + super(knowledgeSourceName); + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setIncludeReferences(Boolean includeReferences) { + super.setIncludeReferences(includeReferences); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setIncludeReferenceSourceData(Boolean includeReferenceSourceData) { + super.setIncludeReferenceSourceData(includeReferenceSourceData); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setAlwaysQuerySource(Boolean alwaysQuerySource) { + super.setAlwaysQuerySource(alwaysQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setFailOnError(Boolean failOnError) { + super.setFailOnError(failOnError); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setRerankerThreshold(Float rerankerThreshold) { + super.setRerankerThreshold(rerankerThreshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments) { + super.setMaxOutputDocuments(maxOutputDocuments); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("knowledgeSourceName", getKnowledgeSourceName()); + jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); + jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); + jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); + jsonWriter.writeBooleanField("failOnError", isFailOnError()); + jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricDataAgentKnowledgeSourceParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricDataAgentKnowledgeSourceParams if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricDataAgentKnowledgeSourceParams. + */ + @Generated + public static FabricDataAgentKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String knowledgeSourceName = null; + Boolean includeReferences = null; + Boolean includeReferenceSourceData = null; + Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; + Boolean failOnError = null; + Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + Integer maxOutputDocuments = null; + Boolean enableImageServing = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_DATA_AGENT; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("includeReferences".equals(fieldName)) { + includeReferences = reader.getNullable(JsonReader::getBoolean); + } else if ("includeReferenceSourceData".equals(fieldName)) { + includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); + } else if ("alwaysQuerySource".equals(fieldName)) { + alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("failOnError".equals(fieldName)) { + failOnError = reader.getNullable(JsonReader::getBoolean); + } else if ("rerankerThreshold".equals(fieldName)) { + rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("maxOutputDocuments".equals(fieldName)) { + maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FabricDataAgentKnowledgeSourceParams deserializedFabricDataAgentKnowledgeSourceParams + = new FabricDataAgentKnowledgeSourceParams(knowledgeSourceName); + deserializedFabricDataAgentKnowledgeSourceParams.setIncludeReferences(includeReferences); + deserializedFabricDataAgentKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); + deserializedFabricDataAgentKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedFabricDataAgentKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); + deserializedFabricDataAgentKnowledgeSourceParams.setFailOnError(failOnError); + deserializedFabricDataAgentKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedFabricDataAgentKnowledgeSourceParams.setResultsProcessing(resultsProcessing); + deserializedFabricDataAgentKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedFabricDataAgentKnowledgeSourceParams.setEnableImageServing(enableImageServing); + deserializedFabricDataAgentKnowledgeSourceParams.kind = kind; + return deserializedFabricDataAgentKnowledgeSourceParams; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricDataAgentKnowledgeSourceParams + setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricOntologyKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricOntologyKnowledgeSourceParams.java new file mode 100644 index 0000000000000..cd91a99f3f4fb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FabricOntologyKnowledgeSourceParams.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import java.io.IOException; + +/** + * Specifies runtime parameters for a Fabric Ontology knowledge source. + */ +@Fluent +public final class FabricOntologyKnowledgeSourceParams extends KnowledgeSourceParams { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_ONTOLOGY; + + /** + * Creates an instance of FabricOntologyKnowledgeSourceParams class. + * + * @param knowledgeSourceName the knowledgeSourceName value to set. + */ + @Generated + public FabricOntologyKnowledgeSourceParams(String knowledgeSourceName) { + super(knowledgeSourceName); + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setIncludeReferences(Boolean includeReferences) { + super.setIncludeReferences(includeReferences); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setIncludeReferenceSourceData(Boolean includeReferenceSourceData) { + super.setIncludeReferenceSourceData(includeReferenceSourceData); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setAlwaysQuerySource(Boolean alwaysQuerySource) { + super.setAlwaysQuerySource(alwaysQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setFailOnError(Boolean failOnError) { + super.setFailOnError(failOnError); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setRerankerThreshold(Float rerankerThreshold) { + super.setRerankerThreshold(rerankerThreshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments) { + super.setMaxOutputDocuments(maxOutputDocuments); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("knowledgeSourceName", getKnowledgeSourceName()); + jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); + jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); + jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); + jsonWriter.writeBooleanField("failOnError", isFailOnError()); + jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricOntologyKnowledgeSourceParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricOntologyKnowledgeSourceParams if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricOntologyKnowledgeSourceParams. + */ + @Generated + public static FabricOntologyKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String knowledgeSourceName = null; + Boolean includeReferences = null; + Boolean includeReferenceSourceData = null; + Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; + Boolean failOnError = null; + Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + Integer maxOutputDocuments = null; + Boolean enableImageServing = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.FABRIC_ONTOLOGY; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("includeReferences".equals(fieldName)) { + includeReferences = reader.getNullable(JsonReader::getBoolean); + } else if ("includeReferenceSourceData".equals(fieldName)) { + includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); + } else if ("alwaysQuerySource".equals(fieldName)) { + alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("failOnError".equals(fieldName)) { + failOnError = reader.getNullable(JsonReader::getBoolean); + } else if ("rerankerThreshold".equals(fieldName)) { + rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("maxOutputDocuments".equals(fieldName)) { + maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FabricOntologyKnowledgeSourceParams deserializedFabricOntologyKnowledgeSourceParams + = new FabricOntologyKnowledgeSourceParams(knowledgeSourceName); + deserializedFabricOntologyKnowledgeSourceParams.setIncludeReferences(includeReferences); + deserializedFabricOntologyKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); + deserializedFabricOntologyKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedFabricOntologyKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); + deserializedFabricOntologyKnowledgeSourceParams.setFailOnError(failOnError); + deserializedFabricOntologyKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedFabricOntologyKnowledgeSourceParams.setResultsProcessing(resultsProcessing); + deserializedFabricOntologyKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedFabricOntologyKnowledgeSourceParams.setEnableImageServing(enableImageServing); + deserializedFabricOntologyKnowledgeSourceParams.kind = kind; + return deserializedFabricOntologyKnowledgeSourceParams; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FabricOntologyKnowledgeSourceParams + setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FreshnessPolicy.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FreshnessPolicy.java new file mode 100644 index 0000000000000..90ccea324cbb9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/FreshnessPolicy.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for freshness-aware retrieval. When set, newer documents receive a ranking boost during retrieval. + */ +@Fluent +public final class FreshnessPolicy implements JsonSerializable { + + /* + * ISO 8601 duration for the freshness boosting window (e.g. 'P90D' for 90 days). Documents newer than this duration + * receive a ranking boost during retrieval. + */ + @Generated + private String boostingDuration; + + /** + * Creates an instance of FreshnessPolicy class. + */ + @Generated + public FreshnessPolicy() { + } + + /** + * Get the boostingDuration property: ISO 8601 duration for the freshness boosting window (e.g. 'P90D' for 90 days). + * Documents newer than this duration receive a ranking boost during retrieval. + * + * @return the boostingDuration value. + */ + @Generated + public String getBoostingDuration() { + return this.boostingDuration; + } + + /** + * Set the boostingDuration property: ISO 8601 duration for the freshness boosting window (e.g. 'P90D' for 90 days). + * Documents newer than this duration receive a ranking boost during retrieval. + * + * @param boostingDuration the boostingDuration value to set. + * @return the FreshnessPolicy object itself. + */ + @Generated + public FreshnessPolicy setBoostingDuration(String boostingDuration) { + this.boostingDuration = boostingDuration; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("boostingDuration", this.boostingDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FreshnessPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FreshnessPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FreshnessPolicy. + */ + @Generated + public static FreshnessPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FreshnessPolicy deserializedFreshnessPolicy = new FreshnessPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("boostingDuration".equals(fieldName)) { + deserializedFreshnessPolicy.boostingDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFreshnessPolicy; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ImageServingStatistics.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ImageServingStatistics.java new file mode 100644 index 0000000000000..67cee3cf247d1 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ImageServingStatistics.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Statistics about image serving during a retrieval activity. + */ +@Immutable +public final class ImageServingStatistics implements JsonSerializable { + + /* + * The number of images retrieved from the asset store. + */ + @Generated + private Integer imagesRetrieved; + + /* + * The number of images sent to the downstream model. + */ + @Generated + private Integer imagesSentToModel; + + /* + * The total size in bytes of images sent to the model. + */ + @Generated + private Long totalImageSizeBytes; + + /* + * Indicates whether image verbalization was used instead of direct image serving. + */ + @Generated + private Boolean verbalizationUsed; + + /** + * Creates an instance of ImageServingStatistics class. + */ + @Generated + private ImageServingStatistics() { + } + + /** + * Get the imagesRetrieved property: The number of images retrieved from the asset store. + * + * @return the imagesRetrieved value. + */ + @Generated + public Integer getImagesRetrieved() { + return this.imagesRetrieved; + } + + /** + * Get the imagesSentToModel property: The number of images sent to the downstream model. + * + * @return the imagesSentToModel value. + */ + @Generated + public Integer getImagesSentToModel() { + return this.imagesSentToModel; + } + + /** + * Get the totalImageSizeBytes property: The total size in bytes of images sent to the model. + * + * @return the totalImageSizeBytes value. + */ + @Generated + public Long getTotalImageSizeBytes() { + return this.totalImageSizeBytes; + } + + /** + * Get the verbalizationUsed property: Indicates whether image verbalization was used instead of direct image + * serving. + * + * @return the verbalizationUsed value. + */ + @Generated + public Boolean isVerbalizationUsed() { + return this.verbalizationUsed; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("imagesRetrieved", this.imagesRetrieved); + jsonWriter.writeNumberField("imagesSentToModel", this.imagesSentToModel); + jsonWriter.writeNumberField("totalImageSizeBytes", this.totalImageSizeBytes); + jsonWriter.writeBooleanField("verbalizationUsed", this.verbalizationUsed); + jsonWriter.writeArrayField("servedImages", this.servedImages, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageServingStatistics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageServingStatistics if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageServingStatistics. + */ + @Generated + public static ImageServingStatistics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageServingStatistics deserializedImageServingStatistics = new ImageServingStatistics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("imagesRetrieved".equals(fieldName)) { + deserializedImageServingStatistics.imagesRetrieved = reader.getNullable(JsonReader::getInt); + } else if ("imagesSentToModel".equals(fieldName)) { + deserializedImageServingStatistics.imagesSentToModel = reader.getNullable(JsonReader::getInt); + } else if ("totalImageSizeBytes".equals(fieldName)) { + deserializedImageServingStatistics.totalImageSizeBytes = reader.getNullable(JsonReader::getLong); + } else if ("verbalizationUsed".equals(fieldName)) { + deserializedImageServingStatistics.verbalizationUsed = reader.getNullable(JsonReader::getBoolean); + } else if ("servedImages".equals(fieldName)) { + List servedImages = reader.readArray(reader1 -> ServedImage.fromJson(reader1)); + deserializedImageServingStatistics.servedImages = servedImages; + } else { + reader.skipChildren(); + } + } + return deserializedImageServingStatistics; + }); + } + + /* + * The set of images the model selected to be served to the downstream model for this retrieval activity. + */ + @Generated + private List servedImages; + + /** + * Get the servedImages property: The set of images the model selected to be served to the downstream model for this + * retrieval activity. + * + * @return the servedImages value. + */ + @Generated + public List getServedImages() { + return this.servedImages; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java index 8cd8a2057a049..8921b7752b989 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecord.java @@ -180,6 +180,16 @@ public static KnowledgeBaseActivityRecord fromJson(JsonReader jsonReader) throws return KnowledgeBaseIndexedOneLakeActivityRecord.fromJson(readerToUse.reset()); } else if ("web".equals(discriminatorValue)) { return KnowledgeBaseWebActivityRecord.fromJson(readerToUse.reset()); + } else if ("remoteSharePoint".equals(discriminatorValue)) { + return KnowledgeBaseRemoteSharePointActivityRecord.fromJson(readerToUse.reset()); + } else if ("workIQ".equals(discriminatorValue)) { + return KnowledgeBaseWorkIQActivityRecord.fromJson(readerToUse.reset()); + } else if ("fabricDataAgent".equals(discriminatorValue)) { + return KnowledgeBaseFabricDataAgentActivityRecord.fromJson(readerToUse.reset()); + } else if ("fabricOntology".equals(discriminatorValue)) { + return KnowledgeBaseFabricOntologyActivityRecord.fromJson(readerToUse.reset()); + } else if ("mcpServer".equals(discriminatorValue)) { + return KnowledgeBaseMcpServerActivityRecord.fromJson(readerToUse.reset()); } else if ("file".equals(discriminatorValue)) { return KnowledgeBaseFileActivityRecord.fromJson(readerToUse.reset()); } else if ("indexedSql".equals(discriminatorValue)) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java index 4a10e7db42ede..33db3f699e718 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseActivityRecordType.java @@ -85,6 +85,30 @@ public static Collection values() { @Generated public static final KnowledgeBaseActivityRecordType INDEXED_SHARE_POINT = fromString("indexedSharePoint"); + /** + * Remote SharePoint retrieval activity. + */ + @Generated + public static final KnowledgeBaseActivityRecordType REMOTE_SHARE_POINT = fromString("remoteSharePoint"); + + /** + * WorkIQ retrieval activity. + */ + @Generated + public static final KnowledgeBaseActivityRecordType WORK_IQ = fromString("workIQ"); + + /** + * Fabric Data Agent retrieval activity. + */ + @Generated + public static final KnowledgeBaseActivityRecordType FABRIC_DATA_AGENT = fromString("fabricDataAgent"); + + /** + * Fabric Ontology retrieval activity. + */ + @Generated + public static final KnowledgeBaseActivityRecordType FABRIC_ONTOLOGY = fromString("fabricOntology"); + /** * LLM query planning activity. */ @@ -97,6 +121,12 @@ public static Collection values() { @Generated public static final KnowledgeBaseActivityRecordType MODEL_ANSWER_SYNTHESIS = fromString("modelAnswerSynthesis"); + /** + * MCP server retrieval activity. + */ + @Generated + public static final KnowledgeBaseActivityRecordType MCP_SERVER = fromString("mcpServer"); + /** * File retrieval activity. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAgenticReasoningActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAgenticReasoningActivityRecord.java index 472ccce06e46f..6774d1219b6b5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAgenticReasoningActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAgenticReasoningActivityRecord.java @@ -31,6 +31,12 @@ public final class KnowledgeBaseAgenticReasoningActivityRecord extends Knowledge @Generated private Integer reasoningTokens; + /* + * The retrieval reasoning effort configuration. + */ + @Generated + private KnowledgeRetrievalReasoningEffort retrievalReasoningEffort; + /** * Creates an instance of KnowledgeBaseAgenticReasoningActivityRecord class. * @@ -62,6 +68,16 @@ public Integer getReasoningTokens() { return this.reasoningTokens; } + /** + * Get the retrievalReasoningEffort property: The retrieval reasoning effort configuration. + * + * @return the retrievalReasoningEffort value. + */ + @Generated + public KnowledgeRetrievalReasoningEffort getRetrievalReasoningEffort() { + return this.retrievalReasoningEffort; + } + /** * {@inheritDoc} */ @@ -79,6 +95,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("warning", getWarning()); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeNumberField("reasoningTokens", this.reasoningTokens); + jsonWriter.writeJsonField("retrievalReasoningEffort", this.retrievalReasoningEffort); + jsonWriter.writeJsonField("logicalReasoningEffort", this.logicalReasoningEffort); return jsonWriter.writeEndObject(); } @@ -102,6 +120,8 @@ public static KnowledgeBaseAgenticReasoningActivityRecord fromJson(JsonReader js String warning = null; KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.AGENTIC_REASONING; Integer reasoningTokens = null; + KnowledgeRetrievalReasoningEffort retrievalReasoningEffort = null; + KnowledgeRetrievalReasoningEffort logicalReasoningEffort = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -123,6 +143,10 @@ public static KnowledgeBaseAgenticReasoningActivityRecord fromJson(JsonReader js type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); } else if ("reasoningTokens".equals(fieldName)) { reasoningTokens = reader.getNullable(JsonReader::getInt); + } else if ("retrievalReasoningEffort".equals(fieldName)) { + retrievalReasoningEffort = KnowledgeRetrievalReasoningEffort.fromJson(reader); + } else if ("logicalReasoningEffort".equals(fieldName)) { + logicalReasoningEffort = KnowledgeRetrievalReasoningEffort.fromJson(reader); } else { reader.skipChildren(); } @@ -136,7 +160,27 @@ public static KnowledgeBaseAgenticReasoningActivityRecord fromJson(JsonReader js deserializedKnowledgeBaseAgenticReasoningActivityRecord.setWarning(warning); deserializedKnowledgeBaseAgenticReasoningActivityRecord.type = type; deserializedKnowledgeBaseAgenticReasoningActivityRecord.reasoningTokens = reasoningTokens; + deserializedKnowledgeBaseAgenticReasoningActivityRecord.retrievalReasoningEffort = retrievalReasoningEffort; + deserializedKnowledgeBaseAgenticReasoningActivityRecord.logicalReasoningEffort = logicalReasoningEffort; return deserializedKnowledgeBaseAgenticReasoningActivityRecord; }); } + + /* + * The logical reasoning effort requested by the customer. This is distinct from `retrievalReasoningEffort`, which + * reports the reasoning effort used for billing. + */ + @Generated + private KnowledgeRetrievalReasoningEffort logicalReasoningEffort; + + /** + * Get the logicalReasoningEffort property: The logical reasoning effort requested by the customer. This is distinct + * from `retrievalReasoningEffort`, which reports the reasoning effort used for billing. + * + * @return the logicalReasoningEffort value. + */ + @Generated + public KnowledgeRetrievalReasoningEffort getLogicalReasoningEffort() { + return this.logicalReasoningEffort; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityRecord.java index f1ea372704e91..5bfae0b022e27 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseAzureBlobActivityRecord extends KnowledgeBaseAct @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The azure blob arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the azureBlobArguments property: The azure blob arguments for the retrieval activity. * @@ -131,6 +147,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("azureBlobArguments", this.azureBlobArguments); return jsonWriter.writeEndObject(); } @@ -157,6 +174,7 @@ public static KnowledgeBaseAzureBlobActivityRecord fromJson(JsonReader jsonReade String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseAzureBlobActivityArguments azureBlobArguments = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -184,6 +202,8 @@ public static KnowledgeBaseAzureBlobActivityRecord fromJson(JsonReader jsonReade .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("azureBlobArguments".equals(fieldName)) { azureBlobArguments = KnowledgeBaseAzureBlobActivityArguments.fromJson(reader); } else { @@ -201,6 +221,7 @@ public static KnowledgeBaseAzureBlobActivityRecord fromJson(JsonReader jsonReade deserializedKnowledgeBaseAzureBlobActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseAzureBlobActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseAzureBlobActivityRecord.count = count; + deserializedKnowledgeBaseAzureBlobActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseAzureBlobActivityRecord.azureBlobArguments = azureBlobArguments; return deserializedKnowledgeBaseAzureBlobActivityRecord; }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobReference.java index f777aa58d9741..65c61cdd6eb56 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseAzureBlobReference.java @@ -74,6 +74,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("blobUrl", this.blobUrl); + jsonWriter.writeJsonField("searchSensitivityLabelInfo", this.searchSensitivityLabelInfo); jsonWriter.writeStringField("citationUrl", this.citationUrl); return jsonWriter.writeEndObject(); } @@ -96,6 +97,7 @@ public static KnowledgeBaseAzureBlobReference fromJson(JsonReader jsonReader) th Float rerankerScore = null; KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.AZURE_BLOB; String blobUrl = null; + PurviewSensitivityLabelInfo searchSensitivityLabelInfo = null; String citationUrl = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -112,6 +114,8 @@ public static KnowledgeBaseAzureBlobReference fromJson(JsonReader jsonReader) th type = KnowledgeBaseReferenceType.fromString(reader.getString()); } else if ("blobUrl".equals(fieldName)) { blobUrl = reader.getString(); + } else if ("searchSensitivityLabelInfo".equals(fieldName)) { + searchSensitivityLabelInfo = PurviewSensitivityLabelInfo.fromJson(reader); } else if ("citationUrl".equals(fieldName)) { citationUrl = reader.getString(); } else { @@ -124,11 +128,28 @@ public static KnowledgeBaseAzureBlobReference fromJson(JsonReader jsonReader) th deserializedKnowledgeBaseAzureBlobReference.setRerankerScore(rerankerScore); deserializedKnowledgeBaseAzureBlobReference.type = type; deserializedKnowledgeBaseAzureBlobReference.blobUrl = blobUrl; + deserializedKnowledgeBaseAzureBlobReference.searchSensitivityLabelInfo = searchSensitivityLabelInfo; deserializedKnowledgeBaseAzureBlobReference.citationUrl = citationUrl; return deserializedKnowledgeBaseAzureBlobReference; }); } + /* + * The sensitivity label information for the reference. + */ + @Generated + private PurviewSensitivityLabelInfo searchSensitivityLabelInfo; + + /** + * Get the searchSensitivityLabelInfo property: The sensitivity label information for the reference. + * + * @return the searchSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getSearchSensitivityLabelInfo() { + return this.searchSensitivityLabelInfo; + } + /* * A Search-owned URL that points at the backing document for this reference, usable as a citation target. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityArguments.java new file mode 100644 index 0000000000000..e7d22295be7fc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityArguments.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the arguments the Fabric Data Agent retrieval activity was run with. + */ +@Immutable +public final class KnowledgeBaseFabricDataAgentActivityArguments + implements JsonSerializable { + + /* + * The search string used to query the Fabric Data Agent knowledge source. + */ + @Generated + private String search; + + /** + * Creates an instance of KnowledgeBaseFabricDataAgentActivityArguments class. + */ + @Generated + private KnowledgeBaseFabricDataAgentActivityArguments() { + } + + /** + * Get the search property: The search string used to query the Fabric Data Agent knowledge source. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("search", this.search); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseFabricDataAgentActivityArguments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseFabricDataAgentActivityArguments if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseFabricDataAgentActivityArguments. + */ + @Generated + public static KnowledgeBaseFabricDataAgentActivityArguments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseFabricDataAgentActivityArguments deserializedKnowledgeBaseFabricDataAgentActivityArguments + = new KnowledgeBaseFabricDataAgentActivityArguments(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("search".equals(fieldName)) { + deserializedKnowledgeBaseFabricDataAgentActivityArguments.search = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseFabricDataAgentActivityArguments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityRecord.java new file mode 100644 index 0000000000000..e72003a894d55 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentActivityRecord.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a Fabric Data Agent retrieval activity record. + */ +@Immutable +public final class KnowledgeBaseFabricDataAgentActivityRecord extends KnowledgeBaseActivityRecord { + + /* + * The type of the activity record. + */ + @Generated + private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.FABRIC_DATA_AGENT; + + /* + * The knowledge source for the retrieval activity. + */ + @Generated + private String knowledgeSourceName; + + /* + * The query time for this retrieval activity. + */ + @Generated + private OffsetDateTime queryTime; + + /* + * The count of documents retrieved that were sufficiently relevant to pass the reranker threshold. + */ + @Generated + private Integer count; + + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + + /* + * The Fabric Data Agent arguments for the retrieval activity. + */ + @Generated + private KnowledgeBaseFabricDataAgentActivityArguments fabricDataAgentArguments; + + /** + * Creates an instance of KnowledgeBaseFabricDataAgentActivityRecord class. + * + * @param id the id value to set. + */ + @Generated + private KnowledgeBaseFabricDataAgentActivityRecord(int id) { + super(id); + } + + /** + * Get the type property: The type of the activity record. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseActivityRecordType getType() { + return this.type; + } + + /** + * Get the knowledgeSourceName property: The knowledge source for the retrieval activity. + * + * @return the knowledgeSourceName value. + */ + @Generated + public String getKnowledgeSourceName() { + return this.knowledgeSourceName; + } + + /** + * Get the queryTime property: The query time for this retrieval activity. + * + * @return the queryTime value. + */ + @Generated + public OffsetDateTime getQueryTime() { + return this.queryTime; + } + + /** + * Get the count property: The count of documents retrieved that were sufficiently relevant to pass the reranker + * threshold. + * + * @return the count value. + */ + @Generated + public Integer getCount() { + return this.count; + } + + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + + /** + * Get the fabricDataAgentArguments property: The Fabric Data Agent arguments for the retrieval activity. + * + * @return the fabricDataAgentArguments value. + */ + @Generated + public KnowledgeBaseFabricDataAgentActivityArguments getFabricDataAgentArguments() { + return this.fabricDataAgentArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", getId()); + jsonWriter.writeStringField("startedAt", + getStartedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getStartedAt())); + jsonWriter.writeStringField("completedAt", + getCompletedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCompletedAt())); + jsonWriter.writeNumberField("elapsedMs", getElapsedMs()); + jsonWriter.writeJsonField("error", getError()); + jsonWriter.writeStringField("warning", getWarning()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("knowledgeSourceName", this.knowledgeSourceName); + jsonWriter.writeStringField("queryTime", + this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); + jsonWriter.writeJsonField("fabricDataAgentArguments", this.fabricDataAgentArguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseFabricDataAgentActivityRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseFabricDataAgentActivityRecord if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseFabricDataAgentActivityRecord. + */ + @Generated + public static KnowledgeBaseFabricDataAgentActivityRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int id = 0; + OffsetDateTime startedAt = null; + OffsetDateTime completedAt = null; + Integer elapsedMs = null; + KnowledgeBaseErrorDetail error = null; + String warning = null; + KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.FABRIC_DATA_AGENT; + String knowledgeSourceName = null; + OffsetDateTime queryTime = null; + Integer count = null; + ImageServingStatistics imageServing = null; + KnowledgeBaseFabricDataAgentActivityArguments fabricDataAgentArguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getInt(); + } else if ("startedAt".equals(fieldName)) { + startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("elapsedMs".equals(fieldName)) { + elapsedMs = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + error = KnowledgeBaseErrorDetail.fromJson(reader); + } else if ("warning".equals(fieldName)) { + warning = reader.getString(); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); + } else if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("queryTime".equals(fieldName)) { + queryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); + } else if ("fabricDataAgentArguments".equals(fieldName)) { + fabricDataAgentArguments = KnowledgeBaseFabricDataAgentActivityArguments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseFabricDataAgentActivityRecord deserializedKnowledgeBaseFabricDataAgentActivityRecord + = new KnowledgeBaseFabricDataAgentActivityRecord(id); + deserializedKnowledgeBaseFabricDataAgentActivityRecord.setStartedAt(startedAt); + deserializedKnowledgeBaseFabricDataAgentActivityRecord.setCompletedAt(completedAt); + deserializedKnowledgeBaseFabricDataAgentActivityRecord.setElapsedMs(elapsedMs); + deserializedKnowledgeBaseFabricDataAgentActivityRecord.setError(error); + deserializedKnowledgeBaseFabricDataAgentActivityRecord.setWarning(warning); + deserializedKnowledgeBaseFabricDataAgentActivityRecord.type = type; + deserializedKnowledgeBaseFabricDataAgentActivityRecord.knowledgeSourceName = knowledgeSourceName; + deserializedKnowledgeBaseFabricDataAgentActivityRecord.queryTime = queryTime; + deserializedKnowledgeBaseFabricDataAgentActivityRecord.count = count; + deserializedKnowledgeBaseFabricDataAgentActivityRecord.imageServing = imageServing; + deserializedKnowledgeBaseFabricDataAgentActivityRecord.fabricDataAgentArguments = fabricDataAgentArguments; + return deserializedKnowledgeBaseFabricDataAgentActivityRecord; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentReference.java new file mode 100644 index 0000000000000..0486c413323f8 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricDataAgentReference.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a Fabric Data Agent document reference. + */ +@Immutable +public final class KnowledgeBaseFabricDataAgentReference extends KnowledgeBaseReference { + + /* + * The type of the reference. + */ + @Generated + private KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.FABRIC_DATA_AGENT; + + /* + * The Fabric workspace ID. + */ + @Generated + private String workspaceId; + + /* + * The Fabric Data Agent ID. + */ + @Generated + private String dataAgentId; + + /** + * Creates an instance of KnowledgeBaseFabricDataAgentReference class. + * + * @param id the id value to set. + * @param activitySource the activitySource value to set. + */ + @Generated + private KnowledgeBaseFabricDataAgentReference(String id, int activitySource) { + super(id, activitySource); + } + + /** + * Get the type property: The type of the reference. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseReferenceType getType() { + return this.type; + } + + /** + * Get the workspaceId property: The Fabric workspace ID. + * + * @return the workspaceId value. + */ + @Generated + public String getWorkspaceId() { + return this.workspaceId; + } + + /** + * Get the dataAgentId property: The Fabric Data Agent ID. + * + * @return the dataAgentId value. + */ + @Generated + public String getDataAgentId() { + return this.dataAgentId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeIntField("activitySource", getActivitySource()); + jsonWriter.writeMapField("sourceData", getSourceData(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("dataAgentId", this.dataAgentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseFabricDataAgentReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseFabricDataAgentReference if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseFabricDataAgentReference. + */ + @Generated + public static KnowledgeBaseFabricDataAgentReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int activitySource = 0; + Map sourceData = null; + Float rerankerScore = null; + KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.FABRIC_DATA_AGENT; + String workspaceId = null; + String dataAgentId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("activitySource".equals(fieldName)) { + activitySource = reader.getInt(); + } else if ("sourceData".equals(fieldName)) { + sourceData = reader.readMap(reader1 -> reader1.readUntyped()); + } else if ("rerankerScore".equals(fieldName)) { + rerankerScore = reader.getNullable(JsonReader::getFloat); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseReferenceType.fromString(reader.getString()); + } else if ("workspaceId".equals(fieldName)) { + workspaceId = reader.getString(); + } else if ("dataAgentId".equals(fieldName)) { + dataAgentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseFabricDataAgentReference deserializedKnowledgeBaseFabricDataAgentReference + = new KnowledgeBaseFabricDataAgentReference(id, activitySource); + deserializedKnowledgeBaseFabricDataAgentReference.setSourceData(sourceData); + deserializedKnowledgeBaseFabricDataAgentReference.setRerankerScore(rerankerScore); + deserializedKnowledgeBaseFabricDataAgentReference.type = type; + deserializedKnowledgeBaseFabricDataAgentReference.workspaceId = workspaceId; + deserializedKnowledgeBaseFabricDataAgentReference.dataAgentId = dataAgentId; + return deserializedKnowledgeBaseFabricDataAgentReference; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityArguments.java new file mode 100644 index 0000000000000..7f06423b2938f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityArguments.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the arguments the Fabric Ontology retrieval activity was run with. + */ +@Immutable +public final class KnowledgeBaseFabricOntologyActivityArguments + implements JsonSerializable { + + /* + * The search string used to query the Fabric Ontology knowledge source. + */ + @Generated + private String search; + + /** + * Creates an instance of KnowledgeBaseFabricOntologyActivityArguments class. + */ + @Generated + private KnowledgeBaseFabricOntologyActivityArguments() { + } + + /** + * Get the search property: The search string used to query the Fabric Ontology knowledge source. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("search", this.search); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseFabricOntologyActivityArguments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseFabricOntologyActivityArguments if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseFabricOntologyActivityArguments. + */ + @Generated + public static KnowledgeBaseFabricOntologyActivityArguments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseFabricOntologyActivityArguments deserializedKnowledgeBaseFabricOntologyActivityArguments + = new KnowledgeBaseFabricOntologyActivityArguments(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("search".equals(fieldName)) { + deserializedKnowledgeBaseFabricOntologyActivityArguments.search = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseFabricOntologyActivityArguments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityRecord.java new file mode 100644 index 0000000000000..99f7f5ee39609 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyActivityRecord.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a Fabric Ontology retrieval activity record. + */ +@Immutable +public final class KnowledgeBaseFabricOntologyActivityRecord extends KnowledgeBaseActivityRecord { + + /* + * The type of the activity record. + */ + @Generated + private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.FABRIC_ONTOLOGY; + + /* + * The knowledge source for the retrieval activity. + */ + @Generated + private String knowledgeSourceName; + + /* + * The query time for this retrieval activity. + */ + @Generated + private OffsetDateTime queryTime; + + /* + * The count of documents retrieved that were sufficiently relevant to pass the reranker threshold. + */ + @Generated + private Integer count; + + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + + /* + * The Fabric Ontology arguments for the retrieval activity. + */ + @Generated + private KnowledgeBaseFabricOntologyActivityArguments fabricOntologyArguments; + + /** + * Creates an instance of KnowledgeBaseFabricOntologyActivityRecord class. + * + * @param id the id value to set. + */ + @Generated + private KnowledgeBaseFabricOntologyActivityRecord(int id) { + super(id); + } + + /** + * Get the type property: The type of the activity record. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseActivityRecordType getType() { + return this.type; + } + + /** + * Get the knowledgeSourceName property: The knowledge source for the retrieval activity. + * + * @return the knowledgeSourceName value. + */ + @Generated + public String getKnowledgeSourceName() { + return this.knowledgeSourceName; + } + + /** + * Get the queryTime property: The query time for this retrieval activity. + * + * @return the queryTime value. + */ + @Generated + public OffsetDateTime getQueryTime() { + return this.queryTime; + } + + /** + * Get the count property: The count of documents retrieved that were sufficiently relevant to pass the reranker + * threshold. + * + * @return the count value. + */ + @Generated + public Integer getCount() { + return this.count; + } + + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + + /** + * Get the fabricOntologyArguments property: The Fabric Ontology arguments for the retrieval activity. + * + * @return the fabricOntologyArguments value. + */ + @Generated + public KnowledgeBaseFabricOntologyActivityArguments getFabricOntologyArguments() { + return this.fabricOntologyArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", getId()); + jsonWriter.writeStringField("startedAt", + getStartedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getStartedAt())); + jsonWriter.writeStringField("completedAt", + getCompletedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCompletedAt())); + jsonWriter.writeNumberField("elapsedMs", getElapsedMs()); + jsonWriter.writeJsonField("error", getError()); + jsonWriter.writeStringField("warning", getWarning()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("knowledgeSourceName", this.knowledgeSourceName); + jsonWriter.writeStringField("queryTime", + this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); + jsonWriter.writeJsonField("fabricOntologyArguments", this.fabricOntologyArguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseFabricOntologyActivityRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseFabricOntologyActivityRecord if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseFabricOntologyActivityRecord. + */ + @Generated + public static KnowledgeBaseFabricOntologyActivityRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int id = 0; + OffsetDateTime startedAt = null; + OffsetDateTime completedAt = null; + Integer elapsedMs = null; + KnowledgeBaseErrorDetail error = null; + String warning = null; + KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.FABRIC_ONTOLOGY; + String knowledgeSourceName = null; + OffsetDateTime queryTime = null; + Integer count = null; + ImageServingStatistics imageServing = null; + KnowledgeBaseFabricOntologyActivityArguments fabricOntologyArguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getInt(); + } else if ("startedAt".equals(fieldName)) { + startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("elapsedMs".equals(fieldName)) { + elapsedMs = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + error = KnowledgeBaseErrorDetail.fromJson(reader); + } else if ("warning".equals(fieldName)) { + warning = reader.getString(); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); + } else if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("queryTime".equals(fieldName)) { + queryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); + } else if ("fabricOntologyArguments".equals(fieldName)) { + fabricOntologyArguments = KnowledgeBaseFabricOntologyActivityArguments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseFabricOntologyActivityRecord deserializedKnowledgeBaseFabricOntologyActivityRecord + = new KnowledgeBaseFabricOntologyActivityRecord(id); + deserializedKnowledgeBaseFabricOntologyActivityRecord.setStartedAt(startedAt); + deserializedKnowledgeBaseFabricOntologyActivityRecord.setCompletedAt(completedAt); + deserializedKnowledgeBaseFabricOntologyActivityRecord.setElapsedMs(elapsedMs); + deserializedKnowledgeBaseFabricOntologyActivityRecord.setError(error); + deserializedKnowledgeBaseFabricOntologyActivityRecord.setWarning(warning); + deserializedKnowledgeBaseFabricOntologyActivityRecord.type = type; + deserializedKnowledgeBaseFabricOntologyActivityRecord.knowledgeSourceName = knowledgeSourceName; + deserializedKnowledgeBaseFabricOntologyActivityRecord.queryTime = queryTime; + deserializedKnowledgeBaseFabricOntologyActivityRecord.count = count; + deserializedKnowledgeBaseFabricOntologyActivityRecord.imageServing = imageServing; + deserializedKnowledgeBaseFabricOntologyActivityRecord.fabricOntologyArguments = fabricOntologyArguments; + return deserializedKnowledgeBaseFabricOntologyActivityRecord; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyReference.java new file mode 100644 index 0000000000000..3fd0a26025f03 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFabricOntologyReference.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a Fabric Ontology document reference. + */ +@Immutable +public final class KnowledgeBaseFabricOntologyReference extends KnowledgeBaseReference { + + /* + * The type of the reference. + */ + @Generated + private KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.FABRIC_ONTOLOGY; + + /* + * The Fabric workspace ID. + */ + @Generated + private String workspaceId; + + /* + * The ontology ID within the workspace. + */ + @Generated + private String ontologyId; + + /** + * Creates an instance of KnowledgeBaseFabricOntologyReference class. + * + * @param id the id value to set. + * @param activitySource the activitySource value to set. + */ + @Generated + private KnowledgeBaseFabricOntologyReference(String id, int activitySource) { + super(id, activitySource); + } + + /** + * Get the type property: The type of the reference. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseReferenceType getType() { + return this.type; + } + + /** + * Get the workspaceId property: The Fabric workspace ID. + * + * @return the workspaceId value. + */ + @Generated + public String getWorkspaceId() { + return this.workspaceId; + } + + /** + * Get the ontologyId property: The ontology ID within the workspace. + * + * @return the ontologyId value. + */ + @Generated + public String getOntologyId() { + return this.ontologyId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeIntField("activitySource", getActivitySource()); + jsonWriter.writeMapField("sourceData", getSourceData(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("ontologyId", this.ontologyId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseFabricOntologyReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseFabricOntologyReference if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseFabricOntologyReference. + */ + @Generated + public static KnowledgeBaseFabricOntologyReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int activitySource = 0; + Map sourceData = null; + Float rerankerScore = null; + KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.FABRIC_ONTOLOGY; + String workspaceId = null; + String ontologyId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("activitySource".equals(fieldName)) { + activitySource = reader.getInt(); + } else if ("sourceData".equals(fieldName)) { + sourceData = reader.readMap(reader1 -> reader1.readUntyped()); + } else if ("rerankerScore".equals(fieldName)) { + rerankerScore = reader.getNullable(JsonReader::getFloat); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseReferenceType.fromString(reader.getString()); + } else if ("workspaceId".equals(fieldName)) { + workspaceId = reader.getString(); + } else if ("ontologyId".equals(fieldName)) { + ontologyId = reader.getString(); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseFabricOntologyReference deserializedKnowledgeBaseFabricOntologyReference + = new KnowledgeBaseFabricOntologyReference(id, activitySource); + deserializedKnowledgeBaseFabricOntologyReference.setSourceData(sourceData); + deserializedKnowledgeBaseFabricOntologyReference.setRerankerScore(rerankerScore); + deserializedKnowledgeBaseFabricOntologyReference.type = type; + deserializedKnowledgeBaseFabricOntologyReference.workspaceId = workspaceId; + deserializedKnowledgeBaseFabricOntologyReference.ontologyId = ontologyId; + return deserializedKnowledgeBaseFabricOntologyReference; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityRecord.java index f85e711c389bf..4b1eadae10300 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseFileActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseFileActivityRecord extends KnowledgeBaseActivity @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The File arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the fileArguments property: The File arguments for the retrieval activity. * @@ -131,6 +147,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("fileArguments", this.fileArguments); return jsonWriter.writeEndObject(); } @@ -157,6 +174,7 @@ public static KnowledgeBaseFileActivityRecord fromJson(JsonReader jsonReader) th String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseFileActivityArguments fileArguments = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -184,6 +202,8 @@ public static KnowledgeBaseFileActivityRecord fromJson(JsonReader jsonReader) th .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("fileArguments".equals(fieldName)) { fileArguments = KnowledgeBaseFileActivityArguments.fromJson(reader); } else { @@ -201,6 +221,7 @@ public static KnowledgeBaseFileActivityRecord fromJson(JsonReader jsonReader) th deserializedKnowledgeBaseFileActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseFileActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseFileActivityRecord.count = count; + deserializedKnowledgeBaseFileActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseFileActivityRecord.fileArguments = fileArguments; return deserializedKnowledgeBaseFileActivityRecord; }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityRecord.java index 70cb49bcffb0d..e97c52b453e7f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseIndexedOneLakeActivityRecord extends KnowledgeBa @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The indexed OneLake arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the indexedOneLakeArguments property: The indexed OneLake arguments for the retrieval activity. * @@ -131,6 +147,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("indexedOneLakeArguments", this.indexedOneLakeArguments); return jsonWriter.writeEndObject(); } @@ -157,6 +174,7 @@ public static KnowledgeBaseIndexedOneLakeActivityRecord fromJson(JsonReader json String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseIndexedOneLakeActivityArguments indexedOneLakeArguments = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -184,6 +202,8 @@ public static KnowledgeBaseIndexedOneLakeActivityRecord fromJson(JsonReader json .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("indexedOneLakeArguments".equals(fieldName)) { indexedOneLakeArguments = KnowledgeBaseIndexedOneLakeActivityArguments.fromJson(reader); } else { @@ -201,6 +221,7 @@ public static KnowledgeBaseIndexedOneLakeActivityRecord fromJson(JsonReader json deserializedKnowledgeBaseIndexedOneLakeActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseIndexedOneLakeActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseIndexedOneLakeActivityRecord.count = count; + deserializedKnowledgeBaseIndexedOneLakeActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseIndexedOneLakeActivityRecord.indexedOneLakeArguments = indexedOneLakeArguments; return deserializedKnowledgeBaseIndexedOneLakeActivityRecord; }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeReference.java index 8e39a78278dc8..16f28a5fa943b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedOneLakeReference.java @@ -58,6 +58,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("docUrl", this.documentUrl); + jsonWriter.writeJsonField("searchSensitivityLabelInfo", this.searchSensitivityLabelInfo); jsonWriter.writeStringField("citationUrl", this.citationUrl); return jsonWriter.writeEndObject(); } @@ -80,6 +81,7 @@ public static KnowledgeBaseIndexedOneLakeReference fromJson(JsonReader jsonReade Float rerankerScore = null; KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.INDEXED_ONE_LAKE; String documentUrl = null; + PurviewSensitivityLabelInfo searchSensitivityLabelInfo = null; String citationUrl = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -96,6 +98,8 @@ public static KnowledgeBaseIndexedOneLakeReference fromJson(JsonReader jsonReade type = KnowledgeBaseReferenceType.fromString(reader.getString()); } else if ("docUrl".equals(fieldName)) { documentUrl = reader.getString(); + } else if ("searchSensitivityLabelInfo".equals(fieldName)) { + searchSensitivityLabelInfo = PurviewSensitivityLabelInfo.fromJson(reader); } else if ("citationUrl".equals(fieldName)) { citationUrl = reader.getString(); } else { @@ -108,6 +112,7 @@ public static KnowledgeBaseIndexedOneLakeReference fromJson(JsonReader jsonReade deserializedKnowledgeBaseIndexedOneLakeReference.setRerankerScore(rerankerScore); deserializedKnowledgeBaseIndexedOneLakeReference.type = type; deserializedKnowledgeBaseIndexedOneLakeReference.documentUrl = documentUrl; + deserializedKnowledgeBaseIndexedOneLakeReference.searchSensitivityLabelInfo = searchSensitivityLabelInfo; deserializedKnowledgeBaseIndexedOneLakeReference.citationUrl = citationUrl; return deserializedKnowledgeBaseIndexedOneLakeReference; }); @@ -129,6 +134,22 @@ public String getDocumentUrl() { return this.documentUrl; } + /* + * The sensitivity label information for the reference. + */ + @Generated + private PurviewSensitivityLabelInfo searchSensitivityLabelInfo; + + /** + * Get the searchSensitivityLabelInfo property: The sensitivity label information for the reference. + * + * @return the searchSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getSearchSensitivityLabelInfo() { + return this.searchSensitivityLabelInfo; + } + /* * A Search-owned URL that points at the backing document for this reference, usable as a citation target. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityRecord.java index 0a6d34d6b2882..cf3689b25c099 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseIndexedSharePointActivityRecord extends Knowledg @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The indexed SharePoint arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the indexedSharePointArguments property: The indexed SharePoint arguments for the retrieval activity. * @@ -131,6 +147,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("indexedSharePointArguments", this.indexedSharePointArguments); return jsonWriter.writeEndObject(); } @@ -157,6 +174,7 @@ public static KnowledgeBaseIndexedSharePointActivityRecord fromJson(JsonReader j String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseIndexedSharePointActivityArguments indexedSharePointArguments = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -184,6 +202,8 @@ public static KnowledgeBaseIndexedSharePointActivityRecord fromJson(JsonReader j .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("indexedSharePointArguments".equals(fieldName)) { indexedSharePointArguments = KnowledgeBaseIndexedSharePointActivityArguments.fromJson(reader); } else { @@ -201,6 +221,7 @@ public static KnowledgeBaseIndexedSharePointActivityRecord fromJson(JsonReader j deserializedKnowledgeBaseIndexedSharePointActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseIndexedSharePointActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseIndexedSharePointActivityRecord.count = count; + deserializedKnowledgeBaseIndexedSharePointActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseIndexedSharePointActivityRecord.indexedSharePointArguments = indexedSharePointArguments; return deserializedKnowledgeBaseIndexedSharePointActivityRecord; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointReference.java index 981decd2e1741..85960f0fbd20d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSharePointReference.java @@ -29,6 +29,12 @@ public final class KnowledgeBaseIndexedSharePointReference extends KnowledgeBase @Generated private String documentUrl; + /* + * The sensitivity label information for the reference. + */ + @Generated + private PurviewSensitivityLabelInfo searchSensitivityLabelInfo; + /** * Creates an instance of KnowledgeBaseIndexedSharePointReference class. * @@ -61,6 +67,16 @@ public String getDocumentUrl() { return this.documentUrl; } + /** + * Get the searchSensitivityLabelInfo property: The sensitivity label information for the reference. + * + * @return the searchSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getSearchSensitivityLabelInfo() { + return this.searchSensitivityLabelInfo; + } + /** * {@inheritDoc} */ @@ -74,6 +90,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("docUrl", this.documentUrl); + jsonWriter.writeJsonField("searchSensitivityLabelInfo", this.searchSensitivityLabelInfo); jsonWriter.writeStringField("citationUrl", this.citationUrl); return jsonWriter.writeEndObject(); } @@ -96,6 +113,7 @@ public static KnowledgeBaseIndexedSharePointReference fromJson(JsonReader jsonRe Float rerankerScore = null; KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.INDEXED_SHARE_POINT; String documentUrl = null; + PurviewSensitivityLabelInfo searchSensitivityLabelInfo = null; String citationUrl = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -112,6 +130,8 @@ public static KnowledgeBaseIndexedSharePointReference fromJson(JsonReader jsonRe type = KnowledgeBaseReferenceType.fromString(reader.getString()); } else if ("docUrl".equals(fieldName)) { documentUrl = reader.getString(); + } else if ("searchSensitivityLabelInfo".equals(fieldName)) { + searchSensitivityLabelInfo = PurviewSensitivityLabelInfo.fromJson(reader); } else if ("citationUrl".equals(fieldName)) { citationUrl = reader.getString(); } else { @@ -124,6 +144,7 @@ public static KnowledgeBaseIndexedSharePointReference fromJson(JsonReader jsonRe deserializedKnowledgeBaseIndexedSharePointReference.setRerankerScore(rerankerScore); deserializedKnowledgeBaseIndexedSharePointReference.type = type; deserializedKnowledgeBaseIndexedSharePointReference.documentUrl = documentUrl; + deserializedKnowledgeBaseIndexedSharePointReference.searchSensitivityLabelInfo = searchSensitivityLabelInfo; deserializedKnowledgeBaseIndexedSharePointReference.citationUrl = citationUrl; return deserializedKnowledgeBaseIndexedSharePointReference; }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityRecord.java index b587c46753d2f..310c7dcc0cd9a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseIndexedSqlActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseIndexedSqlActivityRecord extends KnowledgeBaseAc @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The indexed SQL arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the indexedSqlArguments property: The indexed SQL arguments for the retrieval activity. * @@ -131,6 +147,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("indexedSqlArguments", this.indexedSqlArguments); return jsonWriter.writeEndObject(); } @@ -157,6 +174,7 @@ public static KnowledgeBaseIndexedSqlActivityRecord fromJson(JsonReader jsonRead String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseIndexedSqlActivityArguments indexedSqlArguments = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -184,6 +202,8 @@ public static KnowledgeBaseIndexedSqlActivityRecord fromJson(JsonReader jsonRead .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("indexedSqlArguments".equals(fieldName)) { indexedSqlArguments = KnowledgeBaseIndexedSqlActivityArguments.fromJson(reader); } else { @@ -201,6 +221,7 @@ public static KnowledgeBaseIndexedSqlActivityRecord fromJson(JsonReader jsonRead deserializedKnowledgeBaseIndexedSqlActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseIndexedSqlActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseIndexedSqlActivityRecord.count = count; + deserializedKnowledgeBaseIndexedSqlActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseIndexedSqlActivityRecord.indexedSqlArguments = indexedSqlArguments; return deserializedKnowledgeBaseIndexedSqlActivityRecord; }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityArguments.java new file mode 100644 index 0000000000000..c21a73efc6979 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityArguments.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents the arguments the MCP server retrieval activity was run with. + */ +@Immutable +public final class KnowledgeBaseMcpServerActivityArguments + implements JsonSerializable { + + /* + * The name of the MCP server tool used for the retrieval activity. + */ + @Generated + private String toolName; + + /* + * The arguments passed to the MCP server tool. + */ + @Generated + private Map toolArguments; + + /** + * Creates an instance of KnowledgeBaseMcpServerActivityArguments class. + */ + @Generated + private KnowledgeBaseMcpServerActivityArguments() { + } + + /** + * Get the toolName property: The name of the MCP server tool used for the retrieval activity. + * + * @return the toolName value. + */ + @Generated + public String getToolName() { + return this.toolName; + } + + /** + * Get the toolArguments property: The arguments passed to the MCP server tool. + * + * @return the toolArguments value. + */ + @Generated + public Map getToolArguments() { + return this.toolArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("toolName", this.toolName); + jsonWriter.writeMapField("toolArguments", this.toolArguments, + (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseMcpServerActivityArguments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseMcpServerActivityArguments if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseMcpServerActivityArguments. + */ + @Generated + public static KnowledgeBaseMcpServerActivityArguments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseMcpServerActivityArguments deserializedKnowledgeBaseMcpServerActivityArguments + = new KnowledgeBaseMcpServerActivityArguments(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("toolName".equals(fieldName)) { + deserializedKnowledgeBaseMcpServerActivityArguments.toolName = reader.getString(); + } else if ("toolArguments".equals(fieldName)) { + Map toolArguments = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedKnowledgeBaseMcpServerActivityArguments.toolArguments = toolArguments; + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseMcpServerActivityArguments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityRecord.java new file mode 100644 index 0000000000000..28766d1ef9e6c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerActivityRecord.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents an MCP server retrieval activity record. + */ +@Immutable +public final class KnowledgeBaseMcpServerActivityRecord extends KnowledgeBaseActivityRecord { + + /* + * The type of the activity record. + */ + @Generated + private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.MCP_SERVER; + + /* + * The knowledge source for the retrieval activity. + */ + @Generated + private String knowledgeSourceName; + + /* + * The query time for this retrieval activity. + */ + @Generated + private OffsetDateTime queryTime; + + /* + * The count of documents retrieved that were sufficiently relevant to pass the reranker threshold. + */ + @Generated + private Integer count; + + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + + /* + * The MCP server arguments for the retrieval activity. + */ + @Generated + private KnowledgeBaseMcpServerActivityArguments mcpServerArguments; + + /** + * Creates an instance of KnowledgeBaseMcpServerActivityRecord class. + * + * @param id the id value to set. + */ + @Generated + private KnowledgeBaseMcpServerActivityRecord(int id) { + super(id); + } + + /** + * Get the type property: The type of the activity record. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseActivityRecordType getType() { + return this.type; + } + + /** + * Get the knowledgeSourceName property: The knowledge source for the retrieval activity. + * + * @return the knowledgeSourceName value. + */ + @Generated + public String getKnowledgeSourceName() { + return this.knowledgeSourceName; + } + + /** + * Get the queryTime property: The query time for this retrieval activity. + * + * @return the queryTime value. + */ + @Generated + public OffsetDateTime getQueryTime() { + return this.queryTime; + } + + /** + * Get the count property: The count of documents retrieved that were sufficiently relevant to pass the reranker + * threshold. + * + * @return the count value. + */ + @Generated + public Integer getCount() { + return this.count; + } + + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + + /** + * Get the mcpServerArguments property: The MCP server arguments for the retrieval activity. + * + * @return the mcpServerArguments value. + */ + @Generated + public KnowledgeBaseMcpServerActivityArguments getMcpServerArguments() { + return this.mcpServerArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", getId()); + jsonWriter.writeStringField("startedAt", + getStartedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getStartedAt())); + jsonWriter.writeStringField("completedAt", + getCompletedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCompletedAt())); + jsonWriter.writeNumberField("elapsedMs", getElapsedMs()); + jsonWriter.writeJsonField("error", getError()); + jsonWriter.writeStringField("warning", getWarning()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("knowledgeSourceName", this.knowledgeSourceName); + jsonWriter.writeStringField("queryTime", + this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); + jsonWriter.writeJsonField("mcpServerArguments", this.mcpServerArguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseMcpServerActivityRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseMcpServerActivityRecord if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseMcpServerActivityRecord. + */ + @Generated + public static KnowledgeBaseMcpServerActivityRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int id = 0; + OffsetDateTime startedAt = null; + OffsetDateTime completedAt = null; + Integer elapsedMs = null; + KnowledgeBaseErrorDetail error = null; + String warning = null; + KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.MCP_SERVER; + String knowledgeSourceName = null; + OffsetDateTime queryTime = null; + Integer count = null; + ImageServingStatistics imageServing = null; + KnowledgeBaseMcpServerActivityArguments mcpServerArguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getInt(); + } else if ("startedAt".equals(fieldName)) { + startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("elapsedMs".equals(fieldName)) { + elapsedMs = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + error = KnowledgeBaseErrorDetail.fromJson(reader); + } else if ("warning".equals(fieldName)) { + warning = reader.getString(); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); + } else if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("queryTime".equals(fieldName)) { + queryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); + } else if ("mcpServerArguments".equals(fieldName)) { + mcpServerArguments = KnowledgeBaseMcpServerActivityArguments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseMcpServerActivityRecord deserializedKnowledgeBaseMcpServerActivityRecord + = new KnowledgeBaseMcpServerActivityRecord(id); + deserializedKnowledgeBaseMcpServerActivityRecord.setStartedAt(startedAt); + deserializedKnowledgeBaseMcpServerActivityRecord.setCompletedAt(completedAt); + deserializedKnowledgeBaseMcpServerActivityRecord.setElapsedMs(elapsedMs); + deserializedKnowledgeBaseMcpServerActivityRecord.setError(error); + deserializedKnowledgeBaseMcpServerActivityRecord.setWarning(warning); + deserializedKnowledgeBaseMcpServerActivityRecord.type = type; + deserializedKnowledgeBaseMcpServerActivityRecord.knowledgeSourceName = knowledgeSourceName; + deserializedKnowledgeBaseMcpServerActivityRecord.queryTime = queryTime; + deserializedKnowledgeBaseMcpServerActivityRecord.count = count; + deserializedKnowledgeBaseMcpServerActivityRecord.imageServing = imageServing; + deserializedKnowledgeBaseMcpServerActivityRecord.mcpServerArguments = mcpServerArguments; + return deserializedKnowledgeBaseMcpServerActivityRecord; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerReference.java new file mode 100644 index 0000000000000..77260154f14da --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseMcpServerReference.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents an MCP server document reference. + */ +@Immutable +public final class KnowledgeBaseMcpServerReference extends KnowledgeBaseReference { + + /* + * The type of the reference. + */ + @Generated + private KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.MCP_SERVER; + + /* + * The name of the MCP server tool that produced the reference. + */ + @Generated + private String toolName; + + /* + * The title of the MCP server tool result. + */ + @Generated + private String title; + + /** + * Creates an instance of KnowledgeBaseMcpServerReference class. + * + * @param id the id value to set. + * @param activitySource the activitySource value to set. + */ + @Generated + private KnowledgeBaseMcpServerReference(String id, int activitySource) { + super(id, activitySource); + } + + /** + * Get the type property: The type of the reference. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseReferenceType getType() { + return this.type; + } + + /** + * Get the toolName property: The name of the MCP server tool that produced the reference. + * + * @return the toolName value. + */ + @Generated + public String getToolName() { + return this.toolName; + } + + /** + * Get the title property: The title of the MCP server tool result. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeIntField("activitySource", getActivitySource()); + jsonWriter.writeMapField("sourceData", getSourceData(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("toolName", this.toolName); + jsonWriter.writeStringField("title", this.title); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseMcpServerReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseMcpServerReference if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseMcpServerReference. + */ + @Generated + public static KnowledgeBaseMcpServerReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int activitySource = 0; + Map sourceData = null; + Float rerankerScore = null; + KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.MCP_SERVER; + String toolName = null; + String title = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("activitySource".equals(fieldName)) { + activitySource = reader.getInt(); + } else if ("sourceData".equals(fieldName)) { + sourceData = reader.readMap(reader1 -> reader1.readUntyped()); + } else if ("rerankerScore".equals(fieldName)) { + rerankerScore = reader.getNullable(JsonReader::getFloat); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseReferenceType.fromString(reader.getString()); + } else if ("toolName".equals(fieldName)) { + toolName = reader.getString(); + } else if ("title".equals(fieldName)) { + title = reader.getString(); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseMcpServerReference deserializedKnowledgeBaseMcpServerReference + = new KnowledgeBaseMcpServerReference(id, activitySource); + deserializedKnowledgeBaseMcpServerReference.setSourceData(sourceData); + deserializedKnowledgeBaseMcpServerReference.setRerankerScore(rerankerScore); + deserializedKnowledgeBaseMcpServerReference.type = type; + deserializedKnowledgeBaseMcpServerReference.toolName = toolName; + deserializedKnowledgeBaseMcpServerReference.title = title; + return deserializedKnowledgeBaseMcpServerReference; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseQueryHintProcessing.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseQueryHintProcessing.java new file mode 100644 index 0000000000000..a1c9c4a3ef7de --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseQueryHintProcessing.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details about the expressions generated from query hints for a retrieval activity. + */ +@Immutable +public final class KnowledgeBaseQueryHintProcessing implements JsonSerializable { + + /* + * The search clause generated from boost hints for this activity. + */ + @Generated + private String generatedBoost; + + /* + * The filter expression generated from filter hints for this activity. + */ + @Generated + private String generatedFilter; + + /** + * Creates an instance of KnowledgeBaseQueryHintProcessing class. + */ + @Generated + private KnowledgeBaseQueryHintProcessing() { + } + + /** + * Get the generatedBoost property: The search clause generated from boost hints for this activity. + * + * @return the generatedBoost value. + */ + @Generated + public String getGeneratedBoost() { + return this.generatedBoost; + } + + /** + * Get the generatedFilter property: The filter expression generated from filter hints for this activity. + * + * @return the generatedFilter value. + */ + @Generated + public String getGeneratedFilter() { + return this.generatedFilter; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("generatedBoost", this.generatedBoost); + jsonWriter.writeStringField("generatedFilter", this.generatedFilter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseQueryHintProcessing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseQueryHintProcessing if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseQueryHintProcessing. + */ + @Generated + public static KnowledgeBaseQueryHintProcessing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseQueryHintProcessing deserializedKnowledgeBaseQueryHintProcessing + = new KnowledgeBaseQueryHintProcessing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("generatedBoost".equals(fieldName)) { + deserializedKnowledgeBaseQueryHintProcessing.generatedBoost = reader.getString(); + } else if ("generatedFilter".equals(fieldName)) { + deserializedKnowledgeBaseQueryHintProcessing.generatedFilter = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseQueryHintProcessing; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java index eb0d338156d2c..f3cdd3910589f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReference.java @@ -188,6 +188,16 @@ public static KnowledgeBaseReference fromJson(JsonReader jsonReader) throws IOEx return KnowledgeBaseIndexedOneLakeReference.fromJson(readerToUse.reset()); } else if ("web".equals(discriminatorValue)) { return KnowledgeBaseWebReference.fromJson(readerToUse.reset()); + } else if ("remoteSharePoint".equals(discriminatorValue)) { + return KnowledgeBaseRemoteSharePointReference.fromJson(readerToUse.reset()); + } else if ("workIQ".equals(discriminatorValue)) { + return KnowledgeBaseWorkIQReference.fromJson(readerToUse.reset()); + } else if ("fabricDataAgent".equals(discriminatorValue)) { + return KnowledgeBaseFabricDataAgentReference.fromJson(readerToUse.reset()); + } else if ("fabricOntology".equals(discriminatorValue)) { + return KnowledgeBaseFabricOntologyReference.fromJson(readerToUse.reset()); + } else if ("mcpServer".equals(discriminatorValue)) { + return KnowledgeBaseMcpServerReference.fromJson(readerToUse.reset()); } else if ("file".equals(discriminatorValue)) { return KnowledgeBaseFileReference.fromJson(readerToUse.reset()); } else if ("indexedSql".equals(discriminatorValue)) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java index f79b3b582b7e4..cf053d7517455 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseReferenceType.java @@ -73,6 +73,36 @@ public static Collection values() { @Generated public static final KnowledgeBaseReferenceType INDEXED_SHARE_POINT = fromString("indexedSharePoint"); + /** + * Remote SharePoint document reference. + */ + @Generated + public static final KnowledgeBaseReferenceType REMOTE_SHARE_POINT = fromString("remoteSharePoint"); + + /** + * Work IQ document reference. + */ + @Generated + public static final KnowledgeBaseReferenceType WORK_IQ = fromString("workIQ"); + + /** + * Fabric Data Agent document reference. + */ + @Generated + public static final KnowledgeBaseReferenceType FABRIC_DATA_AGENT = fromString("fabricDataAgent"); + + /** + * Fabric Ontology document reference. + */ + @Generated + public static final KnowledgeBaseReferenceType FABRIC_ONTOLOGY = fromString("fabricOntology"); + + /** + * MCP server document reference. + */ + @Generated + public static final KnowledgeBaseReferenceType MCP_SERVER = fromString("mcpServer"); + /** * File document reference. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityArguments.java new file mode 100644 index 0000000000000..cbb1e0300037f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityArguments.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the arguments the remote SharePoint retrieval activity was run with. + */ +@Immutable +public final class KnowledgeBaseRemoteSharePointActivityArguments + implements JsonSerializable { + + /* + * The search string used to query the remote SharePoint knowledge source. + */ + @Generated + private String search; + + /* + * The filter expression add-on for the retrieval activity. + */ + @Generated + private String filterExpressionAddOn; + + /** + * Creates an instance of KnowledgeBaseRemoteSharePointActivityArguments class. + */ + @Generated + private KnowledgeBaseRemoteSharePointActivityArguments() { + } + + /** + * Get the search property: The search string used to query the remote SharePoint knowledge source. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * Get the filterExpressionAddOn property: The filter expression add-on for the retrieval activity. + * + * @return the filterExpressionAddOn value. + */ + @Generated + public String getFilterExpressionAddOn() { + return this.filterExpressionAddOn; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("search", this.search); + jsonWriter.writeStringField("filterExpressionAddOn", this.filterExpressionAddOn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseRemoteSharePointActivityArguments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseRemoteSharePointActivityArguments if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseRemoteSharePointActivityArguments. + */ + @Generated + public static KnowledgeBaseRemoteSharePointActivityArguments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseRemoteSharePointActivityArguments deserializedKnowledgeBaseRemoteSharePointActivityArguments + = new KnowledgeBaseRemoteSharePointActivityArguments(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("search".equals(fieldName)) { + deserializedKnowledgeBaseRemoteSharePointActivityArguments.search = reader.getString(); + } else if ("filterExpressionAddOn".equals(fieldName)) { + deserializedKnowledgeBaseRemoteSharePointActivityArguments.filterExpressionAddOn + = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseRemoteSharePointActivityArguments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityRecord.java new file mode 100644 index 0000000000000..c31cc67a12366 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointActivityRecord.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a remote SharePoint retrieval activity record. + */ +@Immutable +public final class KnowledgeBaseRemoteSharePointActivityRecord extends KnowledgeBaseActivityRecord { + + /* + * The type of the activity record. + */ + @Generated + private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.REMOTE_SHARE_POINT; + + /* + * The knowledge source for the retrieval activity. + */ + @Generated + private String knowledgeSourceName; + + /* + * The query time for this retrieval activity. + */ + @Generated + private OffsetDateTime queryTime; + + /* + * The count of documents retrieved that were sufficiently relevant to pass the reranker threshold. + */ + @Generated + private Integer count; + + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + + /* + * The remote SharePoint arguments for the retrieval activity. + */ + @Generated + private KnowledgeBaseRemoteSharePointActivityArguments remoteSharePointArguments; + + /** + * Creates an instance of KnowledgeBaseRemoteSharePointActivityRecord class. + * + * @param id the id value to set. + */ + @Generated + private KnowledgeBaseRemoteSharePointActivityRecord(int id) { + super(id); + } + + /** + * Get the type property: The type of the activity record. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseActivityRecordType getType() { + return this.type; + } + + /** + * Get the knowledgeSourceName property: The knowledge source for the retrieval activity. + * + * @return the knowledgeSourceName value. + */ + @Generated + public String getKnowledgeSourceName() { + return this.knowledgeSourceName; + } + + /** + * Get the queryTime property: The query time for this retrieval activity. + * + * @return the queryTime value. + */ + @Generated + public OffsetDateTime getQueryTime() { + return this.queryTime; + } + + /** + * Get the count property: The count of documents retrieved that were sufficiently relevant to pass the reranker + * threshold. + * + * @return the count value. + */ + @Generated + public Integer getCount() { + return this.count; + } + + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + + /** + * Get the remoteSharePointArguments property: The remote SharePoint arguments for the retrieval activity. + * + * @return the remoteSharePointArguments value. + */ + @Generated + public KnowledgeBaseRemoteSharePointActivityArguments getRemoteSharePointArguments() { + return this.remoteSharePointArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", getId()); + jsonWriter.writeStringField("startedAt", + getStartedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getStartedAt())); + jsonWriter.writeStringField("completedAt", + getCompletedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCompletedAt())); + jsonWriter.writeNumberField("elapsedMs", getElapsedMs()); + jsonWriter.writeJsonField("error", getError()); + jsonWriter.writeStringField("warning", getWarning()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("knowledgeSourceName", this.knowledgeSourceName); + jsonWriter.writeStringField("queryTime", + this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); + jsonWriter.writeJsonField("remoteSharePointArguments", this.remoteSharePointArguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseRemoteSharePointActivityRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseRemoteSharePointActivityRecord if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseRemoteSharePointActivityRecord. + */ + @Generated + public static KnowledgeBaseRemoteSharePointActivityRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int id = 0; + OffsetDateTime startedAt = null; + OffsetDateTime completedAt = null; + Integer elapsedMs = null; + KnowledgeBaseErrorDetail error = null; + String warning = null; + KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.REMOTE_SHARE_POINT; + String knowledgeSourceName = null; + OffsetDateTime queryTime = null; + Integer count = null; + ImageServingStatistics imageServing = null; + KnowledgeBaseRemoteSharePointActivityArguments remoteSharePointArguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getInt(); + } else if ("startedAt".equals(fieldName)) { + startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("elapsedMs".equals(fieldName)) { + elapsedMs = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + error = KnowledgeBaseErrorDetail.fromJson(reader); + } else if ("warning".equals(fieldName)) { + warning = reader.getString(); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); + } else if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("queryTime".equals(fieldName)) { + queryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); + } else if ("remoteSharePointArguments".equals(fieldName)) { + remoteSharePointArguments = KnowledgeBaseRemoteSharePointActivityArguments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseRemoteSharePointActivityRecord deserializedKnowledgeBaseRemoteSharePointActivityRecord + = new KnowledgeBaseRemoteSharePointActivityRecord(id); + deserializedKnowledgeBaseRemoteSharePointActivityRecord.setStartedAt(startedAt); + deserializedKnowledgeBaseRemoteSharePointActivityRecord.setCompletedAt(completedAt); + deserializedKnowledgeBaseRemoteSharePointActivityRecord.setElapsedMs(elapsedMs); + deserializedKnowledgeBaseRemoteSharePointActivityRecord.setError(error); + deserializedKnowledgeBaseRemoteSharePointActivityRecord.setWarning(warning); + deserializedKnowledgeBaseRemoteSharePointActivityRecord.type = type; + deserializedKnowledgeBaseRemoteSharePointActivityRecord.knowledgeSourceName = knowledgeSourceName; + deserializedKnowledgeBaseRemoteSharePointActivityRecord.queryTime = queryTime; + deserializedKnowledgeBaseRemoteSharePointActivityRecord.count = count; + deserializedKnowledgeBaseRemoteSharePointActivityRecord.imageServing = imageServing; + deserializedKnowledgeBaseRemoteSharePointActivityRecord.remoteSharePointArguments + = remoteSharePointArguments; + return deserializedKnowledgeBaseRemoteSharePointActivityRecord; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointReference.java new file mode 100644 index 0000000000000..f51e56d689feb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRemoteSharePointReference.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a remote SharePoint document reference. + */ +@Immutable +public final class KnowledgeBaseRemoteSharePointReference extends KnowledgeBaseReference { + + /* + * The type of the reference. + */ + @Generated + private KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.REMOTE_SHARE_POINT; + + /* + * The url the reference data originated from. + */ + @Generated + private String webUrl; + + /* + * The sensitivity label information for the reference. + */ + @Generated + private PurviewSensitivityLabelInfo searchSensitivityLabelInfo; + + /** + * Creates an instance of KnowledgeBaseRemoteSharePointReference class. + * + * @param id the id value to set. + * @param activitySource the activitySource value to set. + */ + @Generated + private KnowledgeBaseRemoteSharePointReference(String id, int activitySource) { + super(id, activitySource); + } + + /** + * Get the type property: The type of the reference. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseReferenceType getType() { + return this.type; + } + + /** + * Get the webUrl property: The url the reference data originated from. + * + * @return the webUrl value. + */ + @Generated + public String getWebUrl() { + return this.webUrl; + } + + /** + * Get the searchSensitivityLabelInfo property: The sensitivity label information for the reference. + * + * @return the searchSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getSearchSensitivityLabelInfo() { + return this.searchSensitivityLabelInfo; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeIntField("activitySource", getActivitySource()); + jsonWriter.writeMapField("sourceData", getSourceData(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("webUrl", this.webUrl); + jsonWriter.writeJsonField("searchSensitivityLabelInfo", this.searchSensitivityLabelInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseRemoteSharePointReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseRemoteSharePointReference if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseRemoteSharePointReference. + */ + @Generated + public static KnowledgeBaseRemoteSharePointReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int activitySource = 0; + Map sourceData = null; + Float rerankerScore = null; + KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.REMOTE_SHARE_POINT; + String webUrl = null; + PurviewSensitivityLabelInfo searchSensitivityLabelInfo = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("activitySource".equals(fieldName)) { + activitySource = reader.getInt(); + } else if ("sourceData".equals(fieldName)) { + sourceData = reader.readMap(reader1 -> reader1.readUntyped()); + } else if ("rerankerScore".equals(fieldName)) { + rerankerScore = reader.getNullable(JsonReader::getFloat); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseReferenceType.fromString(reader.getString()); + } else if ("webUrl".equals(fieldName)) { + webUrl = reader.getString(); + } else if ("searchSensitivityLabelInfo".equals(fieldName)) { + searchSensitivityLabelInfo = PurviewSensitivityLabelInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseRemoteSharePointReference deserializedKnowledgeBaseRemoteSharePointReference + = new KnowledgeBaseRemoteSharePointReference(id, activitySource); + deserializedKnowledgeBaseRemoteSharePointReference.setSourceData(sourceData); + deserializedKnowledgeBaseRemoteSharePointReference.setRerankerScore(rerankerScore); + deserializedKnowledgeBaseRemoteSharePointReference.type = type; + deserializedKnowledgeBaseRemoteSharePointReference.webUrl = webUrl; + deserializedKnowledgeBaseRemoteSharePointReference.searchSensitivityLabelInfo = searchSensitivityLabelInfo; + return deserializedKnowledgeBaseRemoteSharePointReference; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalResult.java index fac4a3da286b6..d218f697e628d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseRetrievalResult.java @@ -83,6 +83,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("response", this.response, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("activity", this.activity, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("references", this.references, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("responseSensitivityLabelInfo", this.responseSensitivityLabelInfo); return jsonWriter.writeEndObject(); } @@ -113,6 +114,9 @@ public static KnowledgeBaseRetrievalResult fromJson(JsonReader jsonReader) throw List references = reader.readArray(reader1 -> KnowledgeBaseReference.fromJson(reader1)); deserializedKnowledgeBaseRetrievalResult.references = references; + } else if ("responseSensitivityLabelInfo".equals(fieldName)) { + deserializedKnowledgeBaseRetrievalResult.responseSensitivityLabelInfo + = PurviewSensitivityLabelInfo.fromJson(reader); } else { reader.skipChildren(); } @@ -120,4 +124,20 @@ public static KnowledgeBaseRetrievalResult fromJson(JsonReader jsonReader) throw return deserializedKnowledgeBaseRetrievalResult; }); } + + /* + * The sensitivity label information for the overall response. + */ + @Generated + private PurviewSensitivityLabelInfo responseSensitivityLabelInfo; + + /** + * Get the responseSensitivityLabelInfo property: The sensitivity label information for the overall response. + * + * @return the responseSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getResponseSensitivityLabelInfo() { + return this.responseSensitivityLabelInfo; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityArguments.java index 48fd28477841f..87aa6ff663a1b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityArguments.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityArguments.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.SearchIndexFieldReference; +import com.azure.search.documents.models.QueryType; import java.io.IOException; import java.util.List; @@ -120,6 +121,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("searchFields", this.searchFields, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("semanticConfigurationName", this.semanticConfigurationName); + jsonWriter.writeStringField("queryType", this.queryType == null ? null : this.queryType.toString()); return jsonWriter.writeEndObject(); } @@ -154,6 +156,9 @@ public static KnowledgeBaseSearchIndexActivityArguments fromJson(JsonReader json } else if ("semanticConfigurationName".equals(fieldName)) { deserializedKnowledgeBaseSearchIndexActivityArguments.semanticConfigurationName = reader.getString(); + } else if ("queryType".equals(fieldName)) { + deserializedKnowledgeBaseSearchIndexActivityArguments.queryType + = QueryType.fromString(reader.getString()); } else { reader.skipChildren(); } @@ -161,4 +166,21 @@ public static KnowledgeBaseSearchIndexActivityArguments fromJson(JsonReader json return deserializedKnowledgeBaseSearchIndexActivityArguments; }); } + + /* + * The query syntax used to execute the search. Query hints can cause semantic queries to use full query syntax. + */ + @Generated + private QueryType queryType; + + /** + * Get the queryType property: The query syntax used to execute the search. Query hints can cause semantic queries + * to use full query syntax. + * + * @return the queryType value. + */ + @Generated + public QueryType getQueryType() { + return this.queryType; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityRecord.java index e42442cd5be58..f5ab89610fc2f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseSearchIndexActivityRecord extends KnowledgeBaseA @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The search index arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the searchIndexArguments property: The search index arguments for the retrieval activity. * @@ -131,7 +147,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("searchIndexArguments", this.searchIndexArguments); + jsonWriter.writeJsonField("queryHintProcessing", this.queryHintProcessing); return jsonWriter.writeEndObject(); } @@ -157,7 +175,9 @@ public static KnowledgeBaseSearchIndexActivityRecord fromJson(JsonReader jsonRea String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseSearchIndexActivityArguments searchIndexArguments = null; + KnowledgeBaseQueryHintProcessing queryHintProcessing = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -184,8 +204,12 @@ public static KnowledgeBaseSearchIndexActivityRecord fromJson(JsonReader jsonRea .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("searchIndexArguments".equals(fieldName)) { searchIndexArguments = KnowledgeBaseSearchIndexActivityArguments.fromJson(reader); + } else if ("queryHintProcessing".equals(fieldName)) { + queryHintProcessing = KnowledgeBaseQueryHintProcessing.fromJson(reader); } else { reader.skipChildren(); } @@ -201,8 +225,26 @@ public static KnowledgeBaseSearchIndexActivityRecord fromJson(JsonReader jsonRea deserializedKnowledgeBaseSearchIndexActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseSearchIndexActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseSearchIndexActivityRecord.count = count; + deserializedKnowledgeBaseSearchIndexActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseSearchIndexActivityRecord.searchIndexArguments = searchIndexArguments; + deserializedKnowledgeBaseSearchIndexActivityRecord.queryHintProcessing = queryHintProcessing; return deserializedKnowledgeBaseSearchIndexActivityRecord; }); } + + /* + * Details about the expressions generated from query hints for this activity. + */ + @Generated + private KnowledgeBaseQueryHintProcessing queryHintProcessing; + + /** + * Get the queryHintProcessing property: Details about the expressions generated from query hints for this activity. + * + * @return the queryHintProcessing value. + */ + @Generated + public KnowledgeBaseQueryHintProcessing getQueryHintProcessing() { + return this.queryHintProcessing; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexReference.java index 159f2935f85b5..506e2dc140e48 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexReference.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseSearchIndexReference.java @@ -74,6 +74,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("docKey", this.docKey); + jsonWriter.writeJsonField("searchSensitivityLabelInfo", this.searchSensitivityLabelInfo); jsonWriter.writeStringField("citationUrl", this.citationUrl); return jsonWriter.writeEndObject(); } @@ -96,6 +97,7 @@ public static KnowledgeBaseSearchIndexReference fromJson(JsonReader jsonReader) Float rerankerScore = null; KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.SEARCH_INDEX; String docKey = null; + PurviewSensitivityLabelInfo searchSensitivityLabelInfo = null; String citationUrl = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -112,6 +114,8 @@ public static KnowledgeBaseSearchIndexReference fromJson(JsonReader jsonReader) type = KnowledgeBaseReferenceType.fromString(reader.getString()); } else if ("docKey".equals(fieldName)) { docKey = reader.getString(); + } else if ("searchSensitivityLabelInfo".equals(fieldName)) { + searchSensitivityLabelInfo = PurviewSensitivityLabelInfo.fromJson(reader); } else if ("citationUrl".equals(fieldName)) { citationUrl = reader.getString(); } else { @@ -124,11 +128,28 @@ public static KnowledgeBaseSearchIndexReference fromJson(JsonReader jsonReader) deserializedKnowledgeBaseSearchIndexReference.setRerankerScore(rerankerScore); deserializedKnowledgeBaseSearchIndexReference.type = type; deserializedKnowledgeBaseSearchIndexReference.docKey = docKey; + deserializedKnowledgeBaseSearchIndexReference.searchSensitivityLabelInfo = searchSensitivityLabelInfo; deserializedKnowledgeBaseSearchIndexReference.citationUrl = citationUrl; return deserializedKnowledgeBaseSearchIndexReference; }); } + /* + * The sensitivity label information for the reference. + */ + @Generated + private PurviewSensitivityLabelInfo searchSensitivityLabelInfo; + + /** + * Get the searchSensitivityLabelInfo property: The sensitivity label information for the reference. + * + * @return the searchSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getSearchSensitivityLabelInfo() { + return this.searchSensitivityLabelInfo; + } + /* * A Search-owned URL that points at the backing document for this reference, usable as a citation target. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityRecord.java index 4ad0e32df59fc..3971637de46d5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityRecord.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWebActivityRecord.java @@ -43,6 +43,12 @@ public final class KnowledgeBaseWebActivityRecord extends KnowledgeBaseActivityR @Generated private Integer count; + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + /* * The web arguments for the retrieval activity. */ @@ -101,6 +107,16 @@ public Integer getCount() { return this.count; } + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + /** * Get the webArguments property: The web arguments for the retrieval activity. * @@ -131,6 +147,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryTime", this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); jsonWriter.writeJsonField("webArguments", this.webArguments); return jsonWriter.writeEndObject(); } @@ -157,6 +174,7 @@ public static KnowledgeBaseWebActivityRecord fromJson(JsonReader jsonReader) thr String knowledgeSourceName = null; OffsetDateTime queryTime = null; Integer count = null; + ImageServingStatistics imageServing = null; KnowledgeBaseWebActivityArguments webArguments = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -184,6 +202,8 @@ public static KnowledgeBaseWebActivityRecord fromJson(JsonReader jsonReader) thr .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("count".equals(fieldName)) { count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); } else if ("webArguments".equals(fieldName)) { webArguments = KnowledgeBaseWebActivityArguments.fromJson(reader); } else { @@ -201,6 +221,7 @@ public static KnowledgeBaseWebActivityRecord fromJson(JsonReader jsonReader) thr deserializedKnowledgeBaseWebActivityRecord.knowledgeSourceName = knowledgeSourceName; deserializedKnowledgeBaseWebActivityRecord.queryTime = queryTime; deserializedKnowledgeBaseWebActivityRecord.count = count; + deserializedKnowledgeBaseWebActivityRecord.imageServing = imageServing; deserializedKnowledgeBaseWebActivityRecord.webArguments = webArguments; return deserializedKnowledgeBaseWebActivityRecord; }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityArguments.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityArguments.java new file mode 100644 index 0000000000000..41fd5f76395bc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityArguments.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the arguments the WorkIQ retrieval activity was run with. + */ +@Immutable +public final class KnowledgeBaseWorkIQActivityArguments + implements JsonSerializable { + + /* + * The search string used to query the WorkIQ knowledge source. + */ + @Generated + private String search; + + /** + * Creates an instance of KnowledgeBaseWorkIQActivityArguments class. + */ + @Generated + private KnowledgeBaseWorkIQActivityArguments() { + } + + /** + * Get the search property: The search string used to query the WorkIQ knowledge source. + * + * @return the search value. + */ + @Generated + public String getSearch() { + return this.search; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("search", this.search); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseWorkIQActivityArguments from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseWorkIQActivityArguments if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeBaseWorkIQActivityArguments. + */ + @Generated + public static KnowledgeBaseWorkIQActivityArguments fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeBaseWorkIQActivityArguments deserializedKnowledgeBaseWorkIQActivityArguments + = new KnowledgeBaseWorkIQActivityArguments(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("search".equals(fieldName)) { + deserializedKnowledgeBaseWorkIQActivityArguments.search = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeBaseWorkIQActivityArguments; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityRecord.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityRecord.java new file mode 100644 index 0000000000000..08e2f9016cccf --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQActivityRecord.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a WorkIQ retrieval activity record. + */ +@Immutable +public final class KnowledgeBaseWorkIQActivityRecord extends KnowledgeBaseActivityRecord { + + /* + * The type of the activity record. + */ + @Generated + private KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.WORK_IQ; + + /* + * The knowledge source for the retrieval activity. + */ + @Generated + private String knowledgeSourceName; + + /* + * The query time for this retrieval activity. + */ + @Generated + private OffsetDateTime queryTime; + + /* + * The count of documents retrieved that were sufficiently relevant to pass the reranker threshold. + */ + @Generated + private Integer count; + + /* + * Statistics about image serving for this retrieval activity + */ + @Generated + private ImageServingStatistics imageServing; + + /* + * The WorkIQ arguments for the retrieval activity. + */ + @Generated + private KnowledgeBaseWorkIQActivityArguments workIQArguments; + + /** + * Creates an instance of KnowledgeBaseWorkIQActivityRecord class. + * + * @param id the id value to set. + */ + @Generated + private KnowledgeBaseWorkIQActivityRecord(int id) { + super(id); + } + + /** + * Get the type property: The type of the activity record. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseActivityRecordType getType() { + return this.type; + } + + /** + * Get the knowledgeSourceName property: The knowledge source for the retrieval activity. + * + * @return the knowledgeSourceName value. + */ + @Generated + public String getKnowledgeSourceName() { + return this.knowledgeSourceName; + } + + /** + * Get the queryTime property: The query time for this retrieval activity. + * + * @return the queryTime value. + */ + @Generated + public OffsetDateTime getQueryTime() { + return this.queryTime; + } + + /** + * Get the count property: The count of documents retrieved that were sufficiently relevant to pass the reranker + * threshold. + * + * @return the count value. + */ + @Generated + public Integer getCount() { + return this.count; + } + + /** + * Get the imageServing property: Statistics about image serving for this retrieval activity. + * + * @return the imageServing value. + */ + @Generated + public ImageServingStatistics getImageServing() { + return this.imageServing; + } + + /** + * Get the workIQArguments property: The WorkIQ arguments for the retrieval activity. + * + * @return the workIQArguments value. + */ + @Generated + public KnowledgeBaseWorkIQActivityArguments getWorkIQArguments() { + return this.workIQArguments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", getId()); + jsonWriter.writeStringField("startedAt", + getStartedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getStartedAt())); + jsonWriter.writeStringField("completedAt", + getCompletedAt() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(getCompletedAt())); + jsonWriter.writeNumberField("elapsedMs", getElapsedMs()); + jsonWriter.writeJsonField("error", getError()); + jsonWriter.writeStringField("warning", getWarning()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("knowledgeSourceName", this.knowledgeSourceName); + jsonWriter.writeStringField("queryTime", + this.queryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryTime)); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeJsonField("imageServing", this.imageServing); + jsonWriter.writeJsonField("workIQArguments", this.workIQArguments); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseWorkIQActivityRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseWorkIQActivityRecord if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseWorkIQActivityRecord. + */ + @Generated + public static KnowledgeBaseWorkIQActivityRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int id = 0; + OffsetDateTime startedAt = null; + OffsetDateTime completedAt = null; + Integer elapsedMs = null; + KnowledgeBaseErrorDetail error = null; + String warning = null; + KnowledgeBaseActivityRecordType type = KnowledgeBaseActivityRecordType.WORK_IQ; + String knowledgeSourceName = null; + OffsetDateTime queryTime = null; + Integer count = null; + ImageServingStatistics imageServing = null; + KnowledgeBaseWorkIQActivityArguments workIQArguments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getInt(); + } else if ("startedAt".equals(fieldName)) { + startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("elapsedMs".equals(fieldName)) { + elapsedMs = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + error = KnowledgeBaseErrorDetail.fromJson(reader); + } else if ("warning".equals(fieldName)) { + warning = reader.getString(); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseActivityRecordType.fromString(reader.getString()); + } else if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("queryTime".equals(fieldName)) { + queryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getInt); + } else if ("imageServing".equals(fieldName)) { + imageServing = ImageServingStatistics.fromJson(reader); + } else if ("workIQArguments".equals(fieldName)) { + workIQArguments = KnowledgeBaseWorkIQActivityArguments.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseWorkIQActivityRecord deserializedKnowledgeBaseWorkIQActivityRecord + = new KnowledgeBaseWorkIQActivityRecord(id); + deserializedKnowledgeBaseWorkIQActivityRecord.setStartedAt(startedAt); + deserializedKnowledgeBaseWorkIQActivityRecord.setCompletedAt(completedAt); + deserializedKnowledgeBaseWorkIQActivityRecord.setElapsedMs(elapsedMs); + deserializedKnowledgeBaseWorkIQActivityRecord.setError(error); + deserializedKnowledgeBaseWorkIQActivityRecord.setWarning(warning); + deserializedKnowledgeBaseWorkIQActivityRecord.type = type; + deserializedKnowledgeBaseWorkIQActivityRecord.knowledgeSourceName = knowledgeSourceName; + deserializedKnowledgeBaseWorkIQActivityRecord.queryTime = queryTime; + deserializedKnowledgeBaseWorkIQActivityRecord.count = count; + deserializedKnowledgeBaseWorkIQActivityRecord.imageServing = imageServing; + deserializedKnowledgeBaseWorkIQActivityRecord.workIQArguments = workIQArguments; + return deserializedKnowledgeBaseWorkIQActivityRecord; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQReference.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQReference.java new file mode 100644 index 0000000000000..605785378fd2b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeBaseWorkIQReference.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a WorkIQ document reference. + */ +@Immutable +public final class KnowledgeBaseWorkIQReference extends KnowledgeBaseReference { + + /* + * The type of the reference. + */ + @Generated + private KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.WORK_IQ; + + /** + * Creates an instance of KnowledgeBaseWorkIQReference class. + * + * @param id the id value to set. + * @param activitySource the activitySource value to set. + */ + @Generated + private KnowledgeBaseWorkIQReference(String id, int activitySource) { + super(id, activitySource); + } + + /** + * Get the type property: The type of the reference. + * + * @return the type value. + */ + @Generated + @Override + public KnowledgeBaseReferenceType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", getId()); + jsonWriter.writeIntField("activitySource", getActivitySource()); + jsonWriter.writeMapField("sourceData", getSourceData(), (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeNumberField("rerankerScore", getRerankerScore()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("searchSensitivityLabelInfo", this.searchSensitivityLabelInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeBaseWorkIQReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeBaseWorkIQReference if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KnowledgeBaseWorkIQReference. + */ + @Generated + public static KnowledgeBaseWorkIQReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + int activitySource = 0; + Map sourceData = null; + Float rerankerScore = null; + KnowledgeBaseReferenceType type = KnowledgeBaseReferenceType.WORK_IQ; + PurviewSensitivityLabelInfo searchSensitivityLabelInfo = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("activitySource".equals(fieldName)) { + activitySource = reader.getInt(); + } else if ("sourceData".equals(fieldName)) { + sourceData = reader.readMap(reader1 -> reader1.readUntyped()); + } else if ("rerankerScore".equals(fieldName)) { + rerankerScore = reader.getNullable(JsonReader::getFloat); + } else if ("type".equals(fieldName)) { + type = KnowledgeBaseReferenceType.fromString(reader.getString()); + } else if ("searchSensitivityLabelInfo".equals(fieldName)) { + searchSensitivityLabelInfo = PurviewSensitivityLabelInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + KnowledgeBaseWorkIQReference deserializedKnowledgeBaseWorkIQReference + = new KnowledgeBaseWorkIQReference(id, activitySource); + deserializedKnowledgeBaseWorkIQReference.setSourceData(sourceData); + deserializedKnowledgeBaseWorkIQReference.setRerankerScore(rerankerScore); + deserializedKnowledgeBaseWorkIQReference.type = type; + deserializedKnowledgeBaseWorkIQReference.searchSensitivityLabelInfo = searchSensitivityLabelInfo; + return deserializedKnowledgeBaseWorkIQReference; + }); + } + + /* + * The sensitivity label information for the reference. + */ + @Generated + private PurviewSensitivityLabelInfo searchSensitivityLabelInfo; + + /** + * Get the searchSensitivityLabelInfo property: The sensitivity label information for the reference. + * + * @return the searchSensitivityLabelInfo value. + */ + @Generated + public PurviewSensitivityLabelInfo getSearchSensitivityLabelInfo() { + return this.searchSensitivityLabelInfo; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalAutoReasoningEffort.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalAutoReasoningEffort.java new file mode 100644 index 0000000000000..f9fb8b07679cc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalAutoReasoningEffort.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Automatically select the reasoning effort during retrieval. The service seeds every request at the cheapest tier and + * escalates only as far as needed, up to the service's maximum available tier. + */ +@Immutable +public final class KnowledgeRetrievalAutoReasoningEffort extends KnowledgeRetrievalReasoningEffort { + + /* + * The kind of reasoning effort. + */ + @Generated + private KnowledgeRetrievalReasoningEffortKind kind = KnowledgeRetrievalReasoningEffortKind.AUTO; + + /** + * Creates an instance of KnowledgeRetrievalAutoReasoningEffort class. + */ + @Generated + public KnowledgeRetrievalAutoReasoningEffort() { + } + + /** + * Get the kind property: The kind of reasoning effort. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeRetrievalReasoningEffortKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KnowledgeRetrievalAutoReasoningEffort from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KnowledgeRetrievalAutoReasoningEffort if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KnowledgeRetrievalAutoReasoningEffort. + */ + @Generated + public static KnowledgeRetrievalAutoReasoningEffort fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KnowledgeRetrievalAutoReasoningEffort deserializedKnowledgeRetrievalAutoReasoningEffort + = new KnowledgeRetrievalAutoReasoningEffort(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedKnowledgeRetrievalAutoReasoningEffort.kind + = KnowledgeRetrievalReasoningEffortKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedKnowledgeRetrievalAutoReasoningEffort; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffort.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffort.java index d799957c6be1f..c71bc0244280c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffort.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffort.java @@ -84,6 +84,8 @@ public static KnowledgeRetrievalReasoningEffort fromJson(JsonReader jsonReader) return KnowledgeRetrievalLowReasoningEffort.fromJson(readerToUse.reset()); } else if ("medium".equals(discriminatorValue)) { return KnowledgeRetrievalMediumReasoningEffort.fromJson(readerToUse.reset()); + } else if ("auto".equals(discriminatorValue)) { + return KnowledgeRetrievalAutoReasoningEffort.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffortKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffortKind.java index 9b3cb20f4f9bc..cfa62c16fafab 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffortKind.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeRetrievalReasoningEffortKind.java @@ -61,4 +61,11 @@ public static Collection values() { */ @Generated public static final KnowledgeRetrievalReasoningEffortKind MEDIUM = fromString("medium"); + + /** + * Automatically select the reasoning effort during retrieval, escalating from the cheapest tier only as far as + * needed. + */ + @Generated + public static final KnowledgeRetrievalReasoningEffortKind AUTO = fromString("auto"); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java index 46b26dd7456eb..070b82b68b441 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceIngestionParameters.java @@ -267,6 +267,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("contentExtractionMode", this.contentExtractionMode == null ? null : this.contentExtractionMode.toString()); jsonWriter.writeJsonField("aiServices", this.aiServices); + jsonWriter.writeJsonField("assetStore", this.assetStore); + jsonWriter.writeJsonField("freshnessPolicy", this.freshnessPolicy); jsonWriter.writeStringField("networkAccessMode", this.networkAccessMode == null ? null : this.networkAccessMode.toString()); jsonWriter.writeJsonField("cache", this.cache); @@ -314,6 +316,10 @@ public static KnowledgeSourceIngestionParameters fromJson(JsonReader jsonReader) = KnowledgeSourceContentExtractionMode.fromString(reader.getString()); } else if ("aiServices".equals(fieldName)) { deserializedKnowledgeSourceIngestionParameters.aiServices = AiServices.fromJson(reader); + } else if ("assetStore".equals(fieldName)) { + deserializedKnowledgeSourceIngestionParameters.assetStore = AssetStore.fromJson(reader); + } else if ("freshnessPolicy".equals(fieldName)) { + deserializedKnowledgeSourceIngestionParameters.freshnessPolicy = FreshnessPolicy.fromJson(reader); } else if ("networkAccessMode".equals(fieldName)) { deserializedKnowledgeSourceIngestionParameters.networkAccessMode = KnowledgeSourceNetworkAccessMode.fromString(reader.getString()); @@ -327,6 +333,62 @@ public static KnowledgeSourceIngestionParameters fromJson(JsonReader jsonReader) }); } + /* + * Optional asset store configuration for storing extracted assets such as images. + */ + @Generated + private AssetStore assetStore; + + /* + * Optional freshness policy for biasing retrieval toward newer documents. + */ + @Generated + private FreshnessPolicy freshnessPolicy; + + /** + * Get the assetStore property: Optional asset store configuration for storing extracted assets such as images. + * + * @return the assetStore value. + */ + @Generated + public AssetStore getAssetStore() { + return this.assetStore; + } + + /** + * Set the assetStore property: Optional asset store configuration for storing extracted assets such as images. + * + * @param assetStore the assetStore value to set. + * @return the KnowledgeSourceIngestionParameters object itself. + */ + @Generated + public KnowledgeSourceIngestionParameters setAssetStore(AssetStore assetStore) { + this.assetStore = assetStore; + return this; + } + + /** + * Get the freshnessPolicy property: Optional freshness policy for biasing retrieval toward newer documents. + * + * @return the freshnessPolicy value. + */ + @Generated + public FreshnessPolicy getFreshnessPolicy() { + return this.freshnessPolicy; + } + + /** + * Set the freshnessPolicy property: Optional freshness policy for biasing retrieval toward newer documents. + * + * @param freshnessPolicy the freshnessPolicy value to set. + * @return the KnowledgeSourceIngestionParameters object itself. + */ + @Generated + public KnowledgeSourceIngestionParameters setFreshnessPolicy(FreshnessPolicy freshnessPolicy) { + this.freshnessPolicy = freshnessPolicy; + return this; + } + /* * Optional AI Services configuration for content processing. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceParams.java index 12ba924ba81ac..7769e1ade18fc 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/KnowledgeSourceParams.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import java.io.IOException; /** @@ -162,9 +163,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", this.includeReferences); jsonWriter.writeBooleanField("includeReferenceSourceData", this.includeReferenceSourceData); jsonWriter.writeBooleanField("alwaysQuerySource", this.alwaysQuerySource); + jsonWriter.writeBooleanField("neverQuerySource", this.neverQuerySource); jsonWriter.writeBooleanField("failOnError", this.failOnError); jsonWriter.writeNumberField("rerankerThreshold", this.rerankerThreshold); + jsonWriter.writeStringField("resultsProcessing", + this.resultsProcessing == null ? null : this.resultsProcessing.toString()); jsonWriter.writeNumberField("maxOutputDocuments", this.maxOutputDocuments); + jsonWriter.writeBooleanField("enableImageServing", this.enableImageServing); return jsonWriter.writeEndObject(); } @@ -205,6 +210,16 @@ public static KnowledgeSourceParams fromJson(JsonReader jsonReader) throws IOExc return IndexedOneLakeKnowledgeSourceParams.fromJson(readerToUse.reset()); } else if ("web".equals(discriminatorValue)) { return WebKnowledgeSourceParams.fromJson(readerToUse.reset()); + } else if ("remoteSharePoint".equals(discriminatorValue)) { + return RemoteSharePointKnowledgeSourceParams.fromJson(readerToUse.reset()); + } else if ("workIQ".equals(discriminatorValue)) { + return WorkIQKnowledgeSourceParams.fromJson(readerToUse.reset()); + } else if ("fabricDataAgent".equals(discriminatorValue)) { + return FabricDataAgentKnowledgeSourceParams.fromJson(readerToUse.reset()); + } else if ("fabricOntology".equals(discriminatorValue)) { + return FabricOntologyKnowledgeSourceParams.fromJson(readerToUse.reset()); + } else if ("mcpServer".equals(discriminatorValue)) { + return McpServerKnowledgeSourceParams.fromJson(readerToUse.reset()); } else if ("file".equals(discriminatorValue)) { return FileKnowledgeSourceParams.fromJson(readerToUse.reset()); } else if ("indexedSql".equals(discriminatorValue)) { @@ -224,9 +239,12 @@ static KnowledgeSourceParams fromJsonKnownDiscriminator(JsonReader jsonReader) t Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -240,12 +258,18 @@ static KnowledgeSourceParams fromJsonKnownDiscriminator(JsonReader jsonReader) t includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } @@ -255,9 +279,12 @@ static KnowledgeSourceParams fromJsonKnownDiscriminator(JsonReader jsonReader) t deserializedKnowledgeSourceParams.includeReferences = includeReferences; deserializedKnowledgeSourceParams.includeReferenceSourceData = includeReferenceSourceData; deserializedKnowledgeSourceParams.alwaysQuerySource = alwaysQuerySource; + deserializedKnowledgeSourceParams.neverQuerySource = neverQuerySource; deserializedKnowledgeSourceParams.failOnError = failOnError; deserializedKnowledgeSourceParams.rerankerThreshold = rerankerThreshold; + deserializedKnowledgeSourceParams.resultsProcessing = resultsProcessing; deserializedKnowledgeSourceParams.maxOutputDocuments = maxOutputDocuments; + deserializedKnowledgeSourceParams.enableImageServing = enableImageServing; return deserializedKnowledgeSourceParams; }); } @@ -281,6 +308,13 @@ static KnowledgeSourceParams fromJsonKnownDiscriminator(JsonReader jsonReader) t @Generated private Integer maxOutputDocuments; + /* + * Indicates whether image serving should be enabled for this knowledge source at retrieval time. When true, images + * extracted during ingestion are delivered to downstream models. + */ + @Generated + private Boolean enableImageServing; + /** * Get the alwaysQuerySource property: Indicates that this knowledge source should bypass source selection and * always be queried at retrieval time. @@ -350,4 +384,93 @@ public KnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments) { this.maxOutputDocuments = maxOutputDocuments; return this; } + + /** + * Get the enableImageServing property: Indicates whether image serving should be enabled for this knowledge source + * at retrieval time. When true, images extracted during ingestion are delivered to downstream models. + * + * @return the enableImageServing value. + */ + @Generated + public Boolean isEnableImageServing() { + return this.enableImageServing; + } + + /** + * Set the enableImageServing property: Indicates whether image serving should be enabled for this knowledge source + * at retrieval time. When true, images extracted during ingestion are delivered to downstream models. + * + * @param enableImageServing the enableImageServing value to set. + * @return the KnowledgeSourceParams object itself. + */ + @Generated + public KnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + this.enableImageServing = enableImageServing; + return this; + } + + /* + * Indicates that this knowledge source should be excluded from the request's candidate set and never queried at + * retrieval time. The exclusion is request-local and does not modify knowledge base membership. Cannot be combined + * with alwaysQuerySource on the same knowledge source. + */ + @Generated + private Boolean neverQuerySource; + + /* + * Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored + * knowledge source value applies. + */ + @Generated + private KnowledgeSourceResultsProcessing resultsProcessing; + + /** + * Get the neverQuerySource property: Indicates that this knowledge source should be excluded from the request's + * candidate set and never queried at retrieval time. The exclusion is request-local and does not modify knowledge + * base membership. Cannot be combined with alwaysQuerySource on the same knowledge source. + * + * @return the neverQuerySource value. + */ + @Generated + public Boolean isNeverQuerySource() { + return this.neverQuerySource; + } + + /** + * Set the neverQuerySource property: Indicates that this knowledge source should be excluded from the request's + * candidate set and never queried at retrieval time. The exclusion is request-local and does not modify knowledge + * base membership. Cannot be combined with alwaysQuerySource on the same knowledge source. + * + * @param neverQuerySource the neverQuerySource value to set. + * @return the KnowledgeSourceParams object itself. + */ + @Generated + public KnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + this.neverQuerySource = neverQuerySource; + return this; + } + + /** + * Get the resultsProcessing property: Overrides the knowledge source's stored resultsProcessing for this retrieve + * call only. When omitted, the stored knowledge source value applies. + * + * @return the resultsProcessing value. + */ + @Generated + public KnowledgeSourceResultsProcessing getResultsProcessing() { + return this.resultsProcessing; + } + + /** + * Set the resultsProcessing property: Overrides the knowledge source's stored resultsProcessing for this retrieve + * call only. When omitted, the stored knowledge source value applies. + * + * @param resultsProcessing the resultsProcessing value to set. + * @return the KnowledgeSourceParams object itself. + */ + @Generated + public KnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + this.resultsProcessing = resultsProcessing; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/McpServerKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/McpServerKnowledgeSourceParams.java new file mode 100644 index 0000000000000..f1ce7b28f9e21 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/McpServerKnowledgeSourceParams.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import java.io.IOException; + +/** + * Specifies runtime parameters for an MCP server knowledge source. + */ +@Fluent +public final class McpServerKnowledgeSourceParams extends KnowledgeSourceParams { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.MCP_SERVER; + + /** + * Creates an instance of McpServerKnowledgeSourceParams class. + * + * @param knowledgeSourceName the knowledgeSourceName value to set. + */ + @Generated + public McpServerKnowledgeSourceParams(String knowledgeSourceName) { + super(knowledgeSourceName); + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setIncludeReferences(Boolean includeReferences) { + super.setIncludeReferences(includeReferences); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setIncludeReferenceSourceData(Boolean includeReferenceSourceData) { + super.setIncludeReferenceSourceData(includeReferenceSourceData); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setAlwaysQuerySource(Boolean alwaysQuerySource) { + super.setAlwaysQuerySource(alwaysQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setFailOnError(Boolean failOnError) { + super.setFailOnError(failOnError); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setRerankerThreshold(Float rerankerThreshold) { + super.setRerankerThreshold(rerankerThreshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments) { + super.setMaxOutputDocuments(maxOutputDocuments); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("knowledgeSourceName", getKnowledgeSourceName()); + jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); + jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); + jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); + jsonWriter.writeBooleanField("failOnError", isFailOnError()); + jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of McpServerKnowledgeSourceParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of McpServerKnowledgeSourceParams if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the McpServerKnowledgeSourceParams. + */ + @Generated + public static McpServerKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String knowledgeSourceName = null; + Boolean includeReferences = null; + Boolean includeReferenceSourceData = null; + Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; + Boolean failOnError = null; + Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + Integer maxOutputDocuments = null; + Boolean enableImageServing = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.MCP_SERVER; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("includeReferences".equals(fieldName)) { + includeReferences = reader.getNullable(JsonReader::getBoolean); + } else if ("includeReferenceSourceData".equals(fieldName)) { + includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); + } else if ("alwaysQuerySource".equals(fieldName)) { + alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("failOnError".equals(fieldName)) { + failOnError = reader.getNullable(JsonReader::getBoolean); + } else if ("rerankerThreshold".equals(fieldName)) { + rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("maxOutputDocuments".equals(fieldName)) { + maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + McpServerKnowledgeSourceParams deserializedMcpServerKnowledgeSourceParams + = new McpServerKnowledgeSourceParams(knowledgeSourceName); + deserializedMcpServerKnowledgeSourceParams.setIncludeReferences(includeReferences); + deserializedMcpServerKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); + deserializedMcpServerKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedMcpServerKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); + deserializedMcpServerKnowledgeSourceParams.setFailOnError(failOnError); + deserializedMcpServerKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedMcpServerKnowledgeSourceParams.setResultsProcessing(resultsProcessing); + deserializedMcpServerKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedMcpServerKnowledgeSourceParams.setEnableImageServing(enableImageServing); + deserializedMcpServerKnowledgeSourceParams.kind = kind; + return deserializedMcpServerKnowledgeSourceParams; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public McpServerKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/PurviewSensitivityLabelInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/PurviewSensitivityLabelInfo.java new file mode 100644 index 0000000000000..9fc9ac2f56f9e --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/PurviewSensitivityLabelInfo.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about the sensitivity label applied to a document. + */ +@Immutable +public final class PurviewSensitivityLabelInfo implements JsonSerializable { + + /* + * The display name for the sensitivity label. + */ + @Generated + private String displayName; + + /* + * The ID of the sensitivity label. + */ + @Generated + private String sensitivityLabelId; + + /* + * The tooltip that should be displayed for the label in a UI. + */ + @Generated + private String toolTip; + + /* + * The priority in which the sensitivity label is applied. + */ + @Generated + private Integer priority; + + /* + * The color that the UI should display for the label, if configured. + */ + @Generated + private String color; + + /* + * Indicates whether the sensitivity label enforces encryption. + */ + @Generated + private Boolean isEncrypted; + + /** + * Creates an instance of PurviewSensitivityLabelInfo class. + */ + @Generated + private PurviewSensitivityLabelInfo() { + } + + /** + * Get the displayName property: The display name for the sensitivity label. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Get the sensitivityLabelId property: The ID of the sensitivity label. + * + * @return the sensitivityLabelId value. + */ + @Generated + public String getSensitivityLabelId() { + return this.sensitivityLabelId; + } + + /** + * Get the toolTip property: The tooltip that should be displayed for the label in a UI. + * + * @return the toolTip value. + */ + @Generated + public String getToolTip() { + return this.toolTip; + } + + /** + * Get the priority property: The priority in which the sensitivity label is applied. + * + * @return the priority value. + */ + @Generated + public Integer getPriority() { + return this.priority; + } + + /** + * Get the color property: The color that the UI should display for the label, if configured. + * + * @return the color value. + */ + @Generated + public String getColor() { + return this.color; + } + + /** + * Get the isEncrypted property: Indicates whether the sensitivity label enforces encryption. + * + * @return the isEncrypted value. + */ + @Generated + public Boolean isEncrypted() { + return this.isEncrypted; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("sensitivityLabelId", this.sensitivityLabelId); + jsonWriter.writeStringField("toolTip", this.toolTip); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeStringField("color", this.color); + jsonWriter.writeBooleanField("isEncrypted", this.isEncrypted); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewSensitivityLabelInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewSensitivityLabelInfo if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PurviewSensitivityLabelInfo. + */ + @Generated + public static PurviewSensitivityLabelInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewSensitivityLabelInfo deserializedPurviewSensitivityLabelInfo = new PurviewSensitivityLabelInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("displayName".equals(fieldName)) { + deserializedPurviewSensitivityLabelInfo.displayName = reader.getString(); + } else if ("sensitivityLabelId".equals(fieldName)) { + deserializedPurviewSensitivityLabelInfo.sensitivityLabelId = reader.getString(); + } else if ("toolTip".equals(fieldName)) { + deserializedPurviewSensitivityLabelInfo.toolTip = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedPurviewSensitivityLabelInfo.priority = reader.getNullable(JsonReader::getInt); + } else if ("color".equals(fieldName)) { + deserializedPurviewSensitivityLabelInfo.color = reader.getString(); + } else if ("isEncrypted".equals(fieldName)) { + deserializedPurviewSensitivityLabelInfo.isEncrypted = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedPurviewSensitivityLabelInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/RemoteSharePointKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/RemoteSharePointKnowledgeSourceParams.java new file mode 100644 index 0000000000000..c107991adeaf9 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/RemoteSharePointKnowledgeSourceParams.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import java.io.IOException; + +/** + * Specifies runtime parameters for a remote SharePoint knowledge source. + */ +@Fluent +public final class RemoteSharePointKnowledgeSourceParams extends KnowledgeSourceParams { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.REMOTE_SHARE_POINT; + + /* + * A filter condition applied to the SharePoint data source. It must be specified in the Keyword Query Language + * syntax. It will be combined as a conjunction with the filter expression specified in the knowledge source + * definition. + */ + @Generated + private String filterExpressionAddOn; + + /** + * Creates an instance of RemoteSharePointKnowledgeSourceParams class. + * + * @param knowledgeSourceName the knowledgeSourceName value to set. + */ + @Generated + public RemoteSharePointKnowledgeSourceParams(String knowledgeSourceName) { + super(knowledgeSourceName); + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * Get the filterExpressionAddOn property: A filter condition applied to the SharePoint data source. It must be + * specified in the Keyword Query Language syntax. It will be combined as a conjunction with the filter expression + * specified in the knowledge source definition. + * + * @return the filterExpressionAddOn value. + */ + @Generated + public String getFilterExpressionAddOn() { + return this.filterExpressionAddOn; + } + + /** + * Set the filterExpressionAddOn property: A filter condition applied to the SharePoint data source. It must be + * specified in the Keyword Query Language syntax. It will be combined as a conjunction with the filter expression + * specified in the knowledge source definition. + * + * @param filterExpressionAddOn the filterExpressionAddOn value to set. + * @return the RemoteSharePointKnowledgeSourceParams object itself. + */ + @Generated + public RemoteSharePointKnowledgeSourceParams setFilterExpressionAddOn(String filterExpressionAddOn) { + this.filterExpressionAddOn = filterExpressionAddOn; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setIncludeReferences(Boolean includeReferences) { + super.setIncludeReferences(includeReferences); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setIncludeReferenceSourceData(Boolean includeReferenceSourceData) { + super.setIncludeReferenceSourceData(includeReferenceSourceData); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setAlwaysQuerySource(Boolean alwaysQuerySource) { + super.setAlwaysQuerySource(alwaysQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setFailOnError(Boolean failOnError) { + super.setFailOnError(failOnError); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setRerankerThreshold(Float rerankerThreshold) { + super.setRerankerThreshold(rerankerThreshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments) { + super.setMaxOutputDocuments(maxOutputDocuments); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("knowledgeSourceName", getKnowledgeSourceName()); + jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); + jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); + jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); + jsonWriter.writeBooleanField("failOnError", isFailOnError()); + jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("filterExpressionAddOn", this.filterExpressionAddOn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteSharePointKnowledgeSourceParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteSharePointKnowledgeSourceParams if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RemoteSharePointKnowledgeSourceParams. + */ + @Generated + public static RemoteSharePointKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String knowledgeSourceName = null; + Boolean includeReferences = null; + Boolean includeReferenceSourceData = null; + Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; + Boolean failOnError = null; + Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + Integer maxOutputDocuments = null; + Boolean enableImageServing = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.REMOTE_SHARE_POINT; + String filterExpressionAddOn = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("includeReferences".equals(fieldName)) { + includeReferences = reader.getNullable(JsonReader::getBoolean); + } else if ("includeReferenceSourceData".equals(fieldName)) { + includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); + } else if ("alwaysQuerySource".equals(fieldName)) { + alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("failOnError".equals(fieldName)) { + failOnError = reader.getNullable(JsonReader::getBoolean); + } else if ("rerankerThreshold".equals(fieldName)) { + rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("maxOutputDocuments".equals(fieldName)) { + maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else if ("filterExpressionAddOn".equals(fieldName)) { + filterExpressionAddOn = reader.getString(); + } else { + reader.skipChildren(); + } + } + RemoteSharePointKnowledgeSourceParams deserializedRemoteSharePointKnowledgeSourceParams + = new RemoteSharePointKnowledgeSourceParams(knowledgeSourceName); + deserializedRemoteSharePointKnowledgeSourceParams.setIncludeReferences(includeReferences); + deserializedRemoteSharePointKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); + deserializedRemoteSharePointKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedRemoteSharePointKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); + deserializedRemoteSharePointKnowledgeSourceParams.setFailOnError(failOnError); + deserializedRemoteSharePointKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedRemoteSharePointKnowledgeSourceParams.setResultsProcessing(resultsProcessing); + deserializedRemoteSharePointKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedRemoteSharePointKnowledgeSourceParams.setEnableImageServing(enableImageServing); + deserializedRemoteSharePointKnowledgeSourceParams.kind = kind; + deserializedRemoteSharePointKnowledgeSourceParams.filterExpressionAddOn = filterExpressionAddOn; + return deserializedRemoteSharePointKnowledgeSourceParams; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RemoteSharePointKnowledgeSourceParams + setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ServedImage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ServedImage.java new file mode 100644 index 0000000000000..ee8970baaff41 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/ServedImage.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a single image that the model selected to be served during a retrieval activity. + */ +@Immutable +public final class ServedImage implements JsonSerializable { + + /* + * The image label extracted from the source document by Content Understanding enrichment. Corresponds to the figure + * numbering in the original document. + */ + @Generated + private String imageId; + + /* + * The relative path to the image within the asset store. + */ + @Generated + private final String imagePath; + + /* + * The size in bytes of this image as sent to the model. + */ + @Generated + private final long sizeBytes; + + /** + * Get the imageId property: The image label extracted from the source document by Content Understanding enrichment. + * Corresponds to the figure numbering in the original document. + * + * @return the imageId value. + */ + @Generated + public String getImageId() { + return this.imageId; + } + + /** + * Get the imagePath property: The relative path to the image within the asset store. + * + * @return the imagePath value. + */ + @Generated + public String getImagePath() { + return this.imagePath; + } + + /** + * Get the sizeBytes property: The size in bytes of this image as sent to the model. + * + * @return the sizeBytes value. + */ + @Generated + public long getSizeBytes() { + return this.sizeBytes; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("imagePath", this.imagePath); + jsonWriter.writeLongField("sizeBytes", this.sizeBytes); + jsonWriter.writeStringField("imageId", this.imageId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServedImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServedImage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServedImage. + */ + @Generated + public static ServedImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String imagePath = null; + long sizeBytes = 0L; + String imageId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("imagePath".equals(fieldName)) { + imagePath = reader.getString(); + } else if ("sizeBytes".equals(fieldName)) { + sizeBytes = reader.getLong(); + } else if ("imageId".equals(fieldName)) { + imageId = reader.getString(); + } else { + reader.skipChildren(); + } + } + ServedImage deserializedServedImage = new ServedImage(imagePath, sizeBytes); + deserializedServedImage.imageId = imageId; + return deserializedServedImage; + }); + } + + /** + * Creates an instance of ServedImage class. + * + * @param imagePath the imagePath value to set. + * @param sizeBytes the sizeBytes value to set. + */ + @Generated + private ServedImage(String imagePath, long sizeBytes) { + this.imagePath = imagePath; + this.sizeBytes = sizeBytes; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WebKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WebKnowledgeSourceParams.java index fa1fbe211f2b9..f2dc7933fe96d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WebKnowledgeSourceParams.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WebKnowledgeSourceParams.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import java.io.IOException; /** @@ -197,9 +198,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); jsonWriter.writeBooleanField("failOnError", isFailOnError()); jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeStringField("language", this.language); jsonWriter.writeStringField("market", this.market); @@ -224,9 +229,12 @@ public static WebKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IO Boolean includeReferences = null; Boolean includeReferenceSourceData = null; Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; Boolean failOnError = null; Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; Integer maxOutputDocuments = null; + Boolean enableImageServing = null; KnowledgeSourceKind kind = KnowledgeSourceKind.WEB; String language = null; String market = null; @@ -243,12 +251,18 @@ public static WebKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IO includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); } else if ("alwaysQuerySource".equals(fieldName)) { alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); } else if ("failOnError".equals(fieldName)) { failOnError = reader.getNullable(JsonReader::getBoolean); } else if ("rerankerThreshold".equals(fieldName)) { rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); } else if ("maxOutputDocuments".equals(fieldName)) { maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); } else if ("kind".equals(fieldName)) { kind = KnowledgeSourceKind.fromString(reader.getString()); } else if ("language".equals(fieldName)) { @@ -268,9 +282,12 @@ public static WebKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IO deserializedWebKnowledgeSourceParams.setIncludeReferences(includeReferences); deserializedWebKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); deserializedWebKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedWebKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); deserializedWebKnowledgeSourceParams.setFailOnError(failOnError); deserializedWebKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedWebKnowledgeSourceParams.setResultsProcessing(resultsProcessing); deserializedWebKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedWebKnowledgeSourceParams.setEnableImageServing(enableImageServing); deserializedWebKnowledgeSourceParams.kind = kind; deserializedWebKnowledgeSourceParams.language = language; deserializedWebKnowledgeSourceParams.market = market; @@ -309,4 +326,34 @@ public WebKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments super.setMaxOutputDocuments(maxOutputDocuments); return this; } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WebKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WebKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WebKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WorkIQKnowledgeSourceParams.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WorkIQKnowledgeSourceParams.java new file mode 100644 index 0000000000000..69e2d015a03f2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/models/WorkIQKnowledgeSourceParams.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.knowledgebases.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; +import java.io.IOException; + +/** + * Specifies runtime parameters for a WorkIQ knowledge source. + */ +@Fluent +public final class WorkIQKnowledgeSourceParams extends KnowledgeSourceParams { + + /* + * The type of the knowledge source. + */ + @Generated + private KnowledgeSourceKind kind = KnowledgeSourceKind.WORK_IQ; + + /** + * Creates an instance of WorkIQKnowledgeSourceParams class. + * + * @param knowledgeSourceName the knowledgeSourceName value to set. + */ + @Generated + public WorkIQKnowledgeSourceParams(String knowledgeSourceName) { + super(knowledgeSourceName); + } + + /** + * Get the kind property: The type of the knowledge source. + * + * @return the kind value. + */ + @Generated + @Override + public KnowledgeSourceKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setIncludeReferences(Boolean includeReferences) { + super.setIncludeReferences(includeReferences); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setIncludeReferenceSourceData(Boolean includeReferenceSourceData) { + super.setIncludeReferenceSourceData(includeReferenceSourceData); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setAlwaysQuerySource(Boolean alwaysQuerySource) { + super.setAlwaysQuerySource(alwaysQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setFailOnError(Boolean failOnError) { + super.setFailOnError(failOnError); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setRerankerThreshold(Float rerankerThreshold) { + super.setRerankerThreshold(rerankerThreshold); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setMaxOutputDocuments(Integer maxOutputDocuments) { + super.setMaxOutputDocuments(maxOutputDocuments); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setEnableImageServing(Boolean enableImageServing) { + super.setEnableImageServing(enableImageServing); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("knowledgeSourceName", getKnowledgeSourceName()); + jsonWriter.writeBooleanField("includeReferences", isIncludeReferences()); + jsonWriter.writeBooleanField("includeReferenceSourceData", isIncludeReferenceSourceData()); + jsonWriter.writeBooleanField("alwaysQuerySource", isAlwaysQuerySource()); + jsonWriter.writeBooleanField("neverQuerySource", isNeverQuerySource()); + jsonWriter.writeBooleanField("failOnError", isFailOnError()); + jsonWriter.writeNumberField("rerankerThreshold", getRerankerThreshold()); + jsonWriter.writeStringField("resultsProcessing", + getResultsProcessing() == null ? null : getResultsProcessing().toString()); + jsonWriter.writeNumberField("maxOutputDocuments", getMaxOutputDocuments()); + jsonWriter.writeBooleanField("enableImageServing", isEnableImageServing()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkIQKnowledgeSourceParams from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkIQKnowledgeSourceParams if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkIQKnowledgeSourceParams. + */ + @Generated + public static WorkIQKnowledgeSourceParams fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String knowledgeSourceName = null; + Boolean includeReferences = null; + Boolean includeReferenceSourceData = null; + Boolean alwaysQuerySource = null; + Boolean neverQuerySource = null; + Boolean failOnError = null; + Float rerankerThreshold = null; + KnowledgeSourceResultsProcessing resultsProcessing = null; + Integer maxOutputDocuments = null; + Boolean enableImageServing = null; + KnowledgeSourceKind kind = KnowledgeSourceKind.WORK_IQ; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("knowledgeSourceName".equals(fieldName)) { + knowledgeSourceName = reader.getString(); + } else if ("includeReferences".equals(fieldName)) { + includeReferences = reader.getNullable(JsonReader::getBoolean); + } else if ("includeReferenceSourceData".equals(fieldName)) { + includeReferenceSourceData = reader.getNullable(JsonReader::getBoolean); + } else if ("alwaysQuerySource".equals(fieldName)) { + alwaysQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("neverQuerySource".equals(fieldName)) { + neverQuerySource = reader.getNullable(JsonReader::getBoolean); + } else if ("failOnError".equals(fieldName)) { + failOnError = reader.getNullable(JsonReader::getBoolean); + } else if ("rerankerThreshold".equals(fieldName)) { + rerankerThreshold = reader.getNullable(JsonReader::getFloat); + } else if ("resultsProcessing".equals(fieldName)) { + resultsProcessing = KnowledgeSourceResultsProcessing.fromString(reader.getString()); + } else if ("maxOutputDocuments".equals(fieldName)) { + maxOutputDocuments = reader.getNullable(JsonReader::getInt); + } else if ("enableImageServing".equals(fieldName)) { + enableImageServing = reader.getNullable(JsonReader::getBoolean); + } else if ("kind".equals(fieldName)) { + kind = KnowledgeSourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + WorkIQKnowledgeSourceParams deserializedWorkIQKnowledgeSourceParams + = new WorkIQKnowledgeSourceParams(knowledgeSourceName); + deserializedWorkIQKnowledgeSourceParams.setIncludeReferences(includeReferences); + deserializedWorkIQKnowledgeSourceParams.setIncludeReferenceSourceData(includeReferenceSourceData); + deserializedWorkIQKnowledgeSourceParams.setAlwaysQuerySource(alwaysQuerySource); + deserializedWorkIQKnowledgeSourceParams.setNeverQuerySource(neverQuerySource); + deserializedWorkIQKnowledgeSourceParams.setFailOnError(failOnError); + deserializedWorkIQKnowledgeSourceParams.setRerankerThreshold(rerankerThreshold); + deserializedWorkIQKnowledgeSourceParams.setResultsProcessing(resultsProcessing); + deserializedWorkIQKnowledgeSourceParams.setMaxOutputDocuments(maxOutputDocuments); + deserializedWorkIQKnowledgeSourceParams.setEnableImageServing(enableImageServing); + deserializedWorkIQKnowledgeSourceParams.kind = kind; + return deserializedWorkIQKnowledgeSourceParams; + }); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setNeverQuerySource(Boolean neverQuerySource) { + super.setNeverQuerySource(neverQuerySource); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WorkIQKnowledgeSourceParams setResultsProcessing(KnowledgeSourceResultsProcessing resultsProcessing) { + super.setResultsProcessing(resultsProcessing); + return this; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DocumentDebugInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DocumentDebugInfo.java index f554ed555f583..1fe36e0fd123d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DocumentDebugInfo.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/DocumentDebugInfo.java @@ -10,6 +10,8 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; +import java.util.Map; /** * Contains debugging information that can be used to further explore your search results. @@ -65,8 +67,14 @@ public static DocumentDebugInfo fromJson(JsonReader jsonReader) throws IOExcepti while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("vectors".equals(fieldName)) { + if ("semantic".equals(fieldName)) { + deserializedDocumentDebugInfo.semantic = SemanticDebugInfo.fromJson(reader); + } else if ("vectors".equals(fieldName)) { deserializedDocumentDebugInfo.vectors = VectorsDebugInfo.fromJson(reader); + } else if ("innerHits".equals(fieldName)) { + Map> innerHits = reader.readMap( + reader1 -> reader1.readArray(reader2 -> QueryResultDocumentInnerHit.fromJson(reader2))); + deserializedDocumentDebugInfo.innerHits = innerHits; } else { reader.skipChildren(); } @@ -74,4 +82,37 @@ public static DocumentDebugInfo fromJson(JsonReader jsonReader) throws IOExcepti return deserializedDocumentDebugInfo; }); } + + /* + * Contains debugging information specific to semantic ranking requests. + */ + @Generated + private SemanticDebugInfo semantic; + + /* + * Contains debugging information specific to vectors matched within a collection of complex types. + */ + @Generated + private Map> innerHits; + + /** + * Get the semantic property: Contains debugging information specific to semantic ranking requests. + * + * @return the semantic value. + */ + @Generated + public SemanticDebugInfo getSemantic() { + return this.semantic; + } + + /** + * Get the innerHits property: Contains debugging information specific to vectors matched within a collection of + * complex types. + * + * @return the innerHits value. + */ + @Generated + public Map> getInnerHits() { + return this.innerHits; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java index 906e23ff4dded..b0283c46f59d0 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/FacetResult.java @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; /** @@ -107,6 +108,20 @@ public static FacetResult fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("count".equals(fieldName)) { deserializedFacetResult.count = reader.getNullable(JsonReader::getLong); + } else if ("avg".equals(fieldName)) { + deserializedFacetResult.avg = reader.getNullable(JsonReader::getDouble); + } else if ("min".equals(fieldName)) { + deserializedFacetResult.min = reader.getNullable(JsonReader::getDouble); + } else if ("max".equals(fieldName)) { + deserializedFacetResult.max = reader.getNullable(JsonReader::getDouble); + } else if ("sum".equals(fieldName)) { + deserializedFacetResult.sum = reader.getNullable(JsonReader::getDouble); + } else if ("cardinality".equals(fieldName)) { + deserializedFacetResult.cardinality = reader.getNullable(JsonReader::getLong); + } else if ("@search.facets".equals(fieldName)) { + Map> facets + = reader.readMap(reader1 -> reader1.readArray(reader2 -> FacetResult.fromJson(reader2))); + deserializedFacetResult.facets = facets; } else { if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); @@ -118,4 +133,103 @@ public static FacetResult fromJson(JsonReader jsonReader) throws IOException { return deserializedFacetResult; }); } + + /* + * The resulting total avg for the facet when a avg metric is requested. + */ + @Generated + private Double avg; + + /* + * The resulting total min for the facet when a min metric is requested. + */ + @Generated + private Double min; + + /* + * The resulting total max for the facet when a max metric is requested. + */ + @Generated + private Double max; + + /* + * The resulting total sum for the facet when a sum metric is requested. + */ + @Generated + private Double sum; + + /* + * The resulting total cardinality for the facet when a cardinality metric is requested. + */ + @Generated + private Long cardinality; + + /* + * The nested facet query results for the search operation, organized as a collection of buckets for each faceted + * field; null if the query did not contain any nested facets. + */ + @Generated + private Map> facets; + + /** + * Get the avg property: The resulting total avg for the facet when a avg metric is requested. + * + * @return the avg value. + */ + @Generated + public Double getAvg() { + return this.avg; + } + + /** + * Get the min property: The resulting total min for the facet when a min metric is requested. + * + * @return the min value. + */ + @Generated + public Double getMin() { + return this.min; + } + + /** + * Get the max property: The resulting total max for the facet when a max metric is requested. + * + * @return the max value. + */ + @Generated + public Double getMax() { + return this.max; + } + + /** + * Get the sum property: The resulting total sum for the facet when a sum metric is requested. + * + * @return the sum value. + */ + @Generated + public Double getSum() { + return this.sum; + } + + /** + * Get the cardinality property: The resulting total cardinality for the facet when a cardinality metric is + * requested. + * + * @return the cardinality value. + */ + @Generated + public Long getCardinality() { + return this.cardinality; + } + + /** + * Get the facets property: The nested facet query results for the search operation, organized as a collection of + * buckets for each faceted field; null if the query did not contain any nested facets. + * + * @return the facets value. + */ + @Generated + public Map> getFacets() { + return this.facets; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridCountAndFacetMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridCountAndFacetMode.java new file mode 100644 index 0000000000000..985054fec1676 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridCountAndFacetMode.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determines whether the count and facets should includes all documents that matched the search query, or only the + * documents that are retrieved within the 'maxTextRecallSize' window. The default value is 'countAllResults'. + */ +public final class HybridCountAndFacetMode extends ExpandableStringEnum { + + /** + * Only include documents that were matched within the 'maxTextRecallSize' retrieval window when computing 'count' + * and 'facets'. + */ + @Generated + public static final HybridCountAndFacetMode COUNT_RETRIEVABLE_RESULTS = fromString("countRetrievableResults"); + + /** + * Include all documents that were matched by the search query when computing 'count' and 'facets', regardless of + * whether or not those documents are within the 'maxTextRecallSize' retrieval window. + */ + @Generated + public static final HybridCountAndFacetMode COUNT_ALL_RESULTS = fromString("countAllResults"); + + /** + * Creates a new instance of HybridCountAndFacetMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public HybridCountAndFacetMode() { + } + + /** + * Creates or finds a HybridCountAndFacetMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding HybridCountAndFacetMode. + */ + @Generated + public static HybridCountAndFacetMode fromString(String name) { + return fromString(name, HybridCountAndFacetMode.class); + } + + /** + * Gets known HybridCountAndFacetMode values. + * + * @return known HybridCountAndFacetMode values. + */ + @Generated + public static Collection values() { + return values(HybridCountAndFacetMode.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridSearch.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridSearch.java new file mode 100644 index 0000000000000..2000f7e7cb24f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/HybridSearch.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The query parameters to configure hybrid search behaviors. + */ +@Fluent +public final class HybridSearch implements JsonSerializable { + + /* + * Determines the maximum number of documents to be retrieved by the text query portion of a hybrid search request. + * Those documents will be combined with the documents matching the vector queries to produce a single final list of + * results. Choosing a larger maxTextRecallSize value will allow retrieving and paging through more documents (using + * the top and skip parameters), at the cost of higher resource utilization and higher latency. The value needs to + * be between 1 and 10,000. Default is 1000. + */ + @Generated + private Integer maxTextRecallSize; + + /* + * Determines whether the count and facets should includes all documents that matched the search query, or only the + * documents that are retrieved within the 'maxTextRecallSize' window. + */ + @Generated + private HybridCountAndFacetMode countAndFacetMode; + + /** + * Creates an instance of HybridSearch class. + */ + @Generated + public HybridSearch() { + } + + /** + * Get the maxTextRecallSize property: Determines the maximum number of documents to be retrieved by the text query + * portion of a hybrid search request. Those documents will be combined with the documents matching the vector + * queries to produce a single final list of results. Choosing a larger maxTextRecallSize value will allow + * retrieving and paging through more documents (using the top and skip parameters), at the cost of higher resource + * utilization and higher latency. The value needs to be between 1 and 10,000. Default is 1000. + * + * @return the maxTextRecallSize value. + */ + @Generated + public Integer getMaxTextRecallSize() { + return this.maxTextRecallSize; + } + + /** + * Set the maxTextRecallSize property: Determines the maximum number of documents to be retrieved by the text query + * portion of a hybrid search request. Those documents will be combined with the documents matching the vector + * queries to produce a single final list of results. Choosing a larger maxTextRecallSize value will allow + * retrieving and paging through more documents (using the top and skip parameters), at the cost of higher resource + * utilization and higher latency. The value needs to be between 1 and 10,000. Default is 1000. + * + * @param maxTextRecallSize the maxTextRecallSize value to set. + * @return the HybridSearch object itself. + */ + @Generated + public HybridSearch setMaxTextRecallSize(Integer maxTextRecallSize) { + this.maxTextRecallSize = maxTextRecallSize; + return this; + } + + /** + * Get the countAndFacetMode property: Determines whether the count and facets should includes all documents that + * matched the search query, or only the documents that are retrieved within the 'maxTextRecallSize' window. + * + * @return the countAndFacetMode value. + */ + @Generated + public HybridCountAndFacetMode getCountAndFacetMode() { + return this.countAndFacetMode; + } + + /** + * Set the countAndFacetMode property: Determines whether the count and facets should includes all documents that + * matched the search query, or only the documents that are retrieved within the 'maxTextRecallSize' window. + * + * @param countAndFacetMode the countAndFacetMode value to set. + * @return the HybridSearch object itself. + */ + @Generated + public HybridSearch setCountAndFacetMode(HybridCountAndFacetMode countAndFacetMode) { + this.countAndFacetMode = countAndFacetMode; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxTextRecallSize", this.maxTextRecallSize); + jsonWriter.writeStringField("countAndFacetMode", + this.countAndFacetMode == null ? null : this.countAndFacetMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HybridSearch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HybridSearch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HybridSearch. + */ + @Generated + public static HybridSearch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HybridSearch deserializedHybridSearch = new HybridSearch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("maxTextRecallSize".equals(fieldName)) { + deserializedHybridSearch.maxTextRecallSize = reader.getNullable(JsonReader::getInt); + } else if ("countAndFacetMode".equals(fieldName)) { + deserializedHybridSearch.countAndFacetMode = HybridCountAndFacetMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedHybridSearch; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryLanguage.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryLanguage.java new file mode 100644 index 0000000000000..4229b9855cabe --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryLanguage.java @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The language of the query. + */ +public final class QueryLanguage extends ExpandableStringEnum { + + /** + * Query language not specified. + */ + @Generated + public static final QueryLanguage NONE = fromString("none"); + + /** + * Query language value for English (United States). + */ + @Generated + public static final QueryLanguage EN_US = fromString("en-us"); + + /** + * Query language value for English (Great Britain). + */ + @Generated + public static final QueryLanguage EN_GB = fromString("en-gb"); + + /** + * Query language value for English (India). + */ + @Generated + public static final QueryLanguage EN_IN = fromString("en-in"); + + /** + * Query language value for English (Canada). + */ + @Generated + public static final QueryLanguage EN_CA = fromString("en-ca"); + + /** + * Query language value for English (Australia). + */ + @Generated + public static final QueryLanguage EN_AU = fromString("en-au"); + + /** + * Query language value for French (France). + */ + @Generated + public static final QueryLanguage FR_FR = fromString("fr-fr"); + + /** + * Query language value for French (Canada). + */ + @Generated + public static final QueryLanguage FR_CA = fromString("fr-ca"); + + /** + * Query language value for German (Germany). + */ + @Generated + public static final QueryLanguage DE_DE = fromString("de-de"); + + /** + * Query language value for Spanish (Spain). + */ + @Generated + public static final QueryLanguage ES_ES = fromString("es-es"); + + /** + * Query language value for Spanish (Mexico). + */ + @Generated + public static final QueryLanguage ES_MX = fromString("es-mx"); + + /** + * Query language value for Chinese (China). + */ + @Generated + public static final QueryLanguage ZH_CN = fromString("zh-cn"); + + /** + * Query language value for Chinese (Taiwan). + */ + @Generated + public static final QueryLanguage ZH_TW = fromString("zh-tw"); + + /** + * Query language value for Portuguese (Brazil). + */ + @Generated + public static final QueryLanguage PT_BR = fromString("pt-br"); + + /** + * Query language value for Portuguese (Portugal). + */ + @Generated + public static final QueryLanguage PT_PT = fromString("pt-pt"); + + /** + * Query language value for Italian (Italy). + */ + @Generated + public static final QueryLanguage IT_IT = fromString("it-it"); + + /** + * Query language value for Japanese (Japan). + */ + @Generated + public static final QueryLanguage JA_JP = fromString("ja-jp"); + + /** + * Query language value for Korean (Korea). + */ + @Generated + public static final QueryLanguage KO_KR = fromString("ko-kr"); + + /** + * Query language value for Russian (Russia). + */ + @Generated + public static final QueryLanguage RU_RU = fromString("ru-ru"); + + /** + * Query language value for Czech (Czech Republic). + */ + @Generated + public static final QueryLanguage CS_CZ = fromString("cs-cz"); + + /** + * Query language value for Dutch (Belgium). + */ + @Generated + public static final QueryLanguage NL_BE = fromString("nl-be"); + + /** + * Query language value for Dutch (Netherlands). + */ + @Generated + public static final QueryLanguage NL_NL = fromString("nl-nl"); + + /** + * Query language value for Hungarian (Hungary). + */ + @Generated + public static final QueryLanguage HU_HU = fromString("hu-hu"); + + /** + * Query language value for Polish (Poland). + */ + @Generated + public static final QueryLanguage PL_PL = fromString("pl-pl"); + + /** + * Query language value for Swedish (Sweden). + */ + @Generated + public static final QueryLanguage SV_SE = fromString("sv-se"); + + /** + * Query language value for Turkish (Turkey). + */ + @Generated + public static final QueryLanguage TR_TR = fromString("tr-tr"); + + /** + * Query language value for Hindi (India). + */ + @Generated + public static final QueryLanguage HI_IN = fromString("hi-in"); + + /** + * Query language value for Arabic (Saudi Arabia). + */ + @Generated + public static final QueryLanguage AR_SA = fromString("ar-sa"); + + /** + * Query language value for Arabic (Egypt). + */ + @Generated + public static final QueryLanguage AR_EG = fromString("ar-eg"); + + /** + * Query language value for Arabic (Morocco). + */ + @Generated + public static final QueryLanguage AR_MA = fromString("ar-ma"); + + /** + * Query language value for Arabic (Kuwait). + */ + @Generated + public static final QueryLanguage AR_KW = fromString("ar-kw"); + + /** + * Query language value for Arabic (Jordan). + */ + @Generated + public static final QueryLanguage AR_JO = fromString("ar-jo"); + + /** + * Query language value for Danish (Denmark). + */ + @Generated + public static final QueryLanguage DA_DK = fromString("da-dk"); + + /** + * Query language value for Norwegian (Norway). + */ + @Generated + public static final QueryLanguage NO_NO = fromString("no-no"); + + /** + * Query language value for Bulgarian (Bulgaria). + */ + @Generated + public static final QueryLanguage BG_BG = fromString("bg-bg"); + + /** + * Query language value for Croatian (Croatia). + */ + @Generated + public static final QueryLanguage HR_HR = fromString("hr-hr"); + + /** + * Query language value for Croatian (Bosnia and Herzegovina). + */ + @Generated + public static final QueryLanguage HR_BA = fromString("hr-ba"); + + /** + * Query language value for Malay (Malaysia). + */ + @Generated + public static final QueryLanguage MS_MY = fromString("ms-my"); + + /** + * Query language value for Malay (Brunei Darussalam). + */ + @Generated + public static final QueryLanguage MS_BN = fromString("ms-bn"); + + /** + * Query language value for Slovenian (Slovenia). + */ + @Generated + public static final QueryLanguage SL_SL = fromString("sl-sl"); + + /** + * Query language value for Tamil (India). + */ + @Generated + public static final QueryLanguage TA_IN = fromString("ta-in"); + + /** + * Query language value for Vietnamese (Viet Nam). + */ + @Generated + public static final QueryLanguage VI_VN = fromString("vi-vn"); + + /** + * Query language value for Greek (Greece). + */ + @Generated + public static final QueryLanguage EL_GR = fromString("el-gr"); + + /** + * Query language value for Romanian (Romania). + */ + @Generated + public static final QueryLanguage RO_RO = fromString("ro-ro"); + + /** + * Query language value for Icelandic (Iceland). + */ + @Generated + public static final QueryLanguage IS_IS = fromString("is-is"); + + /** + * Query language value for Indonesian (Indonesia). + */ + @Generated + public static final QueryLanguage ID_ID = fromString("id-id"); + + /** + * Query language value for Thai (Thailand). + */ + @Generated + public static final QueryLanguage TH_TH = fromString("th-th"); + + /** + * Query language value for Lithuanian (Lithuania). + */ + @Generated + public static final QueryLanguage LT_LT = fromString("lt-lt"); + + /** + * Query language value for Ukrainian (Ukraine). + */ + @Generated + public static final QueryLanguage UK_UA = fromString("uk-ua"); + + /** + * Query language value for Latvian (Latvia). + */ + @Generated + public static final QueryLanguage LV_LV = fromString("lv-lv"); + + /** + * Query language value for Estonian (Estonia). + */ + @Generated + public static final QueryLanguage ET_EE = fromString("et-ee"); + + /** + * Query language value for Catalan. + */ + @Generated + public static final QueryLanguage CA_ES = fromString("ca-es"); + + /** + * Query language value for Finnish (Finland). + */ + @Generated + public static final QueryLanguage FI_FI = fromString("fi-fi"); + + /** + * Query language value for Serbian (Bosnia and Herzegovina). + */ + @Generated + public static final QueryLanguage SR_BA = fromString("sr-ba"); + + /** + * Query language value for Serbian (Montenegro). + */ + @Generated + public static final QueryLanguage SR_ME = fromString("sr-me"); + + /** + * Query language value for Serbian (Serbia). + */ + @Generated + public static final QueryLanguage SR_RS = fromString("sr-rs"); + + /** + * Query language value for Slovak (Slovakia). + */ + @Generated + public static final QueryLanguage SK_SK = fromString("sk-sk"); + + /** + * Query language value for Norwegian (Norway). + */ + @Generated + public static final QueryLanguage NB_NO = fromString("nb-no"); + + /** + * Query language value for Armenian (Armenia). + */ + @Generated + public static final QueryLanguage HY_AM = fromString("hy-am"); + + /** + * Query language value for Bengali (India). + */ + @Generated + public static final QueryLanguage BN_IN = fromString("bn-in"); + + /** + * Query language value for Basque. + */ + @Generated + public static final QueryLanguage EU_ES = fromString("eu-es"); + + /** + * Query language value for Galician. + */ + @Generated + public static final QueryLanguage GL_ES = fromString("gl-es"); + + /** + * Query language value for Gujarati (India). + */ + @Generated + public static final QueryLanguage GU_IN = fromString("gu-in"); + + /** + * Query language value for Hebrew (Israel). + */ + @Generated + public static final QueryLanguage HE_IL = fromString("he-il"); + + /** + * Query language value for Irish (Ireland). + */ + @Generated + public static final QueryLanguage GA_IE = fromString("ga-ie"); + + /** + * Query language value for Kannada (India). + */ + @Generated + public static final QueryLanguage KN_IN = fromString("kn-in"); + + /** + * Query language value for Malayalam (India). + */ + @Generated + public static final QueryLanguage ML_IN = fromString("ml-in"); + + /** + * Query language value for Marathi (India). + */ + @Generated + public static final QueryLanguage MR_IN = fromString("mr-in"); + + /** + * Query language value for Persian (U.A.E.). + */ + @Generated + public static final QueryLanguage FA_AE = fromString("fa-ae"); + + /** + * Query language value for Punjabi (India). + */ + @Generated + public static final QueryLanguage PA_IN = fromString("pa-in"); + + /** + * Query language value for Telugu (India). + */ + @Generated + public static final QueryLanguage TE_IN = fromString("te-in"); + + /** + * Query language value for Urdu (Pakistan). + */ + @Generated + public static final QueryLanguage UR_PK = fromString("ur-pk"); + + /** + * Creates a new instance of QueryLanguage value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public QueryLanguage() { + } + + /** + * Creates or finds a QueryLanguage from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryLanguage. + */ + @Generated + public static QueryLanguage fromString(String name) { + return fromString(name, QueryLanguage.class); + } + + /** + * Gets known QueryLanguage values. + * + * @return known QueryLanguage values. + */ + @Generated + public static Collection values() { + return values(QueryLanguage.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentInnerHit.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentInnerHit.java new file mode 100644 index 0000000000000..8f877c9b7160b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentInnerHit.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Detailed scoring information for an individual element of a complex collection. + */ +@Immutable +public final class QueryResultDocumentInnerHit implements JsonSerializable { + + /* + * Position of this specific matching element within it's original collection. Position starts at 0. + */ + @Generated + private Long ordinal; + + /* + * Detailed scoring information for an individual element of a complex collection that matched a vector query. + */ + @Generated + private List> vectors; + + /** + * Creates an instance of QueryResultDocumentInnerHit class. + */ + @Generated + private QueryResultDocumentInnerHit() { + } + + /** + * Get the ordinal property: Position of this specific matching element within it's original collection. Position + * starts at 0. + * + * @return the ordinal value. + */ + @Generated + public Long getOrdinal() { + return this.ordinal; + } + + /** + * Get the vectors property: Detailed scoring information for an individual element of a complex collection that + * matched a vector query. + * + * @return the vectors value. + */ + @Generated + public List> getVectors() { + return this.vectors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryResultDocumentInnerHit from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryResultDocumentInnerHit if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryResultDocumentInnerHit. + */ + @Generated + public static QueryResultDocumentInnerHit fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryResultDocumentInnerHit deserializedQueryResultDocumentInnerHit = new QueryResultDocumentInnerHit(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("ordinal".equals(fieldName)) { + deserializedQueryResultDocumentInnerHit.ordinal = reader.getNullable(JsonReader::getLong); + } else if ("vectors".equals(fieldName)) { + List> vectors = reader + .readArray(reader1 -> reader1.readMap(reader2 -> SingleVectorFieldResult.fromJson(reader2))); + deserializedQueryResultDocumentInnerHit.vectors = vectors; + } else { + reader.skipChildren(); + } + } + return deserializedQueryResultDocumentInnerHit; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentRerankerInput.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentRerankerInput.java new file mode 100644 index 0000000000000..af60b6ba9d83d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentRerankerInput.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The raw concatenated strings that were sent to the semantic enrichment process. + */ +@Immutable +public final class QueryResultDocumentRerankerInput implements JsonSerializable { + + /* + * The raw string for the title field that was used for semantic enrichment. + */ + @Generated + private String title; + + /* + * The raw concatenated strings for the content fields that were used for semantic enrichment. + */ + @Generated + private String content; + + /* + * The raw concatenated strings for the keyword fields that were used for semantic enrichment. + */ + @Generated + private String keywords; + + /** + * Creates an instance of QueryResultDocumentRerankerInput class. + */ + @Generated + private QueryResultDocumentRerankerInput() { + } + + /** + * Get the title property: The raw string for the title field that was used for semantic enrichment. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the content property: The raw concatenated strings for the content fields that were used for semantic + * enrichment. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Get the keywords property: The raw concatenated strings for the keyword fields that were used for semantic + * enrichment. + * + * @return the keywords value. + */ + @Generated + public String getKeywords() { + return this.keywords; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryResultDocumentRerankerInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryResultDocumentRerankerInput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryResultDocumentRerankerInput. + */ + @Generated + public static QueryResultDocumentRerankerInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryResultDocumentRerankerInput deserializedQueryResultDocumentRerankerInput + = new QueryResultDocumentRerankerInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("title".equals(fieldName)) { + deserializedQueryResultDocumentRerankerInput.title = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedQueryResultDocumentRerankerInput.content = reader.getString(); + } else if ("keywords".equals(fieldName)) { + deserializedQueryResultDocumentRerankerInput.keywords = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedQueryResultDocumentRerankerInput; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentSemanticField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentSemanticField.java new file mode 100644 index 0000000000000..966051909abf4 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryResultDocumentSemanticField.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Description of fields that were sent to the semantic enrichment process, as well as how they were used. + */ +@Immutable +public final class QueryResultDocumentSemanticField implements JsonSerializable { + + /* + * The name of the field that was sent to the semantic enrichment process + */ + @Generated + private String name; + + /* + * The way the field was used for the semantic enrichment process (fully used, partially used, or unused) + */ + @Generated + private SemanticFieldState state; + + /** + * Creates an instance of QueryResultDocumentSemanticField class. + */ + @Generated + private QueryResultDocumentSemanticField() { + } + + /** + * Get the name property: The name of the field that was sent to the semantic enrichment process. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the state property: The way the field was used for the semantic enrichment process (fully used, partially + * used, or unused). + * + * @return the state value. + */ + @Generated + public SemanticFieldState getState() { + return this.state; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryResultDocumentSemanticField from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryResultDocumentSemanticField if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryResultDocumentSemanticField. + */ + @Generated + public static QueryResultDocumentSemanticField fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryResultDocumentSemanticField deserializedQueryResultDocumentSemanticField + = new QueryResultDocumentSemanticField(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedQueryResultDocumentSemanticField.name = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedQueryResultDocumentSemanticField.state + = SemanticFieldState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedQueryResultDocumentSemanticField; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesDebugInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesDebugInfo.java new file mode 100644 index 0000000000000..7a59a6f5c8429 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesDebugInfo.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains debugging information specific to query rewrites. + */ +@Immutable +public final class QueryRewritesDebugInfo implements JsonSerializable { + + /* + * List of query rewrites generated for the text query. + */ + @Generated + private QueryRewritesValuesDebugInfo text; + + /* + * List of query rewrites generated for the vectorizable text queries. + */ + @Generated + private List vectors; + + /** + * Creates an instance of QueryRewritesDebugInfo class. + */ + @Generated + private QueryRewritesDebugInfo() { + } + + /** + * Get the text property: List of query rewrites generated for the text query. + * + * @return the text value. + */ + @Generated + public QueryRewritesValuesDebugInfo getText() { + return this.text; + } + + /** + * Get the vectors property: List of query rewrites generated for the vectorizable text queries. + * + * @return the vectors value. + */ + @Generated + public List getVectors() { + return this.vectors; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryRewritesDebugInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryRewritesDebugInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryRewritesDebugInfo. + */ + @Generated + public static QueryRewritesDebugInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryRewritesDebugInfo deserializedQueryRewritesDebugInfo = new QueryRewritesDebugInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("text".equals(fieldName)) { + deserializedQueryRewritesDebugInfo.text = QueryRewritesValuesDebugInfo.fromJson(reader); + } else if ("vectors".equals(fieldName)) { + List vectors + = reader.readArray(reader1 -> QueryRewritesValuesDebugInfo.fromJson(reader1)); + deserializedQueryRewritesDebugInfo.vectors = vectors; + } else { + reader.skipChildren(); + } + } + return deserializedQueryRewritesDebugInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesType.java new file mode 100644 index 0000000000000..894a2e3d4bf0f --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesType.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This parameter is only valid if the query type is `semantic`. When QueryRewrites is set to `generative`, the query + * terms are sent to a generate model which will produce 10 (default) rewrites to help increase the recall of the + * request. The requested count can be configured by appending the pipe character `|` followed by the `count-<number + * of rewrites>` option, such as `generative|count-3`. Defaults to `None`. + */ +public final class QueryRewritesType extends ExpandableStringEnum { + + /** + * Do not generate additional query rewrites for this query. + */ + @Generated + public static final QueryRewritesType NONE = fromString("none"); + + /** + * Generate alternative query terms to increase the recall of a search request. + */ + @Generated + public static final QueryRewritesType GENERATIVE = fromString("generative"); + + /** + * Creates a new instance of QueryRewritesType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public QueryRewritesType() { + } + + /** + * Creates or finds a QueryRewritesType from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryRewritesType. + */ + @Generated + public static QueryRewritesType fromString(String name) { + return fromString(name, QueryRewritesType.class); + } + + /** + * Gets known QueryRewritesType values. + * + * @return known QueryRewritesType values. + */ + @Generated + public static Collection values() { + return values(QueryRewritesType.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesValuesDebugInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesValuesDebugInfo.java new file mode 100644 index 0000000000000..668ef0c9a3d95 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QueryRewritesValuesDebugInfo.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains debugging information specific to query rewrites. + */ +@Immutable +public final class QueryRewritesValuesDebugInfo implements JsonSerializable { + + /* + * The input text to the generative query rewriting model. There may be cases where the user query and the input to + * the generative model are not identical. + */ + @Generated + private String inputQuery; + + /* + * List of query rewrites. + */ + @Generated + private List rewrites; + + /** + * Creates an instance of QueryRewritesValuesDebugInfo class. + */ + @Generated + private QueryRewritesValuesDebugInfo() { + } + + /** + * Get the inputQuery property: The input text to the generative query rewriting model. There may be cases where the + * user query and the input to the generative model are not identical. + * + * @return the inputQuery value. + */ + @Generated + public String getInputQuery() { + return this.inputQuery; + } + + /** + * Get the rewrites property: List of query rewrites. + * + * @return the rewrites value. + */ + @Generated + public List getRewrites() { + return this.rewrites; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryRewritesValuesDebugInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryRewritesValuesDebugInfo if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryRewritesValuesDebugInfo. + */ + @Generated + public static QueryRewritesValuesDebugInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryRewritesValuesDebugInfo deserializedQueryRewritesValuesDebugInfo = new QueryRewritesValuesDebugInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("inputQuery".equals(fieldName)) { + deserializedQueryRewritesValuesDebugInfo.inputQuery = reader.getString(); + } else if ("rewrites".equals(fieldName)) { + List rewrites = reader.readArray(reader1 -> reader1.getString()); + deserializedQueryRewritesValuesDebugInfo.rewrites = rewrites; + } else { + reader.skipChildren(); + } + } + return deserializedQueryRewritesValuesDebugInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QuerySpellerType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QuerySpellerType.java new file mode 100644 index 0000000000000..740fee60f3fc2 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/QuerySpellerType.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Improve search recall by spell-correcting individual search query terms. + */ +public final class QuerySpellerType extends ExpandableStringEnum { + + /** + * Speller not enabled. + */ + @Generated + public static final QuerySpellerType NONE = fromString("none"); + + /** + * Speller corrects individual query terms using a static lexicon for the language specified by the queryLanguage + * parameter. + */ + @Generated + public static final QuerySpellerType LEXICON = fromString("lexicon"); + + /** + * Creates a new instance of QuerySpellerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public QuerySpellerType() { + } + + /** + * Creates or finds a QuerySpellerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding QuerySpellerType. + */ + @Generated + public static QuerySpellerType fromString(String name) { + return fromString(name, QuerySpellerType.class); + } + + /** + * Gets known QuerySpellerType values. + * + * @return known QuerySpellerType values. + */ + @Generated + public static Collection values() { + return values(QuerySpellerType.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchDocumentsResult.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchDocumentsResult.java index de683e41e78bf..ea67961645d6b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchDocumentsResult.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchDocumentsResult.java @@ -229,6 +229,8 @@ public static SearchDocumentsResult fromJson(JsonReader jsonReader) throws IOExc } else if ("@search.answers".equals(fieldName)) { List answers = reader.readArray(reader1 -> QueryAnswerResult.fromJson(reader1)); deserializedSearchDocumentsResult.answers = answers; + } else if ("@search.debug".equals(fieldName)) { + deserializedSearchDocumentsResult.debugInfo = DebugInfo.fromJson(reader); } else if ("@search.nextPageParameters".equals(fieldName)) { deserializedSearchDocumentsResult.nextPageParameters = SearchRequest.fromJson(reader); } else if ("@odata.nextLink".equals(fieldName)) { @@ -239,6 +241,9 @@ public static SearchDocumentsResult fromJson(JsonReader jsonReader) throws IOExc } else if ("@search.semanticPartialResponseType".equals(fieldName)) { deserializedSearchDocumentsResult.semanticPartialResponseType = SemanticSearchResultsType.fromString(reader.getString()); + } else if ("@search.semanticQueryRewritesResultType".equals(fieldName)) { + deserializedSearchDocumentsResult.semanticQueryRewritesResultType + = SemanticQueryRewritesResultType.fromString(reader.getString()); } else { reader.skipChildren(); } @@ -246,4 +251,36 @@ public static SearchDocumentsResult fromJson(JsonReader jsonReader) throws IOExc return deserializedSearchDocumentsResult; }); } + + /* + * Debug information that applies to the search results as a whole. + */ + @Generated + private DebugInfo debugInfo; + + /* + * Type of query rewrite that was used to retrieve documents. + */ + @Generated + private SemanticQueryRewritesResultType semanticQueryRewritesResultType; + + /** + * Get the debugInfo property: Debug information that applies to the search results as a whole. + * + * @return the debugInfo value. + */ + @Generated + public DebugInfo getDebugInfo() { + return this.debugInfo; + } + + /** + * Get the semanticQueryRewritesResultType property: Type of query rewrite that was used to retrieve documents. + * + * @return the semanticQueryRewritesResultType value. + */ + @Generated + public SemanticQueryRewritesResultType getSemanticQueryRewritesResultType() { + return this.semanticQueryRewritesResultType; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java index 176761e45d389..719a64c9656f7 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java @@ -1017,6 +1017,36 @@ public SearchOptions setVectorFilterMode(VectorFilterMode vectorFilterMode) { @Generated private Boolean enableElevatedRead; + /* + * A value that specifies the language of the search query. + */ + @Generated + private QueryLanguage queryLanguage; + + /* + * A value that specifies the type of the speller to use to spell-correct individual search query terms. + */ + @Generated + private QuerySpellerType querySpeller; + + /* + * A value that specifies whether query rewrites should be generated to augment the search query. + */ + @Generated + private QueryRewritesType queryRewrites; + + /* + * The comma-separated list of field names used for semantic ranking. + */ + @Generated + private List semanticFields; + + /* + * The query parameters to configure hybrid search behaviors. + */ + @Generated + private HybridSearch hybridSearch; + /** * Get the querySourceAuthorization property: Token identifying the user for which the query is being executed. This * token is used to enforce security restrictions on documents. @@ -1065,34 +1095,117 @@ public SearchOptions setEnableElevatedRead(Boolean enableElevatedRead) { return this; } - /* - * The key of the document to use as the basis for finding similar documents. This parameter cannot be used together - * with search text. + /** + * Get the queryLanguage property: A value that specifies the language of the search query. + * + * @return the queryLanguage value. */ @Generated - private String moreLikeThis; + public QueryLanguage getQueryLanguage() { + return this.queryLanguage; + } /** - * Get the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This - * parameter cannot be used together with search text. + * Set the queryLanguage property: A value that specifies the language of the search query. * - * @return the moreLikeThis value. + * @param queryLanguage the queryLanguage value to set. + * @return the SearchOptions object itself. */ @Generated - public String getMoreLikeThis() { - return this.moreLikeThis; + public SearchOptions setQueryLanguage(QueryLanguage queryLanguage) { + this.queryLanguage = queryLanguage; + return this; } /** - * Set the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This - * parameter cannot be used together with search text. + * Get the querySpeller property: A value that specifies the type of the speller to use to spell-correct individual + * search query terms. * - * @param moreLikeThis the moreLikeThis value to set. + * @return the querySpeller value. + */ + @Generated + public QuerySpellerType getQuerySpeller() { + return this.querySpeller; + } + + /** + * Set the querySpeller property: A value that specifies the type of the speller to use to spell-correct individual + * search query terms. + * + * @param querySpeller the querySpeller value to set. * @return the SearchOptions object itself. */ @Generated - public SearchOptions setMoreLikeThis(String moreLikeThis) { - this.moreLikeThis = moreLikeThis; + public SearchOptions setQuerySpeller(QuerySpellerType querySpeller) { + this.querySpeller = querySpeller; + return this; + } + + /** + * Get the queryRewrites property: A value that specifies whether query rewrites should be generated to augment the + * search query. + * + * @return the queryRewrites value. + */ + @Generated + public QueryRewritesType getQueryRewrites() { + return this.queryRewrites; + } + + /** + * Set the queryRewrites property: A value that specifies whether query rewrites should be generated to augment the + * search query. + * + * @param queryRewrites the queryRewrites value to set. + * @return the SearchOptions object itself. + */ + @Generated + public SearchOptions setQueryRewrites(QueryRewritesType queryRewrites) { + this.queryRewrites = queryRewrites; + return this; + } + + /** + * Get the semanticFields property: The comma-separated list of field names used for semantic ranking. + * + * @return the semanticFields value. + */ + @Generated + public List getSemanticFields() { + return this.semanticFields; + } + + /** + * Set the semanticFields property: The comma-separated list of field names used for semantic ranking. + * + * @param semanticFields the semanticFields value to set. + * @return the SearchOptions object itself. + */ + @Generated + public SearchOptions setSemanticFields(List semanticFields) { + this.semanticFields = semanticFields; + return this; + } + + /** + * Get the hybridSearch property: The query parameters to configure hybrid search behaviors. + * + * @return the hybridSearch value. + */ + @Generated + public HybridSearch getHybridSearch() { + return this.hybridSearch; + } + + /** + * Set the hybridSearch property: The query parameters to configure hybrid search behaviors. + * + * @param hybridSearch the hybridSearch value to set. + * @return the SearchOptions object itself. + */ + @Generated + public SearchOptions setHybridSearch(HybridSearch hybridSearch) { + this.hybridSearch = hybridSearch; return this; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java index 46e9f6f39d2d0..a184669369f73 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchRequest.java @@ -588,6 +588,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { .collect(Collectors.joining(","))); } jsonWriter.writeStringField("searchMode", this.searchMode == null ? null : this.searchMode.toString()); + jsonWriter.writeStringField("queryLanguage", this.queryLanguage == null ? null : this.queryLanguage.toString()); + jsonWriter.writeStringField("speller", this.querySpeller == null ? null : this.querySpeller.toString()); if (this.select != null) { jsonWriter.writeStringField("select", this.select.stream().map(element -> element == null ? "" : element).collect(Collectors.joining(","))); @@ -601,9 +603,17 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("semanticQuery", this.semanticQuery); jsonWriter.writeStringField("answers", this.answers == null ? null : this.answers.toString()); jsonWriter.writeStringField("captions", this.captions == null ? null : this.captions.toString()); + jsonWriter.writeStringField("queryRewrites", this.queryRewrites == null ? null : this.queryRewrites.toString()); + if (this.semanticFields != null) { + jsonWriter.writeStringField("semanticFields", + this.semanticFields.stream() + .map(element -> element == null ? "" : element) + .collect(Collectors.joining(","))); + } jsonWriter.writeArrayField("vectorQueries", this.vectorQueries, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("vectorFilterMode", this.vectorFilterMode == null ? null : this.vectorFilterMode.toString()); + jsonWriter.writeJsonField("hybridSearch", this.hybridSearch); return jsonWriter.writeEndObject(); } @@ -680,6 +690,10 @@ public static SearchRequest fromJson(JsonReader jsonReader) throws IOException { deserializedSearchRequest.searchFields = searchFields; } else if ("searchMode".equals(fieldName)) { deserializedSearchRequest.searchMode = SearchMode.fromString(reader.getString()); + } else if ("queryLanguage".equals(fieldName)) { + deserializedSearchRequest.queryLanguage = QueryLanguage.fromString(reader.getString()); + } else if ("speller".equals(fieldName)) { + deserializedSearchRequest.querySpeller = QuerySpellerType.fromString(reader.getString()); } else if ("select".equals(fieldName)) { List select = reader.getNullable(nonNullReader -> { String selectEncodedAsString = nonNullReader.getString(); @@ -704,11 +718,23 @@ public static SearchRequest fromJson(JsonReader jsonReader) throws IOException { deserializedSearchRequest.answers = QueryAnswerType.fromString(reader.getString()); } else if ("captions".equals(fieldName)) { deserializedSearchRequest.captions = QueryCaptionType.fromString(reader.getString()); + } else if ("queryRewrites".equals(fieldName)) { + deserializedSearchRequest.queryRewrites = QueryRewritesType.fromString(reader.getString()); + } else if ("semanticFields".equals(fieldName)) { + List semanticFields = reader.getNullable(nonNullReader -> { + String semanticFieldsEncodedAsString = nonNullReader.getString(); + return semanticFieldsEncodedAsString.isEmpty() + ? new LinkedList<>() + : new LinkedList<>(Arrays.asList(semanticFieldsEncodedAsString.split(",", -1))); + }); + deserializedSearchRequest.semanticFields = semanticFields; } else if ("vectorQueries".equals(fieldName)) { List vectorQueries = reader.readArray(reader1 -> VectorQuery.fromJson(reader1)); deserializedSearchRequest.vectorQueries = vectorQueries; } else if ("vectorFilterMode".equals(fieldName)) { deserializedSearchRequest.vectorFilterMode = VectorFilterMode.fromString(reader.getString()); + } else if ("hybridSearch".equals(fieldName)) { + deserializedSearchRequest.hybridSearch = HybridSearch.fromJson(reader); } else { reader.skipChildren(); } @@ -1094,33 +1120,146 @@ public SearchRequest setVectorFilterMode(VectorFilterMode vectorFilterMode) { } /* - * The key of the document to use as the basis for finding similar documents. This parameter cannot be used together - * with search text. + * A value that specifies the language of the search query. */ @Generated - private String moreLikeThis; + private QueryLanguage queryLanguage; + + /* + * A value that specifies the type of the speller to use to spell-correct individual search query terms. + */ + @Generated + private QuerySpellerType querySpeller; + + /* + * A value that specifies whether query rewrites should be generated to augment the search query. + */ + @Generated + private QueryRewritesType queryRewrites; + + /* + * The comma-separated list of field names used for semantic ranking. + */ + @Generated + private List semanticFields; + + /* + * The query parameters to configure hybrid search behaviors. + */ + @Generated + private HybridSearch hybridSearch; /** - * Get the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This - * parameter cannot be used together with search text. + * Get the queryLanguage property: A value that specifies the language of the search query. * - * @return the moreLikeThis value. + * @return the queryLanguage value. */ @Generated - public String getMoreLikeThis() { - return this.moreLikeThis; + public QueryLanguage getQueryLanguage() { + return this.queryLanguage; } /** - * Set the moreLikeThis property: The key of the document to use as the basis for finding similar documents. This - * parameter cannot be used together with search text. + * Set the queryLanguage property: A value that specifies the language of the search query. * - * @param moreLikeThis the moreLikeThis value to set. + * @param queryLanguage the queryLanguage value to set. * @return the SearchRequest object itself. */ @Generated - public SearchRequest setMoreLikeThis(String moreLikeThis) { - this.moreLikeThis = moreLikeThis; + public SearchRequest setQueryLanguage(QueryLanguage queryLanguage) { + this.queryLanguage = queryLanguage; + return this; + } + + /** + * Get the querySpeller property: A value that specifies the type of the speller to use to spell-correct individual + * search query terms. + * + * @return the querySpeller value. + */ + @Generated + public QuerySpellerType getQuerySpeller() { + return this.querySpeller; + } + + /** + * Set the querySpeller property: A value that specifies the type of the speller to use to spell-correct individual + * search query terms. + * + * @param querySpeller the querySpeller value to set. + * @return the SearchRequest object itself. + */ + @Generated + public SearchRequest setQuerySpeller(QuerySpellerType querySpeller) { + this.querySpeller = querySpeller; + return this; + } + + /** + * Get the queryRewrites property: A value that specifies whether query rewrites should be generated to augment the + * search query. + * + * @return the queryRewrites value. + */ + @Generated + public QueryRewritesType getQueryRewrites() { + return this.queryRewrites; + } + + /** + * Set the queryRewrites property: A value that specifies whether query rewrites should be generated to augment the + * search query. + * + * @param queryRewrites the queryRewrites value to set. + * @return the SearchRequest object itself. + */ + @Generated + public SearchRequest setQueryRewrites(QueryRewritesType queryRewrites) { + this.queryRewrites = queryRewrites; + return this; + } + + /** + * Get the semanticFields property: The comma-separated list of field names used for semantic ranking. + * + * @return the semanticFields value. + */ + @Generated + public List getSemanticFields() { + return this.semanticFields; + } + + /** + * Set the semanticFields property: The comma-separated list of field names used for semantic ranking. + * + * @param semanticFields the semanticFields value to set. + * @return the SearchRequest object itself. + */ + @Generated + public SearchRequest setSemanticFields(List semanticFields) { + this.semanticFields = semanticFields; + return this; + } + + /** + * Get the hybridSearch property: The query parameters to configure hybrid search behaviors. + * + * @return the hybridSearch value. + */ + @Generated + public HybridSearch getHybridSearch() { + return this.hybridSearch; + } + + /** + * Set the hybridSearch property: The query parameters to configure hybrid search behaviors. + * + * @param hybridSearch the hybridSearch value to set. + * @return the SearchRequest object itself. + */ + @Generated + public SearchRequest setHybridSearch(HybridSearch hybridSearch) { + this.hybridSearch = hybridSearch; return this; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchScoreThreshold.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchScoreThreshold.java new file mode 100644 index 0000000000000..569a17945318b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchScoreThreshold.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The results of the vector query will filter based on the '. + */ +@Immutable +public final class SearchScoreThreshold extends VectorThreshold { + + /* + * Type of threshold. + */ + @Generated + private VectorThresholdKind kind = VectorThresholdKind.SEARCH_SCORE; + + /* + * The threshold will filter based on the ' + */ + @Generated + private final double value; + + /** + * Creates an instance of SearchScoreThreshold class. + * + * @param value the value value to set. + */ + @Generated + public SearchScoreThreshold(double value) { + this.value = value; + } + + /** + * Get the kind property: Type of threshold. + * + * @return the kind value. + */ + @Generated + @Override + public VectorThresholdKind getKind() { + return this.kind; + } + + /** + * Get the value property: The threshold will filter based on the '. + * + * @return the value value. + */ + @Generated + public double getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("value", this.value); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SearchScoreThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SearchScoreThreshold if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SearchScoreThreshold. + */ + @Generated + public static SearchScoreThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double value = 0.0; + VectorThresholdKind kind = VectorThresholdKind.SEARCH_SCORE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("value".equals(fieldName)) { + value = reader.getDouble(); + } else if ("kind".equals(fieldName)) { + kind = VectorThresholdKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + SearchScoreThreshold deserializedSearchScoreThreshold = new SearchScoreThreshold(value); + deserializedSearchScoreThreshold.kind = kind; + return deserializedSearchScoreThreshold; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticDebugInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticDebugInfo.java new file mode 100644 index 0000000000000..5514e28b6aa08 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticDebugInfo.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains debugging information specific to semantic ranking requests. + */ +@Immutable +public final class SemanticDebugInfo implements JsonSerializable { + + /* + * The title field that was sent to the semantic enrichment process, as well as how it was used + */ + @Generated + private QueryResultDocumentSemanticField titleField; + + /* + * The content fields that were sent to the semantic enrichment process, as well as how they were used + */ + @Generated + private List contentFields; + + /* + * The keyword fields that were sent to the semantic enrichment process, as well as how they were used + */ + @Generated + private List keywordFields; + + /* + * The raw concatenated strings that were sent to the semantic enrichment process. + */ + @Generated + private QueryResultDocumentRerankerInput rerankerInput; + + /** + * Creates an instance of SemanticDebugInfo class. + */ + @Generated + private SemanticDebugInfo() { + } + + /** + * Get the titleField property: The title field that was sent to the semantic enrichment process, as well as how it + * was used. + * + * @return the titleField value. + */ + @Generated + public QueryResultDocumentSemanticField getTitleField() { + return this.titleField; + } + + /** + * Get the contentFields property: The content fields that were sent to the semantic enrichment process, as well as + * how they were used. + * + * @return the contentFields value. + */ + @Generated + public List getContentFields() { + return this.contentFields; + } + + /** + * Get the keywordFields property: The keyword fields that were sent to the semantic enrichment process, as well as + * how they were used. + * + * @return the keywordFields value. + */ + @Generated + public List getKeywordFields() { + return this.keywordFields; + } + + /** + * Get the rerankerInput property: The raw concatenated strings that were sent to the semantic enrichment process. + * + * @return the rerankerInput value. + */ + @Generated + public QueryResultDocumentRerankerInput getRerankerInput() { + return this.rerankerInput; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SemanticDebugInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SemanticDebugInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SemanticDebugInfo. + */ + @Generated + public static SemanticDebugInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SemanticDebugInfo deserializedSemanticDebugInfo = new SemanticDebugInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("titleField".equals(fieldName)) { + deserializedSemanticDebugInfo.titleField = QueryResultDocumentSemanticField.fromJson(reader); + } else if ("contentFields".equals(fieldName)) { + List contentFields + = reader.readArray(reader1 -> QueryResultDocumentSemanticField.fromJson(reader1)); + deserializedSemanticDebugInfo.contentFields = contentFields; + } else if ("keywordFields".equals(fieldName)) { + List keywordFields + = reader.readArray(reader1 -> QueryResultDocumentSemanticField.fromJson(reader1)); + deserializedSemanticDebugInfo.keywordFields = keywordFields; + } else if ("rerankerInput".equals(fieldName)) { + deserializedSemanticDebugInfo.rerankerInput = QueryResultDocumentRerankerInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedSemanticDebugInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticFieldState.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticFieldState.java new file mode 100644 index 0000000000000..8539f8a24876a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticFieldState.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The way the field was used for the semantic enrichment process. + */ +public final class SemanticFieldState extends ExpandableStringEnum { + + /** + * The field was fully used for semantic enrichment. + */ + @Generated + public static final SemanticFieldState USED = fromString("used"); + + /** + * The field was not used for semantic enrichment. + */ + @Generated + public static final SemanticFieldState UNUSED = fromString("unused"); + + /** + * The field was partially used for semantic enrichment. + */ + @Generated + public static final SemanticFieldState PARTIAL = fromString("partial"); + + /** + * Creates a new instance of SemanticFieldState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SemanticFieldState() { + } + + /** + * Creates or finds a SemanticFieldState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SemanticFieldState. + */ + @Generated + public static SemanticFieldState fromString(String name) { + return fromString(name, SemanticFieldState.class); + } + + /** + * Gets known SemanticFieldState values. + * + * @return known SemanticFieldState values. + */ + @Generated + public static Collection values() { + return values(SemanticFieldState.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticQueryRewritesResultType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticQueryRewritesResultType.java new file mode 100644 index 0000000000000..9b48ff67006e7 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SemanticQueryRewritesResultType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of query rewrite that was used for this request. + */ +public final class SemanticQueryRewritesResultType extends ExpandableStringEnum { + + /** + * Query rewrites were not successfully generated for this request. Only the original query was used to retrieve the + * results. + */ + @Generated + public static final SemanticQueryRewritesResultType ORIGINAL_QUERY_ONLY = fromString("originalQueryOnly"); + + /** + * Creates a new instance of SemanticQueryRewritesResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SemanticQueryRewritesResultType() { + } + + /** + * Creates or finds a SemanticQueryRewritesResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SemanticQueryRewritesResultType. + */ + @Generated + public static SemanticQueryRewritesResultType fromString(String name) { + return fromString(name, SemanticQueryRewritesResultType.class); + } + + /** + * Gets known SemanticQueryRewritesResultType values. + * + * @return known SemanticQueryRewritesResultType values. + */ + @Generated + public static Collection values() { + return values(SemanticQueryRewritesResultType.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorFilterMode.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorFilterMode.java index 56a7b7ca2b684..e4b1802e36580 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorFilterMode.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorFilterMode.java @@ -25,6 +25,13 @@ public final class VectorFilterMode extends ExpandableStringEnum @Generated public static final VectorQueryKind TEXT = fromString("text"); + /** + * Vector query where an url that represents an image value that needs to be vectorized is provided. + */ + @Generated + public static final VectorQueryKind IMAGE_URL = fromString("imageUrl"); + + /** + * Vector query where a base 64 encoded binary of an image that needs to be vectorized is provided. + */ + @Generated + public static final VectorQueryKind IMAGE_BINARY = fromString("imageBinary"); + /** * Creates a new instance of VectorQueryKind value. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSimilarityThreshold.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSimilarityThreshold.java new file mode 100644 index 0000000000000..ba5196ab78822 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorSimilarityThreshold.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The results of the vector query will be filtered based on the vector similarity metric. Note this is the canonical + * definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be + * chosen automatically according to the metric used by the field. + */ +@Immutable +public final class VectorSimilarityThreshold extends VectorThreshold { + + /* + * Type of threshold. + */ + @Generated + private VectorThresholdKind kind = VectorThresholdKind.VECTOR_SIMILARITY; + + /* + * The threshold will filter based on the similarity metric value. Note this is the canonical definition of + * similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen + * automatically according to the metric used by the field. + */ + @Generated + private final double value; + + /** + * Creates an instance of VectorSimilarityThreshold class. + * + * @param value the value value to set. + */ + @Generated + public VectorSimilarityThreshold(double value) { + this.value = value; + } + + /** + * Get the kind property: Type of threshold. + * + * @return the kind value. + */ + @Generated + @Override + public VectorThresholdKind getKind() { + return this.kind; + } + + /** + * Get the value property: The threshold will filter based on the similarity metric value. Note this is the + * canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or + * smaller) will be chosen automatically according to the metric used by the field. + * + * @return the value value. + */ + @Generated + public double getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("value", this.value); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorSimilarityThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorSimilarityThreshold if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VectorSimilarityThreshold. + */ + @Generated + public static VectorSimilarityThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double value = 0.0; + VectorThresholdKind kind = VectorThresholdKind.VECTOR_SIMILARITY; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("value".equals(fieldName)) { + value = reader.getDouble(); + } else if ("kind".equals(fieldName)) { + kind = VectorThresholdKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + VectorSimilarityThreshold deserializedVectorSimilarityThreshold = new VectorSimilarityThreshold(value); + deserializedVectorSimilarityThreshold.kind = kind; + return deserializedVectorSimilarityThreshold; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThreshold.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThreshold.java new file mode 100644 index 0000000000000..76775c8babd9a --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThreshold.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The threshold used for vector queries. + */ +@Immutable +public class VectorThreshold implements JsonSerializable { + + /* + * Type of threshold. + */ + @Generated + private VectorThresholdKind kind = VectorThresholdKind.fromString("VectorThreshold"); + + /** + * Creates an instance of VectorThreshold class. + */ + @Generated + public VectorThreshold() { + } + + /** + * Get the kind property: Type of threshold. + * + * @return the kind value. + */ + @Generated + public VectorThresholdKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorThreshold if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VectorThreshold. + */ + @Generated + public static VectorThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("vectorSimilarity".equals(discriminatorValue)) { + return VectorSimilarityThreshold.fromJson(readerToUse.reset()); + } else if ("searchScore".equals(discriminatorValue)) { + return SearchScoreThreshold.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static VectorThreshold fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorThreshold deserializedVectorThreshold = new VectorThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("kind".equals(fieldName)) { + deserializedVectorThreshold.kind = VectorThresholdKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedVectorThreshold; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThresholdKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThresholdKind.java new file mode 100644 index 0000000000000..62f3ac2f0d83d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorThresholdKind.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.search.documents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of threshold used to filter vector queries. + */ +public final class VectorThresholdKind extends ExpandableStringEnum { + + /** + * The results of the vector query will be filtered based on the vector similarity metric. Note this is the + * canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or + * smaller) will be chosen automatically according to the metric used by the field. + */ + @Generated + public static final VectorThresholdKind VECTOR_SIMILARITY = fromString("vectorSimilarity"); + + /** + * The results of the vector query will filter based on the '@search.score' value. Note this is the + * @search.score returned as part of the search response. The threshold direction will be chosen for higher + * @search.score. + */ + @Generated + public static final VectorThresholdKind SEARCH_SCORE = fromString("searchScore"); + + /** + * Creates a new instance of VectorThresholdKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public VectorThresholdKind() { + } + + /** + * Creates or finds a VectorThresholdKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorThresholdKind. + */ + @Generated + public static VectorThresholdKind fromString(String name) { + return fromString(name, VectorThresholdKind.class); + } + + /** + * Gets known VectorThresholdKind values. + * + * @return known VectorThresholdKind values. + */ + @Generated + public static Collection values() { + return values(VectorThresholdKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java index 1326688879082..7f6fb6dbfab72 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java @@ -3,7 +3,6 @@ package com.azure.search.documents; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.Configuration; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexClientBuilder; @@ -23,7 +22,6 @@ import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchServiceStatistics; -import com.azure.search.documents.indexes.models.ServiceIndexersRuntime; import com.azure.search.documents.indexes.models.SearchSuggester; import com.azure.search.documents.indexes.models.TagScoringFunction; import com.azure.search.documents.indexes.models.TagScoringParameters; @@ -57,11 +55,6 @@ public static void main(String[] args) { private static void getServiceStatistics(SearchIndexClient client) { SearchServiceStatistics searchServiceStatistics = client.getServiceStatistics(); - ServiceIndexersRuntime runtime = searchServiceStatistics.getIndexersRuntime(); - if (runtime != null) { - System.out.printf("Service indexer runtime: %d used, %s remaining seconds, period %s to %s%n", - runtime.getUsedSeconds(), runtime.getRemainingSeconds(), runtime.getBeginningTime(), runtime.getEndingTime()); - } System.out.println(":" + searchServiceStatistics); try { System.out.println(searchServiceStatistics.toJsonString()); @@ -117,12 +110,6 @@ private static void getIndexStatistics(SearchIndexClient client) { System.out.println("document Count:" + documentCount); System.out.println("storage Size:" + storageSize); - client.listIndexStatsSummary(new RequestOptions().addQueryParam("search", index.getName()) - .addQueryParam("searchType", "prefix").addQueryParam("pageSize", "1")) - .forEach(statistics -> System.out.printf("Index %s: %d documents, %d storage bytes, %d vector bytes%n", - statistics.getName(), statistics.getDocumentCount(), statistics.getStorageSize(), - statistics.getVectorIndexSize())); - // Output: // document Count:0 // storage Size:0 diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseCrudExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseCrudExample.java index 19f8e4886cd4a..2ec6621df789b 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseCrudExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBaseCrudExample.java @@ -4,10 +4,8 @@ package com.azure.search.documents; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.rest.RequestOptions; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexClientBuilder; -import com.azure.search.documents.indexes.SearchIndexAsyncClient; import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSourceReference; import com.azure.search.documents.indexes.models.SearchField; @@ -17,6 +15,8 @@ import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; /** @@ -28,6 +28,7 @@ *
  • Getting a knowledge base by name
  • *
  • Listing all knowledge bases
  • *
  • Updating a knowledge base
  • + *
  • Creating, retrieving, and updating knowledge base tags
  • *
  • Deleting a knowledge base
  • * *

    @@ -67,12 +68,19 @@ public static void main(String[] args) { searchIndexClient.createKnowledgeSource(knowledgeSource); knowledgeSourceCreated = true; + Map initialTags = new LinkedHashMap<>(); + initialTags.put("environment", "sample"); + initialTags.put("owner", "search-sdk"); + + // Tags are customer-defined resource metadata. They don't configure or prove billing attribution. KnowledgeBase knowledgeBase - = new KnowledgeBase(knowledgeBaseName, new KnowledgeSourceReference(knowledgeSourceName)); + = new KnowledgeBase(knowledgeBaseName, new KnowledgeSourceReference(knowledgeSourceName)) + .setTags(initialTags); KnowledgeBase created = searchIndexClient.createKnowledgeBase(knowledgeBase); knowledgeBaseCreated = true; System.out.println("Created knowledge base: " + created.getName()); + verifyTags(initialTags, created.getTags(), "create"); if (!knowledgeBaseName.equals(created.getName())) { throw new IllegalStateException("The created knowledge base name didn't match the request."); } @@ -82,13 +90,13 @@ public static void main(String[] args) { System.out.println("Retrieved knowledge base: " + retrieved.getName()); System.out.println("ETag: " + retrieved.getETag()); System.out.println("Knowledge sources: " + retrieved.getKnowledgeSources().size()); + verifyTags(initialTags, retrieved.getTags(), "get"); if (retrieved.getETag() == null || retrieved.getKnowledgeSources().size() != 1) { throw new IllegalStateException("The retrieved knowledge base was missing its ETag or source."); } // List all knowledge bases - boolean listed = searchIndexClient.listKnowledgeBases(new RequestOptions() - .addQueryParam("search", knowledgeBaseName).addQueryParam("searchType", "prefix").addQueryParam("pageSize", "1")) + boolean listed = searchIndexClient.listKnowledgeBases() .stream() .anyMatch(kb -> knowledgeBaseName.equals(kb.getName())); if (!listed) { @@ -96,20 +104,14 @@ public static void main(String[] args) { } // Update a knowledge base + Map updatedTags = new LinkedHashMap<>(initialTags); + updatedTags.put("release", "2026-08-01-preview"); retrieved.setDescription("Updated description for sample knowledge base"); - KnowledgeBase updated; - if (args.length > 0 && "async".equals(args[0])) { - SearchIndexAsyncClient asyncClient = new SearchIndexClientBuilder() - .credential(new AzureKeyCredential(API_KEY)).endpoint(ENDPOINT).buildAsyncClient(); - updated = asyncClient.createOrUpdateKnowledgeBase(retrieved).block(); - } else { - updated = searchIndexClient.createOrUpdateKnowledgeBase(retrieved); - } - if (updated == null) { - throw new IllegalStateException("The knowledge base update completed without a response body."); - } + retrieved.setTags(updatedTags); + KnowledgeBase updated = searchIndexClient.createOrUpdateKnowledgeBase(retrieved); System.out.println("\nUpdated knowledge base: " + updated.getName()); System.out.println("Description: " + updated.getDescription()); + verifyTags(updatedTags, updated.getTags(), "update"); if (!retrieved.getDescription().equals(updated.getDescription())) { throw new IllegalStateException("The updated description wasn't persisted."); } @@ -154,4 +156,9 @@ private static RuntimeException cleanup(Runnable cleanup, RuntimeException previ return previousFailure; } + private static void verifyTags(Map expected, Map actual, String operation) { + if (!expected.equals(actual)) { + throw new IllegalStateException("Knowledge base tags didn't persist after " + operation + "."); + } + } } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBasePreviewConfigurationExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBasePreviewConfigurationExample.java new file mode 100644 index 0000000000000..a556c776cefef --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeBasePreviewConfigurationExample.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel; +import com.azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.SearchField; +import com.azure.search.documents.indexes.models.SearchFieldDataType; +import com.azure.search.documents.indexes.models.SearchIndex; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.SemanticConfiguration; +import com.azure.search.documents.indexes.models.SemanticField; +import com.azure.search.documents.indexes.models.SemanticPrioritizedFields; +import com.azure.search.documents.indexes.models.SemanticSearch; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalAutoReasoningEffort; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; +import com.azure.search.documents.models.IndexAction; +import com.azure.search.documents.models.IndexActionType; +import com.azure.search.documents.models.IndexDocumentsBatch; +import com.azure.search.documents.models.IndexDocumentsResult; + +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.UUID; + +/** + * Demonstrates knowledge-base and request-level retrieval configuration precedence. + * + *

    Set {@code SEARCH_ENDPOINT}, {@code SEARCH_API_KEY}, {@code SEARCH_OPENAI_ENDPOINT}, + * {@code SEARCH_OPENAI_API_KEY}, {@code SEARCH_OPENAI_DEPLOYMENT_NAME}, and {@code SEARCH_OPENAI_MODEL_NAME}. The + * deployed model must support automatic reasoning.

    + */ +public class KnowledgeBasePreviewConfigurationExample { + private static final String SEMANTIC_CONFIGURATION_NAME = "sample-semantic-config"; + + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + AzureKeyCredential credential = new AzureKeyCredential(System.getenv("SEARCH_API_KEY")); + SearchIndexClient searchIndexClient + = new SearchIndexClientBuilder().credential(credential).endpoint(endpoint).buildClient(); + + String suffix = UUID.randomUUID().toString().replace("-", "").substring(0, 12); + String indexName = "kb-config-index-" + suffix; + String knowledgeSourceName = "kb-config-source-" + suffix; + String knowledgeBaseName = "kb-config-" + suffix; + boolean indexCreated = false; + boolean knowledgeSourceCreated = false; + boolean knowledgeBaseCreated = false; + + try { + searchIndexClient.createIndex(createSampleIndex(indexName)); + indexCreated = true; + uploadSampleDocument(searchIndexClient.getSearchClient(indexName)); + + SearchIndexKnowledgeSource knowledgeSource = new SearchIndexKnowledgeSource(knowledgeSourceName, + new SearchIndexKnowledgeSourceParameters(indexName) + .setSemanticConfigurationName(SEMANTIC_CONFIGURATION_NAME)); + searchIndexClient.createKnowledgeSource(knowledgeSource); + knowledgeSourceCreated = true; + + KnowledgeBase knowledgeBase + = new KnowledgeBase(knowledgeBaseName, new KnowledgeSourceReference(knowledgeSourceName)) + .setModels(new KnowledgeBaseAzureOpenAIModel(new AzureOpenAIVectorizerParameters() + .setResourceUrl(System.getenv("SEARCH_OPENAI_ENDPOINT")) + .setApiKey(System.getenv("SEARCH_OPENAI_API_KEY")) + .setDeploymentName(System.getenv("SEARCH_OPENAI_DEPLOYMENT_NAME")) + .setModelName(AzureOpenAIModelName.fromString(System.getenv("SEARCH_OPENAI_MODEL_NAME"))))) + .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS); + searchIndexClient.createKnowledgeBase(knowledgeBase); + knowledgeBaseCreated = true; + + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder().endpoint(endpoint) + .credential(credential) + .knowledgeBaseName(knowledgeBaseName) + .buildClient(); + + // With neither a request nor KB reasoning setting, the service default is low. + verifyReasoningEffort(retrievalClient.retrieve(createRequest()), KnowledgeRetrievalReasoningEffortKind.LOW); + + KnowledgeBaseRetrieveDefaults retrieveDefaults = new KnowledgeBaseRetrieveDefaults() + .setMaxRuntimeInSeconds(30) + .setMaxOutputDocuments(5) + .setMaxOutputSizeInTokens(6000); + knowledgeBase.setRetrievalReasoningEffort(new KnowledgeRetrievalAutoReasoningEffort()) + .setRetrieveDefaults(retrieveDefaults); + searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); + + KnowledgeBase persistedKnowledgeBase = searchIndexClient.getKnowledgeBase(knowledgeBaseName); + if (!(persistedKnowledgeBase.getRetrievalReasoningEffort() instanceof KnowledgeRetrievalAutoReasoningEffort) + || persistedKnowledgeBase.getRetrieveDefaults() == null + || !Integer.valueOf(6000) + .equals(persistedKnowledgeBase.getRetrieveDefaults().getMaxOutputSizeInTokens())) { + throw new IllegalStateException("The KB reasoning effort or retrieve defaults weren't persisted."); + } + + // When the request omits these values, KB auto reasoning and retrieveDefaults apply. Auto chooses the + // effective billing effort reported by the activity record. + KnowledgeBaseAgenticReasoningActivityRecord automaticReasoning + = findReasoningActivity(retrievalClient.retrieve(createRequest())); + if (automaticReasoning.getRetrievalReasoningEffort() == null) { + throw new IllegalStateException("Automatic reasoning didn't report an effective reasoning effort."); + } + + // Request values override the KB values. Note the intentionally different property names: + // retrieveDefaults.maxOutputSizeInTokens versus request.maxOutputSize. + KnowledgeBaseRetrievalOptions requestOverride = createRequest() + .setRetrievalReasoningEffort(new KnowledgeRetrievalLowReasoningEffort()) + .setMaxOutputDocuments(2) + .setMaxOutputSize(5000); + verifyReasoningEffort(retrievalClient.retrieve(requestOverride), KnowledgeRetrievalReasoningEffortKind.LOW); + + KnowledgeBase unchangedKnowledgeBase = searchIndexClient.getKnowledgeBase(knowledgeBaseName); + if (!(unchangedKnowledgeBase.getRetrievalReasoningEffort() + instanceof KnowledgeRetrievalAutoReasoningEffort) + || !Integer.valueOf(6000) + .equals(unchangedKnowledgeBase.getRetrieveDefaults().getMaxOutputSizeInTokens())) { + throw new IllegalStateException("Request overrides must not modify persisted KB configuration."); + } + System.out.println("Verified request > knowledge base > service-default precedence."); + } finally { + if (knowledgeBaseCreated) { + searchIndexClient.deleteKnowledgeBase(knowledgeBaseName); + } + if (knowledgeSourceCreated) { + searchIndexClient.deleteKnowledgeSource(knowledgeSourceName); + } + if (indexCreated) { + searchIndexClient.deleteIndex(indexName); + } + } + } + + private static SearchIndex createSampleIndex(String indexName) { + return new SearchIndex(indexName, + Arrays.asList(new SearchField("id", SearchFieldDataType.STRING).setKey(true), + new SearchField("title", SearchFieldDataType.STRING).setSearchable(true), + new SearchField("content", SearchFieldDataType.STRING).setSearchable(true), + new SearchField("category", SearchFieldDataType.STRING).setSearchable(true).setFilterable(true))) + .setSemanticSearch(new SemanticSearch().setConfigurations(new SemanticConfiguration( + SEMANTIC_CONFIGURATION_NAME, + new SemanticPrioritizedFields().setTitleField(new SemanticField("title")) + .setContentFields(new SemanticField("content")) + .setKeywordsFields(new SemanticField("category"))))); + } + + private static void uploadSampleDocument(SearchClient searchClient) { + Map document = new LinkedHashMap<>(); + document.put("id", "1"); + document.put("title", "August product update"); + document.put("content", "The latest product update adds knowledge base reasoning improvements."); + document.put("category", "Product update"); + IndexDocumentsResult result = searchClient.indexDocuments(new IndexDocumentsBatch( + new IndexAction().setActionType(IndexActionType.UPLOAD).setAdditionalProperties(document))); + if (result.getResults().size() != 1 || !result.getResults().get(0).isSucceeded()) { + throw new IllegalStateException("The sample document wasn't indexed successfully."); + } + + for (int attempt = 0; attempt < 30; attempt++) { + if (searchClient.getDocumentCount() > 0) { + return; + } + try { + Thread.sleep(1000); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + throw new IllegalStateException("Interrupted while waiting for the sample document.", ex); + } + } + throw new IllegalStateException("The sample document wasn't available for retrieval."); + } + + private static KnowledgeBaseRetrievalOptions createRequest() { + return new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the latest product updates?")) + .setIncludeActivity(true); + } + + private static void verifyReasoningEffort(KnowledgeBaseRetrievalResult result, + KnowledgeRetrievalReasoningEffortKind expectedKind) { + KnowledgeBaseAgenticReasoningActivityRecord activity = findReasoningActivity(result); + if (activity.getRetrievalReasoningEffort() == null + || !expectedKind.equals(activity.getRetrievalReasoningEffort().getKind())) { + throw new IllegalStateException("The retrieval didn't use the expected reasoning effort."); + } + } + + private static KnowledgeBaseAgenticReasoningActivityRecord + findReasoningActivity(KnowledgeBaseRetrievalResult result) { + if (result.getActivity() == null) { + throw new IllegalStateException("The retrieval response didn't contain activity records."); + } + return result.getActivity() + .stream() + .filter(KnowledgeBaseAgenticReasoningActivityRecord.class::isInstance) + .map(KnowledgeBaseAgenticReasoningActivityRecord.class::cast) + .findFirst() + .orElseThrow(() -> new IllegalStateException("The response didn't contain agentic reasoning activity.")); + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalExample.java index 95aa559e84142..1f4fca3b6b4e8 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalExample.java @@ -7,24 +7,13 @@ import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageTextContent; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageContent; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageImageContent; -import com.azure.search.documents.knowledgebases.models.KnowledgeBaseImageContent; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; -import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort; import com.azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams; -import com.azure.search.documents.knowledgebases.models.KnowledgeSourceParams; -import com.azure.search.documents.knowledgebases.models.FileKnowledgeSourceParams; -import com.azure.search.documents.knowledgebases.models.IndexedSqlKnowledgeSourceParams; -import com.azure.search.documents.knowledgebases.models.IndexedSharePointKnowledgeSourceParams; import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; /** * This example demonstrates end-to-end knowledge base retrieval using the KnowledgeBaseRetrievalClient. @@ -41,8 +30,6 @@ *
  • SEARCH_ENDPOINT - the endpoint of your Azure AI Search service
  • *
  • SEARCH_API_KEY - the admin key of your Azure AI Search service
  • *
  • KNOWLEDGE_BASE_NAME - the name of an existing knowledge base
  • - *
  • KNOWLEDGE_SOURCE_NAME - the name of its populated source when passing file, sql, or sharepoint
  • - *
  • SEARCH_IMAGE_URL - optional image URL for a knowledge base with an image-capable model
  • * */ public class KnowledgeRetrievalExample { @@ -58,16 +45,6 @@ public static void main(String[] args) { .knowledgeBaseName(KB_NAME) .buildClient(); - if (args.length > 0) { - KnowledgeSourceParams source = sourceParameters(args[0], System.getenv("KNOWLEDGE_SOURCE_NAME")); - retrievalClient.retrieve(new KnowledgeBaseRetrievalOptions() - .setIntents(new KnowledgeRetrievalSemanticIntent("Summarize the latest changes.")) - .setKnowledgeSourceParams(Arrays.asList(source.setIncludeReferences(true).setIncludeReferenceSourceData(true))) - .setIncludeActivity(true)).getReferences() - .forEach(reference -> System.out.println("Source reference: " + reference.getId())); - return; - } - // Simple retrieval with a semantic intent System.out.println("=== Simple Retrieval ==="); simpleRetrieval(retrievalClient); @@ -79,14 +56,6 @@ public static void main(String[] args) { // Retrieval with source params, filters, and references System.out.println("\n=== Retrieval with Source Params and References ==="); retrievalWithSourceParams(retrievalClient); - - System.out.println("\n=== Retrieval with Conversation History ==="); - retrievalClient.retrieve(conversationRequest(System.getenv("SEARCH_IMAGE_URL"))).getResponse().forEach(message -> - message.getContent().forEach(content -> { - if (content instanceof KnowledgeBaseMessageTextContent) { - System.out.println(((KnowledgeBaseMessageTextContent) content).getText()); - } - })); } private static void simpleRetrieval(KnowledgeBaseRetrievalClient retrievalClient) { @@ -124,10 +93,7 @@ private static void retrievalWithSourceParams(KnowledgeBaseRetrievalClient retri new SearchIndexKnowledgeSourceParams("my-knowledge-source") .setFilterAddOn("Address/StateProvince eq 'VA'") .setIncludeReferences(true) - .setIncludeReferenceSourceData(true) - .setAlwaysQuerySource(true) - .setFailOnError(true) - .setMaxOutputDocuments(3))) + .setIncludeReferenceSourceData(true))) .setIncludeActivity(true); KnowledgeBaseRetrievalResult response = retrievalClient.retrieve(request); @@ -146,35 +112,4 @@ private static void retrievalWithSourceParams(KnowledgeBaseRetrievalClient retri System.out.println(" Reference [" + reference.getId() + "] score: " + reference.getRerankerScore()); } } - - static KnowledgeBaseRetrievalOptions conversationRequest(String imageUrl) { - List followUp = new ArrayList<>(); - followUp.add(new KnowledgeBaseMessageTextContent("Yes, and free wifi.")); - if (imageUrl != null) { - followUp.add(new KnowledgeBaseMessageImageContent(new KnowledgeBaseImageContent(imageUrl))); - } - return new KnowledgeBaseRetrievalOptions() - .setMessages(Arrays.asList( - new KnowledgeBaseMessage(new KnowledgeBaseMessageTextContent("Find hotels near the ocean.")) - .setRole("user"), - new KnowledgeBaseMessage(new KnowledgeBaseMessageTextContent("Do you need parking?")) - .setRole("assistant"), - new KnowledgeBaseMessage(followUp).setRole("user"))) - .setRetrievalReasoningEffort(new KnowledgeRetrievalLowReasoningEffort()) - .setMaxOutputDocuments(5) - .setIncludeActivity(true); - } - - static KnowledgeSourceParams sourceParameters(String kind, String name) { - switch (kind) { - case "file": - return new FileKnowledgeSourceParams(name).setAlwaysQuerySource(true).setMaxOutputDocuments(3); - case "sql": - return new IndexedSqlKnowledgeSourceParams(name).setAlwaysQuerySource(true).setMaxOutputDocuments(3); - case "sharepoint": - return new IndexedSharePointKnowledgeSourceParams(name).setAlwaysQuerySource(true).setMaxOutputDocuments(3); - default: - throw new IllegalArgumentException("Expected file, sql, sharepoint, or no arguments."); - } - } } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java new file mode 100644 index 0000000000000..4dbf152506355 --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessage; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageContent; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseMessageTextContent; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseReference; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; +import com.azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo; + +public class KnowledgeRetrievalPreviewResponseExample { + private static final String ENDPOINT = System.getenv("SEARCH_ENDPOINT"); + private static final String API_KEY = System.getenv("SEARCH_API_KEY"); + private static final String KB_NAME = "my-knowledge-base"; + + public static void main(String[] args) { + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() + .credential(new AzureKeyCredential(API_KEY)) + .endpoint(ENDPOINT) + .buildClient(); + try { + KnowledgeSourceReference knowledgeSource = new KnowledgeSourceReference("my-knowledge-source") + .setEnableImageServing(true) + .setEnableFreshness(true); + + KnowledgeBase knowledgeBase = new KnowledgeBase(KB_NAME, knowledgeSource); + searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); + + //build retrieval client + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() + .credential(new AzureKeyCredential(API_KEY)) + .endpoint(ENDPOINT) + .knowledgeBaseName(KB_NAME) + .buildClient(); + + //build retrieval request with preview options + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setMaxOutputDocuments(5) + .setIncludeActivity(true) + .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS) + .setIntents(new KnowledgeRetrievalSemanticIntent("What hotels have free wifi?")); + + //send request + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); + + //parse result + + for (KnowledgeBaseMessage message : result.getResponse()) { + System.out.println("Message role: " + message.getRole()); + for (KnowledgeBaseMessageContent content : message.getContent()) { + if (content instanceof KnowledgeBaseMessageTextContent) { + System.out.println("Text content: " + ((KnowledgeBaseMessageTextContent) content).getText()); + } + } + } + + for (KnowledgeBaseActivityRecord record : result.getActivity()) { + System.out.println("Activity [" + record.getType() + "] id=" + record.getId() + + " elapsed=" + record.getElapsedMs() + "ms"); + if (record instanceof KnowledgeBaseModelAnswerSynthesisActivityRecord) { + KnowledgeBaseModelAnswerSynthesisActivityRecord synthesis = + (KnowledgeBaseModelAnswerSynthesisActivityRecord) record; + if (synthesis.getModel() != null) { + System.out.println(" Model: " + synthesis.getModel().getModelName()); + } + System.out.println(" Input tokens: " + synthesis.getInputTokens()); + System.out.println(" Output tokens: " + synthesis.getOutputTokens()); + } + } + + for (KnowledgeBaseReference ref : result.getReferences()) { + System.out.println("Reference id=" + ref.getId() + " type=" + ref.getType() + + " rerankerScore=" + ref.getRerankerScore()); + if (ref.getSourceData() != null) { + System.out.println(" Source data: " + ref.getSourceData().toString()); + } + } + + PurviewSensitivityLabelInfo labelInfo = result.getResponseSensitivityLabelInfo(); + if (labelInfo != null) { + System.out.println("Sensitivity Label " + labelInfo.getDisplayName()); + System.out.println(" Label ID: " + labelInfo.getSensitivityLabelId()); + System.out.println(" Priority: " + labelInfo.getPriority()); + System.out.println(" Color: " + labelInfo.getColor()); + } + + } finally { + searchIndexClient.deleteKnowledgeBase(KB_NAME); + } + } + +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeServiceStatsPreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeServiceStatsPreviewExample.java new file mode 100644 index 0000000000000..e358bd317f85a --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeServiceStatsPreviewExample.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.ResourceCounter; +import com.azure.search.documents.indexes.models.SearchServiceCounters; +import com.azure.search.documents.indexes.models.SearchServiceLimits; +import com.azure.search.documents.indexes.models.SearchServiceStatistics; + +/** + * Demonstrates retrieving service-level knowledge resource counters and the per-index vector-size limit introduced in + * the preview API. + * + * The counters describe service usage and quotas. {@code maxVectorIndexSizePerIndexInBytes} is a separate limit that + * applies to each index; it isn't current vector usage or a per-partition quota. + */ +public class KnowledgeServiceStatsPreviewExample { + + public static void main(String[] args) { + SearchIndexClient client = new SearchIndexClientBuilder() + .endpoint(System.getenv("SEARCH_ENDPOINT")) + .credential(new AzureKeyCredential(System.getenv("SEARCH_API_KEY"))) + .buildClient(); + + // Retrieve service statistics + SearchServiceStatistics stats = client.getServiceStatistics(); + SearchServiceCounters counters = stats.getCounters(); + SearchServiceLimits limits = stats.getLimits(); + + // New preview counters for Knowledge Retrieval objects + ResourceCounter kbCounter = counters.getKnowledgeBaseCounter(); + ResourceCounter ksCounter = counters.getKnowledgeSourceCounter(); + verifyCounter("knowledge base", kbCounter); + verifyCounter("knowledge source", ksCounter); + + System.out.println("Knowledge Bases - usage: " + kbCounter.getUsage() + ", quota: " + kbCounter.getQuota()); + System.out.println("Knowledge Sources - usage: " + ksCounter.getUsage() + ", quota: " + ksCounter.getQuota()); + + Long maxVectorIndexSize = limits == null ? null : limits.getMaxVectorIndexSizePerIndexInBytes(); + if (maxVectorIndexSize == null) { + System.out.println("The service didn't report a per-index vector-size limit."); + } else { + if (maxVectorIndexSize <= 0) { + throw new IllegalStateException("The per-index vector-size limit must be positive."); + } + System.out.println("Maximum vector index size per index: " + maxVectorIndexSize + " bytes"); + } + } + + private static void verifyCounter(String resourceType, ResourceCounter counter) { + if (counter == null || counter.getUsage() < 0 + || (counter.getQuota() != null && counter.getQuota() < counter.getUsage())) { + throw new IllegalStateException("The " + resourceType + " counter was missing or invalid."); + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java index 5e90077996539..403c985c92770 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceCrudExample.java @@ -4,9 +4,7 @@ package com.azure.search.documents; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.rest.RequestOptions; import com.azure.search.documents.indexes.SearchIndexClient; -import com.azure.search.documents.indexes.SearchIndexAsyncClient; import com.azure.search.documents.indexes.SearchIndexClientBuilder; import com.azure.search.documents.indexes.SearchIndexerClient; import com.azure.search.documents.indexes.SearchIndexerClientBuilder; @@ -15,27 +13,17 @@ import com.azure.search.documents.indexes.models.AzureOpenAIModelName; import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; import com.azure.search.documents.indexes.models.CreatedResources; -import com.azure.search.documents.indexes.models.ContentColumnMapping; -import com.azure.search.documents.indexes.models.EmbeddingColumnMapping; -import com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSource; -import com.azure.search.documents.indexes.models.IndexedSqlKnowledgeSourceParameters; -import com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSource; -import com.azure.search.documents.indexes.models.IndexedSharePointKnowledgeSourceParameters; -import com.azure.search.documents.indexes.models.IndexedSharePointContainerName; -import com.azure.search.documents.indexes.models.KnowledgeSource; -import com.azure.search.documents.indexes.models.KnowledgeSourceIngestionPermissionOption; import com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode; import com.azure.search.documents.indexes.models.LexicalAnalyzerName; import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFieldValueBoost; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints; import com.azure.search.documents.indexes.models.SearchIndexerStatus; -import com.azure.search.documents.indexes.models.WebKnowledgeSource; -import com.azure.search.documents.indexes.models.WebKnowledgeSourceParameters; -import com.azure.search.documents.indexes.models.WebKnowledgeSourceDomains; -import com.azure.search.documents.indexes.models.WebKnowledgeSourceDomain; import com.azure.search.documents.knowledgebases.models.AiServices; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; @@ -48,7 +36,7 @@ import java.util.UUID; /** - * Demonstrates GA knowledge source configuration and generated-resource inspection. + * Demonstrates preview Knowledge Source configuration and generated-resource inspection. * *

    The supported-language Blob folder should contain English content; the fallback folder should contain content in * a language without a dedicated Microsoft analyzer.

    @@ -59,11 +47,6 @@ * {@code SEARCH_AI_SERVICES_ENDPOINT}, {@code SEARCH_AI_SERVICES_API_KEY}, {@code SEARCH_OPENAI_ENDPOINT}, * {@code SEARCH_OPENAI_API_KEY}, {@code SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME}, and * {@code SEARCH_OPENAI_EMBEDDING_MODEL_NAME} before running this sample.

    - *

    Alternatively, pass {@code sql}, {@code sharepoint}, or {@code web} to run just that source's CRUD flow. - * SQL additionally requires {@code SEARCH_SQL_CONNECTION_STRING} and {@code SEARCH_SQL_TABLE}. The table must have - * Title, Content, and LastModified columns. SharePoint requires {@code SEARCH_SHAREPOINT_CONNECTION_STRING}, - * a configured connector application, and permissions to read the site. SQL and SharePoint use the embedding - * configuration above. The web example restricts retrieval to learn.microsoft.com.

    */ public class KnowledgeSourceCrudExample { public static void main(String[] args) { @@ -74,14 +57,9 @@ public static void main(String[] args) { SearchIndexerClient searchIndexerClient = new SearchIndexerClientBuilder().credential(credential).endpoint(endpoint).buildClient(); - if (args.length > 0) { - runSourceExample(searchIndexClient, args[0]); - return; - } - String suffix = UUID.randomUUID().toString().replace("-", "").substring(0, 12); - String indexName = "knowledge-source-index-" + suffix; - String searchIndexSourceName = "search-index-source-" + suffix; + String indexName = "query-hints-index-" + suffix; + String searchIndexSourceName = "query-hints-" + suffix; String privateBlobSourceName = "private-blob-" + suffix; String fallbackBlobSourceName = "fallback-blob-" + suffix; List createdSources = new ArrayList<>(); @@ -93,14 +71,11 @@ public static void main(String[] args) { new SearchField("Category", SearchFieldDataType.STRING).setSearchable(true).setFilterable(true)))); indexCreated = true; - SearchIndexKnowledgeSource searchIndexSource = new SearchIndexKnowledgeSource(searchIndexSourceName, - new SearchIndexKnowledgeSourceParameters(indexName).setBaseFilter("Category eq 'Luxury'")); - SearchIndexKnowledgeSource createdSearchIndexSource = (SearchIndexKnowledgeSource) searchIndexClient - .createKnowledgeSource(searchIndexSource); + SearchIndexKnowledgeSource queryHintSource = createQueryHintSource(searchIndexSourceName, indexName); + SearchIndexKnowledgeSource createdQueryHintSource = (SearchIndexKnowledgeSource) searchIndexClient + .createKnowledgeSource(queryHintSource); createdSources.add(searchIndexSourceName); - if (!"Category eq 'Luxury'".equals(createdSearchIndexSource.getSearchIndexParameters().getBaseFilter())) { - throw new IllegalStateException("The base filter wasn't persisted on the knowledge source."); - } + verifyQueryHints(createdQueryHintSource); AzureBlobKnowledgeSource privateBlobSource = createBlobSource(privateBlobSourceName, System.getenv("SEARCH_SUPPORTED_LANGUAGE_FOLDER_PATH"), KnowledgeSourceNetworkAccessMode.PRIVATE); @@ -118,9 +93,9 @@ public static void main(String[] args) { inspectGeneratedResources(searchIndexClient, searchIndexerClient, createdFallbackBlobSource, KnowledgeSourceNetworkAccessMode.PUBLIC, "snippet_default", LexicalAnalyzerName.STANDARD_LUCENE); - createdSearchIndexSource.setDescription("Search-index source with a persisted base filter."); - searchIndexClient.createOrUpdateKnowledgeSource(createdSearchIndexSource); - searchIndexClient.listKnowledgeSources(new RequestOptions().addQueryParam("pageSize", "1")) + createdQueryHintSource.setDescription("Search-index source with persisted query hints."); + searchIndexClient.createOrUpdateKnowledgeSource(createdQueryHintSource); + searchIndexClient.listKnowledgeSources() .stream() .filter(source -> createdSources.contains(source.getName())) .forEach(source -> System.out.println("Created " + source.getKind() + " source " + source.getName())); @@ -133,78 +108,27 @@ public static void main(String[] args) { } } - private static void runSourceExample(SearchIndexClient client, String kind) { - String name = "sample-" + kind + "-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12); - KnowledgeSource source; - switch (kind) { - case "sql": - source = sqlSource(name, System.getenv("SEARCH_SQL_CONNECTION_STRING"), - System.getenv("SEARCH_SQL_TABLE"), embeddingIngestion()); - break; - case "sharepoint": - source = sharePointSource(name, System.getenv("SEARCH_SHAREPOINT_CONNECTION_STRING"), - embeddingIngestion().setIngestionPermissionOptions(KnowledgeSourceIngestionPermissionOption.USER_IDS, - KnowledgeSourceIngestionPermissionOption.GROUP_IDS)); - break; - case "web": - source = webSource(name); - break; - default: - throw new IllegalArgumentException("Expected sql, sharepoint, web, or no arguments for the Blob flow."); - } - client.createKnowledgeSource(source); - try { - KnowledgeSource persisted = client.getKnowledgeSource(name); - SearchIndexAsyncClient asyncClient = new SearchIndexClientBuilder() - .endpoint(System.getenv("SEARCH_ENDPOINT")) - .credential(new AzureKeyCredential(System.getenv("SEARCH_API_KEY"))).buildAsyncClient(); - asyncClient.createOrUpdateKnowledgeSourceWithResponse( - persisted.setDescription("Updated " + kind + " knowledge source"), new RequestOptions()) - .doOnNext(response -> System.out.println("Updated source: " + response.getValue().getName())) - .block(); - System.out.println("Synchronization: " + client.getKnowledgeSourceStatus(name).getSynchronizationStatus()); - } finally { - client.deleteKnowledgeSource(name); - } + private static SearchIndexKnowledgeSource createQueryHintSource(String name, String indexName) { + SearchIndexKnowledgeSourceFilterHint filterHint + = new SearchIndexKnowledgeSourceFilterHint("Category", Collections.singletonList("Luxury")) + .setFilterInstructions("Use Category when the user requests a specific hotel category."); + SearchIndexKnowledgeSourceFieldValueBoost boost + = new SearchIndexKnowledgeSourceFieldValueBoost("Category", 2.0) + .setFieldValues(Collections.singletonList("Luxury")) + .setBoostInstructions("Prefer luxury hotels when luxury amenities are requested."); + SearchIndexKnowledgeSourceQueryHints queryHints = new SearchIndexKnowledgeSourceQueryHints() + .setFilters(Collections.singletonList(filterHint)) + .setBoosts(Collections.singletonList(boost)); + return new SearchIndexKnowledgeSource(name, + new SearchIndexKnowledgeSourceParameters(indexName).setQueryHints(queryHints)); } - private static KnowledgeSourceIngestionParameters embeddingIngestion() { - return new KnowledgeSourceIngestionParameters() - .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL) - .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer().setAzureOpenAIParameters( - new AzureOpenAIVectorizerParameters().setResourceUrl(System.getenv("SEARCH_OPENAI_ENDPOINT")) - .setApiKey(System.getenv("SEARCH_OPENAI_API_KEY")) - .setDeploymentName(System.getenv("SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME")) - .setModelName(AzureOpenAIModelName.fromString(System.getenv("SEARCH_OPENAI_EMBEDDING_MODEL_NAME"))))); - } - - static IndexedSqlKnowledgeSource sqlSource(String name, String connectionString, String table, - KnowledgeSourceIngestionParameters ingestion) { - return new IndexedSqlKnowledgeSource(name, new IndexedSqlKnowledgeSourceParameters(connectionString, table) - .setHighWaterMarkColumnName("LastModified") - .setContentColumns(Arrays.asList( - new ContentColumnMapping("title", "Title", "Edm.String"), - new ContentColumnMapping("content", "Content", "Edm.String"))) - .setEmbeddingColumns(Collections.singletonList(new EmbeddingColumnMapping("contentVector", "Content"))) - .setIngestionParameters(ingestion)); - } - - static IndexedSharePointKnowledgeSource sharePointSource(String name, String connectionString, - KnowledgeSourceIngestionParameters ingestion) { - return new IndexedSharePointKnowledgeSource(name, - new IndexedSharePointKnowledgeSourceParameters(connectionString, IndexedSharePointContainerName.DEFAULT_SITE_LIBRARY) - .setIngestionParameters(ingestion)); - } - - static WebKnowledgeSource webSource(String name) { - return new WebKnowledgeSource(name).setWebParameters(new WebKnowledgeSourceParameters() - .setDomains(new WebKnowledgeSourceDomains() - .setAllowedDomains(Collections.singletonList(new WebKnowledgeSourceDomain("learn.microsoft.com") - .setIncludeSubpages(true)))) - .setLanguage("en") - .setMarket("en-US") - .setCount(5) - .setFreshness("Month")); + private static void verifyQueryHints(SearchIndexKnowledgeSource source) { + SearchIndexKnowledgeSourceQueryHints queryHints = source.getSearchIndexParameters().getQueryHints(); + if (queryHints == null || queryHints.getFilters() == null || queryHints.getFilters().size() != 1 + || queryHints.getBoosts() == null || queryHints.getBoosts().size() != 1) { + throw new IllegalStateException("The query hints weren't persisted on the knowledge source."); + } } private static AzureBlobKnowledgeSource createBlobSource(String name, String folderPath, diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricDataAgentPreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricDataAgentPreviewExample.java new file mode 100644 index 0000000000000..cadedc83c15c5 --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricDataAgentPreviewExample.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSource; +import com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeSource; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; + +/** + * Demonstrates creating and using a Fabric Data Agent knowledge source in the preview API. + */ +public class KnowledgeSourceFabricDataAgentPreviewExample { + + private static final String KB_NAME = "fabric-data-agent-kind-sample-kb"; + private static final String KS_NAME = "fabric-data-agent-kind-sample-ks"; + + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + String apiKey = System.getenv("SEARCH_API_KEY"); + String workspaceId = System.getenv("FABRIC_WORKSPACE_ID"); + String dataAgentId = System.getenv("FABRIC_DATA_AGENT_ID"); + + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .knowledgeBaseName(KB_NAME) + .buildClient(); + + try { + // Create KS — Fabric Data Agent requires a workspace ID and data agent ID + FabricDataAgentKnowledgeSource knowledgeSource = new FabricDataAgentKnowledgeSource( + KS_NAME, + new FabricDataAgentKnowledgeSourceParameters(workspaceId, dataAgentId) + ); + searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); + + // Verify KS kind + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(KS_NAME); + System.out.println("KnowledgeSource kind = " + retrieved.getKind()); + + // Hook up KS to a KB + KnowledgeSourceReference ref = new KnowledgeSourceReference(KS_NAME); + KnowledgeBase knowledgeBase = new KnowledgeBase(KB_NAME, ref); + searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); + System.out.println("Created KnowledgeBase " + KB_NAME + " referencing " + KS_NAME); + + // Issue retrieval request to verify everything is wired up end-to-end + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What data is the agent managing?")); + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); + System.out.println("Response messages: " + result.getResponse().size()); + + } finally { + searchIndexClient.deleteKnowledgeBase(KB_NAME); + searchIndexClient.deleteKnowledgeSource(KS_NAME); + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricOntologyPreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricOntologyPreviewExample.java new file mode 100644 index 0000000000000..de7e797762bbf --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricOntologyPreviewExample.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSource; +import com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeSource; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; + +/** + * Demonstrates creating and using a Fabric Ontology knowledge source in the preview API. + */ +public class KnowledgeSourceFabricOntologyPreviewExample { + + private static final String KB_NAME = "fabric-ontology-kind-sample-kb"; + private static final String KS_NAME = "fabric-ontology-kind-sample-ks"; + + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + String apiKey = System.getenv("SEARCH_API_KEY"); + String workspaceId = System.getenv("FABRIC_WORKSPACE_ID"); + String ontologyId = System.getenv("FABRIC_ONTOLOGY_ID"); + + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .knowledgeBaseName(KB_NAME) + .buildClient(); + + try { + // Create KS — Fabric Ontology requires a workspace ID and ontology ID + FabricOntologyKnowledgeSource knowledgeSource = new FabricOntologyKnowledgeSource( + KS_NAME, + new FabricOntologyKnowledgeSourceParameters(workspaceId, ontologyId) + ); + searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); + + // Verify KS kind + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(KS_NAME); + System.out.println("KnowledgeSource kind = " + retrieved.getKind()); + + // Hook up KS to a KB + KnowledgeSourceReference ref = new KnowledgeSourceReference(KS_NAME); + KnowledgeBase knowledgeBase = new KnowledgeBase(KB_NAME, ref); + searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); + System.out.println("Created KnowledgeBase " + KB_NAME + " referencing " + KS_NAME); + + // Issue retrieval request to verify everything is wired up end-to-end + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What entities are in the ontology?")); + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); + System.out.println("Response messages: " + result.getResponse().size()); + + } finally { + searchIndexClient.deleteKnowledgeBase(KB_NAME); + searchIndexClient.deleteKnowledgeSource(KS_NAME); + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java new file mode 100644 index 0000000000000..dfcb14471eece --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.util.BinaryData; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; +import com.azure.search.documents.indexes.models.FileKnowledgeSource; +import com.azure.search.documents.indexes.models.FileKnowledgeSourceExtractionMode; +import com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.FileUploadMetadata; +import com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode; +import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.ListingSearchType; +import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; +import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; +import com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer; +import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; +import com.azure.search.documents.models.ContentFileDetails; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * Demonstrates the lifecycle of files in a File knowledge source. + * + *

    Set {@code SEARCH_ENDPOINT}, {@code SEARCH_API_KEY}, {@code SEARCH_OPENAI_ENDPOINT}, + * {@code SEARCH_OPENAI_API_KEY}, {@code SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME}, and + * {@code SEARCH_OPENAI_EMBEDDING_MODEL_NAME} before running this sample. If the Search service uses a user-assigned + * managed identity for the embedding deployment, also set {@code SEARCH_USER_ASSIGNED_IDENTITY}.

    + */ +public class KnowledgeSourceFilePreviewExample { + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + String apiKey = System.getenv("SEARCH_API_KEY"); + String openAiEndpoint = System.getenv("SEARCH_OPENAI_ENDPOINT"); + String openAiApiKey = System.getenv("SEARCH_OPENAI_API_KEY"); + String embeddingDeployment = System.getenv("SEARCH_OPENAI_EMBEDDING_DEPLOYMENT_NAME"); + String embeddingModel = System.getenv("SEARCH_OPENAI_EMBEDDING_MODEL_NAME"); + String userAssignedIdentity = System.getenv("SEARCH_USER_ASSIGNED_IDENTITY"); + + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder().endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + String knowledgeSourceName + = "file-ks-sample-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12); + List uploadedFileIds = new ArrayList<>(); + boolean knowledgeSourceCreated = false; + + try { + AzureOpenAIVectorizerParameters vectorizerParameters + = new AzureOpenAIVectorizerParameters().setResourceUrl(openAiEndpoint) + .setDeploymentName(embeddingDeployment) + .setModelName(AzureOpenAIModelName.fromString(embeddingModel)); + if (userAssignedIdentity == null || userAssignedIdentity.isEmpty()) { + vectorizerParameters.setApiKey(openAiApiKey); + } else { + vectorizerParameters + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(userAssignedIdentity)); + } + KnowledgeSourceIngestionParameters ingestionParameters = new KnowledgeSourceIngestionParameters() + .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL) + .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(vectorizerParameters)); + FileKnowledgeSource knowledgeSource = new FileKnowledgeSource(knowledgeSourceName, + new FileKnowledgeSourceParameters().setIngestionParameters(ingestionParameters)); + searchIndexClient.createKnowledgeSource(knowledgeSource); + knowledgeSourceCreated = true; + + Map metadata = new LinkedHashMap<>(); + metadata.put("team", "search"); + metadata.put("release", "2026-08-01-preview"); + + KnowledgeSourceFile firstFile = searchIndexClient.uploadKnowledgeSourceFileMultipart(knowledgeSourceName, + createUploadRequest("release-notes/august/features.md", + "# August features\n\nFile knowledge source lifecycle improvements.", metadata)); + verifyUploadedFile(firstFile, "release-notes/august/features.md", "release-notes/august/", metadata); + uploadedFileIds.add(firstFile.getFileId()); + + KnowledgeSourceFile secondFile = searchIndexClient.uploadKnowledgeSourceFileMultipart(knowledgeSourceName, + createUploadRequest("release-notes/august/migration.md", + "# Migration\n\nSteps for adopting the August preview.", Collections.singletonMap("type", "guide"))); + verifyUploadedFile(secondFile, "release-notes/august/migration.md", "release-notes/august/", + Collections.singletonMap("type", "guide")); + uploadedFileIds.add(secondFile.getFileId()); + + List> pages = new ArrayList<>(); + searchIndexClient + .listKnowledgeSourceFiles(knowledgeSourceName, "release-notes/august/", null, 1, + ListingSearchType.PREFIX) + .iterableByPage() + .forEach(pages::add); + verifyPrefixPagination(pages); + + Map updatedMetadata = new LinkedHashMap<>(metadata); + updatedMetadata.put("status", "reviewed"); + KnowledgeSourceFile updatedFile = searchIndexClient.updateKnowledgeSourceFile(firstFile.getFileId(), + knowledgeSourceName, + new UpdateKnowledgeSourceFileRequest( + new FileUploadMetadata().setFileName(firstFile.getFileName()).setMetadata(updatedMetadata), + createFileContent("# August features\n\nUpdated and reviewed.", "features.md"))); + if (!firstFile.getFileId().equals(updatedFile.getFileId()) + || !updatedMetadata.equals(updatedFile.getMetadata())) { + throw new IllegalStateException("The file wasn't updated in place."); + } + + searchIndexClient.deleteKnowledgeSourceFile(secondFile.getFileId(), knowledgeSourceName); + uploadedFileIds.remove(secondFile.getFileId()); + long remainingFiles = searchIndexClient.listKnowledgeSourceFiles(knowledgeSourceName).stream().count(); + if (remainingFiles != 1) { + throw new IllegalStateException("Deleting one file should leave the other file intact."); + } + + searchIndexClient.deleteKnowledgeSourceFile(firstFile.getFileId(), knowledgeSourceName); + uploadedFileIds.remove(firstFile.getFileId()); + if (searchIndexClient.listKnowledgeSourceFiles(knowledgeSourceName).stream().findAny().isPresent()) { + throw new IllegalStateException("The File knowledge source should be empty after deleting its files."); + } + } finally { + uploadedFileIds.forEach(fileId -> searchIndexClient.deleteKnowledgeSourceFile(fileId, knowledgeSourceName)); + if (knowledgeSourceCreated) { + searchIndexClient.deleteKnowledgeSource(knowledgeSourceName); + } + } + } + + private static UploadKnowledgeSourceFileMultipartRequest createUploadRequest(String fileName, String contents, + Map metadata) { + FileUploadMetadata fileMetadata = new FileUploadMetadata().setFileName(fileName).setMetadata(metadata); + String contentFileName = fileName.substring(fileName.lastIndexOf('/') + 1); + return new UploadKnowledgeSourceFileMultipartRequest(fileMetadata, + createFileContent(contents, contentFileName)); + } + + private static ContentFileDetails createFileContent(String contents, String fileName) { + return new ContentFileDetails(BinaryData.fromString(contents)).setFilename(fileName) + .setContentType("text/markdown; charset=utf-8"); + } + + private static void verifyUploadedFile(KnowledgeSourceFile file, String expectedName, String expectedPrefix, + Map expectedMetadata) { + if (file.getFileId() == null || !expectedName.equals(file.getFileName()) + || !expectedPrefix.equals(file.getPrefix()) || !expectedMetadata.equals(file.getMetadata()) + || file.getParsingMode() == null || file.getExtractionMode() == null) { + throw new IllegalStateException("The uploaded file metadata didn't match the request."); + } + + FileKnowledgeSourceExtractionMode extractionMode = file.getExtractionMode(); + if (!FileKnowledgeSourceExtractionMode.MINIMAL.equals(extractionMode) + && !FileKnowledgeSourceExtractionMode.STANDARD.equals(extractionMode)) { + throw new IllegalStateException("The service returned an unsupported extraction mode."); + } + System.out.println("The service selected parsing mode " + file.getParsingMode() + " and extraction mode " + + extractionMode + "."); + } + + private static void verifyPrefixPagination(List> pages) { + if (pages.size() != 2 || pages.stream().anyMatch(page -> page.getElements().stream().count() != 1) + || pages.get(0).getContinuationToken() == null + || pages.get(pages.size() - 1).getContinuationToken() != null) { + throw new IllegalStateException("Prefix listing didn't return two cursor-paginated file pages."); + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFreshnessPreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFreshnessPreviewExample.java new file mode 100644 index 0000000000000..66ba2e6cf649d --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFreshnessPreviewExample.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; +import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; + +/** + * Demonstrates how persisted retrieval defaults and freshness-aware behavior work together + * for indexed knowledge sources in the preview API. + * + *

    Key concepts shown:

    + *
      + *
    • Setting enableFreshness on a KnowledgeSourceReference so retrieval prefers recent documents
    • + *
    • Persisting retrieval defaults (outputMode, retrievalReasoningEffort, retrievalInstructions) on the KB
    • + *
    • Issuing a retrieve call that inherits those defaults without re-specifying them
    • + *
    + */ +public class KnowledgeSourceFreshnessPreviewExample { + + private static final String KB_NAME = "freshness-defaults-sample-kb"; + private static final String KS_NAME = "freshness-defaults-sample-ks"; + + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + String apiKey = System.getenv("SEARCH_API_KEY"); + String indexName = System.getenv("SEARCH_INDEX_NAME"); + String aoaiEndpoint = System.getenv("SEARCH_OPENAI_ENDPOINT"); + String aoaiDeployment = System.getenv("SEARCH_OPENAI_DEPLOYMENT_NAME"); + + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .knowledgeBaseName(KB_NAME) + .buildClient(); + + + try { + // Step 1: Create an indexed knowledge source backed by a search index. + SearchIndexKnowledgeSource knowledgeSource = new SearchIndexKnowledgeSource( + KS_NAME, + new SearchIndexKnowledgeSourceParameters(indexName) + .setSemanticConfigurationName("my-semantic-config") + ); + searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); + + // Step 2: Reference the source with enableFreshness = true. + // This tells the service to prefer recently-updated documents during retrieval. + KnowledgeSourceReference sourceRef = new KnowledgeSourceReference(KS_NAME) + .setEnableFreshness(true); + + // Step 3: Create the knowledge base with persisted retrieval defaults. + // These defaults apply to every retrieve call unless overridden at query time. + KnowledgeBase knowledgeBase = new KnowledgeBase(KB_NAME, sourceRef) + .setModels(new KnowledgeBaseAzureOpenAIModel( + new AzureOpenAIVectorizerParameters() + .setResourceUrl(aoaiEndpoint) + .setDeploymentName(aoaiDeployment) + .setModelName(AzureOpenAIModelName.GPT54))) + .setOutputMode(KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA) + .setRetrievalReasoningEffort(new KnowledgeRetrievalMinimalReasoningEffort()) + .setRetrievalInstructions("Prefer documents updated in the last 7 days."); + + searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); + System.out.println("Created KB with freshness enabled and persisted defaults."); + + // Step 4: Retrieve — pass only the query. Defaults from the KB are applied automatically. + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What are the latest updates?")); + + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); + System.out.println("Response messages: " + result.getResponse().size()); + System.out.println("Activity records: " + + (result.getActivity() != null ? result.getActivity().size() : 0)); + + + } finally { + // Cleanup + searchIndexClient.deleteKnowledgeBase(KB_NAME); + searchIndexClient.deleteKnowledgeSource(KS_NAME); + System.out.println("Cleaned up KB and KS."); + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceMcpServerPreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceMcpServerPreviewExample.java new file mode 100644 index 0000000000000..48cb9d1fbcb68 --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceMcpServerPreviewExample.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeSource; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.McpServerKnowledgeSource; +import com.azure.search.documents.indexes.models.McpServerKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.McpServerTool; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; + +import java.util.Arrays; + +/** + * Demonstrates creating and using an MCP Server knowledge source in the preview API. + */ +public class KnowledgeSourceMcpServerPreviewExample { + + private static final String KB_NAME = "mcp-server-kind-sample-kb"; + private static final String KS_NAME = "mcp-server-kind-sample-ks"; + + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + String apiKey = System.getenv("SEARCH_API_KEY"); + + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .knowledgeBaseName(KB_NAME) + .buildClient(); + + try { + // Create KS — MCP Server requires a server URL and a list of tools + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource( + KS_NAME, + new McpServerKnowledgeSourceParameters( + "https://my-mcp-server.example.com/sse", + Arrays.asList( + new McpServerTool().setName("search-tool").setMaxOutputTokens(2000), + new McpServerTool().setName("lookup-tool").setMaxOutputTokens(1000) + ) + ) + ); + searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); + + // Verify KS kind + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(KS_NAME); + System.out.println("KnowledgeSource kind = " + retrieved.getKind()); + + // Hook up KS to a KB + KnowledgeSourceReference ref = new KnowledgeSourceReference(KS_NAME); + KnowledgeBase knowledgeBase = new KnowledgeBase(KB_NAME, ref); + searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); + System.out.println("Created KnowledgeBase " + KB_NAME + " referencing " + KS_NAME); + + // Issue retrieval request to verify everything is wired up end-to-end + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What tools are available?")); + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); + System.out.println("Response messages: " + result.getResponse().size()); + + } finally { + searchIndexClient.deleteKnowledgeBase(KB_NAME); + searchIndexClient.deleteKnowledgeSource(KS_NAME); + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceWorkIqPreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceWorkIqPreviewExample.java new file mode 100644 index 0000000000000..64566acd1eb57 --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceWorkIqPreviewExample.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents; + +import com.azure.core.credential.AzureKeyCredential; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; +import com.azure.search.documents.indexes.models.EntraAppAuthentication; +import com.azure.search.documents.indexes.models.KnowledgeBase; +import com.azure.search.documents.indexes.models.KnowledgeBaseAzureOpenAIModel; +import com.azure.search.documents.indexes.models.KnowledgeSourceReference; +import com.azure.search.documents.indexes.models.WorkIQKnowledgeSource; +import com.azure.search.documents.indexes.models.WorkIQKnowledgeSourceParameters; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalOptions; +import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResult; +import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; +import com.azure.search.documents.knowledgebases.models.WorkIQKnowledgeSourceParams; + +import java.util.Collections; +import java.util.UUID; + +/** + * Demonstrates a Work IQ knowledge source using a customer-owned Microsoft Entra application. + * + *

    Set {@code SEARCH_ENDPOINT}, {@code SEARCH_API_KEY}, {@code SEARCH_WORK_IQ_APPLICATION_ID}, + * {@code SEARCH_WORK_IQ_FEDERATED_CREDENTIAL_ID}, {@code SEARCH_WORK_IQ_USER_ASSERTION}, + * {@code SEARCH_OPENAI_ENDPOINT}, {@code SEARCH_OPENAI_API_KEY}, {@code SEARCH_OPENAI_DEPLOYMENT_NAME}, and + * {@code SEARCH_OPENAI_MODEL_NAME}. Set {@code SEARCH_WORK_IQ_TENANT_ID} only when the application is in a different + * tenant from the Search service.

    + */ +public class KnowledgeSourceWorkIqPreviewExample { + public static void main(String[] args) { + String endpoint = System.getenv("SEARCH_ENDPOINT"); + String apiKey = System.getenv("SEARCH_API_KEY"); + String tenantId = System.getenv("SEARCH_WORK_IQ_TENANT_ID"); + + SearchIndexClient searchIndexClient = new SearchIndexClientBuilder().endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + String suffix = UUID.randomUUID().toString().replace("-", "").substring(0, 12); + String knowledgeSourceName = "work-iq-source-" + suffix; + String knowledgeBaseName = "work-iq-kb-" + suffix; + boolean knowledgeSourceCreated = false; + boolean knowledgeBaseCreated = false; + + try { + EntraAppAuthentication entraAuthentication = new EntraAppAuthentication( + System.getenv("SEARCH_WORK_IQ_APPLICATION_ID"), + System.getenv("SEARCH_WORK_IQ_FEDERATED_CREDENTIAL_ID")); + if (tenantId != null && !tenantId.isEmpty()) { + entraAuthentication.setTenantId(tenantId); + } + + // Federation is configured on the Entra application and Search service identity. The SDK doesn't accept a + // client secret or a user-assigned identity resource ID for this Work IQ configuration. + WorkIQKnowledgeSource knowledgeSource = new WorkIQKnowledgeSource(knowledgeSourceName, + new WorkIQKnowledgeSourceParameters(entraAuthentication)); + WorkIQKnowledgeSource created + = (WorkIQKnowledgeSource) searchIndexClient.createKnowledgeSource(knowledgeSource); + knowledgeSourceCreated = true; + + EntraAppAuthentication persistedAuthentication + = created.getWorkIQParameters().getEntraAppAuthentication(); + if (!entraAuthentication.getApplicationId().equals(persistedAuthentication.getApplicationId()) + || !entraAuthentication.getFederatedCredentialId() + .equals(persistedAuthentication.getFederatedCredentialId()) + || (tenantId == null && persistedAuthentication.getTenantId() != null) + || (tenantId != null && !tenantId.equals(persistedAuthentication.getTenantId()))) { + throw new IllegalStateException("The Work IQ Entra application configuration wasn't persisted."); + } + + KnowledgeBase knowledgeBase + = new KnowledgeBase(knowledgeBaseName, new KnowledgeSourceReference(knowledgeSourceName)) + .setModels(new KnowledgeBaseAzureOpenAIModel(new AzureOpenAIVectorizerParameters() + .setResourceUrl(System.getenv("SEARCH_OPENAI_ENDPOINT")) + .setApiKey(System.getenv("SEARCH_OPENAI_API_KEY")) + .setDeploymentName(System.getenv("SEARCH_OPENAI_DEPLOYMENT_NAME")) + .setModelName(AzureOpenAIModelName.fromString(System.getenv("SEARCH_OPENAI_MODEL_NAME"))))); + searchIndexClient.createKnowledgeBase(knowledgeBase); + knowledgeBaseCreated = true; + + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder().endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .knowledgeBaseName(knowledgeBaseName) + .buildClient(); + WorkIQKnowledgeSourceParams sourceParams + = new WorkIQKnowledgeSourceParams(knowledgeSourceName).setAlwaysQuerySource(true) + .setIncludeReferences(true); + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setIntents(new KnowledgeRetrievalSemanticIntent("What work items are relevant?")) + .setKnowledgeSourceParams(Collections.singletonList(sourceParams)); + + // Search authentication is supplied by the client credential. The Work IQ user assertion is supplied + // separately in x-ms-query-work-iq-source-authorization; it isn't a Search API key or access token. + String workIqUserAssertion = System.getenv("SEARCH_WORK_IQ_USER_ASSERTION"); + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options, null, workIqUserAssertion); + if (result.getResponse() == null) { + throw new IllegalStateException("Work IQ retrieval didn't return a response."); + } + System.out.println("Work IQ retrieval completed with " + result.getResponse().size() + " messages."); + } finally { + if (knowledgeBaseCreated) { + searchIndexClient.deleteKnowledgeBase(knowledgeBaseName); + } + if (knowledgeSourceCreated) { + searchIndexClient.deleteKnowledgeSource(knowledgeSourceName); + } + } + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchOptionsExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchOptionsExample.java index 8705ba47ebeab..fddf2c8ea0180 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchOptionsExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchOptionsExample.java @@ -37,14 +37,6 @@ public static void main(String[] args) { searchResultsCountFromPage(searchClient); searchResultsCoverageFromPage(searchClient); searchResultsFacets(searchClient); - findSimilarDocuments(searchClient); - } - - private static void findSimilarDocuments(SearchClient searchClient) { - SearchOptions options = new SearchOptions().setMoreLikeThis("1") - .setSearchFields("HotelName", "Description") - .setTop(5); - searchClient.search(options).forEach(result -> System.out.println(result.getAdditionalProperties())); } private static void searchResultsFacets(SearchClient searchClient) { diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java index 7060446750db6..ce44ce8141308 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java @@ -4,7 +4,6 @@ package com.azure.search.documents; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.Configuration; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexClientBuilder; @@ -38,10 +37,6 @@ public static void main(String[] args) { System.out.println("Create synonym map...\n"); createSynonymMap(serviceClient, synonymMapName); - serviceClient.listSynonymMaps(new RequestOptions().addQueryParam("search", synonymMapName) - .addQueryParam("searchType", "prefix").addQueryParam("pageSize", "1").addQueryParam("$select", "name")) - .iterableByPage().forEach(page -> page.getValue() - .forEach(map -> System.out.println("Listed synonym map: " + map.getName()))); System.out.println("Create index and assign synonym map to it...\n"); SearchIndex searchIndex = assignSynonymMapToIndex(synonymMapName); diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java index 54f1c499627f5..f5d5fe3dd26c1 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java @@ -12,11 +12,6 @@ import com.azure.search.documents.indexes.models.SearchIndexerSkillset; import com.azure.search.documents.indexes.models.WebApiHttpHeaders; import com.azure.search.documents.indexes.models.WebApiSkill; -import com.azure.search.documents.indexes.models.ContentUnderstandingSkill; -import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingProperties; -import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingUnit; -import com.azure.search.documents.indexes.models.AIServicesAccountKey; -import com.azure.search.documents.models.ContentUnderstandingSkillChunkingMethod; import java.util.Arrays; import java.util.Collections; @@ -40,51 +35,11 @@ public static void main(String[] args) { .credential(new AzureKeyCredential(ADMIN_KEY)) .buildClient(); - if (args.length > 0 && "content-understanding".equals(args[0])) { - SearchIndexerSkillset skillset = new SearchIndexerSkillset("content-understanding-sample", - contentUnderstandingSkill(System.getenv("SEARCH_CONTENT_MODEL_NAME"), - System.getenv("SEARCH_CONTENT_MODEL_DEPLOYMENT"), ContentUnderstandingSkillChunkingMethod.SEMANTIC)) - .setCognitiveServicesAccount(new AIServicesAccountKey(System.getenv("SEARCH_AI_SERVICES_API_KEY"), - System.getenv("SEARCH_AI_SERVICES_ENDPOINT"))); - searchIndexerClient.createSkillset(skillset); - try { - System.out.println(searchIndexerClient.getSkillset(skillset.getName()).getSkills()); - } finally { - searchIndexerClient.deleteSkillset(skillset.getName()); - } - return; - } - createOcrSkillset(searchIndexerClient); createCustomSkillset(searchIndexerClient); cleanupSkillset(searchIndexerClient); } - /** - * Builds a content-understanding skill for file data, using token-based semantic chunks or fixed-size characters. - * Run the sample with {@code content-understanding} and set SEARCH_CONTENT_MODEL_NAME, - * SEARCH_CONTENT_MODEL_DEPLOYMENT, SEARCH_AI_SERVICES_ENDPOINT, and SEARCH_AI_SERVICES_API_KEY in addition to the Search endpoint and key. - * An indexer using this skill must expose /document/file_data (allowSkillsetToReadFileData). - * - * @param modelName The supported model name. - * @param deployment The provisioned model deployment. - * @param method The chunking method. - * @return The configured content-understanding skill. - */ - public static ContentUnderstandingSkill contentUnderstandingSkill(String modelName, String deployment, - ContentUnderstandingSkillChunkingMethod method) { - boolean semantic = ContentUnderstandingSkillChunkingMethod.SEMANTIC.equals(method); - return new ContentUnderstandingSkill( - Collections.singletonList(new InputFieldMappingEntry("file_data").setSource("/document/file_data")), - Collections.singletonList(new OutputFieldMappingEntry("text_sections").setTargetName("sections"))) - .setModelName(modelName) - .setModelDeployment(deployment) - .setChunkingProperties(new ContentUnderstandingSkillChunkingProperties().setMethod(method) - .setUnit(semantic ? ContentUnderstandingSkillChunkingUnit.TOKENS - : ContentUnderstandingSkillChunkingUnit.CHARACTERS) - .setMaximumLength(semantic ? 500 : 2000)); - } - private static void createOcrSkillset(SearchIndexerClient searchIndexerClient) { // Sample OCR definition // https://docs.microsoft.com/azure/search/cognitive-search-skill-ocr#sample-definition diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java index e290a9f0cca33..5b4267d1b7b25 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java @@ -4,7 +4,6 @@ package com.azure.search.documents.indexes; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.Configuration; public class ListIndexersExample { @@ -27,29 +26,12 @@ public static void main(String[] args) { .credential(new AzureKeyCredential(ADMIN_KEY)) .buildAsyncClient(); - String prefix = args.length == 0 ? "" : args[0]; - listIndexers(indexerAsyncClient, prefix); - indexerAsyncClient.listDataSourceConnections(listingOptions(prefix)).mapPage(source -> source.getName()) - .doOnNext(name -> System.out.println("Data source: " + name)).blockLast(); - indexerAsyncClient.listSkillsets(listingOptions(prefix)).mapPage(skillset -> skillset.getName()) - .doOnNext(name -> System.out.println("Skillset: " + name)).blockLast(); + listIndexers(indexerAsyncClient); } - private static RequestOptions listingOptions(String prefix) { - return new RequestOptions().addQueryParam("search", prefix).addQueryParam("searchType", "prefix") - .addQueryParam("pageSize", "1").addQueryParam("$select", "name"); - } - - private static void listIndexers(SearchIndexerAsyncClient indexerAsyncClient, String prefix) { + private static void listIndexers(SearchIndexerAsyncClient indexerAsyncClient) { System.out.println("Found the following indexers:"); - indexerAsyncClient.listIndexers(listingOptions(prefix)) - .concatMap(indexer -> indexerAsyncClient.getIndexerStatus(indexer.getName()).doOnNext(status -> { - System.out.println("Indexer: " + indexer.getName()); - if (status.getRuntime() != null) { - System.out.printf("Runtime: %d used, %s remaining seconds, period %s to %s%n", - status.getRuntime().getUsedSeconds(), status.getRuntime().getRemainingSeconds(), - status.getRuntime().getBeginningTime(), status.getRuntime().getEndingTime()); - } - })).blockLast(); + indexerAsyncClient.listIndexers().subscribe(indexer -> + System.out.printf("Indexer name: %s, ETag: %s%n", indexer.getName(), indexer.getETag())); } } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexesExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexesExample.java index c996beac8c937..31ec6b86b6c94 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexesExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexesExample.java @@ -10,7 +10,6 @@ import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.SearchIndex; -import com.azure.search.documents.indexes.models.SearchAlias; import java.util.ArrayList; import java.util.Arrays; @@ -40,7 +39,6 @@ public static void main(String[] args) { String prefix = "sample-paged-index-" + UUID.randomUUID().toString().replace("-", ""); List expectedNames = Arrays.asList(prefix + "-one", prefix + "-two"); List createdNames = new ArrayList<>(); - List createdAliases = new ArrayList<>(); try { expectedNames.forEach(name -> { @@ -59,23 +57,7 @@ public static void main(String[] args) { List> asyncPages = indexAsyncClient.listIndexes(requestOptions).byPage().collectList().block(); verifyPages("reactive", expectedNames, asyncPages); - - String continuation = syncPages.get(0).getContinuationToken(); - indexClient.listIndexes(new RequestOptions()).iterableByPage(continuation) - .forEach(page -> System.out.println("Resumed page: " + page.getValue().get(0).getName())); - indexClient.listIndexesWithSelectedProperties(Arrays.asList("name", "description"), - new RequestOptions().addQueryParam("search", prefix).addQueryParam("searchType", "prefix") - .addQueryParam("pageSize", "1")) - .forEach(index -> System.out.println("Selected index name: " + index.getName())); - - String aliasName = prefix + "-alias"; - indexClient.createAlias(new SearchAlias(aliasName, expectedNames.get(0))); - createdAliases.add(aliasName); - indexClient.listAliases(new RequestOptions().addQueryParam("search", prefix) - .addQueryParam("searchType", "prefix").addQueryParam("pageSize", "1")) - .forEach(alias -> System.out.println("Alias: " + alias.getName())); } finally { - createdAliases.forEach(indexClient::deleteAlias); createdNames.forEach(indexClient::deleteIndex); } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeSourceTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeSourceTests.java index 47270ea669f5e..c22bae10ac680 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeSourceTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/KnowledgeSourceTests.java @@ -16,6 +16,12 @@ import com.azure.search.documents.indexes.SearchIndexAsyncClient; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSource; +import com.azure.search.documents.indexes.models.AzureBlobKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSource; +import com.azure.search.documents.indexes.models.FabricDataAgentKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSource; +import com.azure.search.documents.indexes.models.FabricOntologyKnowledgeSourceParameters; import com.azure.search.documents.indexes.models.AzureOpenAIModelName; import com.azure.search.documents.indexes.models.AzureOpenAIVectorizerParameters; import com.azure.search.documents.indexes.models.ContentColumnMapping; @@ -29,22 +35,44 @@ import com.azure.search.documents.indexes.models.KnowledgeSource; import com.azure.search.documents.indexes.models.KnowledgeSourceContentExtractionMode; import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.KnowledgeSourceIngestionPermissionOption; import com.azure.search.documents.indexes.models.KnowledgeSourceKind; +import com.azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing; import com.azure.search.documents.indexes.models.KnowledgeSourceSynchronizationStatus; import com.azure.search.documents.indexes.models.ListingSearchType; +import com.azure.search.documents.indexes.models.McpServerAuthentication; +import com.azure.search.documents.indexes.models.McpServerFoundryConnectionAuthentication; +import com.azure.search.documents.indexes.models.McpServerFoundryConnectionParameters; +import com.azure.search.documents.indexes.models.McpServerHeaders; +import com.azure.search.documents.indexes.models.McpServerJsonOutputParsing; +import com.azure.search.documents.indexes.models.McpServerKnowledgeSource; +import com.azure.search.documents.indexes.models.McpServerKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.McpServerNoneOutputParsing; +import com.azure.search.documents.indexes.models.McpServerOutputParsingJsonParameters; +import com.azure.search.documents.indexes.models.McpServerOutputParsingSplitParameters; +import com.azure.search.documents.indexes.models.McpServerSplitOutputParsing; +import com.azure.search.documents.indexes.models.McpServerStoredHeadersAuthentication; +import com.azure.search.documents.indexes.models.McpServerStoredHeadersParameters; +import com.azure.search.documents.indexes.models.McpServerTool; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchIndexFieldReference; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSource; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity; import com.azure.search.documents.indexes.models.SemanticConfiguration; import com.azure.search.documents.indexes.models.SemanticField; import com.azure.search.documents.indexes.models.SemanticPrioritizedFields; import com.azure.search.documents.indexes.models.SemanticSearch; +import com.azure.search.documents.indexes.models.TextSplitMode; import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; import com.azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest; import com.azure.search.documents.indexes.models.WebKnowledgeSource; import com.azure.search.documents.indexes.models.WebKnowledgeSourceParameters; +import com.azure.search.documents.indexes.models.EntraAppAuthentication; +import com.azure.search.documents.indexes.models.WorkIQKnowledgeSource; +import com.azure.search.documents.indexes.models.WorkIQKnowledgeSourceParameters; import com.azure.search.documents.knowledgebases.models.AiServices; +import com.azure.search.documents.knowledgebases.models.FreshnessPolicy; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters; import com.azure.search.documents.knowledgebases.models.KnowledgeSourceStatus; @@ -56,7 +84,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; -import org.junit.jupiter.api.parallel.ResourceLock; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.util.function.Tuple2; @@ -88,7 +115,6 @@ * Tests for Knowledge Source operations. */ @Execution(ExecutionMode.SAME_THREAD) -@ResourceLock("search-knowledge-resources") public class KnowledgeSourceTests extends SearchTestBase { private static final String HOTEL_INDEX_NAME = "shared-knowledge-source-index"; private static final String BLOB_CONNECTION_STRING = "ResourceId=/subscriptions/" + SUBSCRIPTION_ID @@ -168,6 +194,30 @@ public void createKnowledgeSourceSearchIndexAsync() { }).verifyComplete(); } + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void createKnowledgeSourceRemoteSharePointSync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void createKnowledgeSourceRemoteSharePointAsync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void createKnowledgeSourceRemoteSharePointCustomParametersSync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void createKnowledgeSourceRemoteSharePointCustomParametersAsync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + @Test public void getKnowledgeSourceSearchIndexSync() { // Test getting a knowledge source. @@ -201,6 +251,18 @@ public void getKnowledgeSourceSearchIndexAsync() { }).verifyComplete(); } + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void getKnowledgeSourceRemoteSharePointSync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void getKnowledgeSourceRemoteSharePointAsync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + @Test public void listKnowledgeSourcesSync() { // Test listing knowledge sources. @@ -316,6 +378,18 @@ public void updateKnowledgeSourceSearchIndexAsync() { .verifyComplete(); } + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void updateKnowledgeSourceRemoteSharePointSync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + + @Test + @Disabled("RemoteSharePointKnowledgeSource removed in 2026-04-01 API version") + public void updateKnowledgeSourceRemoteSharePointAsync() { + // Disabled: RemoteSharePointKnowledgeSource was removed from the 2026-04-01 API version. + } + @Test public void statusPayloadMapsToModelsWithNullables() throws IOException { // Sample status payload with nullables for first sync @@ -590,87 +664,1047 @@ public void createKnowledgeSourceWithInvalidName() { assertTrue(true); } - try { - WebKnowledgeSource webKS = new WebKnowledgeSource(null); - HttpResponseException ex2 - = assertThrows(HttpResponseException.class, () -> searchIndexClient.createKnowledgeSource(webKS)); - assertTrue(ex2.getResponse().getStatusCode() >= 400 && ex2.getResponse().getStatusCode() < 500); + try { + WebKnowledgeSource webKS = new WebKnowledgeSource(null); + HttpResponseException ex2 + = assertThrows(HttpResponseException.class, () -> searchIndexClient.createKnowledgeSource(webKS)); + assertTrue(ex2.getResponse().getStatusCode() >= 400 && ex2.getResponse().getStatusCode() < 500); + + } catch (NullPointerException | IllegalArgumentException e) { + // Expected exception for null name + assertTrue(true); + } + } + + @Test + public void webKnowledgeSourceResponseShapeValidation() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + WebKnowledgeSource webKS + = new WebKnowledgeSource(randomKnowledgeSourceName()).setDescription("Test for response modeling"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(webKS); + + WebKnowledgeSource createdWeb = assertInstanceOf(WebKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.WEB, createdWeb.getKind()); + assertNotNull(createdWeb.getName()); + assertEquals("Test for response modeling", createdWeb.getDescription()); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(created.getName()); + WebKnowledgeSource retrievedWeb = assertInstanceOf(WebKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.WEB, retrievedWeb.getKind()); + assertEquals(createdWeb.getName(), retrievedWeb.getName()); + assertEquals("Test for response modeling", retrievedWeb.getDescription()); + } + + @Test + public void webKnowledgeSourceJsonSerializationRoundTrip() { + WebKnowledgeSource webKS + = new WebKnowledgeSource(randomKnowledgeSourceName()).setDescription("JSON serialization test"); + + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { + webKS.toJson(writer); // Real method from WebKnowledgeSource + } + String json = outputStream.toString(); + + assertTrue(json.contains("\"kind\":\"web\"")); + assertTrue(json.contains("\"name\":")); + assertTrue(json.contains(webKS.getName())); + + try (JsonReader reader = JsonProviders.createReader(json)) { + WebKnowledgeSource deserialized = WebKnowledgeSource.fromJson(reader); // Real static method + assertEquals(KnowledgeSourceKind.WEB, deserialized.getKind()); + assertEquals(webKS.getName(), deserialized.getName()); + assertEquals(webKS.getDescription(), deserialized.getDescription()); + } + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } + + @Test + public void webKnowledgeSourceInheritsKnowledgeSourceBehavior() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + WebKnowledgeSource webKS + = new WebKnowledgeSource(randomKnowledgeSourceName()).setDescription("Inheritance test") + .setETag("test-etag"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(webKS); + + // Verify inherited properties work + assertNotNull(created.getName()); + assertNotNull(created.getDescription()); + + assertInstanceOf(WebKnowledgeSource.class, created); + + String newDescription = "Updated via base class"; + created.setDescription(newDescription); + + KnowledgeSource updated = searchIndexClient.createOrUpdateKnowledgeSource(created); + assertEquals(newDescription, updated.getDescription()); + } + + @Test + public void createFabricOntologyKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + assertEquals(knowledgeSource.getName(), created.getName()); + FabricOntologyKnowledgeSource createdSource = assertInstanceOf(FabricOntologyKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.FABRIC_ONTOLOGY, createdSource.getKind()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, createdSource.getFabricOntologyParameters().getWorkspaceId()); + assertEquals(FABRIC_ONTOLOGY_ID, createdSource.getFabricOntologyParameters().getOntologyId()); + } + } + + @Test + public void createFabricOntologyKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + assertEquals(knowledgeSource.getName(), created.getName()); + FabricOntologyKnowledgeSource createdSource + = assertInstanceOf(FabricOntologyKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.FABRIC_ONTOLOGY, createdSource.getKind()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, createdSource.getFabricOntologyParameters().getWorkspaceId()); + assertEquals(FABRIC_ONTOLOGY_ID, createdSource.getFabricOntologyParameters().getOntologyId()); + } + }).verifyComplete(); + } + + @Test + public void getFabricOntologyKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params) + .setDescription("Fabric Ontology for testing"); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(knowledgeSource.getName()); + assertEquals(knowledgeSource.getName(), retrieved.getName()); + + FabricOntologyKnowledgeSource retrievedSource + = assertInstanceOf(FabricOntologyKnowledgeSource.class, retrieved); + assertEquals("Fabric Ontology for testing", retrievedSource.getDescription()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, retrievedSource.getFabricOntologyParameters().getWorkspaceId()); + assertEquals(FABRIC_ONTOLOGY_ID, retrievedSource.getFabricOntologyParameters().getOntologyId()); + } + } + + @Test + public void getFabricOntologyKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params) + .setDescription("Fabric Ontology for testing"); + + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono).assertNext(retrieved -> { + assertEquals(knowledgeSource.getName(), retrieved.getName()); + + FabricOntologyKnowledgeSource retrievedSource + = assertInstanceOf(FabricOntologyKnowledgeSource.class, retrieved); + assertEquals("Fabric Ontology for testing", retrievedSource.getDescription()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, retrievedSource.getFabricOntologyParameters().getWorkspaceId()); + assertEquals(FABRIC_ONTOLOGY_ID, retrievedSource.getFabricOntologyParameters().getOntologyId()); + } + }).verifyComplete(); + } + + @Test + public void updateFabricOntologyKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + knowledgeSource.setDescription("Updated Fabric Ontology description"); + KnowledgeSource updated = searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); + + assertEquals("Updated Fabric Ontology description", updated.getDescription()); + FabricOntologyKnowledgeSource updatedSource = assertInstanceOf(FabricOntologyKnowledgeSource.class, updated); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, updatedSource.getFabricOntologyParameters().getWorkspaceId()); + } + } + + @Test + public void updateFabricOntologyKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + Mono createUpdateAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient + .createOrUpdateKnowledgeSource(created.setDescription("Updated Fabric Ontology description"))) + .flatMap(updated -> searchIndexClient.getKnowledgeSource(updated.getName())); + + StepVerifier.create(createUpdateAndGetMono).assertNext(retrieved -> { + assertEquals("Updated Fabric Ontology description", retrieved.getDescription()); + FabricOntologyKnowledgeSource retrievedSource + = assertInstanceOf(FabricOntologyKnowledgeSource.class, retrieved); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, retrievedSource.getFabricOntologyParameters().getWorkspaceId()); + } + }).verifyComplete(); + } + + @Test + public void deleteFabricOntologyKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(knowledgeSource.getName()); + assertNotNull(retrieved); + + searchIndexClient.deleteKnowledgeSource(knowledgeSource.getName()); + + HttpResponseException exception = assertThrows(HttpResponseException.class, + () -> searchIndexClient.getKnowledgeSource(knowledgeSource.getName())); + assertEquals(404, exception.getResponse().getStatusCode()); + } + + @Test + public void deleteFabricOntologyKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono) + .assertNext(retrieved -> assertEquals(knowledgeSource.getName(), retrieved.getName())) + .verifyComplete(); + + StepVerifier.create(searchIndexClient.deleteKnowledgeSource(knowledgeSource.getName())).verifyComplete(); + + StepVerifier.create(searchIndexClient.getKnowledgeSource(knowledgeSource.getName())) + .verifyError(HttpResponseException.class); + } + + @Test + public void listFabricOntologyKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + long initialCount = searchIndexClient.listKnowledgeSources().stream().count(); + + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_ONTOLOGY_ID); + FabricOntologyKnowledgeSource knowledgeSource + = new FabricOntologyKnowledgeSource(randomKnowledgeSourceName(), params); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + Map knowledgeSourcesByName = searchIndexClient.listKnowledgeSources() + .stream() + .collect(Collectors.toMap(KnowledgeSource::getName, Function.identity())); + + assertEquals(initialCount + 1, knowledgeSourcesByName.size()); + assertTrue(knowledgeSourcesByName.containsKey(knowledgeSource.getName())); + + KnowledgeSource listed = knowledgeSourcesByName.get(knowledgeSource.getName()); + FabricOntologyKnowledgeSource listedSource = assertInstanceOf(FabricOntologyKnowledgeSource.class, listed); + assertEquals(KnowledgeSourceKind.FABRIC_ONTOLOGY, listedSource.getKind()); + } + + @Test + public void fabricOntologyKnowledgeSourceSerializationRoundTrip() throws IOException { + FabricOntologyKnowledgeSourceParameters params + = new FabricOntologyKnowledgeSourceParameters("workspace-id-123", "ontology-id-456"); + FabricOntologyKnowledgeSource original + = new FabricOntologyKnowledgeSource("test-fabric-ks", params).setDescription("Serialization test"); + + // Serialize + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { + original.toJson(writer); + } + String json = outputStream.toString(); + + // Verify JSON contains expected fields + assertTrue(json.contains("\"fabricOntology\""), "JSON should contain kind 'fabricOntology'"); + assertTrue(json.contains("\"workspace-id-123\""), "JSON should contain workspaceId"); + assertTrue(json.contains("\"ontology-id-456\""), "JSON should contain ontologyId"); + assertTrue(json.contains("\"test-fabric-ks\""), "JSON should contain name"); + + // Deserialize + try (JsonReader reader = JsonProviders.createReader(json)) { + KnowledgeSource deserialized = KnowledgeSource.fromJson(reader); + + FabricOntologyKnowledgeSource deserializedSource + = assertInstanceOf(FabricOntologyKnowledgeSource.class, deserialized); + assertEquals("test-fabric-ks", deserializedSource.getName()); + assertEquals("Serialization test", deserializedSource.getDescription()); + assertEquals(KnowledgeSourceKind.FABRIC_ONTOLOGY, deserializedSource.getKind()); + assertEquals("workspace-id-123", deserializedSource.getFabricOntologyParameters().getWorkspaceId()); + assertEquals("ontology-id-456", deserializedSource.getFabricOntologyParameters().getOntologyId()); + } + } + + @Test + public void createFabricDataAgentKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + assertEquals(knowledgeSource.getName(), created.getName()); + FabricDataAgentKnowledgeSource createdSource = assertInstanceOf(FabricDataAgentKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.FABRIC_DATA_AGENT, createdSource.getKind()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, createdSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals(FABRIC_DATA_AGENT_ID, createdSource.getFabricDataAgentParameters().getDataAgentId()); + } + } + + @Test + public void createFabricDataAgentKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + assertEquals(knowledgeSource.getName(), created.getName()); + FabricDataAgentKnowledgeSource createdSource + = assertInstanceOf(FabricDataAgentKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.FABRIC_DATA_AGENT, createdSource.getKind()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, createdSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals(FABRIC_DATA_AGENT_ID, createdSource.getFabricDataAgentParameters().getDataAgentId()); + } + }).verifyComplete(); + } + + @Test + public void getFabricDataAgentKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params) + .setDescription("Fabric Data Agent for testing"); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(knowledgeSource.getName()); + assertEquals(knowledgeSource.getName(), retrieved.getName()); + + FabricDataAgentKnowledgeSource retrievedSource + = assertInstanceOf(FabricDataAgentKnowledgeSource.class, retrieved); + assertEquals("Fabric Data Agent for testing", retrievedSource.getDescription()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, retrievedSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals(FABRIC_DATA_AGENT_ID, retrievedSource.getFabricDataAgentParameters().getDataAgentId()); + } + } + + @Test + public void getFabricDataAgentKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params) + .setDescription("Fabric Data Agent for testing"); + + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono).assertNext(retrieved -> { + assertEquals(knowledgeSource.getName(), retrieved.getName()); + + FabricDataAgentKnowledgeSource retrievedSource + = assertInstanceOf(FabricDataAgentKnowledgeSource.class, retrieved); + assertEquals("Fabric Data Agent for testing", retrievedSource.getDescription()); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, retrievedSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals(FABRIC_DATA_AGENT_ID, retrievedSource.getFabricDataAgentParameters().getDataAgentId()); + } + }).verifyComplete(); + } + + @Test + public void updateFabricDataAgentKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + knowledgeSource.setDescription("Updated Fabric Data Agent description"); + KnowledgeSource updated = searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); + + assertEquals("Updated Fabric Data Agent description", updated.getDescription()); + FabricDataAgentKnowledgeSource updatedSource = assertInstanceOf(FabricDataAgentKnowledgeSource.class, updated); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, updatedSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals(FABRIC_DATA_AGENT_ID, updatedSource.getFabricDataAgentParameters().getDataAgentId()); + } + } + + @Test + public void updateFabricDataAgentKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + Mono createUpdateAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient + .createOrUpdateKnowledgeSource(created.setDescription("Updated Fabric Data Agent description"))) + .flatMap(updated -> searchIndexClient.getKnowledgeSource(updated.getName())); + + StepVerifier.create(createUpdateAndGetMono).assertNext(retrieved -> { + assertEquals("Updated Fabric Data Agent description", retrieved.getDescription()); + FabricDataAgentKnowledgeSource retrievedSource + = assertInstanceOf(FabricDataAgentKnowledgeSource.class, retrieved); + if (interceptorManager.isLiveMode()) { + assertEquals(FABRIC_WORKSPACE_ID, retrievedSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals(FABRIC_DATA_AGENT_ID, retrievedSource.getFabricDataAgentParameters().getDataAgentId()); + } + }).verifyComplete(); + } + + @Test + public void deleteFabricDataAgentKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(knowledgeSource.getName()); + assertNotNull(retrieved); + + searchIndexClient.deleteKnowledgeSource(knowledgeSource.getName()); + + HttpResponseException exception = assertThrows(HttpResponseException.class, + () -> searchIndexClient.getKnowledgeSource(knowledgeSource.getName())); + assertEquals(404, exception.getResponse().getStatusCode()); + } + + @Test + public void deleteFabricDataAgentKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono) + .assertNext(retrieved -> assertEquals(knowledgeSource.getName(), retrieved.getName())) + .verifyComplete(); + + StepVerifier.create(searchIndexClient.deleteKnowledgeSource(knowledgeSource.getName())).verifyComplete(); + + StepVerifier.create(searchIndexClient.getKnowledgeSource(knowledgeSource.getName())) + .verifyError(HttpResponseException.class); + } + + @Test + public void listFabricDataAgentKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + long initialCount = searchIndexClient.listKnowledgeSources().stream().count(); + + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters(FABRIC_WORKSPACE_ID, FABRIC_DATA_AGENT_ID); + FabricDataAgentKnowledgeSource knowledgeSource + = new FabricDataAgentKnowledgeSource(randomKnowledgeSourceName(), params); + + searchIndexClient.createKnowledgeSource(knowledgeSource); + + Map knowledgeSourcesByName = searchIndexClient.listKnowledgeSources() + .stream() + .collect(Collectors.toMap(KnowledgeSource::getName, Function.identity())); + + assertEquals(initialCount + 1, knowledgeSourcesByName.size()); + assertTrue(knowledgeSourcesByName.containsKey(knowledgeSource.getName())); + + KnowledgeSource listed = knowledgeSourcesByName.get(knowledgeSource.getName()); + FabricDataAgentKnowledgeSource listedSource = assertInstanceOf(FabricDataAgentKnowledgeSource.class, listed); + assertEquals(KnowledgeSourceKind.FABRIC_DATA_AGENT, listedSource.getKind()); + } + + @Test + public void fabricDataAgentKnowledgeSourceSerializationRoundTrip() throws IOException { + FabricDataAgentKnowledgeSourceParameters params + = new FabricDataAgentKnowledgeSourceParameters("workspace-id-789", "agent-id-012"); + FabricDataAgentKnowledgeSource original + = new FabricDataAgentKnowledgeSource("test-fabric-da-ks", params).setDescription("Serialization test"); + + // Serialize + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { + original.toJson(writer); + } + String json = outputStream.toString(); + + // Verify JSON contains expected fields + assertTrue(json.contains("\"fabricDataAgent\""), "JSON should contain kind 'fabricDataAgent'"); + assertTrue(json.contains("\"workspace-id-789\""), "JSON should contain workspaceId"); + assertTrue(json.contains("\"agent-id-012\""), "JSON should contain dataAgentId"); + assertTrue(json.contains("\"test-fabric-da-ks\""), "JSON should contain name"); + + // Deserialize + try (JsonReader reader = JsonProviders.createReader(json)) { + KnowledgeSource deserialized = KnowledgeSource.fromJson(reader); + + FabricDataAgentKnowledgeSource deserializedSource + = assertInstanceOf(FabricDataAgentKnowledgeSource.class, deserialized); + assertEquals("test-fabric-da-ks", deserializedSource.getName()); + assertEquals("Serialization test", deserializedSource.getDescription()); + assertEquals(KnowledgeSourceKind.FABRIC_DATA_AGENT, deserializedSource.getKind()); + assertEquals("workspace-id-789", deserializedSource.getFabricDataAgentParameters().getWorkspaceId()); + assertEquals("agent-id-012", deserializedSource.getFabricDataAgentParameters().getDataAgentId()); + } + } + + @Test + public void createMcpServerKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + assertEquals(knowledgeSource.getName(), created.getName()); + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.MCP_SERVER, createdSource.getKind()); + assertEquals("https://mcp.contoso.com/sse", createdSource.getMcpServerParameters().getServerURL()); + assertEquals(1, createdSource.getMcpServerParameters().getTools().size()); + assertEquals("search_code", createdSource.getMcpServerParameters().getTools().get(0).getName()); + } + + @Test + public void createMcpServerKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + assertEquals(knowledgeSource.getName(), created.getName()); + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.MCP_SERVER, createdSource.getKind()); + assertEquals("https://mcp.contoso.com/sse", createdSource.getMcpServerParameters().getServerURL()); + assertEquals(1, createdSource.getMcpServerParameters().getTools().size()); + assertEquals("search_code", createdSource.getMcpServerParameters().getTools().get(0).getName()); + }).verifyComplete(); + } + + @Test + public void createMcpServerKnowledgeSourceWithFoundryAuthSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + McpServerFoundryConnectionParameters foundryParams + = new McpServerFoundryConnectionParameters().setConnectionId("my-foundry-connection"); + McpServerFoundryConnectionAuthentication auth = new McpServerFoundryConnectionAuthentication(foundryParams); + + McpServerTool tool = new McpServerTool().setName("search_code") + .setOutputParsing(new McpServerJsonOutputParsing( + new McpServerOutputParsingJsonParameters("$.results[*]").setIncludeContext(true))); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", Collections.singletonList(tool)) + .setAuthentication(auth); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.MCP_SERVER, createdSource.getKind()); + + // Verify auth + McpServerAuthentication createdAuth = createdSource.getMcpServerParameters().getAuthentication(); + assertNotNull(createdAuth); + McpServerFoundryConnectionAuthentication foundryAuth + = assertInstanceOf(McpServerFoundryConnectionAuthentication.class, createdAuth); + assertEquals("my-foundry-connection", foundryAuth.getFoundryConnectionParameters().getConnectionId()); + + // Verify tool with JSON output parsing + McpServerTool createdTool = createdSource.getMcpServerParameters().getTools().get(0); + assertEquals("search_code", createdTool.getName()); + McpServerJsonOutputParsing jsonParsing + = assertInstanceOf(McpServerJsonOutputParsing.class, createdTool.getOutputParsing()); + assertEquals("$.results[*]", jsonParsing.getJsonParameters().getDocumentsPath()); + assertEquals(true, jsonParsing.getJsonParameters().isIncludeContext()); + } + + @Test + public void createMcpServerKnowledgeSourceWithFoundryAuthAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + + McpServerFoundryConnectionParameters foundryParams + = new McpServerFoundryConnectionParameters().setConnectionId("my-foundry-connection"); + McpServerFoundryConnectionAuthentication auth = new McpServerFoundryConnectionAuthentication(foundryParams); + + McpServerTool tool = new McpServerTool().setName("search_code") + .setOutputParsing(new McpServerJsonOutputParsing( + new McpServerOutputParsingJsonParameters("$.results[*]").setIncludeContext(true))); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", Collections.singletonList(tool)) + .setAuthentication(auth); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.MCP_SERVER, createdSource.getKind()); + + McpServerFoundryConnectionAuthentication foundryAuth + = assertInstanceOf(McpServerFoundryConnectionAuthentication.class, + createdSource.getMcpServerParameters().getAuthentication()); + assertEquals("my-foundry-connection", foundryAuth.getFoundryConnectionParameters().getConnectionId()); + + McpServerTool createdTool = createdSource.getMcpServerParameters().getTools().get(0); + McpServerJsonOutputParsing jsonParsing + = assertInstanceOf(McpServerJsonOutputParsing.class, createdTool.getOutputParsing()); + assertEquals("$.results[*]", jsonParsing.getJsonParameters().getDocumentsPath()); + assertEquals(true, jsonParsing.getJsonParameters().isIncludeContext()); + }).verifyComplete(); + } + + @Test + public void createMcpServerKnowledgeSourceWithStoredHeadersSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + Map headers = new java.util.HashMap<>(); + headers.put("x-api-key", "my-api-key"); + McpServerStoredHeadersParameters storedHeadersParams = new McpServerStoredHeadersParameters() + .setHeaders(new McpServerHeaders().setAdditionalProperties(headers)); + McpServerStoredHeadersAuthentication auth = new McpServerStoredHeadersAuthentication(storedHeadersParams); + + McpServerTool tool = new McpServerTool().setName("get_issues") + .setResultsProcessing(KnowledgeSourceResultsProcessing.NONE) + .setMaxOutputTokens(500); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", Collections.singletonList(tool)) + .setAuthentication(auth); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.MCP_SERVER, createdSource.getKind()); + + // Verify stored headers auth (values are write-only/masked on read, so just check type) + McpServerStoredHeadersAuthentication storedAuth = assertInstanceOf(McpServerStoredHeadersAuthentication.class, + createdSource.getMcpServerParameters().getAuthentication()); + assertNotNull(storedAuth.getStoredHeadersParameters()); + + // Verify tool params + McpServerTool createdTool = createdSource.getMcpServerParameters().getTools().get(0); + assertEquals("get_issues", createdTool.getName()); + assertEquals(KnowledgeSourceResultsProcessing.NONE, createdTool.getResultsProcessing()); + assertEquals(500, createdTool.getMaxOutputTokens()); + } + + @Test + public void createMcpServerKnowledgeSourceWithStoredHeadersAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + + Map headers = new java.util.HashMap<>(); + headers.put("x-api-key", "my-api-key"); + McpServerStoredHeadersParameters storedHeadersParams = new McpServerStoredHeadersParameters() + .setHeaders(new McpServerHeaders().setAdditionalProperties(headers)); + McpServerStoredHeadersAuthentication auth = new McpServerStoredHeadersAuthentication(storedHeadersParams); + + McpServerTool tool = new McpServerTool().setName("get_issues") + .setResultsProcessing(KnowledgeSourceResultsProcessing.NONE) + .setMaxOutputTokens(500); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", Collections.singletonList(tool)) + .setAuthentication(auth); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.MCP_SERVER, createdSource.getKind()); + + McpServerStoredHeadersAuthentication storedAuth = assertInstanceOf( + McpServerStoredHeadersAuthentication.class, createdSource.getMcpServerParameters().getAuthentication()); + assertNotNull(storedAuth.getStoredHeadersParameters()); + + McpServerTool createdTool = createdSource.getMcpServerParameters().getTools().get(0); + assertEquals("get_issues", createdTool.getName()); + assertEquals(KnowledgeSourceResultsProcessing.NONE, createdTool.getResultsProcessing()); + assertEquals(500, createdTool.getMaxOutputTokens()); + }).verifyComplete(); + } + + @Test + public void createMcpServerKnowledgeSourceWithSplitOutputParsingSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + McpServerOutputParsingSplitParameters splitParams + = new McpServerOutputParsingSplitParameters().setTextSplitMode(TextSplitMode.PAGES) + .setMaximumPageLength(2000) + .setPageOverlapLength(200) + .setMaximumPagesToTake(50); + + McpServerTool tool = new McpServerTool().setName("get_docs") + .setOutputParsing(new McpServerSplitOutputParsing().setSplitParameters(splitParams)); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", Collections.singletonList(tool)); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + McpServerTool createdTool = createdSource.getMcpServerParameters().getTools().get(0); + assertEquals("get_docs", createdTool.getName()); + + McpServerSplitOutputParsing splitParsing + = assertInstanceOf(McpServerSplitOutputParsing.class, createdTool.getOutputParsing()); + assertNotNull(splitParsing.getSplitParameters()); + assertEquals(TextSplitMode.PAGES, splitParsing.getSplitParameters().getTextSplitMode()); + assertEquals(2000, splitParsing.getSplitParameters().getMaximumPageLength()); + assertEquals(200, splitParsing.getSplitParameters().getPageOverlapLength()); + assertEquals(50, splitParsing.getSplitParameters().getMaximumPagesToTake()); + } + + @Test + public void createMcpServerKnowledgeSourceWithSplitOutputParsingAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + + McpServerOutputParsingSplitParameters splitParams + = new McpServerOutputParsingSplitParameters().setTextSplitMode(TextSplitMode.PAGES) + .setMaximumPageLength(2000) + .setPageOverlapLength(200) + .setMaximumPagesToTake(50); + + McpServerTool tool = new McpServerTool().setName("get_docs") + .setOutputParsing(new McpServerSplitOutputParsing().setSplitParameters(splitParams)); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", Collections.singletonList(tool)); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + McpServerTool createdTool = createdSource.getMcpServerParameters().getTools().get(0); + assertEquals("get_docs", createdTool.getName()); + + McpServerSplitOutputParsing splitParsing + = assertInstanceOf(McpServerSplitOutputParsing.class, createdTool.getOutputParsing()); + assertNotNull(splitParsing.getSplitParameters()); + assertEquals(TextSplitMode.PAGES, splitParsing.getSplitParameters().getTextSplitMode()); + assertEquals(2000, splitParsing.getSplitParameters().getMaximumPageLength()); + assertEquals(200, splitParsing.getSplitParameters().getPageOverlapLength()); + assertEquals(50, splitParsing.getSplitParameters().getMaximumPagesToTake()); + }).verifyComplete(); + } + + @Test + public void createMcpServerKnowledgeSourceWithMultipleToolsSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + + McpServerTool tool1 = new McpServerTool().setName("search_code") + .setOutputParsing(new McpServerJsonOutputParsing(new McpServerOutputParsingJsonParameters("$.results[*]"))) + .setResultsProcessing(KnowledgeSourceResultsProcessing.RERANK); + + McpServerTool tool2 = new McpServerTool().setName("get_issues") + .setOutputParsing(new McpServerNoneOutputParsing()) + .setResultsProcessing(KnowledgeSourceResultsProcessing.NONE) + .setMaxOutputTokens(1000); + + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", java.util.Arrays.asList(tool1, tool2)); + McpServerKnowledgeSource knowledgeSource + = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params).setDescription("Multi-tool MCP source"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals("Multi-tool MCP source", createdSource.getDescription()); + assertEquals(2, createdSource.getMcpServerParameters().getTools().size()); + + Map toolMap = createdSource.getMcpServerParameters() + .getTools() + .stream() + .collect(Collectors.toMap(McpServerTool::getName, Function.identity())); + + McpServerTool createdTool1 = toolMap.get("search_code"); + assertNotNull(createdTool1); + assertInstanceOf(McpServerJsonOutputParsing.class, createdTool1.getOutputParsing()); + assertEquals(KnowledgeSourceResultsProcessing.RERANK, createdTool1.getResultsProcessing()); + + McpServerTool createdTool2 = toolMap.get("get_issues"); + assertNotNull(createdTool2); + assertInstanceOf(McpServerNoneOutputParsing.class, createdTool2.getOutputParsing()); + assertEquals(KnowledgeSourceResultsProcessing.NONE, createdTool2.getResultsProcessing()); + assertEquals(1000, createdTool2.getMaxOutputTokens()); + } + + @Test + public void createMcpServerKnowledgeSourceWithMultipleToolsAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + + McpServerTool tool1 = new McpServerTool().setName("search_code") + .setOutputParsing(new McpServerJsonOutputParsing(new McpServerOutputParsingJsonParameters("$.results[*]"))) + .setResultsProcessing(KnowledgeSourceResultsProcessing.RERANK); + + McpServerTool tool2 = new McpServerTool().setName("get_issues") + .setOutputParsing(new McpServerNoneOutputParsing()) + .setResultsProcessing(KnowledgeSourceResultsProcessing.NONE) + .setMaxOutputTokens(1000); + + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", java.util.Arrays.asList(tool1, tool2)); + McpServerKnowledgeSource knowledgeSource + = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params).setDescription("Multi-tool MCP source"); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + McpServerKnowledgeSource createdSource = assertInstanceOf(McpServerKnowledgeSource.class, created); + assertEquals("Multi-tool MCP source", createdSource.getDescription()); + assertEquals(2, createdSource.getMcpServerParameters().getTools().size()); + + Map toolMap = createdSource.getMcpServerParameters() + .getTools() + .stream() + .collect(Collectors.toMap(McpServerTool::getName, Function.identity())); + + assertNotNull(toolMap.get("search_code")); + assertInstanceOf(McpServerJsonOutputParsing.class, toolMap.get("search_code").getOutputParsing()); - } catch (NullPointerException | IllegalArgumentException e) { - // Expected exception for null name - assertTrue(true); - } + McpServerTool createdTool2 = toolMap.get("get_issues"); + assertNotNull(createdTool2); + assertInstanceOf(McpServerNoneOutputParsing.class, createdTool2.getOutputParsing()); + assertEquals(KnowledgeSourceResultsProcessing.NONE, createdTool2.getResultsProcessing()); + assertEquals(1000, createdTool2.getMaxOutputTokens()); + }).verifyComplete(); } @Test - public void webKnowledgeSourceResponseShapeValidation() { + public void getMcpServerKnowledgeSourceSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); - WebKnowledgeSource webKS - = new WebKnowledgeSource(randomKnowledgeSourceName()).setDescription("Test for response modeling"); + searchIndexClient.createKnowledgeSource(knowledgeSource); - KnowledgeSource created = searchIndexClient.createKnowledgeSource(webKS); + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(knowledgeSource.getName()); + McpServerKnowledgeSource retrievedSource = assertInstanceOf(McpServerKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.MCP_SERVER, retrievedSource.getKind()); + assertEquals("https://mcp.contoso.com/sse", retrievedSource.getMcpServerParameters().getServerURL()); + assertEquals("search_code", retrievedSource.getMcpServerParameters().getTools().get(0).getName()); + } - WebKnowledgeSource createdWeb = assertInstanceOf(WebKnowledgeSource.class, created); - assertEquals(KnowledgeSourceKind.WEB, createdWeb.getKind()); - assertNotNull(createdWeb.getName()); - assertEquals("Test for response modeling", createdWeb.getDescription()); + @Test + public void getMcpServerKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); - KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(created.getName()); - WebKnowledgeSource retrievedWeb = assertInstanceOf(WebKnowledgeSource.class, retrieved); - assertEquals(KnowledgeSourceKind.WEB, retrievedWeb.getKind()); - assertEquals(createdWeb.getName(), retrievedWeb.getName()); - assertEquals("Test for response modeling", retrievedWeb.getDescription()); + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono).assertNext(retrieved -> { + McpServerKnowledgeSource retrievedSource = assertInstanceOf(McpServerKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.MCP_SERVER, retrievedSource.getKind()); + assertEquals("https://mcp.contoso.com/sse", retrievedSource.getMcpServerParameters().getServerURL()); + assertEquals("search_code", retrievedSource.getMcpServerParameters().getTools().get(0).getName()); + }).verifyComplete(); } @Test - public void webKnowledgeSourceJsonSerializationRoundTrip() { - WebKnowledgeSource webKS - = new WebKnowledgeSource(randomKnowledgeSourceName()).setDescription("JSON serialization test"); + public void updateMcpServerKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); - try { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { - webKS.toJson(writer); // Real method from WebKnowledgeSource - } - String json = outputStream.toString(); + searchIndexClient.createKnowledgeSource(knowledgeSource); - assertTrue(json.contains("\"kind\":\"web\"")); - assertTrue(json.contains("\"name\":")); - assertTrue(json.contains(webKS.getName())); + knowledgeSource.setDescription("Updated MCP description"); + KnowledgeSource updated = searchIndexClient.createOrUpdateKnowledgeSource(knowledgeSource); - try (JsonReader reader = JsonProviders.createReader(json)) { - WebKnowledgeSource deserialized = WebKnowledgeSource.fromJson(reader); // Real static method - assertEquals(KnowledgeSourceKind.WEB, deserialized.getKind()); - assertEquals(webKS.getName(), deserialized.getName()); - assertEquals(webKS.getDescription(), deserialized.getDescription()); - } - } catch (IOException ex) { - throw new UncheckedIOException(ex); - } + assertEquals("Updated MCP description", updated.getDescription()); + McpServerKnowledgeSource updatedSource = assertInstanceOf(McpServerKnowledgeSource.class, updated); + assertEquals("https://mcp.contoso.com/sse", updatedSource.getMcpServerParameters().getServerURL()); } @Test - public void webKnowledgeSourceInheritsKnowledgeSourceBehavior() { + public void updateMcpServerKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); + + Mono createUpdateAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient + .createOrUpdateKnowledgeSource(created.setDescription("Updated MCP description"))) + .flatMap(updated -> searchIndexClient.getKnowledgeSource(updated.getName())); + + StepVerifier.create(createUpdateAndGetMono).assertNext(retrieved -> { + assertEquals("Updated MCP description", retrieved.getDescription()); + McpServerKnowledgeSource retrievedSource = assertInstanceOf(McpServerKnowledgeSource.class, retrieved); + assertEquals("https://mcp.contoso.com/sse", retrievedSource.getMcpServerParameters().getServerURL()); + }).verifyComplete(); + } + + @Test + public void deleteMcpServerKnowledgeSourceSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); - WebKnowledgeSource webKS - = new WebKnowledgeSource(randomKnowledgeSourceName()).setDescription("Inheritance test") - .setETag("test-etag"); + searchIndexClient.createKnowledgeSource(knowledgeSource); - KnowledgeSource created = searchIndexClient.createKnowledgeSource(webKS); + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(knowledgeSource.getName()); + assertNotNull(retrieved); - // Verify inherited properties work - assertNotNull(created.getName()); - assertNotNull(created.getDescription()); + searchIndexClient.deleteKnowledgeSource(knowledgeSource.getName()); - assertInstanceOf(WebKnowledgeSource.class, created); + HttpResponseException exception = assertThrows(HttpResponseException.class, + () -> searchIndexClient.getKnowledgeSource(knowledgeSource.getName())); + assertEquals(404, exception.getResponse().getStatusCode()); + } - String newDescription = "Updated via base class"; - created.setDescription(newDescription); + @Test + public void deleteMcpServerKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + McpServerKnowledgeSourceParameters params = new McpServerKnowledgeSourceParameters( + "https://mcp.contoso.com/sse", Collections.singletonList(new McpServerTool().setName("search_code"))); + McpServerKnowledgeSource knowledgeSource = new McpServerKnowledgeSource(randomKnowledgeSourceName(), params); - KnowledgeSource updated = searchIndexClient.createOrUpdateKnowledgeSource(created); - assertEquals(newDescription, updated.getDescription()); + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(knowledgeSource) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono) + .assertNext(retrieved -> assertEquals(knowledgeSource.getName(), retrieved.getName())) + .verifyComplete(); + + StepVerifier.create(searchIndexClient.deleteKnowledgeSource(knowledgeSource.getName())).verifyComplete(); + + StepVerifier.create(searchIndexClient.getKnowledgeSource(knowledgeSource.getName())) + .verifyError(HttpResponseException.class); + } + + @Test + public void mcpServerKnowledgeSourceSerializationRoundTrip() throws IOException { + McpServerFoundryConnectionParameters foundryParams + = new McpServerFoundryConnectionParameters().setConnectionId("my-foundry-connection"); + McpServerFoundryConnectionAuthentication auth = new McpServerFoundryConnectionAuthentication(foundryParams); + + McpServerTool tool1 = new McpServerTool().setName("search_code") + .setOutputParsing(new McpServerJsonOutputParsing( + new McpServerOutputParsingJsonParameters("$.results[*]").setIncludeContext(true))) + .setResultsProcessing(KnowledgeSourceResultsProcessing.RERANK); + + McpServerTool tool2 = new McpServerTool().setName("get_issues") + .setOutputParsing(new McpServerNoneOutputParsing()) + .setResultsProcessing(KnowledgeSourceResultsProcessing.NONE) + .setMaxOutputTokens(500); + + McpServerKnowledgeSourceParameters params + = new McpServerKnowledgeSourceParameters("https://mcp.contoso.com/sse", + java.util.Arrays.asList(tool1, tool2)).setAuthentication(auth); + McpServerKnowledgeSource original + = new McpServerKnowledgeSource("test-mcp-ks", params).setDescription("Serialization test"); + + // Serialize + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { + original.toJson(writer); + } + String json = outputStream.toString(); + + // Verify JSON contains expected fields + assertTrue(json.contains("\"mcpServer\""), "JSON should contain kind 'mcpServer'"); + assertTrue(json.contains("\"https://mcp.contoso.com/sse\""), "JSON should contain serverURL"); + assertTrue(json.contains("\"search_code\""), "JSON should contain tool name"); + assertTrue(json.contains("\"get_issues\""), "JSON should contain second tool name"); + assertTrue(json.contains("\"my-foundry-connection\""), "JSON should contain connectionId"); + assertTrue(json.contains("\"$.results[*]\""), "JSON should contain documentsPath"); + + // Deserialize + try (JsonReader reader = JsonProviders.createReader(json)) { + KnowledgeSource deserialized = KnowledgeSource.fromJson(reader); + + McpServerKnowledgeSource deserializedSource + = assertInstanceOf(McpServerKnowledgeSource.class, deserialized); + assertEquals("test-mcp-ks", deserializedSource.getName()); + assertEquals("Serialization test", deserializedSource.getDescription()); + assertEquals(KnowledgeSourceKind.MCP_SERVER, deserializedSource.getKind()); + assertEquals("https://mcp.contoso.com/sse", deserializedSource.getMcpServerParameters().getServerURL()); + assertEquals(2, deserializedSource.getMcpServerParameters().getTools().size()); + + // Verify auth round-trips + McpServerFoundryConnectionAuthentication deserializedAuth + = assertInstanceOf(McpServerFoundryConnectionAuthentication.class, + deserializedSource.getMcpServerParameters().getAuthentication()); + assertEquals("my-foundry-connection", deserializedAuth.getFoundryConnectionParameters().getConnectionId()); + + // Verify tools round-trip + McpServerTool deserializedTool1 = deserializedSource.getMcpServerParameters().getTools().get(0); + assertEquals("search_code", deserializedTool1.getName()); + McpServerJsonOutputParsing jsonParsing + = assertInstanceOf(McpServerJsonOutputParsing.class, deserializedTool1.getOutputParsing()); + assertEquals("$.results[*]", jsonParsing.getJsonParameters().getDocumentsPath()); + assertEquals(true, jsonParsing.getJsonParameters().isIncludeContext()); + + McpServerTool deserializedTool2 = deserializedSource.getMcpServerParameters().getTools().get(1); + assertEquals("get_issues", deserializedTool2.getName()); + assertInstanceOf(McpServerNoneOutputParsing.class, deserializedTool2.getOutputParsing()); + assertEquals(KnowledgeSourceResultsProcessing.NONE, deserializedTool2.getResultsProcessing()); + assertEquals(500, deserializedTool2.getMaxOutputTokens()); + } } @Test @@ -1187,6 +2221,117 @@ public void deleteIndexedSqlKnowledgeSourceAsync() { .verifyError(HttpResponseException.class); } + // --------------------------------------------------------------- + // Blob Knowledge Source with Sensitivity Labels tests + // --------------------------------------------------------------- + + @Disabled("Requires Purview roles on the Search service's system-assigned managed identity") + @Test + public void createBlobKnowledgeSourceWithSensitivityLabelsSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + AzureBlobKnowledgeSourceParameters blobParams + = new AzureBlobKnowledgeSourceParameters(BLOB_CONNECTION_STRING, BLOB_CONTAINER_NAME) + .setIngestionParameters(new KnowledgeSourceIngestionParameters() + .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName(OPENAI_DEPLOYMENT_NAME) + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE))) + .setIngestionPermissionOptions(KnowledgeSourceIngestionPermissionOption.RBAC_SCOPE, + KnowledgeSourceIngestionPermissionOption.SENSITIVITY_LABELS)); + AzureBlobKnowledgeSource knowledgeSource + = new AzureBlobKnowledgeSource(randomKnowledgeSourceName(), blobParams); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + assertEquals(knowledgeSource.getName(), created.getName()); + AzureBlobKnowledgeSource createdSource = assertInstanceOf(AzureBlobKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.AZURE_BLOB, createdSource.getKind()); + assertNotNull(createdSource.getAzureBlobParameters()); + assertNotNull(createdSource.getAzureBlobParameters().getIngestionParameters()); + assertNotNull(createdSource.getAzureBlobParameters().getIngestionParameters().getIngestionPermissionOptions()); + assertTrue(createdSource.getAzureBlobParameters() + .getIngestionParameters() + .getIngestionPermissionOptions() + .contains(KnowledgeSourceIngestionPermissionOption.SENSITIVITY_LABELS)); + } + + @Disabled("Requires Purview roles on the Search service's system-assigned managed identity") + @Test + public void createBlobKnowledgeSourceWithSensitivityLabelsAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + AzureBlobKnowledgeSourceParameters blobParams + = new AzureBlobKnowledgeSourceParameters(BLOB_CONNECTION_STRING, BLOB_CONTAINER_NAME) + .setIngestionParameters(new KnowledgeSourceIngestionParameters() + .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) + .setDeploymentName(OPENAI_DEPLOYMENT_NAME) + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE))) + .setIngestionPermissionOptions(KnowledgeSourceIngestionPermissionOption.RBAC_SCOPE, + KnowledgeSourceIngestionPermissionOption.SENSITIVITY_LABELS)); + AzureBlobKnowledgeSource knowledgeSource + = new AzureBlobKnowledgeSource(randomKnowledgeSourceName(), blobParams); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + assertEquals(knowledgeSource.getName(), created.getName()); + AzureBlobKnowledgeSource createdSource = assertInstanceOf(AzureBlobKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.AZURE_BLOB, createdSource.getKind()); + assertNotNull(createdSource.getAzureBlobParameters()); + assertNotNull(createdSource.getAzureBlobParameters().getIngestionParameters()); + assertNotNull( + createdSource.getAzureBlobParameters().getIngestionParameters().getIngestionPermissionOptions()); + assertTrue(createdSource.getAzureBlobParameters() + .getIngestionParameters() + .getIngestionPermissionOptions() + .contains(KnowledgeSourceIngestionPermissionOption.SENSITIVITY_LABELS)); + }).verifyComplete(); + } + + @Test + public void createFileKnowledgeSourceWithFreshnessPolicySync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + FileKnowledgeSourceParameters params + = new FileKnowledgeSourceParameters().setIngestionParameters(new KnowledgeSourceIngestionParameters() + .setFreshnessPolicy(new FreshnessPolicy().setBoostingDuration("P90D")) + .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer().setAzureOpenAIParameters( + new AzureOpenAIVectorizerParameters().setResourceUrl("https://fake-aoai.openai.azure.com") + .setDeploymentName("text-embedding-3-large") + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE)))); + FileKnowledgeSource knowledgeSource = new FileKnowledgeSource(randomKnowledgeSourceName(), params) + .setDescription("File KS with freshness policy"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(knowledgeSource); + + FileKnowledgeSource createdSource = assertInstanceOf(FileKnowledgeSource.class, created); + assertEquals("File KS with freshness policy", createdSource.getDescription()); + assertNotNull(createdSource.getFileParameters().getIngestionParameters()); + assertNotNull(createdSource.getFileParameters().getIngestionParameters().getFreshnessPolicy()); + assertEquals("P90D", + createdSource.getFileParameters().getIngestionParameters().getFreshnessPolicy().getBoostingDuration()); + } + + @Test + public void createFileKnowledgeSourceWithFreshnessPolicyAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + FileKnowledgeSourceParameters params + = new FileKnowledgeSourceParameters().setIngestionParameters(new KnowledgeSourceIngestionParameters() + .setFreshnessPolicy(new FreshnessPolicy().setBoostingDuration("P90D")) + .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer().setAzureOpenAIParameters( + new AzureOpenAIVectorizerParameters().setResourceUrl("https://fake-aoai.openai.azure.com") + .setDeploymentName("text-embedding-3-large") + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE)))); + FileKnowledgeSource knowledgeSource = new FileKnowledgeSource(randomKnowledgeSourceName(), params) + .setDescription("File KS with freshness policy"); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(knowledgeSource)).assertNext(created -> { + FileKnowledgeSource createdSource = assertInstanceOf(FileKnowledgeSource.class, created); + assertEquals("File KS with freshness policy", createdSource.getDescription()); + assertNotNull(createdSource.getFileParameters().getIngestionParameters()); + assertNotNull(createdSource.getFileParameters().getIngestionParameters().getFreshnessPolicy()); + assertEquals("P90D", + createdSource.getFileParameters().getIngestionParameters().getFreshnessPolicy().getBoostingDuration()); + }).verifyComplete(); + } + @Test public void createWebKnowledgeSourceWithRetrieveDefaultsSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); @@ -1274,7 +2419,7 @@ public void createFileKnowledgeSourceWithStandardExtractionAndCorsSync() { SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); KnowledgeSourceIngestionParameters ingestionParameters = createFileKnowledgeSourceIngestionParameters() .setContentExtractionMode(KnowledgeSourceContentExtractionMode.STANDARD) - .setAiServices(new AiServices(AI_SERVICES_ENDPOINT)); + .setAiServices(new AiServices(AI_SERVICES_ENDPOINT).setApiKey(AI_SERVICES_API_KEY)); FileKnowledgeSource knowledgeSource = new FileKnowledgeSource(randomKnowledgeSourceName(), new FileKnowledgeSourceParameters().setIngestionParameters(ingestionParameters)) .setCorsOptions(new CorsOptions("https://app.contoso.com").setMaxAgeInSeconds(300L)); @@ -1427,6 +2572,204 @@ public void createSearchIndexKnowledgeSourceWithBaseFilterAsync() { }).verifyComplete(); } + @Test + public void createWorkIQKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(workIQKS); + + assertEquals(workIQKS.getName(), created.getName()); + WorkIQKnowledgeSource createdWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.WORK_IQ, createdWorkIQ.getKind()); + } + + @Test + public void createWorkIQKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + + StepVerifier.create(searchIndexClient.createKnowledgeSource(workIQKS)).assertNext(created -> { + assertEquals(workIQKS.getName(), created.getName()); + WorkIQKnowledgeSource createdWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.WORK_IQ, createdWorkIQ.getKind()); + }).verifyComplete(); + } + + @Test + public void createWorkIQKnowledgeSourceWithDescription() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS + = createWorkIQKnowledgeSource(randomKnowledgeSourceName()).setDescription("Work IQ KS for testing"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(workIQKS); + + WorkIQKnowledgeSource createdWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.WORK_IQ, createdWorkIQ.getKind()); + assertEquals("Work IQ KS for testing", createdWorkIQ.getDescription()); + } + + @Test + public void getWorkIQKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + searchIndexClient.createKnowledgeSource(workIQKS); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(workIQKS.getName()); + + assertEquals(workIQKS.getName(), retrieved.getName()); + WorkIQKnowledgeSource retrievedWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.WORK_IQ, retrievedWorkIQ.getKind()); + } + + @Test + public void getWorkIQKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + + Mono createAndGetMono = searchIndexClient.createKnowledgeSource(workIQKS) + .flatMap(created -> searchIndexClient.getKnowledgeSource(created.getName())); + + StepVerifier.create(createAndGetMono).assertNext(retrieved -> { + assertEquals(workIQKS.getName(), retrieved.getName()); + WorkIQKnowledgeSource retrievedWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.WORK_IQ, retrievedWorkIQ.getKind()); + }).verifyComplete(); + } + + @Test + public void updateWorkIQKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + searchIndexClient.createKnowledgeSource(workIQKS); + + String newDescription = "Updated Work IQ description"; + workIQKS.setDescription(newDescription); + KnowledgeSource updated = searchIndexClient.createOrUpdateKnowledgeSource(workIQKS); + + assertEquals(newDescription, updated.getDescription()); + WorkIQKnowledgeSource updatedWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, updated); + assertEquals(KnowledgeSourceKind.WORK_IQ, updatedWorkIQ.getKind()); + } + + @Test + public void updateWorkIQKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + + Mono createUpdateAndGetMono + = searchIndexClient.createKnowledgeSource(workIQKS).flatMap(created -> { + String newDescription = "Updated Work IQ description"; + created.setDescription(newDescription); + return searchIndexClient.createOrUpdateKnowledgeSource(created); + }).flatMap(updated -> searchIndexClient.getKnowledgeSource(updated.getName())); + + StepVerifier.create(createUpdateAndGetMono).assertNext(retrieved -> { + assertEquals("Updated Work IQ description", retrieved.getDescription()); + WorkIQKnowledgeSource retrievedWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.WORK_IQ, retrievedWorkIQ.getKind()); + }).verifyComplete(); + } + + @Test + public void deleteWorkIQKnowledgeSourceSync() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + searchIndexClient.createKnowledgeSource(workIQKS); + + searchIndexClient.deleteKnowledgeSource(workIQKS.getName()); + + assertThrows(HttpResponseException.class, () -> searchIndexClient.getKnowledgeSource(workIQKS.getName())); + } + + @Test + public void deleteWorkIQKnowledgeSourceAsync() { + SearchIndexAsyncClient searchIndexClient = getSearchIndexClientBuilder(false).buildAsyncClient(); + WorkIQKnowledgeSource workIQKS = createWorkIQKnowledgeSource(randomKnowledgeSourceName()); + + Mono createAndDeleteMono = searchIndexClient.createKnowledgeSource(workIQKS) + .flatMap(created -> searchIndexClient.deleteKnowledgeSource(created.getName())); + + StepVerifier.create(createAndDeleteMono).verifyComplete(); + + StepVerifier.create(searchIndexClient.getKnowledgeSource(workIQKS.getName())) + .verifyError(HttpResponseException.class); + } + + @Test + public void listKnowledgeSourcesIncludesWorkIQType() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS + = createWorkIQKnowledgeSource(randomKnowledgeSourceName()).setDescription("Work IQ for listing test"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(workIQKS); + + Map knowledgeSourcesByName = searchIndexClient.listKnowledgeSources() + .stream() + .collect(Collectors.toMap(KnowledgeSource::getName, Function.identity())); + + assertTrue(knowledgeSourcesByName.containsKey(created.getName())); + KnowledgeSource listed = knowledgeSourcesByName.get(created.getName()); + WorkIQKnowledgeSource listedWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, listed); + assertEquals(KnowledgeSourceKind.WORK_IQ, listedWorkIQ.getKind()); + } + + @Test + public void workIQKnowledgeSourceJsonSerializationRoundTrip() { + WorkIQKnowledgeSource workIQKS + = createWorkIQKnowledgeSource(randomKnowledgeSourceName()).setDescription("JSON serialization test"); + + try { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { + workIQKS.toJson(writer); + } + String json = outputStream.toString(); + + assertTrue(json.contains("\"kind\":\"workIQ\"")); + assertTrue(json.contains("\"name\":")); + assertTrue(json.contains(workIQKS.getName())); + assertTrue(json.contains("\"description\":\"JSON serialization test\"")); + + try (JsonReader reader = JsonProviders.createReader(json)) { + WorkIQKnowledgeSource deserialized = WorkIQKnowledgeSource.fromJson(reader); + assertEquals(KnowledgeSourceKind.WORK_IQ, deserialized.getKind()); + assertEquals(workIQKS.getName(), deserialized.getName()); + assertEquals(workIQKS.getDescription(), deserialized.getDescription()); + } + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } + + @Test + public void workIQKnowledgeSourceResponseShapeValidation() { + SearchIndexClient searchIndexClient = getSearchIndexClientBuilder(true).buildClient(); + WorkIQKnowledgeSource workIQKS + = createWorkIQKnowledgeSource(randomKnowledgeSourceName()).setDescription("Response shape test"); + + KnowledgeSource created = searchIndexClient.createKnowledgeSource(workIQKS); + + WorkIQKnowledgeSource createdWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, created); + assertEquals(KnowledgeSourceKind.WORK_IQ, createdWorkIQ.getKind()); + assertNotNull(createdWorkIQ.getName()); + assertEquals("Response shape test", createdWorkIQ.getDescription()); + assertNull(createdWorkIQ.getEncryptionKey()); + + KnowledgeSource retrieved = searchIndexClient.getKnowledgeSource(created.getName()); + WorkIQKnowledgeSource retrievedWorkIQ = assertInstanceOf(WorkIQKnowledgeSource.class, retrieved); + assertEquals(KnowledgeSourceKind.WORK_IQ, retrievedWorkIQ.getKind()); + assertEquals(createdWorkIQ.getName(), retrievedWorkIQ.getName()); + assertEquals("Response shape test", retrievedWorkIQ.getDescription()); + assertNull(retrievedWorkIQ.getEncryptionKey()); + } + + private WorkIQKnowledgeSource createWorkIQKnowledgeSource(String name) { + WorkIQKnowledgeSourceParameters parameters = new WorkIQKnowledgeSourceParameters( + new EntraAppAuthentication("00000000-0000-0000-0000-000000000000", "44444444-4444-4444-4444-444444444444")); + return new WorkIQKnowledgeSource(name, parameters); + } + private FileKnowledgeSource createFileKnowledgeSource(SearchIndexClient client) { FileKnowledgeSource knowledgeSource = createFileKnowledgeSource(); client.createKnowledgeSource(knowledgeSource); @@ -1443,7 +2786,8 @@ private KnowledgeSourceIngestionParameters createFileKnowledgeSourceIngestionPar .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() .setAzureOpenAIParameters(new AzureOpenAIVectorizerParameters().setResourceUrl(OPENAI_ENDPOINT) .setDeploymentName(OPENAI_EMBEDDING_DEPLOYMENT_NAME) - .setModelName(AzureOpenAIModelName.fromString(OPENAI_EMBEDDING_MODEL_NAME)))) + .setModelName(AzureOpenAIModelName.fromString(OPENAI_EMBEDDING_MODEL_NAME)) + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(USER_ASSIGNED_IDENTITY)))) .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java index d7c230f085e23..804d72fa19375 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java @@ -15,8 +15,6 @@ import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.http.AssertingHttpClientBuilder; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonProviders; @@ -71,7 +69,6 @@ public abstract class SearchTestBase extends TestProxyTestBase { protected static final String HOTELS_TESTS_INDEX_DATA_JSON = "HotelsTestsIndexData.json"; private boolean sanitizersRemoved = false; - private InterceptorManager playbackSanitizerManager; protected static final String SEARCH_ENDPOINT = Configuration.getGlobalConfiguration().get("SEARCH_SERVICE_ENDPOINT", "https://playback.search.windows.net"); @@ -99,12 +96,17 @@ public abstract class SearchTestBase extends TestProxyTestBase { protected static final String AI_SERVICES_ENDPOINT = Configuration.getGlobalConfiguration() .get("SEARCH_AI_SERVICES_ENDPOINT", OPENAI_ENDPOINT.replace(".openai.azure.com", ".cognitiveservices.azure.com")); + protected static final String AI_SERVICES_API_KEY + = Configuration.getGlobalConfiguration().get("SEARCH_AI_SERVICES_API_KEY"); protected static final String STORAGE_ACCOUNT_NAME = Configuration.getGlobalConfiguration().get("SEARCH_STORAGE_ACCOUNT_NAME", "storageaccount"); protected static final String BLOB_CONTAINER_NAME = Configuration.getGlobalConfiguration().get("SEARCH_STORAGE_CONTAINER_NAME", "searchcontainer"); + protected static final String USER_ASSIGNED_IDENTITY = Configuration.getGlobalConfiguration() + .get("SEARCH_USER_ASSIGNED_IDENTITY", "/subscriptions/subscription-id/resourceGroups/resource-group-name/" + + "providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-assigned-managed-identity-name"); protected static final String SUBSCRIPTION_ID = Configuration.getGlobalConfiguration().get("SEARCH_SUBSCRIPTION_ID", "subscription-id"); protected static final String RESOURCE_GROUP @@ -288,17 +290,7 @@ protected SearchIndexingBufferedSenderBuilder getBufferedSenderBuilder(St return builder; } - private HttpClient getHttpClient(InterceptorManager interceptorManager, boolean isSync) { - if (interceptorManager.isPlaybackMode() && playbackSanitizerManager != interceptorManager) { - // Normalize only known preview differences. SearchGaTests independently verifies the GA requests. - interceptorManager.addSanitizers( - new TestProxySanitizer("([?&])api-version=2026-10-01(?=&|$)", "$1api-version=2026-08-01-preview", - TestProxySanitizerType.URL), - new TestProxySanitizer(",\\\\s*\\\"purviewEnabled\\\"\\\\s*:\\\\s*false(?=\\\\s*[,}])", "", - TestProxySanitizerType.BODY_REGEX)); - playbackSanitizerManager = interceptorManager; - } - + private static HttpClient getHttpClient(InterceptorManager interceptorManager, boolean isSync) { HttpClient httpClient = interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : HttpClient.createDefault(); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementTests.java index 5ef8bcfb16f3d..fcfd5b149728c 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementTests.java @@ -1578,6 +1578,28 @@ public void canListIndexStatsSummaryWithTopAndSkipAsync() { }).verifyComplete(); } + @Test + public void createIndexWithSensitivityLabelFieldsSync() { + SearchIndex index = new SearchIndex(randomIndexName(HOTEL_INDEX_NAME), + new SearchField("id", SearchFieldDataType.STRING).setKey(true), + new SearchField("labelId", SearchFieldDataType.STRING).setSensitivityLabelId(true).setFilterable(true), + new SearchField("labelName", SearchFieldDataType.STRING).setSensitivityLabelName(true).setFilterable(true), + new SearchField("sourceDoc", SearchFieldDataType.STRING).setSourceDocumentId(true).setFilterable(true)) + .setPurviewEnabled(true); + + SearchIndex created = client.createIndex(index); + indexesToDelete.add(created.getName()); + + List fields = created.getFields(); + SearchField labelIdField = fields.stream().filter(f -> "labelId".equals(f.getName())).findFirst().get(); + SearchField labelNameField = fields.stream().filter(f -> "labelName".equals(f.getName())).findFirst().get(); + SearchField sourceDocField = fields.stream().filter(f -> "sourceDoc".equals(f.getName())).findFirst().get(); + + assertEquals(true, labelIdField.isSensitivityLabelId()); + assertEquals(true, labelNameField.isSensitivityLabelName()); + assertEquals(true, sourceDocField.isSourceDocumentId()); + } + private List createIndexesForPagination(String prefix) { List indexes = Arrays.asList(createTestIndex(prefix + "-a"), createTestIndex(prefix + "-b"), createTestIndex(prefix + "-c")); @@ -1588,6 +1610,29 @@ private List createIndexesForPagination(String prefix) { return indexes; } + @Test + public void createIndexWithSensitivityLabelFieldsAsync() { + SearchIndex index = new SearchIndex(randomIndexName(HOTEL_INDEX_NAME), + new SearchField("id", SearchFieldDataType.STRING).setKey(true), + new SearchField("labelId", SearchFieldDataType.STRING).setSensitivityLabelId(true).setFilterable(true), + new SearchField("labelName", SearchFieldDataType.STRING).setSensitivityLabelName(true).setFilterable(true), + new SearchField("sourceDoc", SearchFieldDataType.STRING).setSourceDocumentId(true).setFilterable(true)) + .setPurviewEnabled(true); + + StepVerifier.create(asyncClient.createIndex(index)).assertNext(created -> { + indexesToDelete.add(created.getName()); + + List fields = created.getFields(); + SearchField labelIdField = fields.stream().filter(f -> "labelId".equals(f.getName())).findFirst().get(); + SearchField labelNameField = fields.stream().filter(f -> "labelName".equals(f.getName())).findFirst().get(); + SearchField sourceDocField = fields.stream().filter(f -> "sourceDoc".equals(f.getName())).findFirst().get(); + + assertEquals(true, labelIdField.isSensitivityLabelId()); + assertEquals(true, labelNameField.isSensitivityLabelName()); + assertEquals(true, sourceDocField.isSourceDocumentId()); + }).verifyComplete(); + } + @Test public void createIndexWithPermissionFilterOptionSync() { SearchIndex index = new SearchIndex(randomIndexName(HOTEL_INDEX_NAME), @@ -1663,4 +1708,20 @@ public void createIndexWithSharePointConnectorAppRegistrationAsync() { }).verifyComplete(); } + @Test + public void sensitivityLabelFieldsDefaultToNullSync() { + SearchIndex index = new SearchIndex(randomIndexName(HOTEL_INDEX_NAME), + new SearchField("id", SearchFieldDataType.STRING).setKey(true), + new SearchField("content", SearchFieldDataType.STRING).setSearchable(true)); + + SearchIndex created = client.createIndex(index); + indexesToDelete.add(created.getName()); + + SearchField contentField + = created.getFields().stream().filter(f -> "content".equals(f.getName())).findFirst().get(); + assertNull(contentField.isSensitivityLabelId()); + assertNull(contentField.isSensitivityLabelName()); + assertNull(contentField.isSourceDocumentId()); + assertNull(created.getPermissionFilterOption()); + } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchIndexerClientBuilderTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchIndexerClientBuilderTests.java index fb59d9f627523..d90f502a6c726 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchIndexerClientBuilderTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchIndexerClientBuilderTests.java @@ -25,8 +25,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -34,11 +32,9 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.security.SecureRandom; import java.time.Duration; import java.util.Collections; -import java.util.concurrent.atomic.AtomicInteger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -52,56 +48,6 @@ public class SearchIndexerClientBuilderTests { private final String searchEndpoint = "https://test.search.windows.net"; private final SearchServiceVersion apiVersion = SearchServiceVersion.V2026_04_01; - @ParameterizedTest - @ValueSource(strings = { "datasources", "indexers", "skillsets" }) - public void asyncListingHelpersPreserveContinuationPages(String resource) { - AtomicInteger requests = new AtomicInteger(); - String continuation = searchEndpoint + "/" + resource + "?api-version=2026-10-01&$skiptoken=next"; - HttpClient httpClient = request -> { - assertEquals("/" + resource, request.getUrl().getPath()); - int page = requests.incrementAndGet(); - assertTrue(page <= 2); - String body = "{\"value\":[{\"name\":\"item-" + page + "\",\"type\":\"azureblob\"," - + "\"credentials\":{\"connectionString\":\"UseDevelopmentStorage=true\"}," - + "\"container\":{\"name\":\"test\"},\"dataSourceName\":\"source\"," - + "\"targetIndexName\":\"index\",\"skills\":[]}]" - + (page == 1 ? ",\"@odata.nextLink\":\"" + continuation + "\"" : "") + "}"; - return Mono - .just(new MockHttpResponse(request, 200, new HttpHeaders(), body.getBytes(StandardCharsets.UTF_8))); - }; - SearchIndexerAsyncClient client = new SearchIndexerClientBuilder().endpoint(searchEndpoint) - .credential(searchApiKeyCredential) - .httpClient(httpClient) - .buildAsyncClient(); - - switch (resource) { - case "datasources": - StepVerifier.create(client.getDataSourceConnections().byPage()).assertNext(page -> { - assertEquals("item-1", page.getValue().get(0).getName()); - assertEquals(continuation, page.getContinuationToken()); - }).assertNext(page -> assertEquals("item-2", page.getValue().get(0).getName())).verifyComplete(); - break; - - case "indexers": - StepVerifier.create(client.getIndexers().byPage()).assertNext(page -> { - assertEquals("item-1", page.getValue().get(0).getName()); - assertEquals(continuation, page.getContinuationToken()); - }).assertNext(page -> assertEquals("item-2", page.getValue().get(0).getName())).verifyComplete(); - break; - - case "skillsets": - StepVerifier.create(client.getSkillsets().byPage()).assertNext(page -> { - assertEquals("item-1", page.getValue().get(0).getName()); - assertEquals(continuation, page.getContinuationToken()); - }).assertNext(page -> assertEquals("item-2", page.getValue().get(0).getName())).verifyComplete(); - break; - - default: - throw new IllegalArgumentException("Unexpected resource: " + resource); - } - assertEquals(2, requests.get()); - } - @Test public void buildSyncClientTest() { SearchIndexerClient client diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchServiceTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchServiceTests.java index ab591a45d4576..5a69cdca562b5 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchServiceTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchServiceTests.java @@ -101,4 +101,45 @@ private static void validateServiceStatistics(SearchServiceStatistics searchServ assertTrue(searchServiceCounters.getSynonymMapCounter().getQuota() >= 1); } + @Test + public void serviceStatsIncludesKnowledgeBaseCounterSync() { + SearchIndexClient serviceClient = getSearchIndexClientBuilder(true).buildClient(); + SearchServiceStatistics stats = serviceClient.getServiceStatistics(); + SearchServiceCounters counters = stats.getCounters(); + + Assertions.assertNotNull(counters.getKnowledgeBaseCounter()); + assertTrue(counters.getKnowledgeBaseCounter().getUsage() >= 0); + } + + @Test + public void serviceStatsIncludesKnowledgeBaseCounterAsync() { + StepVerifier.create(getSearchIndexClientBuilder(false).buildAsyncClient().getServiceStatistics()) + .assertNext(stats -> { + SearchServiceCounters counters = stats.getCounters(); + Assertions.assertNotNull(counters.getKnowledgeBaseCounter()); + assertTrue(counters.getKnowledgeBaseCounter().getUsage() >= 0); + }) + .verifyComplete(); + } + + @Test + public void serviceStatsIncludesKnowledgeSourceCounterSync() { + SearchIndexClient serviceClient = getSearchIndexClientBuilder(true).buildClient(); + SearchServiceStatistics stats = serviceClient.getServiceStatistics(); + SearchServiceCounters counters = stats.getCounters(); + + Assertions.assertNotNull(counters.getKnowledgeSourceCounter()); + assertTrue(counters.getKnowledgeSourceCounter().getUsage() >= 0); + } + + @Test + public void serviceStatsIncludesKnowledgeSourceCounterAsync() { + StepVerifier.create(getSearchIndexClientBuilder(false).buildAsyncClient().getServiceStatistics()) + .assertNext(stats -> { + SearchServiceCounters counters = stats.getCounters(); + Assertions.assertNotNull(counters.getKnowledgeSourceCounter()); + assertTrue(counters.getKnowledgeSourceCounter().getUsage() >= 0); + }) + .verifyComplete(); + } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementTests.java index 401b86a932516..4538716a5dbcd 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementTests.java @@ -10,7 +10,7 @@ import com.azure.search.documents.SearchServiceVersion; import com.azure.search.documents.SearchTestBase; import com.azure.search.documents.indexes.models.CognitiveServicesAccount; -import com.azure.search.documents.indexes.models.AIServicesAccountIdentity; +import com.azure.search.documents.indexes.models.CognitiveServicesAccountKey; import com.azure.search.documents.indexes.models.ConditionalSkill; import com.azure.search.documents.indexes.models.ContentUnderstandingSkill; import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingProperties; @@ -1493,6 +1493,12 @@ private SearchIndexerSkillset createTestSkillsetContentUnderstandingWithAllOptio } private CognitiveServicesAccount createAIFoundryCognitiveServicesAccount() { - return new AIServicesAccountIdentity(AI_SERVICES_ENDPOINT); + String aiFoundryKey = System.getenv("AI_FOUNDRY_KEY"); + + if (aiFoundryKey != null && !aiFoundryKey.isEmpty()) { + return new CognitiveServicesAccountKey(aiFoundryKey); + } else { + return new DefaultCognitiveServicesAccount(); + } } } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SynonymMapManagementTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SynonymMapManagementTests.java index 45e6f178b3c1e..9828418c1ea79 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SynonymMapManagementTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SynonymMapManagementTests.java @@ -4,7 +4,6 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; import com.azure.search.documents.SearchTestBase; @@ -514,10 +513,7 @@ public void canListSynonymMapsByPrefixAcrossPagesSync() { List expectedNames = createSynonymMapsForPagination(prefix); List> pages = new ArrayList<>(); - RequestOptions options = new RequestOptions().addQueryParam("search", prefix) - .addQueryParam("pageSize", "1") - .addQueryParam("searchType", ListingSearchType.PREFIX.toString()); - client.listSynonymMaps(options).iterableByPage().forEach(pages::add); + client.getSynonymMaps(null, prefix, 1, ListingSearchType.PREFIX).iterableByPage().forEach(pages::add); assertSynonymMapPages(expectedNames, pages); } @@ -526,11 +522,9 @@ public void canListSynonymMapsByPrefixAcrossPagesSync() { public void canListSynonymMapsByPrefixAcrossPagesAsync() { String prefix = testResourceNamer.randomName("paged-synonym-", 24); List expectedNames = createSynonymMapsForPagination(prefix); - RequestOptions options = new RequestOptions().addQueryParam("search", prefix) - .addQueryParam("pageSize", "1") - .addQueryParam("searchType", ListingSearchType.PREFIX.toString()); - StepVerifier.create(asyncClient.listSynonymMaps(options).byPage().collectList()) + StepVerifier + .create(asyncClient.getSynonymMaps(null, prefix, 1, ListingSearchType.PREFIX).byPage().collectList()) .assertNext(pages -> assertSynonymMapPages(expectedNames, pages)) .verifyComplete(); } diff --git a/sdk/search/azure-search-perf/pom.xml b/sdk/search/azure-search-perf/pom.xml index b0f8f0743a0a4..aba17f7881572 100644 --- a/sdk/search/azure-search-perf/pom.xml +++ b/sdk/search/azure-search-perf/pom.xml @@ -35,12 +35,12 @@ com.azure azure-core - 1.60.0 + 1.61.0 com.azure azure-core-http-netty - 1.16.8 + 1.17.0 From 95776c748617fae145e6606019eb1bdf79977e27 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:05:56 -0800 Subject: [PATCH 09/20] Preserve Search release-history ordering from main Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- sdk/search/azure-search-documents/CHANGELOG.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 9b632b29c4bbf..7440703d54981 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -124,6 +124,15 @@ The following APIs were public in GA `12.1.1` and have been removed in `12.2.0`: - Upgraded `azure-core` from `1.60.0` to version `1.61.0`. - Upgraded `azure-core-http-netty` from `1.16.8` to version `1.17.0`. +## 12.0.3 (2026-10-06) + +### Other Changes + +#### Dependency Updates + +- Upgraded `azure-core-http-netty` from `1.16.6` to version `1.16.8`. +- Upgraded `azure-core` from `1.59.0` to version `1.60.0`. + ## 12.1.0-beta.2 (2026-08-28) ### Features Added @@ -166,15 +175,6 @@ The following APIs were public in GA `12.1.1` and have been removed in `12.2.0`: - Fixed knowledge source status deserialization for compact synchronization intervals such as `1d` while preserving the existing Java `Duration` API. -## 12.0.3 (2026-10-06) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.16.6` to version `1.16.8`. -- Upgraded `azure-core` from `1.59.0` to version `1.60.0`. - ## 12.0.2 (2026-08-18) ### Other Changes From f1c7feb2dfdaa991f7ae763c43d4d7ffb18ccc23 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:15:02 -0800 Subject: [PATCH 10/20] Fix Search preview coverage documentation spelling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- sdk/search/azure-search-documents/preview-feature-coverage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/preview-feature-coverage.md b/sdk/search/azure-search-documents/preview-feature-coverage.md index 84c0a93dda754..d745043ddc274 100644 --- a/sdk/search/azure-search-documents/preview-feature-coverage.md +++ b/sdk/search/azure-search-documents/preview-feature-coverage.md @@ -82,7 +82,7 @@ These selected tests use fake HTTP responses and do not require live feature fix Final PLAYBACK used the default test configuration with all `SEARCH_*` environment variables removed. Endpoint assertions account for recorded URL sanitization; the two strict pagination fixtures normalize environment-specific blob-container names. Configured-secret scans, Checkstyle and SpotBugs passed. -- The 14 removed supplemental live methods were unrun and accounted for 14 of those historical skips. +- The 14 removed supplemental live methods were not run and accounted for 14 of those historical skips. The other 118 skips exactly match the earlier DP11 recording run: 92 disabled cases and 26 existing live-only cases. Skips are test-execution decisions, not failed HTTP recordings. - Validated recordings were published as `java/search/azure-search-documents_6950366571`, and `assets.json` was From 3d5d1a1de9ef6ff048ae8fa5a4e9088ee4e5eb0a Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:54:19 -0800 Subject: [PATCH 11/20] Update explain stage to use LOGICAL_PLAN constant Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../java/com/azure/search/documents/PreviewSearchSamples.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java index 94cee81555c8b..ed9aa7fda152a 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java @@ -31,7 +31,7 @@ public final class PreviewSearchSamples { public GraphQueryResult planGraph(SearchClient client) { return client.graph(new GraphOptions("MATCH (n) RETURN n") .setExecutionMode(GraphQueryExecutionMode.PLAN_ONLY) - .setExplain(Collections.singletonList(GraphQueryExplainStage.fromString("logical"))) + .setExplain(Collections.singletonList(GraphQueryExplainStage.LOGICAL_PLAN)) .setIncludeDiagnostics(true)); } From 413fde9390db154dd152a39ed8ff6d563b9cfe0d Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:54:46 -0800 Subject: [PATCH 12/20] Change listIndexers to block until completion Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../azure/search/documents/indexes/ListIndexersExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java index 5b4267d1b7b25..f53451408f910 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/ListIndexersExample.java @@ -31,7 +31,7 @@ public static void main(String[] args) { private static void listIndexers(SearchIndexerAsyncClient indexerAsyncClient) { System.out.println("Found the following indexers:"); - indexerAsyncClient.listIndexers().subscribe(indexer -> - System.out.printf("Indexer name: %s, ETag: %s%n", indexer.getName(), indexer.getETag())); + indexerAsyncClient.listIndexers().doOnNext(indexer -> + System.out.printf("Indexer name: %s, ETag: %s%n", indexer.getName(), indexer.getETag())).blockLast(); } } From 0fdf45aa415c89993eecf480cc98b1197c36cb8b Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Wed, 11 Nov 2026 11:59:40 -0800 Subject: [PATCH 13/20] Expose Search listing metadata and typed graph errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 2 + .../src/main/java/SearchCustomizations.java | 78 ++++ .../implementation/SearchIndexClientImpl.java | 409 ++++++++++++------ .../indexes/SearchIndexAsyncClient.java | 46 ++ .../documents/indexes/SearchIndexClient.java | 45 ++ .../indexes/models/IndexListingPagedFlux.java | 26 ++ .../models/IndexListingPagedIterable.java | 26 ++ .../models/IndexListingPagedResponse.java | 96 ++++ .../documents/models/GraphQueryError.java | 120 +++++ .../documents/PreviewSearchSamples.java | 28 ++ .../search/documents/PreviewApiTests.java | 166 +++++++ 11 files changed, 910 insertions(+), 132 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedFlux.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedIterable.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedResponse.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryError.java diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 7440703d54981..f0978fa6e2d0d 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -6,6 +6,8 @@ - Added support for `2026-11-01-preview`, now the default service version. Previously supported GA service versions remain available. - Added synchronous and asynchronous graph queries, typed HTTP responses, query planning, diagnostics, statistics, and provenance models. +- Added `GraphQueryError` for opt-in typed parsing of graph error bodies without changing existing exceptions. +- Added `listIndexesWithMetadata` and `listIndexStatsSummaryWithMetadata` to read optional service-supplied total counts while preserving existing listing APIs. The preview contract does not define a count-request parameter. - Added graph extraction, enrichment cache, graph retrieval activities and references, and updated knowledge source and model options. - Added `none`, `diverse`, and `balanced` vector topic graph retrieval, facet-backed filter hint auto-configuration, and random scoring. - Restored preview search options, including more-like-this and agentic search, and exposed query diagnostics on paged responses. diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index 1c05fcadadcc2..c908cb3e8f97c 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -130,7 +130,10 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) ClassCustomization client = indexes.getClass(className); addTypedListingMethod(client, "listIndexStatsSummary", "IndexStatisticsSummary", false); addTypedListingMethod(client, "listKnowledgeSourceFiles", "KnowledgeSourceFile", true); + addListingMetadataMethods(client, className.endsWith("AsyncClient")); } + addListingMetadataRetrieval(libraryCustomization.getPackage("com.azure.search.documents.implementation") + .getClass("SearchIndexClientImpl")); libraryCustomization.getPackage(KNOWLEDGE_MODELS_PACKAGE) .getClass("KnowledgeBaseIndexedSqlReference") .customizeAst(ast -> ast.getClassByName("KnowledgeBaseIndexedSqlReference").ifPresent(clazz -> { @@ -151,6 +154,81 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) .getClass("SearchResourceEncryptionKey")); } + private static void addListingMetadataRetrieval(ClassCustomization customization) { + customization.customizeAst(ast -> { + ast.addImport("com.azure.search.documents.indexes.models.IndexListingPagedResponse"); + ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + for (String operation : Arrays.asList("listIndexes", "listIndexStatsSummary")) { + for (String suffix : Arrays.asList("", "Async")) { + for (String page : Arrays.asList("", "Next")) { + String original = operation + page + "SinglePage" + suffix; + String name = operation + page + "SinglePageWithMetadata" + suffix; + clazz.getMethodsByName(name).forEach(MethodDeclaration::remove); + MethodDeclaration method = clazz.getMethodsByName(original).get(0).clone(); + method.setName(name).setPrivate(false).setPublic(true); + method.addTypeParameter("T"); + method.addParameter("Class", "itemType"); + method.setType(suffix.isEmpty() ? "IndexListingPagedResponse" + : "Mono>"); + method.findAll(com.github.javaparser.ast.expr.ObjectCreationExpr.class).stream() + .filter(expression -> expression.getType().getNameAsString() + .equals("PagedResponseBase")) + .forEach(expression -> expression.replace(StaticJavaParser.parseExpression( + "new IndexListingPagedResponse<>(res, itemType)"))); + method.setJavadocComment("Retrieves a listing page without discarding its metadata.\n" + + "@param the item type.\n" + + (page.isEmpty() ? "" : "@param nextLink the continuation link.\n") + + "@param requestOptions the request options.\n" + + "@param itemType the item deserialization type.\n" + + "@return the typed page and optional total count."); + clazz.addMember(method); + } + } + } + }); + }); + } + + private static void addListingMetadataMethods(ClassCustomization customization, boolean async) { + customization.customizeAst(ast -> { + ast.addImport("com.azure.search.documents.indexes.models.IndexListingPagedIterable"); + ast.addImport("com.azure.search.documents.indexes.models.IndexListingPagedFlux"); + ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + for (String operation : Arrays.asList("listIndexes", "listIndexStatsSummary")) { + String model = operation.equals("listIndexes") ? "SearchIndex" : "IndexStatisticsSummary"; + String name = operation + "WithMetadata"; + String pagedType = async ? "IndexListingPagedFlux" : "IndexListingPagedIterable"; + String suffix = async ? "Async" : ""; + String retrieval = "(token == null ? serviceClient." + operation + "SinglePageWithMetadata" + + suffix + "(requestOptions, " + model + ".class) : serviceClient." + + operation + "NextSinglePageWithMetadata" + suffix + "(token, nextOptions, " + + model + ".class))" + (async ? ".flux()" : ""); + clazz.getMethodsByName(name).forEach(MethodDeclaration::remove); + MethodDeclaration method = StaticJavaParser.parseMethodDeclaration( + "public " + pagedType + "<" + model + "> " + name + "(RequestOptions requestOptions) {" + + "RequestOptions nextOptions = new RequestOptions().setContext(" + + "requestOptions != null && requestOptions.getContext() != null" + + " ? requestOptions.getContext() : Context.NONE);" + + "return new " + pagedType + "<>(() -> (token, pageSize) -> " + retrieval + "); }"); + method.addAnnotation(StaticJavaParser.parseAnnotation( + "@ServiceMethod(returns = ReturnType.COLLECTION)")); + method.setJavadocComment("Lists " + (model.equals("SearchIndex") ? "indexes" : "index statistics") + + " with HTTP and optional total-count metadata on each page.\n" + + "Counts are null when not returned by the service. This method does not add a count-request " + + "parameter, which is not defined by the preview listing contract.\n" + + "Continuation links control subsequent requests; the initial request's context is retained.\n" + + "@param requestOptions options for the initial HTTP request, or null for defaults.\n" + + "@return the lazy listing with typed pages and optional total counts.\n" + + "@throws com.azure.core.exception.HttpResponseException if a request is rejected."); + clazz.addMember(method); + } + }); + ast.getImports().removeIf(importDeclaration -> importDeclaration.getNameAsString() + .equals("com.azure.search.documents.indexes.models." + + (async ? "IndexListingPagedIterable" : "IndexListingPagedFlux"))); + }); + } + private static void addGaRetrieveOverload(ClassCustomization customization) { customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { MethodDeclaration method = clazz.getMethodsBySignature("retrieve", "KnowledgeBaseRetrievalOptions", diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java index ac2415dace0bb..b825995b452d1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.search.documents.implementation; import com.azure.core.annotation.BodyParam; @@ -44,6 +43,7 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.TypeReference; import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.indexes.models.IndexListingPagedResponse; import com.azure.search.documents.indexes.models.KnowledgeSourceFile; import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; import java.time.Duration; @@ -56,6 +56,7 @@ * Initializes a new instance of the SearchIndexClient type. */ public final class SearchIndexClientImpl { + /** * The proxy service used to perform REST calls. */ @@ -68,7 +69,7 @@ public final class SearchIndexClientImpl { /** * Gets The endpoint URL of the search service. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -82,7 +83,7 @@ public String getEndpoint() { /** * Gets Service version. - * + * * @return the serviceVersion value. */ public SearchServiceVersion getServiceVersion() { @@ -96,7 +97,7 @@ public SearchServiceVersion getServiceVersion() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -110,7 +111,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -119,7 +120,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of SearchIndexClient client. - * + * * @param endpoint The endpoint URL of the search service. * @param serviceVersion Service version. */ @@ -130,7 +131,7 @@ public SearchIndexClientImpl(String endpoint, SearchServiceVersion serviceVersio /** * Initializes an instance of SearchIndexClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The endpoint URL of the search service. * @param serviceVersion Service version. @@ -141,7 +142,7 @@ public SearchIndexClientImpl(HttpPipeline httpPipeline, String endpoint, SearchS /** * Initializes an instance of SearchIndexClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The endpoint URL of the search service. @@ -163,6 +164,7 @@ public SearchIndexClientImpl(HttpPipeline httpPipeline, SerializerAdapter serial @Host("{endpoint}") @ServiceInterface(name = "SearchIndexClient") public interface SearchIndexClientService { + @Put("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -1259,7 +1261,7 @@ Response listIndexStatsSummaryNextSync( * } * } * - * + * * @param name The name of the synonym map. * @param synonymMap The definition of the synonym map to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1347,7 +1349,7 @@ public Mono> createOrUpdateSynonymMapWithResponseAsync(Stri * } * } * - * + * * @param name The name of the synonym map. * @param synonymMap The definition of the synonym map to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1379,7 +1381,7 @@ public Response createOrUpdateSynonymMapWithResponse(String name, Bi * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the synonym map. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1406,7 +1408,7 @@ public Mono> deleteSynonymMapWithResponseAsync(String name, Reque * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the synonym map. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1450,7 +1452,7 @@ public Response deleteSynonymMapWithResponse(String name, RequestOptions r * } * } * - * + * * @param name The name of the synonym map. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1495,7 +1497,7 @@ public Mono> getSynonymMapWithResponseAsync(String name, Re * } * } * - * + * * @param name The name of the synonym map. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1555,7 +1557,7 @@ public Response getSynonymMapWithResponse(String name, RequestOption * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1618,7 +1620,7 @@ private Mono> listSynonymMapsSinglePageAsync(RequestOp * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1679,7 +1681,7 @@ public PagedFlux listSynonymMapsAsync(RequestOptions requestOptions) * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1740,7 +1742,7 @@ private PagedResponse listSynonymMapsSinglePage(RequestOptions reque * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1814,7 +1816,7 @@ public PagedIterable listSynonymMaps(RequestOptions requestOptions) * } * } * - * + * * @param synonymMap The definition of the synonym map to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1889,7 +1891,7 @@ public Mono> createSynonymMapWithResponseAsync(BinaryData s * } * } * - * + * * @param synonymMap The definition of the synonym map to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2381,7 +2383,7 @@ public Response createSynonymMapWithResponse(BinaryData synonymMap, * } * } * - * + * * @param name The name of the index. * @param index The definition of the index to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -2877,7 +2879,7 @@ public Mono> createOrUpdateIndexWithResponseAsync(String na * } * } * - * + * * @param name The name of the index. * @param index The definition of the index to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -2912,7 +2914,7 @@ public Response createOrUpdateIndexWithResponse(String name, BinaryD * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the index. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2941,7 +2943,7 @@ public Mono> deleteIndexWithResponseAsync(String name, RequestOpt * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the index. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3184,7 +3186,7 @@ public Response deleteIndexWithResponse(String name, RequestOptions reques * } * } * - * + * * @param name The name of the index. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3429,7 +3431,7 @@ public Mono> getIndexWithResponseAsync(String name, Request * } * } * - * + * * @param name The name of the index. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3686,7 +3688,7 @@ public Response getIndexWithResponse(String name, RequestOptions req * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -3945,7 +3947,7 @@ private Mono> listIndexesSinglePageAsync(RequestOption * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4202,7 +4204,7 @@ public PagedFlux listIndexesAsync(RequestOptions requestOptions) { * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4459,7 +4461,7 @@ private PagedResponse listIndexesSinglePage(RequestOptions requestOp * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4719,7 +4721,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -4982,7 +4984,7 @@ public PagedIterable listIndexes(RequestOptions requestOptions) { * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5242,7 +5244,7 @@ public PagedFlux listIndexesWithSelectedPropertiesAsync(RequestOptio * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5502,7 +5504,7 @@ private PagedResponse listIndexesWithSelectedPropertiesSinglePage(Re * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5974,7 +5976,7 @@ public PagedIterable listIndexesWithSelectedProperties(RequestOption * } * } * - * + * * @param index The definition of the index to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6447,7 +6449,7 @@ public Mono> createIndexWithResponseAsync(BinaryData index, * } * } * - * + * * @param index The definition of the index to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6478,7 +6480,7 @@ public Response createIndexWithResponse(BinaryData index, RequestOpt * } * } * - * + * * @param name The name of the index. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6507,7 +6509,7 @@ public Mono> getIndexStatisticsWithResponseAsync(String nam * } * } * - * + * * @param name The name of the index. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6560,7 +6562,7 @@ public Response getIndexStatisticsWithResponse(String name, RequestO * } * } * - * + * * @param name The name of the index. * @param request The text and analyzer or analysis components to test. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -6617,7 +6619,7 @@ public Mono> analyzeTextWithResponseAsync(String name, Bina * } * } * - * + * * @param name The name of the index. * @param request The text and analyzer or analysis components to test. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -6675,7 +6677,7 @@ public Response analyzeTextWithResponse(String name, BinaryData requ * } * } * - * + * * @param name The name of the alias. * @param alias The definition of the alias to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -6735,7 +6737,7 @@ public Mono> createOrUpdateAliasWithResponseAsync(String na * } * } * - * + * * @param name The name of the alias. * @param alias The definition of the alias to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -6769,7 +6771,7 @@ public Response createOrUpdateAliasWithResponse(String name, BinaryD * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the alias. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6797,7 +6799,7 @@ public Mono> deleteAliasWithResponseAsync(String name, RequestOpt * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the alias. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6827,7 +6829,7 @@ public Response deleteAliasWithResponse(String name, RequestOptions reques * } * } * - * + * * @param name The name of the alias. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6859,7 +6861,7 @@ public Mono> getAliasWithResponseAsync(String name, Request * } * } * - * + * * @param name The name of the alias. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -6903,7 +6905,7 @@ public Response getAliasWithResponse(String name, RequestOptions req * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -6949,7 +6951,7 @@ private Mono> listAliasesSinglePageAsync(RequestOption * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -6993,7 +6995,7 @@ public PagedFlux listAliasesAsync(RequestOptions requestOptions) { * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7037,7 +7039,7 @@ private PagedResponse listAliasesSinglePage(RequestOptions requestOp * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7083,7 +7085,7 @@ public PagedIterable listAliases(RequestOptions requestOptions) { * } * } * - * + * * @param alias The definition of the alias to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -7130,7 +7132,7 @@ public Mono> createAliasWithResponseAsync(BinaryData alias, * } * } * - * + * * @param alias The definition of the alias to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -7309,7 +7311,7 @@ public Response createAliasWithResponse(BinaryData alias, RequestOpt * } * } * - * + * * @param name The name of the knowledge base. * @param knowledgeBase The definition of the knowledge base to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -7492,7 +7494,7 @@ public Mono> createOrUpdateKnowledgeBaseWithResponseAsync(S * } * } * - * + * * @param name The name of the knowledge base. * @param knowledgeBase The definition of the knowledge base to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -7524,7 +7526,7 @@ public Response createOrUpdateKnowledgeBaseWithResponse(String name, * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the knowledge base. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -7551,7 +7553,7 @@ public Mono> deleteKnowledgeBaseWithResponseAsync(String name, Re * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the knowledge base. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -7642,7 +7644,7 @@ public Response deleteKnowledgeBaseWithResponse(String name, RequestOption * } * } * - * + * * @param name The name of the knowledge base. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -7735,7 +7737,7 @@ public Mono> getKnowledgeBaseWithResponseAsync(String name, * } * } * - * + * * @param name The name of the knowledge base. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -7839,7 +7841,7 @@ public Response getKnowledgeBaseWithResponse(String name, RequestOpt * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -7946,7 +7948,7 @@ private Mono> listKnowledgeBasesSinglePageAsync(Reques * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -8051,7 +8053,7 @@ public PagedFlux listKnowledgeBasesAsync(RequestOptions requestOptio * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -8156,7 +8158,7 @@ private PagedResponse listKnowledgeBasesSinglePage(RequestOptions re * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -8324,7 +8326,7 @@ public PagedIterable listKnowledgeBases(RequestOptions requestOption * } * } * - * + * * @param knowledgeBase The definition of the knowledge base to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -8494,7 +8496,7 @@ public Mono> createKnowledgeBaseWithResponseAsync(BinaryDat * } * } * - * + * * @param knowledgeBase The definition of the knowledge base to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -8577,7 +8579,7 @@ public Response createKnowledgeBaseWithResponse(BinaryData knowledge * } * } * - * + * * @param name The name of the knowledge source. * @param knowledgeSource The definition of the knowledge source to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -8664,7 +8666,7 @@ public Mono> createOrUpdateKnowledgeSourceWithResponseAsync * } * } * - * + * * @param name The name of the knowledge source. * @param knowledgeSource The definition of the knowledge source to create or update. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -8696,7 +8698,7 @@ public Response createOrUpdateKnowledgeSourceWithResponse(String nam * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -8723,7 +8725,7 @@ public Mono> deleteKnowledgeSourceWithResponseAsync(String name, * be performed only if the ETag on the server does not match this value. * * You can add these to a request with {@link RequestOptions#addHeader} - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -8766,7 +8768,7 @@ public Response deleteKnowledgeSourceWithResponse(String name, RequestOpti * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -8811,7 +8813,7 @@ public Mono> getKnowledgeSourceWithResponseAsync(String nam * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -8867,7 +8869,7 @@ public Response getKnowledgeSourceWithResponse(String name, RequestO * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -8926,7 +8928,7 @@ private Mono> listKnowledgeSourcesSinglePageAsync(Requ * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -8983,7 +8985,7 @@ public PagedFlux listKnowledgeSourcesAsync(RequestOptions requestOpt * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -9040,7 +9042,7 @@ private PagedResponse listKnowledgeSourcesSinglePage(RequestOptions * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -9112,7 +9114,7 @@ public PagedIterable listKnowledgeSources(RequestOptions requestOpti * } * } * - * + * * @param knowledgeSource The definition of the knowledge source to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -9186,7 +9188,7 @@ public Mono> createKnowledgeSourceWithResponseAsync(BinaryD * } * } * - * + * * @param knowledgeSource The definition of the knowledge source to create. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -9255,7 +9257,7 @@ public Response createKnowledgeSourceWithResponse(BinaryData knowled * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -9324,7 +9326,7 @@ public Mono> getKnowledgeSourceStatusWithResponseAsync(Stri * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -9370,7 +9372,7 @@ public Response getKnowledgeSourceStatusWithResponse(String name, Re * } * } * - * + * * @param name The name of the knowledge source. * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. * Must follow the format: `attachment; filename="<filename>"`. @@ -9424,7 +9426,7 @@ public Mono> uploadKnowledgeSourceFileWithResponseAsync(Str * } * } * - * + * * @param name The name of the knowledge source. * @param contentDisposition The Content-Disposition header specifying the filename of the uploaded file. * Must follow the format: `attachment; filename="<filename>"`. @@ -9469,7 +9471,7 @@ public Response uploadKnowledgeSourceFileWithResponse(String name, S * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9512,7 +9514,7 @@ public Mono> uploadKnowledgeSourceFileMultipartWithResponse * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9563,7 +9565,7 @@ public Response uploadKnowledgeSourceFileMultipartWithResponseIntern * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9615,7 +9617,7 @@ private Mono> ingestKnowledgeSourceFileMultipartWithRespons * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9666,7 +9668,7 @@ private Response ingestKnowledgeSourceFileMultipartWithResponse(Stri * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9727,7 +9729,7 @@ private Response ingestKnowledgeSourceFileMultipartWithResponse(Stri * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9787,7 +9789,7 @@ private Response ingestKnowledgeSourceFileMultipartWithResponse(Stri * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9846,7 +9848,7 @@ public PollerFlux beginIngestKnowledgeSourceFileMultipar * } * } * - * + * * @param name The name of the knowledge source. * @param body The multipart/form-data body containing the metadata and content parts. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -9909,7 +9911,7 @@ public SyncPoller beginIngestKnowledgeSourceFileMultipar * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -9966,7 +9968,7 @@ private Mono> listKnowledgeSourceFilesSinglePageAsync( * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10020,7 +10022,7 @@ public PagedFlux listKnowledgeSourceFilesAsync(String name, RequestO * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10074,7 +10076,7 @@ private PagedResponse listKnowledgeSourceFilesSinglePage(String name * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10094,7 +10096,7 @@ public PagedIterable listKnowledgeSourceFiles(String name, RequestOp /** * Deletes a file from a File knowledge source and removes all indexed content derived from it. - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -10113,7 +10115,7 @@ public Mono> deleteKnowledgeSourceFileWithResponseAsync(String na /** * Deletes a file from a File knowledge source and removes all indexed content derived from it. - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -10154,7 +10156,7 @@ public Response deleteKnowledgeSourceFileWithResponse(String name, String * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10199,7 +10201,7 @@ public Mono> updateKnowledgeSourceFileWithResponseInternalA * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10251,7 +10253,7 @@ public Response updateKnowledgeSourceFileWithResponseInternal(String * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10304,7 +10306,7 @@ private Mono> ingestKnowledgeSourceFileReplacementWithRespo * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10357,7 +10359,7 @@ private Response ingestKnowledgeSourceFileReplacementWithResponse(St * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10419,7 +10421,7 @@ private Response ingestKnowledgeSourceFileReplacementWithResponse(St * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10481,7 +10483,7 @@ private Response ingestKnowledgeSourceFileReplacementWithResponse(St * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10541,7 +10543,7 @@ public PollerFlux beginIngestKnowledgeSourceFileReplacem * } * } * - * + * * @param name The name of the knowledge source. * @param fileId The unique identifier of the file to update. * @param body The multipart/form-data body containing the metadata and content parts. @@ -10608,7 +10610,7 @@ public SyncPoller beginIngestKnowledgeSourceFileReplacem * Retry-AfterintThe suggested delay in seconds before polling a nonterminal operation * again. * - * + * * @param name The name of the knowledge source. * @param operationId The server-generated identifier returned when ingestion was accepted. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -10666,7 +10668,7 @@ public Mono> getKnowledgeSourceFileIngestionOperationWithRe * Retry-AfterintThe suggested delay in seconds before polling a nonterminal operation * again. * - * + * * @param name The name of the knowledge source. * @param operationId The server-generated identifier returned when ingestion was accepted. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -10724,7 +10726,7 @@ public Response getKnowledgeSourceFileIngestionOperationWithResponse * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10785,7 +10787,7 @@ private Mono> listKnowledgeSourceFileIngestionOperatio * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10846,7 +10848,7 @@ public PagedFlux listKnowledgeSourceFileIngestionOperationsAsync(Str * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10905,7 +10907,7 @@ private PagedResponse listKnowledgeSourceFileIngestionOperationsSing * } * } * - * + * * @param name The name of the knowledge source. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -10966,7 +10968,7 @@ public PagedIterable listKnowledgeSourceFileIngestionOperations(Stri * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11023,7 +11025,7 @@ public Mono> getServiceStatisticsWithResponseAsync(RequestO * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11064,7 +11066,7 @@ public Response getServiceStatisticsWithResponse(RequestOptions requ * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11109,7 +11111,7 @@ private Mono> listIndexStatsSummarySinglePageAsync(Req * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11153,7 +11155,7 @@ public PagedFlux listIndexStatsSummaryAsync(RequestOptions requestOp * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11196,7 +11198,7 @@ private PagedResponse listIndexStatsSummarySinglePage(RequestOptions * } * } * - * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -11243,7 +11245,7 @@ public PagedIterable listIndexStatsSummary(RequestOptions requestOpt * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -11293,7 +11295,7 @@ private Mono> listSynonymMapsNextSinglePageAsync(Strin * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -11539,7 +11541,7 @@ private PagedResponse listSynonymMapsNextSinglePage(String nextLink, * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -11788,7 +11790,7 @@ private Mono> listIndexesNextSinglePageAsync(String ne * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12034,7 +12036,7 @@ private PagedResponse listIndexesNextSinglePage(String nextLink, Req * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12283,7 +12285,7 @@ private Mono> listIndexesWithSelectedPropertiesNextSin * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12317,7 +12319,7 @@ private PagedResponse listIndexesWithSelectedPropertiesNextSinglePag * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12353,7 +12355,7 @@ private Mono> listAliasesNextSinglePageAsync(String ne * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12447,7 +12449,7 @@ private PagedResponse listAliasesNextSinglePage(String nextLink, Req * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12543,7 +12545,7 @@ private Mono> listKnowledgeBasesNextSinglePageAsync(St * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12589,7 +12591,7 @@ private PagedResponse listKnowledgeBasesNextSinglePage(String nextLi * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12637,7 +12639,7 @@ private Mono> listKnowledgeSourcesNextSinglePageAsync( * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12678,7 +12680,7 @@ private PagedResponse listKnowledgeSourcesNextSinglePage(String next * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12721,7 +12723,7 @@ private Mono> listKnowledgeSourceFilesNextSinglePageAs * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12771,7 +12773,7 @@ private PagedResponse listKnowledgeSourceFilesNextSinglePage(String * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12823,7 +12825,7 @@ private PagedResponse listKnowledgeSourceFilesNextSinglePage(String * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12856,7 +12858,7 @@ private PagedResponse listKnowledgeSourceFileIngestionOperationsNext * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12890,7 +12892,7 @@ private Mono> listIndexStatsSummaryNextSinglePageAsync * } * } * - * + * * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -12933,4 +12935,147 @@ private String getNextLink(BinaryData binaryData, String... path) { return null; } } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IndexListingPagedResponse listIndexesSinglePageWithMetadata(RequestOptions requestOptions, + Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + Response res = service.listIndexesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + return new IndexListingPagedResponse<>(res, itemType); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param nextLink the continuation link. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IndexListingPagedResponse listIndexesNextSinglePageWithMetadata(String nextLink, + RequestOptions requestOptions, Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + Response res + = service.listIndexesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new IndexListingPagedResponse<>(res, itemType); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listIndexesSinglePageWithMetadataAsync(RequestOptions requestOptions, + Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil + .withContext(context -> service.listIndexes(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new IndexListingPagedResponse<>(res, itemType)); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param nextLink the continuation link. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listIndexesNextSinglePageWithMetadataAsync(String nextLink, + RequestOptions requestOptions, Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil + .withContext( + context -> service.listIndexesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new IndexListingPagedResponse<>(res, itemType)); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IndexListingPagedResponse listIndexStatsSummarySinglePageWithMetadata(RequestOptions requestOptions, + Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + Response res = service.listIndexStatsSummarySync(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new IndexListingPagedResponse<>(res, itemType); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param nextLink the continuation link. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IndexListingPagedResponse listIndexStatsSummaryNextSinglePageWithMetadata(String nextLink, + RequestOptions requestOptions, Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + Response res + = service.listIndexStatsSummaryNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new IndexListingPagedResponse<>(res, itemType); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + listIndexStatsSummarySinglePageWithMetadataAsync(RequestOptions requestOptions, Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil + .withContext(context -> service.listIndexStatsSummary(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new IndexListingPagedResponse<>(res, itemType)); + } + + /** + * Retrieves a listing page without discarding its metadata. + * + * @param the item type. + * @param nextLink the continuation link. + * @param requestOptions the request options. + * @param itemType the item deserialization type. + * @return the typed page and optional total count. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listIndexStatsSummaryNextSinglePageWithMetadataAsync(String nextLink, + RequestOptions requestOptions, Class itemType) { + final String accept = "application/json;odata.metadata=minimal"; + return FluxUtil.withContext( + context -> service.listIndexStatsSummaryNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new IndexListingPagedResponse<>(res, itemType)); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java index 183969a8d3d5e..e30771d0a0c6e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java @@ -22,6 +22,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.models.GeoPoint; import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.search.documents.SearchAsyncClient; @@ -33,6 +34,7 @@ import com.azure.search.documents.indexes.models.AnalyzeResult; import com.azure.search.documents.indexes.models.AnalyzeTextOptions; import com.azure.search.documents.indexes.models.GetIndexStatisticsResult; +import com.azure.search.documents.indexes.models.IndexListingPagedFlux; import com.azure.search.documents.indexes.models.IndexStatisticsSummary; import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSource; @@ -6240,4 +6242,48 @@ public PagedFlux listKnowledgeSourceFiles(String name, Requ return this.serviceClient.listKnowledgeSourceFilesAsync(name, requestOptions) .mapPage(binaryData -> binaryData.toObject(KnowledgeSourceFile.class)); } + + /** + * Lists indexes with HTTP and optional total-count metadata on each page. + * Counts are null when not returned by the service. This method does not add a count-request parameter, which is + * not defined by the preview listing contract. + * Continuation links control subsequent requests; the initial request's context is retained. + * + * @param requestOptions options for the initial HTTP request, or null for defaults. + * @return the lazy listing with typed pages and optional total counts. + * @throws com.azure.core.exception.HttpResponseException if a request is rejected. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public IndexListingPagedFlux listIndexesWithMetadata(RequestOptions requestOptions) { + RequestOptions nextOptions = new RequestOptions().setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new IndexListingPagedFlux<>(() -> (token, + pageSize) -> (token == null + ? serviceClient.listIndexesSinglePageWithMetadataAsync(requestOptions, SearchIndex.class) + : serviceClient.listIndexesNextSinglePageWithMetadataAsync(token, nextOptions, SearchIndex.class)) + .flux()); + } + + /** + * Lists index statistics with HTTP and optional total-count metadata on each page. + * Counts are null when not returned by the service. This method does not add a count-request parameter, which is + * not defined by the preview listing contract. + * Continuation links control subsequent requests; the initial request's context is retained. + * + * @param requestOptions options for the initial HTTP request, or null for defaults. + * @return the lazy listing with typed pages and optional total counts. + * @throws com.azure.core.exception.HttpResponseException if a request is rejected. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public IndexListingPagedFlux + listIndexStatsSummaryWithMetadata(RequestOptions requestOptions) { + RequestOptions nextOptions = new RequestOptions().setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new IndexListingPagedFlux<>(() -> (token, + pageSize) -> (token == null + ? serviceClient.listIndexStatsSummarySinglePageWithMetadataAsync(requestOptions, + IndexStatisticsSummary.class) + : serviceClient.listIndexStatsSummaryNextSinglePageWithMetadataAsync(token, nextOptions, + IndexStatisticsSummary.class)).flux()); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java index ba2edd28f2163..3329741b30a8c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java @@ -20,6 +20,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.models.GeoPoint; import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.search.documents.SearchClient; import com.azure.search.documents.SearchClientBuilder; @@ -30,6 +31,7 @@ import com.azure.search.documents.indexes.models.AnalyzeResult; import com.azure.search.documents.indexes.models.AnalyzeTextOptions; import com.azure.search.documents.indexes.models.GetIndexStatisticsResult; +import com.azure.search.documents.indexes.models.IndexListingPagedIterable; import com.azure.search.documents.indexes.models.IndexStatisticsSummary; import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSource; @@ -5911,4 +5913,47 @@ public PagedIterable listKnowledgeSourceFiles(String name, return this.serviceClient.listKnowledgeSourceFiles(name, requestOptions) .mapPage(binaryData -> binaryData.toObject(KnowledgeSourceFile.class)); } + + /** + * Lists indexes with HTTP and optional total-count metadata on each page. + * Counts are null when not returned by the service. This method does not add a count-request parameter, which is + * not defined by the preview listing contract. + * Continuation links control subsequent requests; the initial request's context is retained. + * + * @param requestOptions options for the initial HTTP request, or null for defaults. + * @return the lazy listing with typed pages and optional total counts. + * @throws com.azure.core.exception.HttpResponseException if a request is rejected. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public IndexListingPagedIterable listIndexesWithMetadata(RequestOptions requestOptions) { + RequestOptions nextOptions = new RequestOptions().setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new IndexListingPagedIterable<>(() -> (token, + pageSize) -> (token == null + ? serviceClient.listIndexesSinglePageWithMetadata(requestOptions, SearchIndex.class) + : serviceClient.listIndexesNextSinglePageWithMetadata(token, nextOptions, SearchIndex.class))); + } + + /** + * Lists index statistics with HTTP and optional total-count metadata on each page. + * Counts are null when not returned by the service. This method does not add a count-request parameter, which is + * not defined by the preview listing contract. + * Continuation links control subsequent requests; the initial request's context is retained. + * + * @param requestOptions options for the initial HTTP request, or null for defaults. + * @return the lazy listing with typed pages and optional total counts. + * @throws com.azure.core.exception.HttpResponseException if a request is rejected. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public IndexListingPagedIterable + listIndexStatsSummaryWithMetadata(RequestOptions requestOptions) { + RequestOptions nextOptions = new RequestOptions().setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new IndexListingPagedIterable<>(() -> (token, + pageSize) -> (token == null + ? serviceClient.listIndexStatsSummarySinglePageWithMetadata(requestOptions, + IndexStatisticsSummary.class) + : serviceClient.listIndexStatsSummaryNextSinglePageWithMetadata(token, nextOptions, + IndexStatisticsSummary.class))); + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedFlux.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedFlux.java new file mode 100644 index 0000000000000..e06304379bc45 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedFlux.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.indexes.models; + +import com.azure.core.util.CoreUtils; +import com.azure.core.util.paging.ContinuablePagedFluxCore; +import com.azure.core.util.paging.PageRetriever; + +import java.util.function.Supplier; + +/** + * An asynchronous listing whose pages retain optional total-count metadata. + * + * @param the type of items in the listing. + */ +public final class IndexListingPagedFlux extends ContinuablePagedFluxCore> { + /** + * Creates a lazy paged listing. + * + * @param pageRetrieverProvider supplies a retriever for each subscription. + */ + public IndexListingPagedFlux(Supplier>> pageRetrieverProvider) { + super(pageRetrieverProvider, null, token -> !CoreUtils.isNullOrEmpty(token)); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedIterable.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedIterable.java new file mode 100644 index 0000000000000..49d8d93782f6d --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedIterable.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.indexes.models; + +import com.azure.core.http.rest.PagedIterableBase; +import com.azure.core.util.paging.PageRetrieverSync; + +import java.util.function.Supplier; + +/** + * A synchronous listing whose pages retain optional total-count metadata. + * + * @param the type of items in the listing. + */ +public final class IndexListingPagedIterable extends PagedIterableBase> { + /** + * Creates a lazy paged listing. + * + * @param pageRetrieverProvider supplies a retriever for each iteration. + */ + public IndexListingPagedIterable( + Supplier>> pageRetrieverProvider) { + super(pageRetrieverProvider); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedResponse.java new file mode 100644 index 0000000000000..28fdfddf714ad --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexListingPagedResponse.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.indexes.models; + +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * A page of indexes or index statistics, including the total count when returned by the service. + * + * @param the type of items in the page. + */ +public final class IndexListingPagedResponse extends PagedResponseBase { + private final Long count; + + /** + * Creates a page from the service's complete JSON response. + * + * @param response the HTTP response, including the listing envelope. + * @param itemType the type used to deserialize each item. + * @throws NullPointerException if response or itemType is null. + * @throws UncheckedIOException if the response cannot be read. + */ + public IndexListingPagedResponse(Response response, Class itemType) { + this(response, readPage(Objects.requireNonNull(response, "'response' cannot be null.").getValue(), itemType)); + } + + private IndexListingPagedResponse(Response response, PageData page) { + super(response.getRequest(), response.getStatusCode(), response.getHeaders(), page.values, + page.continuationToken, null); + this.count = page.count; + } + + private static PageData readPage(BinaryData body, Class itemType) { + Objects.requireNonNull(itemType, "'itemType' cannot be null."); + try (JsonReader jsonReader = JsonProviders.createReader(body.toString())) { + return jsonReader.readObject(reader -> { + List values = Collections.emptyList(); + Long count = null; + String continuationToken = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("value".equals(fieldName)) { + List items + = reader.readArray(item -> BinaryData.fromString(item.readChildren()).toObject(itemType)); + values = items == null ? Collections.emptyList() : Collections.unmodifiableList(items); + } else if ("@odata.count".equals(fieldName)) { + count = reader.getNullable(JsonReader::getLong); + } else if ("@odata.nextLink".equals(fieldName)) { + continuationToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new PageData<>(values, count, continuationToken); + }); + } catch (IOException exception) { + throw new UncheckedIOException("Failed to read the index listing response.", exception); + } + } + + /** + * Gets the total count supplied by the service, which may exceed the number of items on this page. + * This is null when the service omits the count; it is never inferred from the page size. + * The preview listing contract does not define a count-request parameter. + * + * @return the total count, or null when unavailable. + */ + public Long getCount() { + return count; + } + + private static final class PageData { + private final List values; + private final Long count; + private final String continuationToken; + + private PageData(List values, Long count, String continuationToken) { + this.values = values; + this.count = count; + this.continuationToken = continuationToken; + } + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryError.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryError.java new file mode 100644 index 0000000000000..f6cf941c84b5b --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/GraphQueryError.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonWriter; + +import java.io.IOException; +import java.util.List; + +/** + * A graph-query error body with standard error details and optional graph diagnostics. + * Deserialize the response body retained by {@link HttpResponseException} into this model. + * Graph client methods continue to throw their existing exceptions. + */ +@Immutable +public final class GraphQueryError implements JsonSerializable { + private final ResponseError error; + private final GraphQueryResult result; + private final String json; + + private GraphQueryError(ResponseError error, GraphQueryResult result, String json) { + this.error = error; + this.result = result; + this.json = json; + } + + /** + * Gets the standard service error. + * + * @return the service error details. + */ + public ResponseError getError() { + return error; + } + + /** + * Gets the number of projected rows, when returned with the error. + * + * @return the row count, or null when omitted. + */ + public Long getCount() { + return result.getCount(); + } + + /** + * Gets projection rows returned with the error. + * + * @return the projection rows, or null when omitted. + */ + public List getValue() { + return result.getValue(); + } + + /** + * Gets execution statistics returned with the error. + * + * @return the statistics, or null when omitted. + */ + public GraphQueryStatistics getStatistics() { + return result.getStatistics(); + } + + /** + * Gets structured graph diagnostics, including specific graph rejection codes. + * + * @return the diagnostics, or null when omitted. + */ + public List getDiagnostics() { + return result.getDiagnostics(); + } + + /** + * Gets requested explanation stages returned with the error. + * + * @return the explanation, or null when omitted. + */ + public GraphQueryExplain getExplain() { + return result.getExplain(); + } + + /** + * Gets hydrated source documents returned with the error. + * + * @return the source documents, or null when omitted. + */ + public GraphQueryProvenanceDocuments getProvenanceDocuments() { + return result.getProvenanceDocuments(); + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeRawValue(json); + } + + /** + * Reads a graph-query error body. Optional graph fields may be absent. + * + * @param jsonReader the reader positioned at the error body. + * @return the error model, or null for JSON null. + * @throws IOException if the body cannot be read. + * @throws IllegalStateException if required standard error properties are missing. + */ + public static GraphQueryError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String json = reader.readChildren(); + try (JsonReader errorReader = JsonProviders.createReader(json); + JsonReader resultReader = JsonProviders.createReader(json)) { + return new GraphQueryError(ResponseError.fromJson(errorReader), GraphQueryResult.fromJson(resultReader), + json); + } + }); + } +} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java index ed9aa7fda152a..a4a7006fb4d10 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java @@ -3,6 +3,9 @@ package com.azure.search.documents; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.util.BinaryData; +import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.models.RandomScoringFunction; import com.azure.search.documents.indexes.models.RandomScoringParameters; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; @@ -12,6 +15,7 @@ import com.azure.search.documents.models.GraphQueryExecutionMode; import com.azure.search.documents.models.GraphQueryExplainStage; import com.azure.search.documents.models.GraphQueryResult; +import com.azure.search.documents.models.GraphQueryError; import com.azure.search.documents.models.VectorizedQuery; import reactor.core.publisher.Mono; @@ -22,6 +26,30 @@ * Examples using existing indexes with the November 2026 preview API. */ public final class PreviewSearchSamples { + /** + * Reads optional service-supplied listing totals without enumerating every page. + * A missing count remains null; this API does not request counts through an undocumented query parameter. + * + * @param client the index management client. + */ + public void listIndexesWithMetadata(SearchIndexClient client) { + client.listIndexesWithMetadata(null).streamByPage().limit(1).forEach(page -> { + System.out.printf("Service-supplied total: %s%n", page.getCount()); + page.getValue().forEach(index -> System.out.println(index.getName())); + }); + } + + /** + * Parses typed graph diagnostics without replacing the client's existing exception handling. + * + * @param exception the exception returned by a graph request. + * @return the standard error and optional graph diagnostics. + */ + public Mono graphErrorDetails(HttpResponseException exception) { + return exception.getResponse().getBodyAsString() + .map(body -> BinaryData.fromString(body).toObject(GraphQueryError.class)); + } + /** * Plans a graph query without executing backend searches. * diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java index 313d2e7b5b91a..e569df58bfba1 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -5,14 +5,21 @@ import com.azure.core.credential.AzureKeyCredential; import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.HttpMethod; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.test.http.MockHttpResponse; import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.search.documents.indexes.models.IndexListingPagedResponse; +import com.azure.search.documents.indexes.models.IndexListingPagedIterable; +import com.azure.search.documents.indexes.models.IndexListingPagedFlux; +import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.RandomScoringFunction; import com.azure.search.documents.indexes.models.KnowledgeBaseMicrosoftRetriever1Model; import com.azure.search.documents.indexes.models.KnowledgeBaseModel; @@ -39,6 +46,7 @@ import com.azure.search.documents.models.GraphQueryExecutionMode; import com.azure.search.documents.models.GraphQueryExplainStage; import com.azure.search.documents.models.GraphQueryResult; +import com.azure.search.documents.models.GraphQueryError; import com.azure.search.documents.models.NoneVectorQueryTopicGraph; import com.azure.search.documents.models.SearchPagedResponse; import com.azure.search.documents.models.VectorQueryTopicGraph; @@ -48,12 +56,16 @@ import java.util.Collections; import java.util.Arrays; import java.util.Map; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; import java.nio.charset.StandardCharsets; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -97,6 +109,123 @@ public void existingListConveniencesUseRenamedProtocolOperations() { assertEquals(0, indexers.buildAsyncClient().listSkillsets().collectList().block().size()); } + @Test + public void metadataListingsRetainTotalsContinuationHttpMetadataAndContext() { + AtomicInteger requests = new AtomicInteger(); + SearchIndexClientBuilder builder = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .addPolicy((context, next) -> { + assertEquals("retained", context.getData("listing-context").orElse(null)); + return next.process(); + }) + .httpClient(request -> { + requests.incrementAndGet(); + String query = request.getUrl().getQuery(); + assertFalse(query.contains("$count")); + boolean last = query.contains("cursor=next"); + if (!last) { + assertTrue(query.contains("search=only")); + assertEquals("initial", request.getHeaders().getValue("X-Listing-Test")); + } + String nextLink = last + ? "" + : ",\"@odata.nextLink\":\"https://example.search.windows.net" + request.getUrl().getPath() + + "?api-version=2026-11-01-preview&cursor=next\""; + String body = "{\"@odata.count\":42,\"value\":[{\"name\":\"" + (last ? "second" : "first") + + "\",\"fields\":[],\"documentCount\":1,\"storageSize\":2,\"vectorIndexSize\":3}]" + nextLink + "}"; + return Mono.just(new MockHttpResponse(request, 200, + new HttpHeaders().set("X-Listing-Page", last ? "second" : "first"), + body.getBytes(StandardCharsets.UTF_8))); + }); + RequestOptions options = new RequestOptions().setContext(new Context("listing-context", "retained")) + .setHeader("X-Listing-Test", "initial") + .addQueryParam("search", "only"); + IndexListingPagedIterable indexes = builder.buildClient().listIndexesWithMetadata(options); + IndexListingPagedFlux asyncIndexes = builder.buildAsyncClient().listIndexesWithMetadata(options); + assertEquals(0, requests.get()); + assertMetadataPages(indexes.streamByPage().collect(Collectors.toList())); + assertMetadataPages(asyncIndexes.byPage().collectList().block()); + assertMetadataPages(builder.buildClient() + .listIndexStatsSummaryWithMetadata(options) + .streamByPage() + .collect(Collectors.toList())); + assertMetadataPages( + builder.buildAsyncClient().listIndexStatsSummaryWithMetadata(options).byPage().collectList().block()); + assertEquals(8, requests.get()); + assertEquals("second", + indexes + .iterableByPage( + "https://example.search.windows.net/indexes" + "?api-version=2026-11-01-preview&cursor=next") + .iterator() + .next() + .getValue() + .get(0) + .getName()); + } + + private static void assertMetadataPages(List> pages) { + assertNotNull(pages); + assertEquals(2, pages.size()); + for (IndexListingPagedResponse page : pages) { + assertEquals(42L, page.getCount()); + assertEquals(1, page.getValue().size()); + assertEquals(200, page.getStatusCode()); + assertNotNull(page.getRequest()); + } + assertEquals("first", pages.get(0).getHeaders().getValue("X-Listing-Page")); + assertNotNull(pages.get(0).getContinuationToken()); + assertEquals("second", pages.get(1).getHeaders().getValue("X-Listing-Page")); + assertNull(pages.get(1).getContinuationToken()); + } + + @Test + public void metadataCountsRemainNullableAndSupportLongTotals() { + for (String count : new String[] { null, "null", "0", "2147483648" }) { + Long expected = count == null || "null".equals(count) ? null : Long.valueOf(count); + String body = "{\"value\":[{\"name\":\"only\",\"fields\":[]," + + "\"documentCount\":1,\"storageSize\":2,\"vectorIndexSize\":3}]" + + (count == null ? "" : ",\"@odata.count\":" + count) + "}"; + SearchIndexClientBuilder builder = new SearchIndexClientBuilder() + .endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .httpClient( + request -> Mono.just(new MockHttpResponse(request, 200, body.getBytes(StandardCharsets.UTF_8)))); + assertEquals(expected, + builder.buildClient().listIndexesWithMetadata(null).iterableByPage().iterator().next().getCount()); + assertEquals(expected, + builder.buildAsyncClient().listIndexesWithMetadata(null).byPage().blockFirst().getCount()); + assertEquals(expected, + builder.buildClient() + .listIndexStatsSummaryWithMetadata(null) + .iterableByPage() + .iterator() + .next() + .getCount()); + assertEquals(expected, + builder.buildAsyncClient().listIndexStatsSummaryWithMetadata(null).byPage().blockFirst().getCount()); + assertEquals("only", builder.buildClient().listIndexes(null).iterator().next().getName()); + assertEquals("only", builder.buildAsyncClient().listIndexes(null).blockFirst().getName()); + assertEquals("only", builder.buildClient().listIndexStatsSummary(null).iterator().next().getName()); + assertEquals("only", builder.buildAsyncClient().listIndexStatsSummary(null).blockFirst().getName()); + } + } + + @Test + public void metadataListingsKeepServiceErrorMapping() { + SearchIndexClientBuilder builder = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .httpClient(request -> Mono.just(new MockHttpResponse(request, 404, + "{\"error\":{\"code\":\"NotFound\",\"message\":\"Missing\"}}".getBytes(StandardCharsets.UTF_8)))); + assertThrows(ResourceNotFoundException.class, + () -> builder.buildClient().listIndexesWithMetadata(null).iterator().next()); + assertThrows(ResourceNotFoundException.class, + () -> builder.buildAsyncClient().listIndexesWithMetadata(null).blockFirst()); + assertThrows(ResourceNotFoundException.class, + () -> builder.buildClient().listIndexStatsSummaryWithMetadata(null).iterator().next()); + assertThrows(ResourceNotFoundException.class, + () -> builder.buildAsyncClient().listIndexStatsSummaryWithMetadata(null).blockFirst()); + } + @Test public void fileOperationsPreserveGaParameterOrder() { SearchIndexClientBuilder builder = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") @@ -203,6 +332,43 @@ public void graphRejectionsPreserveResponseDiagnostics() { assertEquals(400, sync.getResponse().getStatusCode()); assertTrue(sync.getResponse().getBodyAsString().block().contains("UnknownVariable")); assertTrue(async.getResponse().getBodyAsString().block().contains("UnknownVariable")); + for (HttpResponseException exception : Arrays.asList(sync, async)) { + GraphQueryError details = BinaryData.fromString(exception.getResponse().getBodyAsString().block()) + .toObject(GraphQueryError.class); + assertEquals("InvalidRequestParameter", details.getError().getCode()); + assertEquals("UnknownVariable", details.getDiagnostics().get(0).getCode()); + assertNull(details.getStatistics()); + assertFalse(exception.getValue() instanceof GraphQueryError); + } + } + + @Test + public void graphErrorsPreserveOptionalGraphFieldsAndStandardErrorBodies() { + String body = "{\"error\":{\"code\":\"InvalidRequestParameter\",\"message\":\"Invalid graph query\"}," + + "\"@search.graphProvenanceDocuments\":{\"doc1\":{\"title\":\"Ada\"}}," + GRAPH_RESPONSE.substring(1); + GraphQueryError details = BinaryData.fromString(body).toObject(GraphQueryError.class); + assertEquals(1L, details.getCount()); + assertEquals("Ada", details.getValue().get(0).getAdditionalProperties().get("name")); + assertEquals(12L, details.getStatistics().getPlanningMs()); + assertEquals("PlanReady", details.getDiagnostics().get(0).getCode()); + assertTrue(details.getExplain().getAdditionalProperties().containsKey("logical")); + assertEquals("Ada", + details.getProvenanceDocuments() + .getAdditionalProperties() + .get("doc1") + .getAdditionalProperties() + .get("title")); + assertEquals(BinaryData.fromString(body).toObject(Map.class), + BinaryData.fromObject(details).toObject(Map.class)); + GraphQueryError minimal + = BinaryData.fromString("{\"error\":{\"code\":\"InvalidRequestParameter\",\"message\":\"Invalid\"}," + + "\"@search.graphDiagnostics\":null}").toObject(GraphQueryError.class); + assertEquals("Invalid", minimal.getError().getMessage()); + assertNull(minimal.getDiagnostics()); + assertNull(minimal.getValue()); + assertNull(minimal.getCount()); + assertNull(minimal.getProvenanceDocuments()); + assertNull(BinaryData.fromString("null").toObject(GraphQueryError.class)); } @Test From 5dc0cd29a35b93bc11b8ce7af22b4006ed1e8f47 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Wed, 11 Nov 2026 13:20:22 -0800 Subject: [PATCH 14/20] Fix Search listing metadata paging contract test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../search/documents/indexes/SearchListingTests.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java index 0f7101d81cd19..da1f3206261fa 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SearchListingTests.java @@ -14,6 +14,8 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.test.http.MockHttpResponse; import com.azure.core.util.BinaryData; +import com.azure.search.documents.indexes.models.IndexListingPagedFlux; +import com.azure.search.documents.indexes.models.IndexListingPagedIterable; import com.azure.search.documents.indexes.models.IndexStatisticsSummary; import com.azure.search.documents.indexes.models.KnowledgeBase; import com.azure.search.documents.indexes.models.KnowledgeSource; @@ -213,9 +215,13 @@ public void publicListingsHaveTypedSyncAndAsyncCounterparts() throws NoSuchMetho if (!Modifier.isPublic(method.getModifiers()) || !method.getName().startsWith("list")) { continue; } - assertEquals(PagedIterable.class, method.getReturnType()); + boolean metadataListing = method.getName().equals("listIndexesWithMetadata") + || method.getName().equals("listIndexStatsSummaryWithMetadata"); + assertEquals(metadataListing ? IndexListingPagedIterable.class : PagedIterable.class, + method.getReturnType(), method.toGenericString()); Method counterpart = asyncClient.getMethod(method.getName(), method.getParameterTypes()); - assertEquals(PagedFlux.class, counterpart.getReturnType()); + assertEquals(metadataListing ? IndexListingPagedFlux.class : PagedFlux.class, + counterpart.getReturnType(), counterpart.toGenericString()); ParameterizedType type = assertInstanceOf(ParameterizedType.class, method.getGenericReturnType()); assertFalse(Arrays.asList(type.getActualTypeArguments()).contains(BinaryData.class)); ParameterizedType asyncType From c5028b7901c88c7b43d7e1b7621f1f0352b27187 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:34:12 -0800 Subject: [PATCH 15/20] Fix file knowledge source preview sample argument order Correct update and delete calls, including cleanup. Exercise the actual sample against fake HTTP for successful execution and cleanup after an update failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 1 + .../KnowledgeSourceFilePreviewExample.java | 47 ++++++------ .../search/documents/PreviewApiTests.java | 74 +++++++++++++++++++ 3 files changed, 101 insertions(+), 21 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index f0978fa6e2d0d..90cd66613704e 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -30,6 +30,7 @@ - Fixed convenience search requests dropping preview query language, spelling, rewriting, hybrid, semantic field, and authorization options. - Carried forward SSE decoding, cancellation, backpressure, buffer ownership, and response-cleanup fixes. - Aligned file delete and update argument order with GA: knowledge source `name` precedes `fileId`. +- Corrected file update and delete argument order in the File knowledge source preview sample, including cleanup. ### Other Changes diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java index dfcb14471eece..76aa100c7ed13 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFilePreviewExample.java @@ -55,26 +55,31 @@ public static void main(String[] args) { String knowledgeSourceName = "file-ks-sample-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12); + AzureOpenAIVectorizerParameters vectorizerParameters + = new AzureOpenAIVectorizerParameters().setResourceUrl(openAiEndpoint) + .setDeploymentName(embeddingDeployment) + .setModelName(AzureOpenAIModelName.fromString(embeddingModel)); + if (userAssignedIdentity == null || userAssignedIdentity.isEmpty()) { + vectorizerParameters.setApiKey(openAiApiKey); + } else { + vectorizerParameters + .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(userAssignedIdentity)); + } + KnowledgeSourceIngestionParameters ingestionParameters = new KnowledgeSourceIngestionParameters() + .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL) + .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() + .setAzureOpenAIParameters(vectorizerParameters)); + FileKnowledgeSource knowledgeSource = new FileKnowledgeSource(knowledgeSourceName, + new FileKnowledgeSourceParameters().setIngestionParameters(ingestionParameters)); + runFileLifecycle(searchIndexClient, knowledgeSource); + } + + static void runFileLifecycle(SearchIndexClient searchIndexClient, FileKnowledgeSource knowledgeSource) { + String knowledgeSourceName = knowledgeSource.getName(); List uploadedFileIds = new ArrayList<>(); boolean knowledgeSourceCreated = false; try { - AzureOpenAIVectorizerParameters vectorizerParameters - = new AzureOpenAIVectorizerParameters().setResourceUrl(openAiEndpoint) - .setDeploymentName(embeddingDeployment) - .setModelName(AzureOpenAIModelName.fromString(embeddingModel)); - if (userAssignedIdentity == null || userAssignedIdentity.isEmpty()) { - vectorizerParameters.setApiKey(openAiApiKey); - } else { - vectorizerParameters - .setAuthIdentity(new SearchIndexerDataUserAssignedIdentity(userAssignedIdentity)); - } - KnowledgeSourceIngestionParameters ingestionParameters = new KnowledgeSourceIngestionParameters() - .setContentExtractionMode(KnowledgeSourceContentExtractionMode.MINIMAL) - .setEmbeddingModel(new KnowledgeSourceAzureOpenAIVectorizer() - .setAzureOpenAIParameters(vectorizerParameters)); - FileKnowledgeSource knowledgeSource = new FileKnowledgeSource(knowledgeSourceName, - new FileKnowledgeSourceParameters().setIngestionParameters(ingestionParameters)); searchIndexClient.createKnowledgeSource(knowledgeSource); knowledgeSourceCreated = true; @@ -105,8 +110,8 @@ public static void main(String[] args) { Map updatedMetadata = new LinkedHashMap<>(metadata); updatedMetadata.put("status", "reviewed"); - KnowledgeSourceFile updatedFile = searchIndexClient.updateKnowledgeSourceFile(firstFile.getFileId(), - knowledgeSourceName, + KnowledgeSourceFile updatedFile = searchIndexClient.updateKnowledgeSourceFile(knowledgeSourceName, + firstFile.getFileId(), new UpdateKnowledgeSourceFileRequest( new FileUploadMetadata().setFileName(firstFile.getFileName()).setMetadata(updatedMetadata), createFileContent("# August features\n\nUpdated and reviewed.", "features.md"))); @@ -115,20 +120,20 @@ public static void main(String[] args) { throw new IllegalStateException("The file wasn't updated in place."); } - searchIndexClient.deleteKnowledgeSourceFile(secondFile.getFileId(), knowledgeSourceName); + searchIndexClient.deleteKnowledgeSourceFile(knowledgeSourceName, secondFile.getFileId()); uploadedFileIds.remove(secondFile.getFileId()); long remainingFiles = searchIndexClient.listKnowledgeSourceFiles(knowledgeSourceName).stream().count(); if (remainingFiles != 1) { throw new IllegalStateException("Deleting one file should leave the other file intact."); } - searchIndexClient.deleteKnowledgeSourceFile(firstFile.getFileId(), knowledgeSourceName); + searchIndexClient.deleteKnowledgeSourceFile(knowledgeSourceName, firstFile.getFileId()); uploadedFileIds.remove(firstFile.getFileId()); if (searchIndexClient.listKnowledgeSourceFiles(knowledgeSourceName).stream().findAny().isPresent()) { throw new IllegalStateException("The File knowledge source should be empty after deleting its files."); } } finally { - uploadedFileIds.forEach(fileId -> searchIndexClient.deleteKnowledgeSourceFile(fileId, knowledgeSourceName)); + uploadedFileIds.forEach(fileId -> searchIndexClient.deleteKnowledgeSourceFile(knowledgeSourceName, fileId)); if (knowledgeSourceCreated) { searchIndexClient.deleteKnowledgeSource(knowledgeSourceName); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java index e569df58bfba1..e1e39dd1f164c 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -25,6 +25,8 @@ import com.azure.search.documents.indexes.models.KnowledgeBaseModel; import com.azure.search.documents.indexes.models.KnowledgeSourceFileIngestionOperation; import com.azure.search.documents.indexes.models.KnowledgeSourceFile; +import com.azure.search.documents.indexes.models.FileKnowledgeSource; +import com.azure.search.documents.indexes.models.FileKnowledgeSourceParameters; import com.azure.search.documents.indexes.models.FileUploadMetadata; import com.azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest; import com.azure.search.documents.indexes.models.RandomScoringParameters; @@ -34,6 +36,7 @@ import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint; import com.azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHintAutoConfiguration; import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexerClientBuilder; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; @@ -51,8 +54,11 @@ import com.azure.search.documents.models.SearchPagedResponse; import com.azure.search.documents.models.VectorQueryTopicGraph; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import reactor.core.publisher.Mono; +import java.util.ArrayList; import java.util.Collections; import java.util.Arrays; import java.util.Map; @@ -258,6 +264,74 @@ public void fileOperationsPreserveGaParameterOrder() { assertEquals("file", updated.getFileId()); } + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void fileLifecycleSamplePreservesRequestPathsIncludingCleanup(boolean failUpdate) { + String endpoint = "https://example.search.windows.net"; + String sourcePath = "/knowledgesources('my-source')"; + String metadata = "{\"team\":\"search\",\"release\":\"2026-08-01-preview\"}"; + String firstFile = sampleFile("file-123", "features.md", metadata); + String secondFile = sampleFile("file-456", "migration.md", "{\"type\":\"guide\"}"); + String updatedFile = sampleFile("file-123", "features.md", + "{\"team\":\"search\",\"release\":\"2026-08-01-preview\",\"status\":\"reviewed\"}"); + List pages = Arrays.asList( + "{\"value\":[" + firstFile + "],\"@odata.nextLink\":\"" + endpoint + sourcePath + + "/files?api-version=2026-11-01-preview&cursor=next\"}", + "{\"value\":[" + secondFile + "]}", "{\"value\":[" + firstFile + "]}", "{\"value\":[]}"); + FileKnowledgeSource source = new FileKnowledgeSource("my-source", new FileKnowledgeSourceParameters()); + List mutations = new ArrayList<>(); + AtomicInteger uploads = new AtomicInteger(); + AtomicInteger listings = new AtomicInteger(); + SearchIndexClient client = new SearchIndexClientBuilder().endpoint(endpoint) + .credential(new AzureKeyCredential("key")) + .httpClient(request -> { + HttpMethod method = request.getHttpMethod(); + String path = request.getUrl().getPath(); + int status; + String body; + if (method == HttpMethod.POST) { + status = 201; + body = "/knowledgesources".equals(path) + ? BinaryData.fromObject(source).toString() + : uploads.getAndIncrement() == 0 ? firstFile : secondFile; + } else if (method == HttpMethod.GET) { + status = 200; + body = pages.get(listings.getAndIncrement()); + } else if (method == HttpMethod.PUT) { + mutations.add(method + " " + path); + status = failUpdate ? 400 : 200; + body = failUpdate + ? "{\"error\":{\"code\":\"BadRequest\",\"message\":\"Simulated update failure\"}}" + : updatedFile; + } else { + assertEquals(HttpMethod.DELETE, method); + mutations.add(method + " " + path); + status = 204; + body = ""; + } + return Mono.just(new MockHttpResponse(request, status, body.getBytes(StandardCharsets.UTF_8))); + }) + .buildClient(); + + if (failUpdate) { + HttpResponseException error = assertThrows(HttpResponseException.class, + () -> KnowledgeSourceFilePreviewExample.runFileLifecycle(client, source)); + assertEquals(400, error.getResponse().getStatusCode()); + } else { + KnowledgeSourceFilePreviewExample.runFileLifecycle(client, source); + } + assertEquals(Arrays.asList("PUT " + sourcePath + "/files('file-123')", + "DELETE " + sourcePath + "/files('" + (failUpdate ? "file-123" : "file-456") + "')", + "DELETE " + sourcePath + "/files('" + (failUpdate ? "file-456" : "file-123") + "')", + "DELETE " + sourcePath), mutations); + } + + private static String sampleFile(String fileId, String fileName, String metadata) { + return "{\"fileId\":\"" + fileId + "\",\"fileName\":\"release-notes/august/" + fileName + + "\",\"prefix\":\"release-notes/august/\",\"parsingMode\":\"markdown\",\"extractionMode\":\"minimal\"," + + "\"metadata\":" + metadata + "}"; + } + @Test public void gaSqlDocumentUrlGetterPreservesWireMapping() { KnowledgeBaseIndexedSqlReference reference = BinaryData From 90658d2fae68bcd4c1c7693e7232ffb66ad930c9 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:49:21 -0800 Subject: [PATCH 16/20] Make preview retrieval response sample non-destructive Use an existing knowledge base configured by KNOWLEDGE_BASE_NAME instead of upserting and deleting a fixed-name resource. Add offline sample tests for successful and failed retrieval with no resource mutations, and document the required configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 1 + .../src/samples/README.md | 5 +- ...wledgeRetrievalPreviewResponseExample.java | 112 ++++++++---------- .../search/documents/PreviewApiTests.java | 31 +++++ 4 files changed, 83 insertions(+), 66 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 90cd66613704e..b4e9abf671a4a 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -31,6 +31,7 @@ - Carried forward SSE decoding, cancellation, backpressure, buffer ownership, and response-cleanup fixes. - Aligned file delete and update argument order with GA: knowledge source `name` precedes `fileId`. - Corrected file update and delete argument order in the File knowledge source preview sample, including cleanup. +- Updated the preview retrieval response parsing sample to use an existing knowledge base without modifying or deleting resources. ### Other Changes diff --git a/sdk/search/azure-search-documents/src/samples/README.md b/sdk/search/azure-search-documents/src/samples/README.md index fd2240effcc03..eff51cbdfebf0 100644 --- a/sdk/search/azure-search-documents/src/samples/README.md +++ b/sdk/search/azure-search-documents/src/samples/README.md @@ -112,6 +112,10 @@ The following sections provide several code snippets covering some of the most c - [Fabric Ontology Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricOntologyPreviewExample.java) - [Fabric Data Agent Knowledge Source (preview)](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeSourceFabricDataAgentPreviewExample.java) +The preview retrieval response parsing sample uses an existing knowledge base configured through +`SEARCH_ENDPOINT`, `SEARCH_API_KEY`, and `KNOWLEDGE_BASE_NAME`. The knowledge base must have a model configured +for answer synthesis. This sample does not create, update, or delete knowledge bases or knowledge sources. + ## Troubleshooting Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. @@ -130,4 +134,3 @@ This project welcomes contributions and suggestions. Find [more contributing][SD [SDK_README_DEPENDENCY]: ../../README.md#adding-the-package-to-your-product [azsearch_docs]: https://learn.microsoft.com/azure/search - diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java index 4dbf152506355..2cd61b49b435b 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/KnowledgeRetrievalPreviewResponseExample.java @@ -4,10 +4,6 @@ package com.azure.search.documents; import com.azure.core.credential.AzureKeyCredential; -import com.azure.search.documents.indexes.SearchIndexClient; -import com.azure.search.documents.indexes.SearchIndexClientBuilder; -import com.azure.search.documents.indexes.models.KnowledgeBase; -import com.azure.search.documents.indexes.models.KnowledgeSourceReference; import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord; @@ -22,85 +18,71 @@ import com.azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent; import com.azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo; +/** + * Demonstrates preview retrieval response parsing against an existing knowledge base without modifying resources. + * + *

    Set {@code SEARCH_ENDPOINT}, {@code SEARCH_API_KEY}, and {@code KNOWLEDGE_BASE_NAME} before running this sample. + * The existing knowledge base must have a model configured for answer synthesis.

    + */ public class KnowledgeRetrievalPreviewResponseExample { private static final String ENDPOINT = System.getenv("SEARCH_ENDPOINT"); private static final String API_KEY = System.getenv("SEARCH_API_KEY"); - private static final String KB_NAME = "my-knowledge-base"; + private static final String KB_NAME = System.getenv("KNOWLEDGE_BASE_NAME"); public static void main(String[] args) { - SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() + KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() .credential(new AzureKeyCredential(API_KEY)) .endpoint(ENDPOINT) + .knowledgeBaseName(KB_NAME) .buildClient(); - try { - KnowledgeSourceReference knowledgeSource = new KnowledgeSourceReference("my-knowledge-source") - .setEnableImageServing(true) - .setEnableFreshness(true); - - KnowledgeBase knowledgeBase = new KnowledgeBase(KB_NAME, knowledgeSource); - searchIndexClient.createOrUpdateKnowledgeBase(knowledgeBase); - - //build retrieval client - KnowledgeBaseRetrievalClient retrievalClient = new KnowledgeBaseRetrievalClientBuilder() - .credential(new AzureKeyCredential(API_KEY)) - .endpoint(ENDPOINT) - .knowledgeBaseName(KB_NAME) - .buildClient(); - - //build retrieval request with preview options - KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() - .setMaxOutputDocuments(5) - .setIncludeActivity(true) - .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS) - .setIntents(new KnowledgeRetrievalSemanticIntent("What hotels have free wifi?")); - - //send request - KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); - - //parse result + retrieveAndInspect(retrievalClient); + } - for (KnowledgeBaseMessage message : result.getResponse()) { - System.out.println("Message role: " + message.getRole()); - for (KnowledgeBaseMessageContent content : message.getContent()) { - if (content instanceof KnowledgeBaseMessageTextContent) { - System.out.println("Text content: " + ((KnowledgeBaseMessageTextContent) content).getText()); - } - } - } + static void retrieveAndInspect(KnowledgeBaseRetrievalClient retrievalClient) { + KnowledgeBaseRetrievalOptions options = new KnowledgeBaseRetrievalOptions() + .setMaxOutputDocuments(5) + .setIncludeActivity(true) + .setOutputMode(KnowledgeRetrievalOutputMode.ANSWER_SYNTHESIS) + .setIntents(new KnowledgeRetrievalSemanticIntent("What hotels have free wifi?")); + KnowledgeBaseRetrievalResult result = retrievalClient.retrieve(options); - for (KnowledgeBaseActivityRecord record : result.getActivity()) { - System.out.println("Activity [" + record.getType() + "] id=" + record.getId() - + " elapsed=" + record.getElapsedMs() + "ms"); - if (record instanceof KnowledgeBaseModelAnswerSynthesisActivityRecord) { - KnowledgeBaseModelAnswerSynthesisActivityRecord synthesis = - (KnowledgeBaseModelAnswerSynthesisActivityRecord) record; - if (synthesis.getModel() != null) { - System.out.println(" Model: " + synthesis.getModel().getModelName()); - } - System.out.println(" Input tokens: " + synthesis.getInputTokens()); - System.out.println(" Output tokens: " + synthesis.getOutputTokens()); + for (KnowledgeBaseMessage message : result.getResponse()) { + System.out.println("Message role: " + message.getRole()); + for (KnowledgeBaseMessageContent content : message.getContent()) { + if (content instanceof KnowledgeBaseMessageTextContent) { + System.out.println("Text content: " + ((KnowledgeBaseMessageTextContent) content).getText()); } } + } - for (KnowledgeBaseReference ref : result.getReferences()) { - System.out.println("Reference id=" + ref.getId() + " type=" + ref.getType() - + " rerankerScore=" + ref.getRerankerScore()); - if (ref.getSourceData() != null) { - System.out.println(" Source data: " + ref.getSourceData().toString()); + for (KnowledgeBaseActivityRecord record : result.getActivity()) { + System.out.println("Activity [" + record.getType() + "] id=" + record.getId() + + " elapsed=" + record.getElapsedMs() + "ms"); + if (record instanceof KnowledgeBaseModelAnswerSynthesisActivityRecord) { + KnowledgeBaseModelAnswerSynthesisActivityRecord synthesis = + (KnowledgeBaseModelAnswerSynthesisActivityRecord) record; + if (synthesis.getModel() != null) { + System.out.println(" Model: " + synthesis.getModel().getModelName()); } + System.out.println(" Input tokens: " + synthesis.getInputTokens()); + System.out.println(" Output tokens: " + synthesis.getOutputTokens()); } + } - PurviewSensitivityLabelInfo labelInfo = result.getResponseSensitivityLabelInfo(); - if (labelInfo != null) { - System.out.println("Sensitivity Label " + labelInfo.getDisplayName()); - System.out.println(" Label ID: " + labelInfo.getSensitivityLabelId()); - System.out.println(" Priority: " + labelInfo.getPriority()); - System.out.println(" Color: " + labelInfo.getColor()); + for (KnowledgeBaseReference ref : result.getReferences()) { + System.out.println("Reference id=" + ref.getId() + " type=" + ref.getType() + + " rerankerScore=" + ref.getRerankerScore()); + if (ref.getSourceData() != null) { + System.out.println(" Source data: " + ref.getSourceData().toString()); } + } - } finally { - searchIndexClient.deleteKnowledgeBase(KB_NAME); + PurviewSensitivityLabelInfo labelInfo = result.getResponseSensitivityLabelInfo(); + if (labelInfo != null) { + System.out.println("Sensitivity Label " + labelInfo.getDisplayName()); + System.out.println(" Label ID: " + labelInfo.getSensitivityLabelId()); + System.out.println(" Priority: " + labelInfo.getPriority()); + System.out.println(" Color: " + labelInfo.getColor()); } } - } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java index e1e39dd1f164c..52c9921a225ad 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -38,6 +38,8 @@ import com.azure.search.documents.indexes.SearchIndexClientBuilder; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.SearchIndexerClientBuilder; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient; +import com.azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClientBuilder; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseGraphSearchActivityRecord; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference; @@ -326,6 +328,35 @@ public void fileLifecycleSamplePreservesRequestPathsIncludingCleanup(boolean fai "DELETE " + sourcePath), mutations); } + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void previewResponseSampleDoesNotModifyResourcesEvenWhenRetrievalFails(boolean failRetrieval) { + AtomicInteger requests = new AtomicInteger(); + KnowledgeBaseRetrievalClient client + = new KnowledgeBaseRetrievalClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .knowledgeBaseName("existing-kb") + .httpClient(request -> { + requests.incrementAndGet(); + assertEquals(HttpMethod.POST, request.getHttpMethod()); + assertEquals("/knowledgebases('existing-kb')/retrieve", request.getUrl().getPath()); + String body = failRetrieval + ? "{\"error\":{\"code\":\"BadRequest\",\"message\":\"Simulated retrieval failure\"}}" + : "{\"response\":[],\"activity\":[],\"references\":[]}"; + return Mono.just(new MockHttpResponse(request, failRetrieval ? 400 : 200, + body.getBytes(StandardCharsets.UTF_8))); + }) + .buildClient(); + if (failRetrieval) { + HttpResponseException error = assertThrows(HttpResponseException.class, + () -> KnowledgeRetrievalPreviewResponseExample.retrieveAndInspect(client)); + assertEquals(400, error.getResponse().getStatusCode()); + } else { + KnowledgeRetrievalPreviewResponseExample.retrieveAndInspect(client); + } + assertEquals(1, requests.get(), "The sample must only retrieve, without resource creation or cleanup."); + } + private static String sampleFile(String fileId, String fileName, String metadata) { return "{\"fileId\":\"" + fileId + "\",\"fileName\":\"release-notes/august/" + fileName + "\",\"prefix\":\"release-notes/august/\",\"parsingMode\":\"markdown\",\"extractionMode\":\"minimal\"," From f80cd6d574c91eece89ce874e9e48a1f210bcd62 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Wed, 11 Nov 2026 15:17:57 -0800 Subject: [PATCH 17/20] Preserve HTTP errors while polling preview file ingestion Validate polling responses after the original client pipeline has applied its policies. Buffer failed response bodies before closing transport responses, preserving status, headers, and error details without replacing azure-core pollers. Wire only preview file ingestion through a regeneration-safe customization and regenerate locally. Add sync/async error, empty-body, response-cleanup, retry, authentication, and context regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 1 + .../src/main/java/SearchCustomizations.java | 11 ++ .../FileIngestionPollingHttpClient.java | 80 +++++++++++++ .../implementation/SearchIndexClientImpl.java | 16 +-- .../documents/FileIngestionPollingTests.java | 105 ++++++++++++++++++ 5 files changed, 205 insertions(+), 8 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FileIngestionPollingHttpClient.java diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index b4e9abf671a4a..315a403982d39 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -32,6 +32,7 @@ - Aligned file delete and update argument order with GA: knowledge source `name` precedes `fileId`. - Corrected file update and delete argument order in the File knowledge source preview sample, including cleanup. - Updated the preview retrieval response parsing sample to use an existing knowledge base without modifying or deleting resources. +- Preserved HTTP status, headers, and error bodies when polling preview file ingestion operations fails, instead of throwing an unrelated exception. ### Other Changes diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index c908cb3e8f97c..59f831e38fbe1 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -134,6 +134,8 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) } addListingMetadataRetrieval(libraryCustomization.getPackage("com.azure.search.documents.implementation") .getClass("SearchIndexClientImpl")); + addFileIngestionPollingErrorHandling(libraryCustomization.getPackage("com.azure.search.documents.implementation") + .getClass("SearchIndexClientImpl")); libraryCustomization.getPackage(KNOWLEDGE_MODELS_PACKAGE) .getClass("KnowledgeBaseIndexedSqlReference") .customizeAst(ast -> ast.getClassByName("KnowledgeBaseIndexedSqlReference").ifPresent(clazz -> { @@ -154,6 +156,15 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) .getClass("SearchResourceEncryptionKey")); } + private static void addFileIngestionPollingErrorHandling(ClassCustomization customization) { + customization.customizeAst(ast -> ast.findAll(MethodDeclaration.class).stream() + .filter(method -> method.getNameAsString().startsWith("beginIngestKnowledgeSourceFile")) + .forEach(method -> method.findAll(com.github.javaparser.ast.expr.ObjectCreationExpr.class).stream() + .filter(expression -> expression.getType().getNameAsString().equals("PollingStrategyOptions")) + .forEach(expression -> expression.setArgument(0, StaticJavaParser.parseExpression( + "FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())"))))); + } + private static void addListingMetadataRetrieval(ClassCustomization customization) { customization.customizeAst(ast -> { ast.addImport("com.azure.search.documents.indexes.models.IndexListingPagedResponse"); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FileIngestionPollingHttpClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FileIngestionPollingHttpClient.java new file mode 100644 index 0000000000000..cfb88c821ed24 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/FileIngestionPollingHttpClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.search.documents.implementation; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import reactor.core.publisher.Mono; + +/** + * Preserves HTTP polling failures before the operation status is deserialized. + */ +public final class FileIngestionPollingHttpClient implements HttpClient { + private static final ClientLogger LOGGER = new ClientLogger(FileIngestionPollingHttpClient.class); + + private final HttpPipeline pipeline; + + private FileIngestionPollingHttpClient(HttpPipeline pipeline) { + this.pipeline = pipeline; + } + + /** + * Creates a polling pipeline that validates responses after the original pipeline has applied all its policies. + * + * @param pipeline the original client pipeline. + * @return the polling pipeline. + */ + public static HttpPipeline createPipeline(HttpPipeline pipeline) { + return new HttpPipelineBuilder().httpClient(new FileIngestionPollingHttpClient(pipeline)) + .tracer(pipeline.getTracer()) + .build(); + } + + @Override + public Mono send(HttpRequest request) { + return send(request, Context.NONE); + } + + @Override + public Mono send(HttpRequest request, Context context) { + return pipeline.send(request, context).flatMap(response -> { + if (isSuccessful(response)) { + return Mono.just(response); + } + return Mono.using(() -> response, errorResponse -> { + HttpResponse bufferedResponse = errorResponse.buffer(); + return bufferedResponse.getBodyAsByteArray() + .then(Mono.error(LOGGER.logExceptionAsError(pollingError(bufferedResponse)))); + }, HttpResponse::close); + }); + } + + @Override + public HttpResponse sendSync(HttpRequest request, Context context) { + HttpResponse response = pipeline.sendSync(request, context); + if (isSuccessful(response)) { + return response; + } + try (HttpResponse errorResponse = response) { + HttpResponse bufferedResponse = errorResponse.buffer(); + bufferedResponse.getBodyAsBinaryData().toBytes(); + throw LOGGER.logExceptionAsError(pollingError(bufferedResponse)); + } + } + + private static boolean isSuccessful(HttpResponse response) { + return response.getStatusCode() >= 200 && response.getStatusCode() < 300; + } + + private static HttpResponseException pollingError(HttpResponse response) { + return new HttpResponseException( + "File ingestion polling failed with HTTP status " + response.getStatusCode() + ".", response); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java index b825995b452d1..0f526ef77d0ea 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java @@ -9686,7 +9686,7 @@ private Response ingestKnowledgeSourceFileMultipartWithResponse(Stri return PollerFlux.create(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileMultipartWithResponseAsync(name, body, requestOptions), new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -9746,7 +9746,7 @@ private Response ingestKnowledgeSourceFileMultipartWithResponse(Stri return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileMultipartWithResponse(name, body, requestOptions), new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -9806,7 +9806,7 @@ public PollerFlux beginIngestKnowledgeSourceFileMultipar return PollerFlux.create(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileMultipartWithResponseAsync(name, body, requestOptions), new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -9865,7 +9865,7 @@ public SyncPoller beginIngestKnowledgeSourceFileMultipar return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileMultipartWithResponse(name, body, requestOptions), new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -10378,7 +10378,7 @@ private Response ingestKnowledgeSourceFileReplacementWithResponse(St return PollerFlux.create(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileReplacementWithResponseAsync(name, fileId, body, requestOptions), new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -10440,7 +10440,7 @@ private Response ingestKnowledgeSourceFileReplacementWithResponse(St return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileReplacementWithResponse(name, fileId, body, requestOptions), new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -10501,7 +10501,7 @@ public PollerFlux beginIngestKnowledgeSourceFileReplacem return PollerFlux.create(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileReplacementWithResponseAsync(name, fileId, body, requestOptions), new com.azure.search.documents.implementation.OperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() @@ -10561,7 +10561,7 @@ public SyncPoller beginIngestKnowledgeSourceFileReplacem return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.ingestKnowledgeSourceFileReplacementWithResponse(name, fileId, body, requestOptions), new com.azure.search.documents.implementation.SyncOperationLocationPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) + new PollingStrategyOptions(FileIngestionPollingHttpClient.createPipeline(this.getHttpPipeline())) .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java index a4a6c19c448d9..27cef184470c8 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/FileIngestionPollingTests.java @@ -11,6 +11,9 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpMethod; import com.azure.core.http.HttpRequest; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.FixedDelayOptions; import com.azure.core.test.http.MockHttpResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.polling.AsyncPollResponse; @@ -27,6 +30,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.params.provider.CsvSource; import reactor.core.publisher.Mono; import java.nio.charset.StandardCharsets; @@ -140,6 +144,107 @@ public void rejectedUploadRoutesHttpErrorWithoutPolling(boolean async) { assertEquals(1, requests.get()); } + @ParameterizedTest + @CsvSource({ + "false, false, 403, false", + "true, true, 403, false", + "false, true, 404, false", + "true, false, 404, false", + "false, false, 500, false", + "true, true, 500, false", + "false, true, 404, true", + "true, false, 404, true" }) + public void pollingHttpErrorsPreserveResponseAndCloseTransport(boolean async, boolean replacement, int status, + boolean emptyBody) { + AtomicInteger polls = new AtomicInteger(); + AtomicInteger closed = new AtomicInteger(); + String errorBody + = emptyBody ? "" : "{\"error\":{\"code\":\"PollingFailed\",\"message\":\"Cannot read operation\"}}"; + HttpClient activation = ingestionTransport(replacement, false, new AtomicInteger()); + SearchIndexClientBuilder clientBuilder = builder(request -> { + assertEquals("offline-test-key", request.getHeaders().getValue(HttpHeaderName.fromString("api-key"))); + if (request.getHttpMethod() == HttpMethod.POST) { + return activation.send(request); + } + assertEquals(HttpMethod.GET, request.getHttpMethod()); + assertEquals(OPERATION_URL, request.getUrl().toString()); + return Mono.deferContextual(context -> { + if (async) { + assertEquals("preserved", context.get("poll-test")); + } + polls.incrementAndGet(); + return Mono.just(new MockHttpResponse(request, status, + new HttpHeaders().set(HttpHeaderName.RETRY_AFTER, "0") + .set(HttpHeaderName.fromString("x-ms-request-id"), "poll-error-id"), + errorBody.getBytes(StandardCharsets.UTF_8)) { + @Override + public void close() { + closed.incrementAndGet(); + } + }); + }); + }).retryPolicy(new RetryPolicy(new RetryOptions(new FixedDelayOptions(1, Duration.ZERO)))); + HttpResponseException error = assertThrows(HttpResponseException.class, () -> { + if (async) { + (replacement + ? clientBuilder.buildAsyncClient() + .beginIngestKnowledgeSourceFileReplacement("files", "file-1", replacement()) + : clientBuilder.buildAsyncClient().beginIngestKnowledgeSourceFileMultipart("files", upload())) + .setPollInterval(POLL_INTERVAL) + .last() + .contextWrite(context -> context.put("poll-test", "preserved")) + .block(TIMEOUT); + } else { + (replacement + ? clientBuilder.buildClient() + .beginIngestKnowledgeSourceFileReplacement("files", "file-1", replacement()) + : clientBuilder.buildClient().beginIngestKnowledgeSourceFileMultipart("files", upload())) + .setPollInterval(POLL_INTERVAL) + .waitForCompletion(TIMEOUT); + } + }); + assertEquals(status, error.getResponse().getStatusCode()); + assertEquals("poll-error-id", + error.getResponse().getHeaders().getValue(HttpHeaderName.fromString("x-ms-request-id"))); + assertEquals(errorBody, error.getResponse().getBodyAsString().block(TIMEOUT)); + assertEquals(errorBody, error.getResponse().getBodyAsString().block(TIMEOUT)); + assertEquals(status == 500 ? 2 : 1, polls.get(), "The original retry policy must run before error mapping."); + assertEquals(polls.get(), closed.get(), "Every failed polling response must be closed."); + } + + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void transientPollingHttpErrorCanRecoverThroughExistingRetryPolicy(boolean async) { + AtomicInteger polls = new AtomicInteger(); + HttpClient activation = ingestionTransport(false, false, new AtomicInteger()); + SearchIndexClientBuilder clientBuilder = builder(request -> { + assertEquals("offline-test-key", request.getHeaders().getValue(HttpHeaderName.fromString("api-key"))); + if (request.getHttpMethod() == HttpMethod.POST) { + return activation.send(request); + } + assertEquals(OPERATION_URL, request.getUrl().toString()); + int poll = polls.incrementAndGet(); + return Mono.just(response(request, poll == 1 ? 503 : 200, + poll == 1 + ? "{\"error\":{\"code\":\"Unavailable\",\"message\":\"Retry\"}}" + : operation("op-1", "succeeded", false))); + }).retryPolicy(new RetryPolicy(new RetryOptions(new FixedDelayOptions(1, Duration.ZERO)))); + KnowledgeSourceFile file = async + ? clientBuilder.buildAsyncClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .setPollInterval(POLL_INTERVAL) + .last() + .flatMap(AsyncPollResponse::getFinalResult) + .block(TIMEOUT) + : clientBuilder.buildClient() + .beginIngestKnowledgeSourceFileMultipart("files", upload()) + .setPollInterval(POLL_INTERVAL) + .getFinalResult(); + assertNotNull(file); + assertEquals("file-1", file.getFileId()); + assertEquals(2, polls.get(), "The service error should be retried before the poller sees the response."); + } + @Test public void operationGetAndSyncAsyncListsPreserveErrorsResultsAndContinuation() { AtomicInteger firstPages = new AtomicInteger(); From 2608cd7af2f6e73bddae5b30bb2450ff1899ac8f Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:09:04 -0800 Subject: [PATCH 18/20] Address Search preview review feedback Restore sample coverage and the explicit customization constructor, simplify stream model replacement without changing generated APIs, and move the task-specific coverage ledger out of the package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 1 + .../src/main/java/SearchCustomizations.java | 65 ++++------- .../preview-feature-coverage.md | 101 ------------------ .../IndexAndServiceStatisticsExample.java | 16 +++ .../indexes/CreateSkillsetExample.java | 61 +++++++++++ .../azure-search-documents/src/test/README.md | 5 +- .../documents/SearchGaSamplesTests.java | 68 ++++++++++++ 7 files changed, 171 insertions(+), 146 deletions(-) delete mode 100644 sdk/search/azure-search-documents/preview-feature-coverage.md diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 315a403982d39..c9fd57072f27d 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -36,6 +36,7 @@ ### Other Changes +- Restored the opt-in Content Understanding skillset sample and index statistics pagination and indexer-runtime examples. - Deprecated `BasicField.isSensitivityLabel()`, which has no effect when building search fields. Use `isSensitivityLabelId()` for sensitivity label ID filtering or `isSensitivityLabelName()` for sensitivity label names. The legacy member and its default remain unchanged for compatibility. #### Dependency Updates diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index 59f831e38fbe1..0abe28c7d53c0 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -25,6 +25,12 @@ * Contains customizations for Azure AI Search code generation. */ public class SearchCustomizations extends Customization { + /** + * Creates the Azure AI Search code generation customizations. + */ + public SearchCustomizations() { + } + @Override public void customize(LibraryCustomization libraryCustomization, Logger logger) { PackageCustomization documents = libraryCustomization.getPackage("com.azure.search.documents"); @@ -468,65 +474,34 @@ private static void customizeKnowledgeBaseRetrievalStream(LibraryCustomization l } private static void addStreamModels(LibraryCustomization customization) { - customization.getRawEditor().addFile(MODELS_PATH + "KnowledgeBaseRetrievalStreamEvent.java", baseEventSource()); + customization.getRawEditor().replaceFile(MODELS_PATH + "KnowledgeBaseRetrievalStreamEvent.java", baseEventSource()); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseRetrievalStartedStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseRetrievalStartedStreamEvent.java", wrapperSource("KnowledgeBaseRetrievalStartedStreamEvent", "KnowledgeBaseRetrievalStartedEvent", "retrieval.started", false, false)); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseActivityStartedStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseActivityStartedStreamEvent.java", wrapperSource("KnowledgeBaseActivityStartedStreamEvent", "KnowledgeBaseActivityStartedEvent", "activity.started", false, false)); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseActivityCompletedStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseActivityCompletedStreamEvent.java", wrapperSource("KnowledgeBaseActivityCompletedStreamEvent", "KnowledgeBaseActivityRecord", "activity.completed", false, false)); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseAnswerCompletedStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseAnswerCompletedStreamEvent.java", wrapperSource("KnowledgeBaseAnswerCompletedStreamEvent", "KnowledgeBaseAnswerCompletedEvent", "answer.completed", false, false)); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseReferencesCompletedStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseReferencesCompletedStreamEvent.java", wrapperSource("KnowledgeBaseReferencesCompletedStreamEvent", "KnowledgeBaseReference", "references.completed", false, true)); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseErrorStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseErrorStreamEvent.java", wrapperSource("KnowledgeBaseErrorStreamEvent", "KnowledgeBaseStreamErrorEvent", "error", true, false)); customization.getRawEditor() - .addFile(MODELS_PATH + "KnowledgeBaseResponseCompletedStreamEvent.java", + .replaceFile(MODELS_PATH + "KnowledgeBaseResponseCompletedStreamEvent.java", wrapperSource("KnowledgeBaseResponseCompletedStreamEvent", "KnowledgeBaseResponseCompletedEvent", "response.completed", true, false)); - replaceStreamModel(customization, "KnowledgeBaseRetrievalStreamEvent", baseEventSource()); - replaceStreamModel(customization, "KnowledgeBaseRetrievalStartedStreamEvent", - wrapperSource("KnowledgeBaseRetrievalStartedStreamEvent", "KnowledgeBaseRetrievalStartedEvent", - "retrieval.started", false, false)); - replaceStreamModel(customization, "KnowledgeBaseActivityStartedStreamEvent", - wrapperSource("KnowledgeBaseActivityStartedStreamEvent", "KnowledgeBaseActivityStartedEvent", - "activity.started", false, false)); - replaceStreamModel(customization, "KnowledgeBaseActivityCompletedStreamEvent", - wrapperSource("KnowledgeBaseActivityCompletedStreamEvent", "KnowledgeBaseActivityRecord", - "activity.completed", false, false)); - replaceStreamModel(customization, "KnowledgeBaseAnswerCompletedStreamEvent", - wrapperSource("KnowledgeBaseAnswerCompletedStreamEvent", "KnowledgeBaseAnswerCompletedEvent", - "answer.completed", false, false)); - replaceStreamModel(customization, "KnowledgeBaseReferencesCompletedStreamEvent", - wrapperSource("KnowledgeBaseReferencesCompletedStreamEvent", "KnowledgeBaseReference", - "references.completed", false, true)); - replaceStreamModel(customization, "KnowledgeBaseErrorStreamEvent", - wrapperSource("KnowledgeBaseErrorStreamEvent", "KnowledgeBaseStreamErrorEvent", "error", true, false)); - replaceStreamModel(customization, "KnowledgeBaseResponseCompletedStreamEvent", - wrapperSource("KnowledgeBaseResponseCompletedStreamEvent", "KnowledgeBaseResponseCompletedEvent", - "response.completed", true, false)); - } - - private static void replaceStreamModel(LibraryCustomization customization, String className, String source) { - customization.getPackage("com.azure.search.documents.knowledgebases.models") - .getClass(className) - .customizeAst(ast -> { - com.github.javaparser.ast.CompilationUnit replacement = StaticJavaParser.parse(source); - ast.setImports(replacement.getImports()); - ast.setTypes(replacement.getTypes()); - }); } private static void customizeKnowledgeSourceStatusDurationParsing(ClassCustomization customization) { @@ -949,7 +924,7 @@ private static void addTypedListingMethod(ClassCustomization customization, Stri } private static String baseEventSource() { - return header("com.azure.search.documents.knowledgebases.models") + return header("com.azure.search.documents.knowledgebases.models", true) + "import com.azure.core.annotation.Generated;\n" + "import com.azure.search.documents.knowledgebases.implementation." + "KnowledgeBaseRetrievalStreamEventConverter;\n" + "import java.util.List;\n\n" + "/**\n" @@ -1019,7 +994,7 @@ private static String wrapperSource(String className, String payloadType, String + " return true;\n" + " }\n" : ""; - return header("com.azure.search.documents.knowledgebases.models") + return header("com.azure.search.documents.knowledgebases.models", true) + "import com.azure.core.annotation.Generated;\n" + "import com.azure.core.annotation.Immutable;\n" + listImports + "\n" + "/**\n" + " * Represents the {@code " + eventName + "} knowledge base retrieval stream event.\n" + " * Access the typed payload with {@link #getValue()}.\n" @@ -1035,8 +1010,14 @@ private static String wrapperSource(String className, String payloadType, String private static String header(String packageName) { + return header(packageName, false); + } + + private static String header(String packageName, boolean generated) { return "// Copyright (c) Microsoft Corporation. All rights reserved.\n" - + "// Licensed under the MIT License.\n\n" + "package " + packageName + ";\n\n"; + + "// Licensed under the MIT License.\n" + + (generated ? "// Code generated by Microsoft (R) TypeSpec Code Generator.\n" : "\n") + + "package " + packageName + ";\n\n"; } diff --git a/sdk/search/azure-search-documents/preview-feature-coverage.md b/sdk/search/azure-search-documents/preview-feature-coverage.md deleted file mode 100644 index d745043ddc274..0000000000000 --- a/sdk/search/azure-search-documents/preview-feature-coverage.md +++ /dev/null @@ -1,101 +0,0 @@ -# November preview / 26.12 deployment feature coverage - -The contract baseline is -[Azure/azure-rest-api-specs#47300](https://github.com/Azure/azure-rest-api-specs/pull/47300), -commit `b41ba04c0219f6622b7f5214fc020f90bad339ae`, matching `tsp-location.yaml`. -Deployment work items and one-pagers are feature inventories, not substitutes for the pinned wire contract. - -## Coverage matrix - -Existing tests are not evidence that all deployed features have passed live validation. -The offline checks exercise Java request/response handling with fake HTTP responses. -The 14 supplemental live-test methods were removed because they had not been exercised against a real service. -Their removal does not close the service-validation gaps below. - -| Feature | Retained SDK coverage | Remaining service validation | -| --- | --- | --- | -| GraphRAG Zero L1 / Topic Graph | `PreviewApiTests` round trips discriminators; `FieldBuilderTests` covers `topicGraphProfile`; `PreviewFeatureContractTests` checks query modes, allowed fields and stored KS defaults | Controlled-corpus diversity/interleaving, index/KS configuration and rejection of invalid mode-specific fields | -| EKG KS ingestion, ontology, cache and status | `PreviewFeatureContractTests` checks graph extraction/cache requests and ontology/triple statistics in status responses | Real extraction, cache reuse/reprocessing, grounding, secret omission on GET, ontology lifecycle and failure recovery | -| EKG retrieval | `PreviewApiTests` checks graph headers/options, diagnostics and rejection bodies; `PreviewFeatureContractTests` checks graph overrides and mixed activity types | Graph execution, KB graph retrieval, provenance hydration, authorization and graph-language cases | -| Agentic Direct Search / KR models | `SearchUtilsTests` forwards agentic options; SSE tests deserialize reasoning; `PreviewFeatureContractTests` checks renamed usage fields and Microsoft Retriever requests | Real reasoning/retrieval, model routing, timeout/budget termination and shared accounting | -| File KS LRO | Existing legacy upload/update tests; `FileIngestionPollingTests` checks sync/async polling, errors, operation GET/list and continuation | Real ingestion/replacement, retained-operation lookup, backend failure and expiry behavior | -| Durable Operations framework | Customer-facing file-operation polling coverage above | Internal serverless teardown, durability/restart and expiry belong to backend tests | -| OneLake indexed KS ACLs / OneLake security filtering | `FieldBuilderTests` maps `oneLakeParentFolders`; `PreviewFeatureContractTests` checks security metadata and data-source serialization | Two-identity visibility checks, inherited/moved-folder ACLs and revocation propagation | -| Random scoring | `PreviewApiTests` checks discriminator and classic-scoring compatibility; `PreviewFeatureContractTests` checks profile and seed forwarding | Same-seed repeatability, changed-seed ordering, seed rejection boundaries and statistical quality | -| KB tools | `PreviewFeatureContractTests` checks tool configuration and singular request-time selection | Source isolation, request/default precedence, invalid tool/source rejection and MCP discovery | -| OpenAI-compatible / APIM models | `PreviewFeatureContractTests` checks KB authentication, ingestion models, vectorizers and exact skill URI forwarding | Real Chat Completions/Responses retrieval, ingestion/vectorization and downstream APIM path/query/header behavior | -| GPT-6 via Responses | Model-name handling in compatible-model contract cases | Real deployed-model retrieval and backend Responses routing | -| Query hint filter auto-configuration | `PreviewApiTests` and `PreviewFeatureContractTests` check facet-backed configuration serialization | Facet bootstrap, filtering, TTL refresh, limits and rejection/permission boundaries | - -`PreviewFeatureContractTests` adds 23 offline wire cases alongside the existing tests. -`FileIngestionPollingTests` adds seven offline polling/operation cases. -Its fake responses establish SDK behavior only, not backend feature availability or ranking quality. - -## Contract details that affect the test design - -- The pinned public spelling is `topicGraph`, not the older graph-community naming. - `none`, `diverse` and `balanced` have different allowed fields. -- The 1,000 candidate-pool change is a server default/documentation change, not a new Java constant or a documented - maximum. Do not add a test that invents an upper bound of 1,000. -- The pinned Azure Blob graph settings use `azureBlobParameters.graphExtraction`. - Do not invent an `ingestionParameter.graphParameter` JSON field from the deployment title. -- A secret/write-only TypeSpec annotation describes the service's read/write contract. - The Java request model must still send a supplied cache connection string; deserializing synthetic request JSON - is not evidence of a service secret disclosure. Actual server omission still requires a live GET check. -- Query hint auto-configuration is present at this pin despite its private/public history. - It is stored KS configuration, not a supported request-time `queryHintOverrides` setting. -- `toolName` is singular. MCP knowledge-source tool configuration is a different API. -- `reasoningTokens` replaces the unreleased Direct Search `rankingTokens` name. -- GPT-6 family names at this pin include `gpt-6-astra`, `gpt-6-sol` and `gpt-6-luna`, not a literal `gpt-6`. - Model-name serialization does not establish deployment or successful retrieval for any model variant. -- LRO tests use the SDK's `SyncPoller` and `PollerFlux`, not a hand-written ingestion poller. - -## Running offline checks - -From the repository root, with a working JDK/Maven: - -```powershell -$env:AZURE_TEST_MODE = 'PLAYBACK' -mvn -B -ntp -f sdk\search\azure-search-documents\pom.xml test ` - '-Dtest=PreviewApiTests,PreviewFeatureContractTests,FileIngestionPollingTests,GetDocumentOptionsTests' -``` - -These selected tests use fake HTTP responses and do not require live feature fixtures. - -### Local validation results - -- After restoring DP10 GA test authentication and applicable GA regressions on November 10, full package PLAYBACK - produced 1,193 passes, 118 existing skips and no failures/errors. The focused restored-test selection produced - 37 passes with no skips. Strict Revapi against the exact October GA `12.2.0` artifact from commit - `c0866c2b2364a855cda5e78e30f4fed8af795415` passed without semantic-version masking. Checkstyle, enabled SpotBugs, - scoped Spotless and snippet verification passed. This follow-up changed test code and documentation only; - it did not change customer-facing SDK code or call Azure services. -- After removing the supplemental live tests on November 10, a clean build and the offline selection above - produced 62 passes with no skips, failures or errors; Checkstyle reported zero violations. -- All 23 cases in `PreviewFeatureContractTests` and seven cases in `FileIngestionPollingTests` passed. -- Final Checkstyle, SpotBugs and scoped Spotless checks passed with zero violations/warnings. - Test sources compiled for both Java 8 and Java 21. -- On November 9, after the operator's backend routing update and completed bootstrap, the existing LIVE retrieval - suites passed: 99 passes, 14 existing skips and no failures/errors. -- Before removal of the supplemental live tests, the full package RECORD run and the final full PLAYBACK run - each produced 1,157 passes, 132 skips and no failures/errors. - Final PLAYBACK used the default test configuration with all `SEARCH_*` environment variables - removed. Endpoint assertions account for recorded URL sanitization; the two strict pagination fixtures normalize - environment-specific blob-container names. Configured-secret scans, Checkstyle and SpotBugs passed. -- The 14 removed supplemental live methods were not run and accounted for 14 of those historical skips. - The other 118 skips exactly match the earlier DP11 recording run: 92 disabled cases and 26 existing live-only cases. - Skips are test-execution decisions, not failed HTTP recordings. -- Validated recordings were published as `java/search/azure-search-documents_6950366571`, and `assets.json` was - updated. Restoring that tag reproduced all 2,000 recording JSON files byte-for-byte against the validated manifest. - Package recording success does not close the feature-specific validation gaps in the matrix. - -## Release gate - -Before claiming all features are tested, record per-feature results, prerequisite skips and backend failures. -Collect request/activity/APIM IDs for failures. Verify routes and actual backend behavior before updating recording -assets; fake-response tests, pre-existing CRUD tests and successful compilation are not substitutes. - -Testing approach follows the -[Java SDK testing guidance](https://azure.github.io/azure-sdk/java_implementation.html#java-testing) -and the repository's [unit testing](https://github.com/Azure/azure-sdk-for-java/blob/main/docs/contributor/unit-testing.md) -and [live testing](https://github.com/Azure/azure-sdk-for-java/blob/main/docs/contributor/live-testing.md) documentation. diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java index 7f6fb6dbfab72..cc728149e4e19 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java @@ -13,6 +13,7 @@ import com.azure.search.documents.indexes.models.FreshnessScoringParameters; import com.azure.search.documents.indexes.models.GetIndexStatisticsResult; import com.azure.search.documents.indexes.models.LexicalAnalyzerName; +import com.azure.search.documents.indexes.models.ListingSearchType; import com.azure.search.documents.indexes.models.MagnitudeScoringFunction; import com.azure.search.documents.indexes.models.MagnitudeScoringParameters; import com.azure.search.documents.indexes.models.ScoringFunctionAggregation; @@ -22,6 +23,7 @@ import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchServiceStatistics; +import com.azure.search.documents.indexes.models.ServiceIndexersRuntime; import com.azure.search.documents.indexes.models.SearchSuggester; import com.azure.search.documents.indexes.models.TagScoringFunction; import com.azure.search.documents.indexes.models.TagScoringParameters; @@ -55,6 +57,11 @@ public static void main(String[] args) { private static void getServiceStatistics(SearchIndexClient client) { SearchServiceStatistics searchServiceStatistics = client.getServiceStatistics(); + ServiceIndexersRuntime runtime = searchServiceStatistics.getIndexersRuntime(); + if (runtime != null) { + System.out.printf("Service indexer runtime: %d used, %s remaining seconds, period %s to %s%n", + runtime.getUsedSeconds(), runtime.getRemainingSeconds(), runtime.getBeginningTime(), runtime.getEndingTime()); + } System.out.println(":" + searchServiceStatistics); try { System.out.println(searchServiceStatistics.toJsonString()); @@ -110,11 +117,20 @@ private static void getIndexStatistics(SearchIndexClient client) { System.out.println("document Count:" + documentCount); System.out.println("storage Size:" + storageSize); + listIndexStatistics(client, index.getName()); + // Output: // document Count:0 // storage Size:0 } + static void listIndexStatistics(SearchIndexClient client, String indexName) { + client.listIndexStatsSummary(indexName, 1, ListingSearchType.PREFIX).iterableByPage().forEach(page -> + page.getValue().forEach(statistics -> System.out.printf( + "Index %s: %d documents, %d storage bytes, %d vector bytes%n", statistics.getName(), + statistics.getDocumentCount(), statistics.getStorageSize(), statistics.getVectorIndexSize()))); + } + /** * A helper method to create an index for testing * diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java index f5d5fe3dd26c1..27224989630f8 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/CreateSkillsetExample.java @@ -6,17 +6,23 @@ import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.Configuration; import com.azure.search.documents.indexes.models.InputFieldMappingEntry; +import com.azure.search.documents.indexes.models.AIServicesAccountKey; +import com.azure.search.documents.indexes.models.ContentUnderstandingSkill; +import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingProperties; +import com.azure.search.documents.indexes.models.ContentUnderstandingSkillChunkingUnit; import com.azure.search.documents.indexes.models.OcrSkill; import com.azure.search.documents.indexes.models.OutputFieldMappingEntry; import com.azure.search.documents.indexes.models.SearchIndexerSkill; import com.azure.search.documents.indexes.models.SearchIndexerSkillset; import com.azure.search.documents.indexes.models.WebApiHttpHeaders; import com.azure.search.documents.indexes.models.WebApiSkill; +import com.azure.search.documents.models.ContentUnderstandingSkillChunkingMethod; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.UUID; public class CreateSkillsetExample { @@ -35,11 +41,66 @@ public static void main(String[] args) { .credential(new AzureKeyCredential(ADMIN_KEY)) .buildClient(); + if (args.length > 0 && "content-understanding".equals(args[0])) { + createContentUnderstandingSkillset(searchIndexerClient); + return; + } + createOcrSkillset(searchIndexerClient); createCustomSkillset(searchIndexerClient); cleanupSkillset(searchIndexerClient); } + private static void createContentUnderstandingSkillset(SearchIndexerClient client) { + SearchIndexerSkillset skillset = new SearchIndexerSkillset( + "content-understanding-" + UUID.randomUUID().toString().replace("-", ""), + contentUnderstandingSkill(requiredSetting("SEARCH_CONTENT_MODEL_NAME"), + requiredSetting("SEARCH_CONTENT_MODEL_DEPLOYMENT"), ContentUnderstandingSkillChunkingMethod.SEMANTIC)) + .setCognitiveServicesAccount(new AIServicesAccountKey(requiredSetting("SEARCH_AI_SERVICES_API_KEY"), + requiredSetting("SEARCH_AI_SERVICES_ENDPOINT"))); + client.createSkillset(skillset); + try { + System.out.println(client.getSkillset(skillset.getName()).getSkills()); + } finally { + client.deleteSkillset(skillset.getName()); + } + } + + /** + * Builds a content-understanding skill using token-based semantic chunks or fixed-size character chunks. + * Run the sample with {@code content-understanding} and set {@code SEARCH_CONTENT_MODEL_NAME}, + * {@code SEARCH_CONTENT_MODEL_DEPLOYMENT}, {@code SEARCH_AI_SERVICES_ENDPOINT}, and + * {@code SEARCH_AI_SERVICES_API_KEY}, in addition to the Search endpoint and key. + * The AI Services resource must support Content Understanding. An indexer using this skill must expose + * {@code /document/file_data} through {@code allowSkillsetToReadFileData}. + * + * @param modelName The supported model name. + * @param deployment The provisioned model deployment. + * @param method The chunking method. + * @return The configured content-understanding skill. + */ + public static ContentUnderstandingSkill contentUnderstandingSkill(String modelName, String deployment, + ContentUnderstandingSkillChunkingMethod method) { + boolean semantic = ContentUnderstandingSkillChunkingMethod.SEMANTIC.equals(method); + return new ContentUnderstandingSkill( + Collections.singletonList(new InputFieldMappingEntry("file_data").setSource("/document/file_data")), + Collections.singletonList(new OutputFieldMappingEntry("text_sections").setTargetName("sections"))) + .setModelName(modelName) + .setModelDeployment(deployment) + .setChunkingProperties(new ContentUnderstandingSkillChunkingProperties().setMethod(method) + .setUnit(semantic ? ContentUnderstandingSkillChunkingUnit.TOKENS + : ContentUnderstandingSkillChunkingUnit.CHARACTERS) + .setMaximumLength(semantic ? 500 : 2000)); + } + + private static String requiredSetting(String name) { + String value = Configuration.getGlobalConfiguration().get(name); + if (value == null || value.isEmpty()) { + throw new IllegalStateException("Set " + name + " before running the Content Understanding sample."); + } + return value; + } + private static void createOcrSkillset(SearchIndexerClient searchIndexerClient) { // Sample OCR definition // https://docs.microsoft.com/azure/search/cognitive-search-skill-ocr#sample-definition diff --git a/sdk/search/azure-search-documents/src/test/README.md b/sdk/search/azure-search-documents/src/test/README.md index 3cfec07933f10..41ab3c3973229 100644 --- a/sdk/search/azure-search-documents/src/test/README.md +++ b/sdk/search/azure-search-documents/src/test/README.md @@ -88,6 +88,5 @@ Use the repository's to review, sanitize and publish recordings, then update `assets.json`. Do not re-record to hide an SDK or test failure. Passing playback verifies the SDK against recorded responses, not current backend behavior or every preview feature. -See the -[preview feature coverage matrix](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/preview-feature-coverage.md) -for the remaining service-validation gaps. +Track feature-specific live results, prerequisite skips, and backend failures in the feature's PR or release work item. +Offline contract tests and successful compilation are not substitutes for live validation. diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java index a4be053b6d4ca..79f2f81b05534 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchGaSamplesTests.java @@ -3,22 +3,90 @@ package com.azure.search.documents; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.core.util.BinaryData; +import com.azure.search.documents.indexes.CreateSkillsetExample; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; import com.azure.search.documents.knowledgebases.implementation.KnowledgeBaseRetrievalStreamEventConverter; import com.azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStreamEvent; +import com.azure.search.documents.models.ContentUnderstandingSkillChunkingMethod; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.api.parallel.Resources; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import reactor.core.publisher.Mono; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.nio.charset.StandardCharsets; +import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; public class SearchGaSamplesTests { + @ParameterizedTest + @ValueSource(booleans = { false, true }) + public void contentUnderstandingSampleUsesMatchingChunkingMethodAndUnit(boolean semantic) { + Map skill = BinaryData.fromObject(CreateSkillsetExample.contentUnderstandingSkill("model", "deployment", + semantic + ? ContentUnderstandingSkillChunkingMethod.SEMANTIC + : ContentUnderstandingSkillChunkingMethod.FIXED_SIZE)) + .toObject(Map.class); + assertEquals("model", skill.get("modelName")); + assertEquals("deployment", skill.get("modelDeployment")); + Map chunking = (Map) skill.get("chunkingProperties"); + assertEquals(semantic ? "semantic" : "fixedSize", chunking.get("method")); + assertEquals(semantic ? "tokens" : "characters", chunking.get("unit")); + assertEquals(semantic ? 500 : 2000, chunking.get("maximumLength")); + } + + @Test + @ResourceLock(Resources.SYSTEM_OUT) + public void indexStatisticsSampleFollowsServicePagination() throws IOException { + AtomicInteger requests = new AtomicInteger(); + SearchIndexClient client = new SearchIndexClientBuilder().endpoint("https://example.search.windows.net") + .credential(new AzureKeyCredential("key")) + .httpClient(request -> { + boolean last = requests.incrementAndGet() == 2; + String query = request.getUrl().getQuery(); + if (last) { + assertTrue(query.contains("cursor=next")); + } else { + assertTrue(query.contains("search=sample")); + assertTrue(query.contains("pageSize=1")); + assertTrue(query.contains("searchType=prefix")); + } + String nextLink = last + ? "" + : ",\"@odata.nextLink\":\"https://example.search.windows.net/indexstats" + + "?api-version=2026-11-01-preview&cursor=next\""; + String body = "{\"value\":[{\"name\":\"sample-" + (last ? "second" : "first") + + "\",\"documentCount\":1,\"storageSize\":2,\"vectorIndexSize\":3}]" + nextLink + "}"; + return Mono.just(new MockHttpResponse(request, 200, body.getBytes(StandardCharsets.UTF_8))); + }) + .buildClient(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + PrintStream original = System.out; + try (PrintStream capture = new PrintStream(output, true, StandardCharsets.UTF_8.name())) { + System.setOut(capture); + IndexAndServiceStatisticsExample.listIndexStatistics(client, "sample"); + } finally { + System.setOut(original); + } + assertEquals(2, requests.get()); + String logged = output.toString(StandardCharsets.UTF_8.name()); + assertTrue(logged.contains("Index sample-first: 1 documents, 2 storage bytes, 3 vector bytes")); + assertTrue(logged.contains("Index sample-second: 1 documents, 2 storage bytes, 3 vector bytes")); + } + @Test @ResourceLock(Resources.SYSTEM_OUT) public void streamSampleLogsErrorPayloadBeforeThrowing() throws IOException { From 89c8cee9d57251620b51b592fce0edbeb026a0e3 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Fri, 13 Nov 2026 16:09:01 -0800 Subject: [PATCH 19/20] Include October GA in Search version fallback Explicitly retain 2026-10-01 in the guarded missing-version fallback. Native generated output remains unchanged because the existing enum entry is detected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../customizations/src/main/java/SearchCustomizations.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index 0abe28c7d53c0..0cd362d056375 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -1057,7 +1057,7 @@ private static void addSearchAudienceScopeHandling(ClassCustomization customizat private static void includeOldApiVersions(ClassCustomization customization) { customization.customizeAst(ast -> ast.getEnumByName(customization.getClassName()).ifPresent(enumDeclaration -> { NodeList entries = enumDeclaration.getEntries(); - for (String version : Arrays.asList("2026-04-01", "2025-09-01", + for (String version : Arrays.asList("2026-10-01", "2026-04-01", "2025-09-01", "2024-07-01", "2023-11-01", "2020-06-30")) { String enumName = ("V" + version.replace("-", "_")); enumName = enumName.toUpperCase(java.util.Locale.ROOT); From ead432d0a418ecd24ca2ea11ebfb58fd7cea81e2 Mon Sep 17 00:00:00 2001 From: hillarykhuu <86318926+hillarykhuu@users.noreply.github.com> Date: Fri, 13 Nov 2026 17:16:27 -0800 Subject: [PATCH 20/20] Remove custom graph response overloads Keep generated sync and async graph convenience methods, remove the extra typed HTTP-response wrappers and their unused helpers, and update API regression coverage and documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfb252ab-066b-422e-9bc7-164f2db3aa03 --- .../azure-search-documents/CHANGELOG.md | 2 +- sdk/search/azure-search-documents/README.md | 2 +- .../src/main/java/SearchCustomizations.java | 25 -------------- .../search/documents/SearchAsyncClient.java | 14 -------- .../azure/search/documents/SearchClient.java | 15 -------- .../documents/implementation/SearchUtils.java | 34 ------------------- .../search/documents/PreviewApiTests.java | 15 ++++---- 7 files changed, 10 insertions(+), 97 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index c9fd57072f27d..fa4cf13f3e513 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -5,7 +5,7 @@ ### Features Added - Added support for `2026-11-01-preview`, now the default service version. Previously supported GA service versions remain available. -- Added synchronous and asynchronous graph queries, typed HTTP responses, query planning, diagnostics, statistics, and provenance models. +- Added synchronous and asynchronous graph queries, typed results, query planning, diagnostics, statistics, and provenance models. - Added `GraphQueryError` for opt-in typed parsing of graph error bodies without changing existing exceptions. - Added `listIndexesWithMetadata` and `listIndexStatsSummaryWithMetadata` to read optional service-supplied total counts while preserving existing listing APIs. The preview contract does not define a count-request parameter. - Added graph extraction, enrichment cache, graph retrieval activities and references, and updated knowledge source and model options. diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index b2b7afc0a5b7c..ae6e885cb5c19 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -575,7 +575,7 @@ The preview includes graph querying and diagnostics, knowledge source graph extr vector topic graph retrieval, automatic facet-backed filter hints, and random scoring. Use `SearchClient.graph` or `SearchAsyncClient.graph` with `GraphOptions` to query an existing graph index. -For response headers and status, use `graphWithResponse`. A plan-only request must request at least one explain stage. +A plan-only request must request at least one explain stage. See the [preview samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PreviewSearchSamples.java). These APIs require a service that supports the preview; the samples do not provision resources. diff --git a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java index 0cd362d056375..d63cd48f6577a 100644 --- a/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java +++ b/sdk/search/azure-search-documents/customizations/src/main/java/SearchCustomizations.java @@ -81,8 +81,6 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) async); } - addGraphResponseMethods(searchClient, false); - addGraphResponseMethods(searchAsyncClient, true); preservePagedSearchAuthorization(searchClient); preservePagedSearchAuthorization(searchAsyncClient); preserveScoringFunctionCompatibility( @@ -358,29 +356,6 @@ private static void preserveScoringConstructor(ClassCustomization customization, })); } - private static void addGraphResponseMethods(ClassCustomization customization, boolean async) { - customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { - String responseType = async ? "Mono>" : "Response"; - String converter = async ? "mapResponse" : "convertResponse"; - if (clazz.getMethodsByName("graphWithResponse").isEmpty()) { - clazz.addMember(StaticJavaParser.parseBodyDeclaration( - "public " + responseType - + " graphWithResponse(GraphOptions options, RequestOptions requestOptions) {" - + "return SearchUtils." + converter - + "(hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options))," - + "SearchUtils.addGraphHeaders(requestOptions, options)), GraphQueryResult.class); }")); - } - clazz.getMethodsByName("graphWithResponse") - .forEach(method -> method.getAllContainedComments().forEach(com.github.javaparser.ast.comments.Comment::remove)); - clazz.getMethodsByName("graphWithResponse").forEach(method -> method.setJavadocComment( - "Executes a graph query and returns its HTTP response and diagnostics.\n" - + "@param options the graph query and diagnostic options.\n" - + "@param requestOptions the HTTP request options.\n" - + "@return the graph result together with the HTTP response.\n" - + "@throws NullPointerException if options is null.")); - })); - } - private static void preserveScoringFunctionCompatibility(ClassCustomization customization) { customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { if (!clazz.getFieldByName("fieldName").isPresent()) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java index 50dc273703752..c72c9db8e9386 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java @@ -1274,20 +1274,6 @@ public Mono graph(GraphOptions options) { .map(protocolMethodData -> protocolMethodData.toObject(GraphQueryResult.class)); } - /** - * Executes a graph query and returns its HTTP response and diagnostics. - * - * @param options the graph query and diagnostic options. - * @param requestOptions the HTTP request options. - * @return the graph result together with the HTTP response. - * @throws NullPointerException if options is null. - */ - public Mono> graphWithResponse(GraphOptions options, RequestOptions requestOptions) { - return SearchUtils - .mapResponse(hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options)), - SearchUtils.addGraphHeaders(requestOptions, options)), GraphQueryResult.class); - } - /** * Retrieves a document from the index. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java index 5e05719ce86df..4cc1727420d72 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java @@ -1265,21 +1265,6 @@ public GraphQueryResult graph(GraphOptions options) { .toObject(GraphQueryResult.class); } - /** - * Executes a graph query and returns its HTTP response and diagnostics. - * - * @param options the graph query and diagnostic options. - * @param requestOptions the HTTP request options. - * @return the graph result together with the HTTP response. - * @throws NullPointerException if options is null. - */ - public Response graphWithResponse(GraphOptions options, RequestOptions requestOptions) { - return SearchUtils.convertResponse( - hiddenGeneratedGraphWithResponse(BinaryData.fromObject(SearchUtils.fromGraphOptions(options)), - SearchUtils.addGraphHeaders(requestOptions, options)), - GraphQueryResult.class); - } - /** * Retrieves a document from the index. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java index 7475da8bc1a9e..d2a9a7127873a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchUtils.java @@ -8,8 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.json.JsonSerializable; -import com.azure.search.documents.implementation.models.GraphRequest; -import com.azure.search.documents.models.GraphOptions; import com.azure.search.documents.models.SearchOptions; import com.azure.search.documents.models.SearchRequest; import reactor.core.publisher.Mono; @@ -18,38 +16,6 @@ * Implementation utilities helper class. */ public final class SearchUtils { - /** - * Converts public graph options into the wire request. - * - * @param options The graph options. - * @return The graph request. - * @throws NullPointerException if options is null. - */ - public static GraphRequest fromGraphOptions(GraphOptions options) { - java.util.Objects.requireNonNull(options, "'options' cannot be null."); - return new GraphRequest(options.getGql()).setSearch(options.getSearch()) - .setFilter(options.getFilter()) - .setVectorQueries(options.getVectorQueries()) - .setExecutionMode(options.getExecutionMode()) - .setExplain(options.getExplain()) - .setIncludeStatistics(options.isIncludeStatistics()) - .setIncludeDiagnostics(options.isIncludeDiagnostics()) - .setProvenance(options.getProvenance()); - } - - /** - * Adds graph authorization options to the HTTP request. - * - * @param requestOptions The HTTP request options. - * @param options The graph options. - * @return The updated request options. - */ - public static RequestOptions addGraphHeaders(RequestOptions requestOptions, GraphOptions options) { - return addSearchHeaders(requestOptions, - new SearchOptions().setQuerySourceAuthorization(options.getQuerySourceAuthorization()) - .setEnableElevatedRead(options.isEnableElevatedRead())); - } - /** * Converts the public API {@link SearchOptions} into {@link SearchRequest}. * diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java index 52c9921a225ad..d249324597e65 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/PreviewApiTests.java @@ -403,13 +403,14 @@ public void syncAndAsyncGraphClientsForwardOptionsAndDeserializeDiagnostics() { assertGraphResult(builder.buildClient().graph(options)); assertGraphResult(builder.buildAsyncClient().graph(options).block()); - Response syncResponse = builder.buildClient().graphWithResponse(options, null); - assertEquals(200, syncResponse.getStatusCode()); - assertGraphResult(syncResponse.getValue()); - Response asyncResponse = builder.buildAsyncClient().graphWithResponse(options, null).block(); - assertNotNull(asyncResponse); - assertEquals(200, asyncResponse.getStatusCode()); - assertGraphResult(asyncResponse.getValue()); + } + + @Test + public void graphClientsDoNotExposeCustomResponseOverloads() { + assertThrows(NoSuchMethodException.class, + () -> SearchClient.class.getMethod("graphWithResponse", GraphOptions.class, RequestOptions.class)); + assertThrows(NoSuchMethodException.class, + () -> SearchAsyncClient.class.getMethod("graphWithResponse", GraphOptions.class, RequestOptions.class)); } private static void assertGraphResult(GraphQueryResult result) {