From 278e23d9680d20944cb453ea283ff696b5234507 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:16:38 +0000 Subject: [PATCH 01/17] Initial plan From 005e4568c4a6ad1dab8d7c3141fc584cb0648f03 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:58:43 +0000 Subject: [PATCH 02/17] [Search 2026-08-01-preview] Add 2026-08-01-preview ApiVersion; document codegen blocker Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com> --- sdk/search/azure-search-documents/CHANGELOG.md | 12 ++++++++++++ sdk/search/azure-search-documents/_metadata.json | 4 ++-- .../azure/search/documents/_patch.py | 1 + .../tests/test_search_client.py | 15 ++++++++++++++- .../azure-search-documents/tsp-location.yaml | 2 +- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index ddec13dd33b2..eb5312b6b686 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -4,12 +4,24 @@ ### Features Added +- Added `ApiVersion.V2026_08_01_PREVIEW` so the `2026-08-01-preview` Search API version can be + selected via the `api_version` keyword on the clients. + ### Breaking Changes ### Bugs Fixed ### Other Changes +- Updated `tsp-location.yaml` and `_metadata.json` to target spec commit + `c19e358860e3cb89a8c7021e8c5a181ab6ef7f62` (`2026-08-01-preview`). The new `2026-08-01-preview` + models and operations are not yet included in this release: the documented generator emits the + synthesized root-namespace request/response models (e.g. `EntraAppAuthentication`, + `FileUploadMetadata`, `KnowledgeBaseRetrieveDefaults`) into a top-level `search` package and + references them with an invalid cross-package relative import (`from ......search import models`), + which is non-importable. This is a spec-side defect (the root `Search` namespace lacks a blanket + `@@clientNamespace("Azure.Search.Documents")` in `client.tsp`) and must be fixed in + `Azure/azure-rest-api-specs` before the full surface can be regenerated. ## 12.1.0b1 (2026-05-28) ### Features Added diff --git a/sdk/search/azure-search-documents/_metadata.json b/sdk/search/azure-search-documents/_metadata.json index b41f4dc8e881..cd58dfc162d6 100644 --- a/sdk/search/azure-search-documents/_metadata.json +++ b/sdk/search/azure-search-documents/_metadata.json @@ -1,6 +1,6 @@ { - "apiVersion": "2026-05-01-preview", + "apiVersion": "2026-08-01-preview", "apiVersions": { - "Search": "2026-05-01-preview" + "Search": "2026-08-01-preview" } } \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_patch.py index 9fbd081e9f8e..8a866c742759 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_patch.py @@ -42,6 +42,7 @@ class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): V2025_09_01 = "2025-09-01" V2026_04_01 = "2026-04-01" V2026_05_01_PREVIEW = "2026-05-01-preview" + V2026_08_01_PREVIEW = "2026-08-01-preview" DEFAULT_VERSION = ApiVersion.V2026_05_01_PREVIEW diff --git a/sdk/search/azure-search-documents/tests/test_search_client.py b/sdk/search/azure-search-documents/tests/test_search_client.py index b42360d19ad0..d06de5be633a 100644 --- a/sdk/search/azure-search-documents/tests/test_search_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_client.py @@ -12,7 +12,12 @@ from azure.core.credentials import AzureKeyCredential from azure.core.paging import ItemPaged -from azure.search.documents import ApiVersion, IndexDocumentsBatch, RequestEntityTooLargeError, SearchClient +from azure.search.documents import ( + ApiVersion, + IndexDocumentsBatch, + RequestEntityTooLargeError, + SearchClient, +) from azure.search.documents._operations._patch import SearchPageIterator from azure.search.documents.models import FacetResult, IndexingResult, SearchResult @@ -93,6 +98,14 @@ def test_constructor_accepts_supported_api_version_enum(self): assert client._config.api_version == ApiVersion.V2020_06_30 + def test_api_version_enum_includes_2026_08_01_preview(self): + assert ApiVersion.V2026_08_01_PREVIEW == "2026-08-01-preview" + + def test_constructor_accepts_2026_08_01_preview_api_version_enum(self): + client = create_search_client(api_version=ApiVersion.V2026_08_01_PREVIEW) + + assert client._config.api_version == "2026-08-01-preview" + class TestSearchRequestBuilding: @mock.patch("azure.search.documents._operations._operations._SearchClientOperationsMixin._search_post") diff --git a/sdk/search/azure-search-documents/tsp-location.yaml b/sdk/search/azure-search-documents/tsp-location.yaml index 0d61dee0e1df..01f8e3d0c4c0 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: 8be8c75d9bb11ea95d8a7e251db74aa78b5cd76c +commit: c19e358860e3cb89a8c7021e8c5a181ab6ef7f62 repo: Azure/azure-rest-api-specs From e6ebb5d65e78d30ce38e956d044db558da2e68bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Aug 2026 21:08:39 +0000 Subject: [PATCH 03/17] [Search] Update tsp-location.yaml to spec commit f05186b; begin regeneration Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com> --- sdk/search/azure-search-documents/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/tsp-location.yaml b/sdk/search/azure-search-documents/tsp-location.yaml index 01f8e3d0c4c0..a8e0ccbf25df 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: c19e358860e3cb89a8c7021e8c5a181ab6ef7f62 +commit: f05186bb638cd3e72b8b63a51b04c909ad26ae54 repo: Azure/azure-rest-api-specs From 8062791fe17e21fcfe444def3e68d8907070a53b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Aug 2026 21:19:15 +0000 Subject: [PATCH 04/17] [Search] Regenerate at spec commit f05186b; document persistent codegen blocker Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com> --- sdk/search/azure-search-documents/CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index eb5312b6b686..14f8e0845384 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -13,14 +13,14 @@ ### Other Changes -- Updated `tsp-location.yaml` and `_metadata.json` to target spec commit - `c19e358860e3cb89a8c7021e8c5a181ab6ef7f62` (`2026-08-01-preview`). The new `2026-08-01-preview` - models and operations are not yet included in this release: the documented generator emits the +- Updated `tsp-location.yaml` to target spec commit + `f05186bb638cd3e72b8b63a51b04c909ad26ae54` (`2026-08-01-preview`). The new `2026-08-01-preview` + models and operations are still not included in this release: the documented generator emits the synthesized root-namespace request/response models (e.g. `EntraAppAuthentication`, `FileUploadMetadata`, `KnowledgeBaseRetrieveDefaults`) into a top-level `search` package and references them with an invalid cross-package relative import (`from ......search import models`), - which is non-importable. This is a spec-side defect (the root `Search` namespace lacks a blanket - `@@clientNamespace("Azure.Search.Documents")` in `client.tsp`) and must be fixed in + which is non-importable. This is a spec-side defect (the root `Search` namespace in `main.tsp` + still lacks a blanket `@clientNamespace("Azure.Search.Documents")`) and must be fixed in `Azure/azure-rest-api-specs` before the full surface can be regenerated. ## 12.1.0b1 (2026-05-28) From 4f4d5f28b702101a88faaee7adc9e9896673c961 Mon Sep 17 00:00:00 2001 From: Efrain Retana Date: Mon, 10 Aug 2026 15:17:09 -0500 Subject: [PATCH 05/17] Regen with latest commit SHA --- .../azure-search-documents/CHANGELOG.md | 9 +- .../apiview-properties.json | 43 +- .../azure/search/documents/_client.py | 12 +- .../azure/search/documents/_configuration.py | 7 +- .../documents/_operations/_operations.py | 61 +- .../search/documents/_operations/_patch.py | 2 +- .../azure/search/documents/_patch.py | 5 +- .../search/documents/_utils/model_base.py | 454 +- .../search/documents/_utils/serialization.py | 138 +- .../azure/search/documents/_utils/utils.py | 84 +- .../azure/search/documents/aio/_client.py | 12 +- .../search/documents/aio/_configuration.py | 7 +- .../documents/aio/_operations/_operations.py | 43 +- .../documents/aio/_operations/_patch.py | 2 +- .../azure/search/documents/aio/_patch.py | 2 +- .../azure/search/documents/indexes/_client.py | 17 +- .../documents/indexes/_configuration.py | 14 +- .../indexes/_operations/_operations.py | 1259 ++- .../azure/search/documents/indexes/_patch.py | 4 +- .../documents/indexes/_utils/model_base.py | 454 +- .../documents/indexes/_utils/serialization.py | 138 +- .../search/documents/indexes/_utils/utils.py | 84 +- .../search/documents/indexes/aio/_client.py | 17 +- .../documents/indexes/aio/_configuration.py | 14 +- .../indexes/aio/_operations/_operations.py | 930 ++- .../search/documents/indexes/aio/_patch.py | 4 +- .../documents/indexes/models/__init__.py | 32 +- .../search/documents/indexes/models/_enums.py | 65 +- .../documents/indexes/models/_models.py | 748 +- .../azure/search/documents/indexes/types.py | 7160 +++++++++++++++++ .../documents/knowledgebases/_client.py | 12 +- .../knowledgebases/_configuration.py | 7 +- .../knowledgebases/_operations/_operations.py | 339 +- .../search/documents/knowledgebases/_patch.py | 2 +- .../knowledgebases/_utils/model_base.py | 454 +- .../knowledgebases/_utils/serialization.py | 138 +- .../documents/knowledgebases/_utils/utils.py | 84 +- .../documents/knowledgebases/aio/_client.py | 12 +- .../knowledgebases/aio/_configuration.py | 7 +- .../aio/_operations/_operations.py | 291 +- .../documents/knowledgebases/aio/_patch.py | 2 +- .../knowledgebases/models/__init__.py | 24 +- .../documents/knowledgebases/models/_enums.py | 22 + .../knowledgebases/models/_models.py | 984 ++- .../search/documents/knowledgebases/types.py | 1455 ++++ .../azure/search/documents/types.py | 1622 ++++ .../azure-search-documents/pyproject.toml | 4 +- .../azure-search-documents/tsp-location.yaml | 2 +- 48 files changed, 16357 insertions(+), 925 deletions(-) create mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/types.py create mode 100644 sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py create mode 100644 sdk/search/azure-search-documents/azure/search/documents/types.py diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 14f8e0845384..84251fff4589 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -14,14 +14,7 @@ ### Other Changes - Updated `tsp-location.yaml` to target spec commit - `f05186bb638cd3e72b8b63a51b04c909ad26ae54` (`2026-08-01-preview`). The new `2026-08-01-preview` - models and operations are still not included in this release: the documented generator emits the - synthesized root-namespace request/response models (e.g. `EntraAppAuthentication`, - `FileUploadMetadata`, `KnowledgeBaseRetrieveDefaults`) into a top-level `search` package and - references them with an invalid cross-package relative import (`from ......search import models`), - which is non-importable. This is a spec-side defect (the root `Search` namespace in `main.tsp` - still lacks a blanket `@clientNamespace("Azure.Search.Documents")`) and must be fixed in - `Azure/azure-rest-api-specs` before the full surface can be regenerated. + `33f88d027ee9721b5ca912c59d531884309f15d3` (`2026-08-01-preview`). ## 12.1.0b1 (2026-05-28) ### Features Added diff --git a/sdk/search/azure-search-documents/apiview-properties.json b/sdk/search/azure-search-documents/apiview-properties.json index 05215a621a9a..7e8a896c0f5e 100644 --- a/sdk/search/azure-search-documents/apiview-properties.json +++ b/sdk/search/azure-search-documents/apiview-properties.json @@ -80,6 +80,7 @@ "azure.search.documents.indexes.models.EmbeddingColumnMapping": "Search.EmbeddingColumnMapping", "azure.search.documents.indexes.models.EntityLinkingSkill": "Search.EntityLinkingSkill", "azure.search.documents.indexes.models.EntityRecognitionSkillV3": "Search.EntityRecognitionSkillV3", + "azure.search.documents.indexes.models.EntraAppAuthentication": "Search.EntraAppAuthentication", "azure.search.documents.models.ErrorAdditionalInfo": "Search.ErrorAdditionalInfo", "azure.search.documents.models.ErrorDetail": "Search.ErrorDetail", "azure.search.documents.models.ErrorResponse": "Search.ErrorResponse", @@ -98,6 +99,7 @@ "azure.search.documents.indexes.models.FileKnowledgeSource": "Search.FileKnowledgeSource", "azure.search.documents.indexes.models.FileKnowledgeSourceParameters": "Search.FileKnowledgeSourceParameters", "azure.search.documents.knowledgebases.models.FileKnowledgeSourceParams": "Search.FileKnowledgeSourceParams", + "azure.search.documents.indexes.models.FileUploadMetadata": "Search.FileUploadMetadata", "azure.search.documents.knowledgebases.models.FreshnessPolicy": "Search.FreshnessPolicy", "azure.search.documents.indexes.models.FreshnessScoringFunction": "Search.FreshnessScoringFunction", "azure.search.documents.indexes.models.FreshnessScoringParameters": "Search.FreshnessScoringParameters", @@ -136,7 +138,10 @@ "azure.search.documents.indexes.models.KeywordTokenizerV2": "Search.KeywordTokenizerV2", "azure.search.documents.indexes.models.KnowledgeBase": "Search.KnowledgeBase", "azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord": "Search.KnowledgeBaseActivityRecord", + "azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel": "Search.KnowledgeBaseActivityRecordModel", + "azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedEvent": "Search.KnowledgeBaseActivityStartedEvent", "azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord": "Search.KnowledgeBaseAgenticReasoningActivityRecord", + "azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedEvent": "Search.KnowledgeBaseAnswerCompletedEvent", "azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityArguments": "Search.KnowledgeBaseAzureBlobActivityArguments", "azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityRecord": "Search.KnowledgeBaseAzureBlobActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseReference": "Search.KnowledgeBaseReference", @@ -174,22 +179,28 @@ "azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord": "Search.KnowledgeBaseModelAnswerSynthesisActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseModelQueryPlanningActivityRecord": "Search.KnowledgeBaseModelQueryPlanningActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseModelWebSummarizationActivityRecord": "Search.KnowledgeBaseModelWebSummarizationActivityRecord", + "azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing": "Search.KnowledgeBaseQueryHintProcessing", "azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointActivityArguments": "Search.KnowledgeBaseRemoteSharePointActivityArguments", "azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointActivityRecord": "Search.KnowledgeBaseRemoteSharePointActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointReference": "Search.KnowledgeBaseRemoteSharePointReference", + "azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent": "Search.KnowledgeBaseResponseCompletedEvent", "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest": "Search.KnowledgeBaseRetrievalRequest", "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResponse": "Search.KnowledgeBaseRetrievalResponse", + "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent": "Search.KnowledgeBaseRetrievalStartedEvent", + "azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults": "Search.KnowledgeBaseRetrieveDefaults", "azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityArguments": "Search.KnowledgeBaseSearchIndexActivityArguments", "azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityRecord": "Search.KnowledgeBaseSearchIndexActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference": "Search.KnowledgeBaseSearchIndexReference", + "azure.search.documents.knowledgebases.models.KnowledgeBaseStreamErrorEvent": "Search.KnowledgeBaseStreamErrorEvent", "azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityArguments": "Search.KnowledgeBaseWebActivityArguments", "azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityRecord": "Search.KnowledgeBaseWebActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseWebReference": "Search.KnowledgeBaseWebReference", "azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityArguments": "Search.KnowledgeBaseWorkIQActivityArguments", "azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityRecord": "Search.KnowledgeBaseWorkIQActivityRecord", "azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQReference": "Search.KnowledgeBaseWorkIQReference", - "azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntent": "Search.KnowledgeRetrievalIntent", "azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort": "Search.KnowledgeRetrievalReasoningEffort", + "azure.search.documents.knowledgebases.models.KnowledgeRetrievalAutoReasoningEffort": "Search.KnowledgeRetrievalAutoReasoningEffort", + "azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntent": "Search.KnowledgeRetrievalIntent", "azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort": "Search.KnowledgeRetrievalLowReasoningEffort", "azure.search.documents.knowledgebases.models.KnowledgeRetrievalMediumReasoningEffort": "Search.KnowledgeRetrievalMediumReasoningEffort", "azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort": "Search.KnowledgeRetrievalMinimalReasoningEffort", @@ -291,8 +302,13 @@ "azure.search.documents.indexes.models.SearchIndexerWarning": "Search.SearchIndexerWarning", "azure.search.documents.indexes.models.SearchIndexFieldReference": "Search.SearchIndexFieldReference", "azure.search.documents.indexes.models.SearchIndexKnowledgeSource": "Search.SearchIndexKnowledgeSource", + "azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoost": "Search.SearchIndexKnowledgeSourceBoost", + "azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFieldValueBoost": "Search.SearchIndexKnowledgeSourceFieldValueBoost", + "azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint": "Search.SearchIndexKnowledgeSourceFilterHint", + "azure.search.documents.indexes.models.SearchIndexKnowledgeSourceMultiWordExpressionBoost": "Search.SearchIndexKnowledgeSourceMultiWordExpressionBoost", "azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters": "Search.SearchIndexKnowledgeSourceParameters", "azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams": "Search.SearchIndexKnowledgeSourceParams", + "azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints": "Search.SearchIndexKnowledgeSourceQueryHints", "azure.search.documents.indexes.models.SearchResourceEncryptionKey": "Search.SearchResourceEncryptionKey", "azure.search.documents.models.SearchResult": "Search.SearchResult", "azure.search.documents.models.VectorThreshold": "Search.VectorThreshold", @@ -307,6 +323,7 @@ "azure.search.documents.indexes.models.SemanticPrioritizedFields": "Search.SemanticPrioritizedFields", "azure.search.documents.indexes.models.SemanticSearch": "Search.SemanticSearch", "azure.search.documents.indexes.models.SentimentSkillV3": "Search.SentimentSkillV3", + "azure.search.documents.knowledgebases.models.ServedImage": "Search.ServedImage", "azure.search.documents.indexes.models.ServiceIndexersRuntime": "Search.ServiceIndexersRuntime", "azure.search.documents.indexes.models.ShaperSkill": "Search.ShaperSkill", "azure.search.documents.indexes.models.SharePointConnectorAppRegistration": "Search.SharePointConnectorAppRegistration", @@ -333,6 +350,8 @@ "azure.search.documents.indexes.models.TruncateTokenFilter": "Search.TruncateTokenFilter", "azure.search.documents.indexes.models.UaxUrlEmailTokenizer": "Search.UaxUrlEmailTokenizer", "azure.search.documents.indexes.models.UniqueTokenFilter": "Search.UniqueTokenFilter", + "azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest": "Search.UpdateKnowledgeSourceFileRequest", + "azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest": "Search.UploadKnowledgeSourceFileMultipartRequest", "azure.search.documents.models.VectorQuery": "Search.VectorQuery", "azure.search.documents.models.VectorizableImageBinaryQuery": "Search.VectorizableImageBinaryQuery", "azure.search.documents.models.VectorizableImageUrlQuery": "Search.VectorizableImageUrlQuery", @@ -353,8 +372,8 @@ "azure.search.documents.indexes.models.WebKnowledgeSourceParameters": "Search.WebKnowledgeSourceParameters", "azure.search.documents.knowledgebases.models.WebKnowledgeSourceParams": "Search.WebKnowledgeSourceParams", "azure.search.documents.indexes.models.WordDelimiterTokenFilter": "Search.WordDelimiterTokenFilter", - "azure.search.documents.knowledgebases.models.WorkIQAttribution": "Search.WorkIQAttribution", "azure.search.documents.indexes.models.WorkIQKnowledgeSource": "Search.WorkIQKnowledgeSource", + "azure.search.documents.indexes.models.WorkIQKnowledgeSourceParameters": "Search.WorkIQKnowledgeSourceParameters", "azure.search.documents.knowledgebases.models.WorkIQKnowledgeSourceParams": "Search.WorkIQKnowledgeSourceParams", "azure.search.documents.models.QueryType": "Search.QueryType", "azure.search.documents.models.ScoringStatistics": "Search.ScoringStatistics", @@ -375,6 +394,7 @@ "azure.search.documents.models.SemanticSearchResultsType": "Search.SemanticSearchResultsType", "azure.search.documents.models.IndexActionType": "Search.IndexActionType", "azure.search.documents.models.AutocompleteMode": "Search.AutocompleteMode", + "azure.search.documents.models.ListingSearchType": "Search.ListingSearchType", "azure.search.documents.models.SearchFieldDataType": "Search.SearchFieldDataType", "azure.search.documents.models.PermissionFilter": "Search.PermissionFilter", "azure.search.documents.models.LexicalAnalyzerName": "Search.LexicalAnalyzerName", @@ -409,19 +429,22 @@ "azure.search.documents.models.KnowledgeRetrievalReasoningEffortKind": "Search.KnowledgeRetrievalReasoningEffortKind", "azure.search.documents.models.KnowledgeRetrievalOutputMode": "Search.KnowledgeRetrievalOutputMode", "azure.search.documents.models.KnowledgeSourceKind": "Search.KnowledgeSourceKind", + "azure.search.documents.models.KnowledgeSourceResultsProcessing": "Search.KnowledgeSourceResultsProcessing", "azure.search.documents.models.KnowledgeSourceIngestionPermissionOption": "Search.KnowledgeSourceIngestionPermissionOption", "azure.search.documents.models.KnowledgeSourceContentExtractionMode": "Search.KnowledgeSourceContentExtractionMode", + "azure.search.documents.models.KnowledgeSourceNetworkAccessMode": "Search.KnowledgeSourceNetworkAccessMode", + "azure.search.documents.models.SearchIndexKnowledgeSourceBoostKind": "Search.SearchIndexKnowledgeSourceBoostKind", "azure.search.documents.models.IndexedSharePointContainerName": "Search.IndexedSharePointContainerName", "azure.search.documents.models.McpServerAuthenticationKind": "Search.McpServerAuthenticationKind", "azure.search.documents.models.McpServerOutputParsingKind": "Search.McpServerOutputParsingKind", "azure.search.documents.models.TextSplitMode": "Search.TextSplitMode", "azure.search.documents.models.SplitSkillLanguage": "Search.SplitSkillLanguage", - "azure.search.documents.models.McpServerToolInclusionMode": "Search.McpServerToolInclusionMode", "azure.search.documents.models.KnowledgeSourceSynchronizationStatus": "Search.KnowledgeSourceSynchronizationStatus", + "azure.search.documents.models.BlobIndexerParsingMode": "Search.BlobIndexerParsingMode", + "azure.search.documents.models.FileKnowledgeSourceExtractionMode": "Search.FileKnowledgeSourceExtractionMode", "azure.search.documents.models.SearchIndexerDataSourceType": "Search.SearchIndexerDataSourceType", "azure.search.documents.models.IndexerPermissionOption": "Search.IndexerPermissionOption", "azure.search.documents.models.IndexerResyncOption": "Search.IndexerResyncOption", - "azure.search.documents.models.BlobIndexerParsingMode": "Search.BlobIndexerParsingMode", "azure.search.documents.models.MarkdownParsingSubmode": "Search.MarkdownParsingSubmode", "azure.search.documents.models.MarkdownHeaderDepth": "Search.MarkdownHeaderDepth", "azure.search.documents.models.BlobIndexerDataToExtract": "Search.BlobIndexerDataToExtract", @@ -461,6 +484,7 @@ "azure.search.documents.models.KnowledgeBaseActivityRecordType": "Search.KnowledgeBaseActivityRecordType", "azure.search.documents.models.KnowledgeBaseReferenceType": "Search.KnowledgeBaseReferenceType", "azure.search.documents.models.KnowledgeRetrievalIntentType": "Search.KnowledgeRetrievalIntentType", + "azure.search.documents.models.KnowledgeBaseRetrievalStatusCode": "Search.KnowledgeBaseRetrievalStatusCode", "azure.search.documents.SearchClient.get_document_count": "Customizations.SearchClient.count", "azure.search.documents.aio.SearchClient.get_document_count": "Customizations.SearchClient.count", "azure.search.documents.SearchClient.get_document": "Customizations.SearchClient.get", @@ -493,8 +517,12 @@ "azure.search.documents.aio.SearchIndexClient.create_knowledge_source": "Customizations.SearchIndexClient.createKnowledgeSource", "azure.search.documents.SearchIndexClient.get_knowledge_source_status": "Customizations.SearchIndexClient.getKnowledgeSourceStatus", "azure.search.documents.aio.SearchIndexClient.get_knowledge_source_status": "Customizations.SearchIndexClient.getKnowledgeSourceStatus", + "azure.search.documents.SearchIndexClient.upload_knowledge_source_file_multipart": "Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart", + "azure.search.documents.aio.SearchIndexClient.upload_knowledge_source_file_multipart": "Customizations.SearchIndexClient.uploadKnowledgeSourceFileMultipart", "azure.search.documents.SearchIndexClient.list_knowledge_source_files": "Customizations.SearchIndexClient.listKnowledgeSourceFiles", "azure.search.documents.aio.SearchIndexClient.list_knowledge_source_files": "Customizations.SearchIndexClient.listKnowledgeSourceFiles", + "azure.search.documents.SearchIndexClient.update_knowledge_source_file": "Customizations.SearchIndexClient.updateKnowledgeSourceFile", + "azure.search.documents.aio.SearchIndexClient.update_knowledge_source_file": "Customizations.SearchIndexClient.updateKnowledgeSourceFile", "azure.search.documents.SearchIndexClient.get_service_statistics": "Customizations.SearchIndexClient.getServiceStatistics", "azure.search.documents.aio.SearchIndexClient.get_service_statistics": "Customizations.SearchIndexClient.getServiceStatistics", "azure.search.documents.SearchIndexClient.list_index_stats_summary": "Customizations.SearchIndexClient.getIndexStatsSummary", @@ -518,6 +546,9 @@ "azure.search.documents.SearchIndexerClient.create_skillset": "Customizations.SearchIndexerClient.createSkillset", "azure.search.documents.aio.SearchIndexerClient.create_skillset": "Customizations.SearchIndexerClient.createSkillset", "azure.search.documents.KnowledgeBaseRetrievalClient.retrieve": "Customizations.KnowledgeBaseRetrievalClient.retrieve", - "azure.search.documents.aio.KnowledgeBaseRetrievalClient.retrieve": "Customizations.KnowledgeBaseRetrievalClient.retrieve" - } + "azure.search.documents.aio.KnowledgeBaseRetrievalClient.retrieve": "Customizations.KnowledgeBaseRetrievalClient.retrieve", + "azure.search.documents.KnowledgeBaseRetrievalClient.retrieve_stream": "Customizations.KnowledgeBaseRetrievalClient.retrieveStream", + "azure.search.documents.aio.KnowledgeBaseRetrievalClient.retrieve_stream": "Customizations.KnowledgeBaseRetrievalClient.retrieveStream" + }, + "CrossLanguageVersion": "da0aafb66887" } \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_client.py b/sdk/search/azure-search-documents/azure/search/documents/_client.py index 8db5c60f68dd..c19b882b0990 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, TYPE_CHECKING, Union -from typing_extensions import Self from azure.core import PipelineClient from azure.core.credentials import AzureKeyCredential @@ -19,6 +19,11 @@ from ._operations import _SearchClientOperationsMixin from ._utils.serialization import Deserializer, Serializer +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -35,8 +40,9 @@ class SearchClient(_SearchClientOperationsMixin): :param index_name: The name of the index. Required. :type index_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_configuration.py index 13fad1111791..19dc1261e170 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_configuration.py @@ -32,15 +32,16 @@ class SearchClientConfiguration: # pylint: disable=too-many-instance-attributes :param index_name: The name of the index. Required. :type index_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ def __init__( self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], index_name: str, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/search/azure-search-documents/azure/search/documents/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_operations/_operations.py index ac4d9c19342f..78daae5ea45a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_operations/_operations.py @@ -27,7 +27,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models1, types as _types_models1 from .._configuration import SearchClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Serializer @@ -47,7 +47,7 @@ def build_search_get_document_count_request(index_name: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -108,7 +108,7 @@ def build_search_search_get_request( # pylint: disable=too-many-locals,too-many _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -210,7 +210,7 @@ def build_search_search_post_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -251,7 +251,7 @@ def build_search_get_document_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -300,7 +300,7 @@ def build_search_suggest_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -346,7 +346,7 @@ def build_search_suggest_post_request(index_name: str, **kwargs: Any) -> HttpReq _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -374,7 +374,7 @@ def build_search_index_request(index_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -415,7 +415,7 @@ def build_search_autocomplete_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -459,7 +459,7 @@ def build_search_autocomplete_post_request(index_name: str, **kwargs: Any) -> Ht _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=none") # Construct URL @@ -564,7 +564,7 @@ def get_document_count(self, **kwargs: Any) -> int: "semantic_fields", ] }, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def _search_get( # pylint: disable=too-many-locals self, @@ -894,7 +894,7 @@ def _search_post( # pylint: disable=too-many-locals @overload def _search_post( self, - body: JSON, + body: _types_models1.SearchPostRequest, *, query_source_authorization: Optional[str] = None, enable_elevated_read: Optional[bool] = None, @@ -915,11 +915,11 @@ def _search_post( @distributed_trace @api_version_validation( params_added_on={"2026-05-01-preview": ["query_source_authorization", "enable_elevated_read"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def _search_post( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types_models1.SearchPostRequest, IO[bytes]] = _Unset, *, query_source_authorization: Optional[str] = None, enable_elevated_read: Optional[bool] = None, @@ -960,8 +960,8 @@ def _search_post( # pylint: disable=too-many-locals ) -> _models1._models.SearchDocumentsResult: """Searches for documents in the index. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchPostRequest, IO[bytes] Required. + :type body: JSON or ~azure.search.documents.types.SearchPostRequest or IO[bytes] :keyword query_source_authorization: Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. Default value is None. @@ -1219,7 +1219,7 @@ def _search_post( # pylint: disable=too-many-locals @distributed_trace @api_version_validation( params_added_on={"2026-05-01-preview": ["query_source_authorization", "enable_elevated_read"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def get_document( self, @@ -1462,7 +1462,7 @@ def _suggest_post( ) -> _models1._models.SuggestDocumentsResult: ... @overload def _suggest_post( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types_models1.SuggestPostRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models1._models.SuggestDocumentsResult: ... @overload def _suggest_post( @@ -1472,7 +1472,7 @@ def _suggest_post( @distributed_trace def _suggest_post( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types_models1.SuggestPostRequest, IO[bytes]] = _Unset, *, search_text: str = _Unset, suggester_name: str = _Unset, @@ -1489,8 +1489,8 @@ def _suggest_post( # pylint: disable=too-many-locals ) -> _models1._models.SuggestDocumentsResult: """Suggests documents in the index that match the given partial query text. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SuggestPostRequest, IO[bytes] Required. + :type body: JSON or ~azure.search.documents.types.SuggestPostRequest or IO[bytes] :keyword search_text: The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. Required. :paramtype search_text: str @@ -1631,7 +1631,7 @@ def _index( ) -> _models1._models.IndexDocumentsResult: ... @overload def _index( - self, batch: JSON, *, content_type: str = "application/json", **kwargs: Any + self, batch: _types_models1.IndexDocumentsBatch, *, content_type: str = "application/json", **kwargs: Any ) -> _models1._models.IndexDocumentsResult: ... @overload def _index( @@ -1640,13 +1640,14 @@ def _index( @distributed_trace def _index( - self, batch: Union[_models1.IndexDocumentsBatch, JSON, IO[bytes]], **kwargs: Any + self, batch: Union[_models1.IndexDocumentsBatch, _types_models1.IndexDocumentsBatch, IO[bytes]], **kwargs: Any ) -> _models1._models.IndexDocumentsResult: """Sends a batch of document write actions to the index. - :param batch: The batch of index actions. Is one of the following types: IndexDocumentsBatch, - JSON, IO[bytes] Required. - :type batch: ~azure.search.documents.models.IndexDocumentsBatch or JSON or IO[bytes] + :param batch: The batch of index actions. Is either a IndexDocumentsBatch type or a IO[bytes] + type. Required. + :type batch: ~azure.search.documents.models.IndexDocumentsBatch or + ~azure.search.documents.types.IndexDocumentsBatch or IO[bytes] :return: IndexDocumentsResult. The IndexDocumentsResult is compatible with MutableMapping :rtype: ~azure.search.documents.models._models.IndexDocumentsResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1862,7 +1863,7 @@ def _autocomplete_post( ) -> _models1._models.AutocompleteResult: ... @overload def _autocomplete_post( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types_models1.AutocompletePostRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models1._models.AutocompleteResult: ... @overload def _autocomplete_post( @@ -1872,7 +1873,7 @@ def _autocomplete_post( @distributed_trace def _autocomplete_post( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types_models1.AutocompletePostRequest, IO[bytes]] = _Unset, *, search_text: str = _Unset, suggester_name: str = _Unset, @@ -1888,8 +1889,8 @@ def _autocomplete_post( # pylint: disable=too-many-locals ) -> _models1._models.AutocompleteResult: """Autocompletes incomplete query terms based on input text and matching terms in the index. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, AutocompletePostRequest, IO[bytes] Required. + :type body: JSON or ~azure.search.documents.types.AutocompletePostRequest or IO[bytes] :keyword search_text: The search text on which to base autocomplete results. Required. :paramtype search_text: str :keyword suggester_name: The name of the suggester as specified in the suggesters collection diff --git a/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py index a0e6587db9f7..c51f8545a393 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py @@ -248,7 +248,7 @@ def __init__(self, client, initial_request: SearchRequest, kwargs, continuation_ self._initial_request = initial_request self._kwargs = kwargs self._facets: Optional[Dict[str, List[Dict[str, Any]]]] = None - self._api_version = kwargs.get("api_version", "2026-05-01-preview") + self._api_version = kwargs.get("api_version", "2026-08-01-preview") def _get_next_cb(self, continuation_token): if continuation_token is None: diff --git a/sdk/search/azure-search-documents/azure/search/documents/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_patch.py index 8a866c742759..57cbd19e6d37 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_patch.py @@ -41,11 +41,10 @@ class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): V2024_07_01 = "2024-07-01" V2025_09_01 = "2025-09-01" V2026_04_01 = "2026-04-01" - V2026_05_01_PREVIEW = "2026-05-01-preview" V2026_08_01_PREVIEW = "2026-08-01-preview" -DEFAULT_VERSION = ApiVersion.V2026_05_01_PREVIEW +DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW class SearchClient(_SearchClient): @@ -61,7 +60,7 @@ class SearchClient(_SearchClient): :type index_name: str :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The diff --git a/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py b/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py index db24930fdca9..0f2c5bdfe70f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -296,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -325,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -420,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +624,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,11 +867,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } + dict_to_pass: dict[str, typing.Any] = {} if args: if isinstance(args[0], ET.Element): dict_to_pass.update(self._init_from_xml(args[0])) @@ -619,9 +887,19 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) - def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: """Deserialize an XML element into a dict mapping rest field names to values. :param ET.Element element: The XML element to deserialize from. @@ -629,53 +907,89 @@ def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: :rtype: dict """ result: dict[str, typing.Any] = {} - model_meta = getattr(self, "_xml", {}) existed_attr_keys: list[str] = [] - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) + result[rf._rest_name] = _deserialize(rf._type, item) # rest thing is additional properties for e in element: @@ -708,6 +1022,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -1082,6 +1399,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1094,6 +1412,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1113,7 +1432,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1126,7 +1448,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1172,6 +1498,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1181,6 +1508,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1414,6 +1742,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py b/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py index 81ec1de5922b..75906e2eb77f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -516,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1472,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1482,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/search/azure-search-documents/azure/search/documents/_utils/utils.py b/sdk/search/azure-search-documents/azure/search/documents/_utils/utils.py index 927adb7c8ae2..b0131200252f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_utils/utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_utils/utils.py @@ -6,10 +6,14 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import Generic, Optional, TYPE_CHECKING, TypeVar +import json +import os +from typing import Any, Generic, IO, Mapping, Optional, TYPE_CHECKING, TypeVar, Union from azure.core import MatchConditions +from .._utils.model_base import Model, SdkJSONEncoder + if TYPE_CHECKING: from .serialization import Deserializer, Serializer @@ -55,3 +59,81 @@ def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchCondi if match_condition == MatchConditions.IfMissing: return "*" return None + + +# file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` +FileContent = Union[str, bytes, IO[str], IO[bytes]] + +FileType = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + tuple[Optional[str], FileContent, Optional[str]], +] + + +def serialize_multipart_data_entry(data_entry: Any) -> Any: + if isinstance(data_entry, (list, tuple, dict, Model)): + return json.dumps(data_entry, cls=SdkJSONEncoder, exclude_readonly=True) + return data_entry + + +def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any: + """Ensure a multipart file entry carries a filename for Content-Disposition. + + Servers distinguish file parts from plain form fields by the presence of + ``filename=`` in the ``Content-Disposition`` header. When callers pass + bare bytes/str/IO the HTTP client omits the filename and the server may + reject the upload. This helper wraps bare values into a (filename, content) + tuple, deriving the name from IO.name when available. + + :param str field_name: The multipart field name used as a filename fallback. + :param entry: The user-provided file entry (tuple, bytes, str, or IO). + :type entry: any + :param int index: The positional index of the entry within the field, used + to disambiguate fallback filenames when multiple entries are provided. + :return: Either the original tuple entry, or a ``(filename, content)`` tuple + wrapping the bare value. + :rtype: any + """ + if isinstance(entry, tuple): + return entry + filename: Optional[str] = None + name_attr = getattr(entry, "name", None) + if isinstance(name_attr, str) and name_attr: + filename = os.path.basename(name_attr) + if not filename: + filename = f"{field_name}_{index}" if index else field_name + + # Return a 3-tuple with an explicit "application/octet-stream" content type. + # A 2-tuple (filename, content) would leave the part's Content-Type unset, and + # the sdk core library only defaults to "application/octet-stream" for bare + # (non-tuple) values - a tuple bypasses that default and falls back to the + # HTTP "text/plain" default instead. Setting it explicitly preserves the + # pre-existing behavior for bare bytes/IO across all transports. + return (filename, entry, "application/octet-stream") + + +def prepare_multipart_form_data( + body: Mapping[str, Any], multipart_fields: list[str], data_fields: list[str] +) -> list[FileType]: + files: list[FileType] = [] + + # Data fields first so streaming server-side parsers see metadata before + # binary file parts. + for data_field in data_fields: + data_entry = body.get(data_field) + if data_entry: + files.append((data_field, str(serialize_multipart_data_entry(data_entry)))) + + for multipart_field in multipart_fields: + multipart_entry = body.get(multipart_field) + if isinstance(multipart_entry, list): + for idx, e in enumerate(multipart_entry): + files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx))) + elif multipart_entry is not None: + files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0))) + + return files diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py index 0c9271c6af74..7c651992fa82 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, TYPE_CHECKING, Union -from typing_extensions import Self from azure.core import AsyncPipelineClient from azure.core.credentials import AzureKeyCredential @@ -19,6 +19,11 @@ from ._configuration import SearchClientConfiguration from ._operations import _SearchClientOperationsMixin +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -35,8 +40,9 @@ class SearchClient(_SearchClientOperationsMixin): :param index_name: The name of the index. Required. :type index_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py index f76517b9b88f..2d071d697d69 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py @@ -32,8 +32,9 @@ class SearchClientConfiguration: # pylint: disable=too-many-instance-attributes :param index_name: The name of the index. Required. :type index_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -44,7 +45,7 @@ def __init__( index_name: str, **kwargs: Any, ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_operations.py index 55e638a61cfe..4943ac4c4c80 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_operations.py @@ -27,7 +27,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models2, types as _types_models2 from ..._operations._operations import ( build_search_autocomplete_get_request, build_search_autocomplete_post_request, @@ -132,7 +132,7 @@ async def get_document_count(self, **kwargs: Any) -> int: "semantic_fields", ] }, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def _search_get( # pylint: disable=too-many-locals self, @@ -462,7 +462,7 @@ async def _search_post( # pylint: disable=too-many-locals @overload async def _search_post( self, - body: JSON, + body: _types_models2.SearchPostRequest, *, query_source_authorization: Optional[str] = None, enable_elevated_read: Optional[bool] = None, @@ -483,11 +483,11 @@ async def _search_post( @distributed_trace_async @api_version_validation( params_added_on={"2026-05-01-preview": ["query_source_authorization", "enable_elevated_read"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def _search_post( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types_models2.SearchPostRequest, IO[bytes]] = _Unset, *, query_source_authorization: Optional[str] = None, enable_elevated_read: Optional[bool] = None, @@ -528,8 +528,8 @@ async def _search_post( # pylint: disable=too-many-locals ) -> _models2._models.SearchDocumentsResult: """Searches for documents in the index. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SearchPostRequest, IO[bytes] Required. + :type body: JSON or ~azure.search.documents.types.SearchPostRequest or IO[bytes] :keyword query_source_authorization: Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. Default value is None. @@ -787,7 +787,7 @@ async def _search_post( # pylint: disable=too-many-locals @distributed_trace_async @api_version_validation( params_added_on={"2026-05-01-preview": ["query_source_authorization", "enable_elevated_read"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def get_document( self, @@ -1030,7 +1030,7 @@ async def _suggest_post( ) -> _models2._models.SuggestDocumentsResult: ... @overload async def _suggest_post( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types_models2.SuggestPostRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models2._models.SuggestDocumentsResult: ... @overload async def _suggest_post( @@ -1040,7 +1040,7 @@ async def _suggest_post( @distributed_trace_async async def _suggest_post( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types_models2.SuggestPostRequest, IO[bytes]] = _Unset, *, search_text: str = _Unset, suggester_name: str = _Unset, @@ -1057,8 +1057,8 @@ async def _suggest_post( # pylint: disable=too-many-locals ) -> _models2._models.SuggestDocumentsResult: """Suggests documents in the index that match the given partial query text. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, SuggestPostRequest, IO[bytes] Required. + :type body: JSON or ~azure.search.documents.types.SuggestPostRequest or IO[bytes] :keyword search_text: The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. Required. :paramtype search_text: str @@ -1199,7 +1199,7 @@ async def _index( ) -> _models2._models.IndexDocumentsResult: ... @overload async def _index( - self, batch: JSON, *, content_type: str = "application/json", **kwargs: Any + self, batch: _types_models2.IndexDocumentsBatch, *, content_type: str = "application/json", **kwargs: Any ) -> _models2._models.IndexDocumentsResult: ... @overload async def _index( @@ -1208,13 +1208,14 @@ async def _index( @distributed_trace_async async def _index( - self, batch: Union[_models2.IndexDocumentsBatch, JSON, IO[bytes]], **kwargs: Any + self, batch: Union[_models2.IndexDocumentsBatch, _types_models2.IndexDocumentsBatch, IO[bytes]], **kwargs: Any ) -> _models2._models.IndexDocumentsResult: """Sends a batch of document write actions to the index. - :param batch: The batch of index actions. Is one of the following types: IndexDocumentsBatch, - JSON, IO[bytes] Required. - :type batch: ~azure.search.documents.models.IndexDocumentsBatch or JSON or IO[bytes] + :param batch: The batch of index actions. Is either a IndexDocumentsBatch type or a IO[bytes] + type. Required. + :type batch: ~azure.search.documents.models.IndexDocumentsBatch or + ~azure.search.documents.types.IndexDocumentsBatch or IO[bytes] :return: IndexDocumentsResult. The IndexDocumentsResult is compatible with MutableMapping :rtype: ~azure.search.documents.models._models.IndexDocumentsResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1430,7 +1431,7 @@ async def _autocomplete_post( ) -> _models2._models.AutocompleteResult: ... @overload async def _autocomplete_post( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, body: _types_models2.AutocompletePostRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models2._models.AutocompleteResult: ... @overload async def _autocomplete_post( @@ -1440,7 +1441,7 @@ async def _autocomplete_post( @distributed_trace_async async def _autocomplete_post( # pylint: disable=too-many-locals self, - body: Union[JSON, IO[bytes]] = _Unset, + body: Union[JSON, _types_models2.AutocompletePostRequest, IO[bytes]] = _Unset, *, search_text: str = _Unset, suggester_name: str = _Unset, @@ -1456,8 +1457,8 @@ async def _autocomplete_post( # pylint: disable=too-many-locals ) -> _models2._models.AutocompleteResult: """Autocompletes incomplete query terms based on input text and matching terms in the index. - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] + :param body: Is one of the following types: JSON, AutocompletePostRequest, IO[bytes] Required. + :type body: JSON or ~azure.search.documents.types.AutocompletePostRequest or IO[bytes] :keyword search_text: The search text on which to base autocomplete results. Required. :paramtype search_text: str :keyword suggester_name: The name of the suggester as specified in the suggesters collection diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py index 48fdf84c6519..b57bcb798e70 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py @@ -55,7 +55,7 @@ def __init__(self, client, initial_request: SearchRequest, kwargs, continuation_ self._initial_request = initial_request self._kwargs = kwargs self._facets: Optional[Dict[str, List[Dict[str, Any]]]] = None - self._api_version = kwargs.get("api_version", "2026-05-01-preview") + self._api_version = kwargs.get("api_version", "2026-08-01-preview") async def _get_next_cb(self, continuation_token): if continuation_token is None: diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py index 769641727b2f..4c5d8182bf57 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py @@ -37,7 +37,7 @@ class SearchClient(_SearchClient): :type index_name: str :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py index f03893069315..6e89b4ebd388 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, TYPE_CHECKING, Union -from typing_extensions import Self from azure.core import PipelineClient from azure.core.credentials import AzureKeyCredential @@ -19,6 +19,11 @@ from ._configuration import SearchIndexClientConfiguration, SearchIndexerClientConfiguration from ._operations import _SearchIndexClientOperationsMixin, _SearchIndexerClientOperationsMixin +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -33,8 +38,9 @@ class SearchIndexClient(_SearchIndexClientOperationsMixin): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -112,8 +118,9 @@ class SearchIndexerClient(_SearchIndexerClientOperationsMixin): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py index 7c1756d62618..779c9a60f5c4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py @@ -30,13 +30,14 @@ class SearchIndexClientConfiguration: # pylint: disable=too-many-instance-attri :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -85,13 +86,14 @@ class SearchIndexerClientConfiguration: # pylint: disable=too-many-instance-att :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py index 068e8567c539..aa0076751f03 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py @@ -30,16 +30,15 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models1, types as _types_models1 from ... import models as _models2 -from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Serializer -from ..._utils.utils import ClientMixinABC, prep_if_match, prep_if_none_match +from ..._utils.utils import ClientMixinABC, prep_if_match, prep_if_none_match, prepare_multipart_form_data from ..._validation import api_version_validation from ...knowledgebases import models as _knowledgebases_models3 from .._configuration import SearchIndexClientConfiguration, SearchIndexerClientConfiguration -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -55,7 +54,7 @@ def build_search_index_create_or_update_synonym_map_request( # pylint: disable= prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -91,7 +90,7 @@ def build_search_index_delete_synonym_map_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -124,7 +123,7 @@ def build_search_index_get_synonym_map_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -146,12 +145,17 @@ def build_search_index_get_synonym_map_request( # pylint: disable=name-too-long def build_search_index_get_synonym_maps_request( # pylint: disable=name-too-long - *, select: Optional[list[str]] = None, **kwargs: Any + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -161,6 +165,12 @@ def build_search_index_get_synonym_maps_request( # pylint: disable=name-too-lon _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if select is not None: _params["$select"] = _SERIALIZER.query("select", select, "[str]", div=",") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -174,7 +184,7 @@ def build_search_index_create_synonym_map_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -205,7 +215,7 @@ def build_search_index_create_or_update_index_request( # pylint: disable=name-t prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -243,7 +253,7 @@ def build_search_index_delete_index_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -274,7 +284,7 @@ def build_search_index_get_index_request(name: str, **kwargs: Any) -> HttpReques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -296,12 +306,16 @@ def build_search_index_get_index_request(name: str, **kwargs: Any) -> HttpReques def build_search_index_list_indexes_request( - *, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None, **kwargs: Any + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -309,12 +323,12 @@ def build_search_index_list_indexes_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if count is not None: - _params["$count"] = _SERIALIZER.query("count", count, "bool") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -326,15 +340,15 @@ def build_search_index_list_indexes_request( def build_search_index_list_indexes_with_selected_properties_request( # pylint: disable=name-too-long *, select: Optional[list[str]] = None, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -344,12 +358,12 @@ def build_search_index_list_indexes_with_selected_properties_request( # pylint: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if select is not None: _params["$select"] = _SERIALIZER.query("select", select, "[str]", div=",") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if count is not None: - _params["$count"] = _SERIALIZER.query("count", count, "bool") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -363,7 +377,7 @@ def build_search_index_create_index_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -387,7 +401,7 @@ def build_search_index_get_index_statistics_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -413,7 +427,7 @@ def build_search_index_analyze_text_request(name: str, **kwargs: Any) -> HttpReq _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -444,7 +458,7 @@ def build_search_index_create_or_update_alias_request( # pylint: disable=name-t prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -480,7 +494,7 @@ def build_search_index_delete_alias_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -511,7 +525,7 @@ def build_search_index_get_alias_request(name: str, **kwargs: Any) -> HttpReques _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -532,11 +546,17 @@ def build_search_index_get_alias_request(name: str, **kwargs: Any) -> HttpReques return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_search_index_list_aliases_request(**kwargs: Any) -> HttpRequest: +def build_search_index_list_aliases_request( + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -544,6 +564,12 @@ def build_search_index_list_aliases_request(**kwargs: Any) -> HttpRequest: # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -557,7 +583,7 @@ def build_search_index_create_alias_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -583,7 +609,7 @@ def build_search_index_create_or_update_knowledge_base_request( # pylint: disab prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -619,7 +645,7 @@ def build_search_index_delete_knowledge_base_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -652,7 +678,7 @@ def build_search_index_get_knowledge_base_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -673,11 +699,17 @@ def build_search_index_get_knowledge_base_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_search_index_list_knowledge_bases_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_search_index_list_knowledge_bases_request( # pylint: disable=name-too-long + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -685,6 +717,12 @@ def build_search_index_list_knowledge_bases_request(**kwargs: Any) -> HttpReques # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -698,7 +736,7 @@ def build_search_index_create_knowledge_base_request(**kwargs: Any) -> HttpReque _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -724,7 +762,7 @@ def build_search_index_create_or_update_knowledge_source_request( # pylint: dis prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -760,7 +798,7 @@ def build_search_index_delete_knowledge_source_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -793,7 +831,7 @@ def build_search_index_get_knowledge_source_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -814,11 +852,17 @@ def build_search_index_get_knowledge_source_request( # pylint: disable=name-too return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_search_index_list_knowledge_sources_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_search_index_list_knowledge_sources_request( # pylint: disable=name-too-long + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -826,6 +870,12 @@ def build_search_index_list_knowledge_sources_request(**kwargs: Any) -> HttpRequ # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -839,7 +889,7 @@ def build_search_index_create_knowledge_source_request(**kwargs: Any) -> HttpReq _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -863,7 +913,7 @@ def build_search_index_get_knowledge_source_status_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -891,7 +941,7 @@ def build_search_index_upload_knowledge_source_file_request( # pylint: disable= _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: str = kwargs.pop("content_type") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -913,13 +963,45 @@ def build_search_index_upload_knowledge_source_file_request( # pylint: disable= return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_search_index_list_knowledge_source_files_request( # pylint: disable=name-too-long +def build_search_index_upload_knowledge_source_file_multipart_request( # pylint: disable=name-too-long name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/knowledgesources('{sourceName}')/files" + path_format_arguments = { + "sourceName": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_search_index_list_knowledge_source_files_request( # pylint: disable=name-too-long + name: str, + *, + prefix: Optional[str] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -932,6 +1014,14 @@ def build_search_index_list_knowledge_source_files_request( # pylint: disable=n # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if prefix is not None: + _params["prefix"] = _SERIALIZER.query("prefix", prefix, "str") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -946,7 +1036,7 @@ def build_search_index_delete_knowledge_source_file_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -968,11 +1058,38 @@ def build_search_index_delete_knowledge_source_file_request( # pylint: disable= return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) +def build_search_index_update_knowledge_source_file_request( # pylint: disable=name-too-long + file_id: str, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/knowledgesources('{sourceName}')/files('{fileId}')" + path_format_arguments = { + "fileId": _SERIALIZER.url("file_id", file_id, "str"), + "sourceName": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + def build_search_index_get_service_statistics_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -989,12 +1106,16 @@ def build_search_index_get_service_statistics_request(**kwargs: Any) -> HttpRequ def build_search_index_list_index_stats_summary_request( # pylint: disable=name-too-long - *, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None, **kwargs: Any + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1002,12 +1123,12 @@ def build_search_index_list_index_stats_summary_request( # pylint: disable=name # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if count is not None: - _params["$count"] = _SERIALIZER.query("count", count, "bool") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -1029,7 +1150,7 @@ def build_search_indexer_create_or_update_data_source_connection_request( # pyl prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1069,7 +1190,7 @@ def build_search_indexer_delete_data_source_connection_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1102,7 +1223,7 @@ def build_search_indexer_get_data_source_connection_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1124,12 +1245,17 @@ def build_search_indexer_get_data_source_connection_request( # pylint: disable= def build_search_indexer_get_data_source_connections_request( # pylint: disable=name-too-long - *, select: Optional[list[str]] = None, **kwargs: Any + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1139,6 +1265,12 @@ def build_search_indexer_get_data_source_connections_request( # pylint: disable _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if select is not None: _params["$select"] = _SERIALIZER.query("select", select, "[str]", div=",") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -1154,7 +1286,7 @@ def build_search_indexer_create_data_source_connection_request( # pylint: disab _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1178,7 +1310,7 @@ def build_search_indexer_reset_indexer_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1204,7 +1336,7 @@ def build_search_indexer_resync_request(name: str, **kwargs: Any) -> HttpRequest _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1234,7 +1366,7 @@ def build_search_indexer_reset_documents_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1263,7 +1395,7 @@ def build_search_indexer_run_indexer_request(name: str, **kwargs: Any) -> HttpRe _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1298,7 +1430,7 @@ def build_search_indexer_create_or_update_indexer_request( # pylint: disable=na prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1342,7 +1474,7 @@ def build_search_indexer_delete_indexer_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1373,7 +1505,7 @@ def build_search_indexer_get_indexer_request(name: str, **kwargs: Any) -> HttpRe _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1395,12 +1527,17 @@ def build_search_indexer_get_indexer_request(name: str, **kwargs: Any) -> HttpRe def build_search_indexer_get_indexers_request( # pylint: disable=name-too-long - *, select: Optional[list[str]] = None, **kwargs: Any + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1410,6 +1547,12 @@ def build_search_indexer_get_indexers_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if select is not None: _params["$select"] = _SERIALIZER.query("select", select, "[str]", div=",") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -1423,7 +1566,7 @@ def build_search_indexer_create_indexer_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1447,7 +1590,7 @@ def build_search_indexer_get_indexer_status_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1482,7 +1625,7 @@ def build_search_indexer_create_or_update_skillset_request( # pylint: disable=n prefer: Literal["return=representation"] = kwargs.pop("prefer", _headers.pop("Prefer", "return=representation")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1526,7 +1669,7 @@ def build_search_indexer_delete_skillset_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1557,7 +1700,7 @@ def build_search_indexer_get_skillset_request(name: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1579,12 +1722,17 @@ def build_search_indexer_get_skillset_request(name: str, **kwargs: Any) -> HttpR def build_search_indexer_get_skillsets_request( # pylint: disable=name-too-long - *, select: Optional[list[str]] = None, **kwargs: Any + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1594,6 +1742,12 @@ def build_search_indexer_get_skillsets_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if select is not None: _params["$select"] = _SERIALIZER.query("select", select, "[str]", div=",") + if search is not None: + _params["search"] = _SERIALIZER.query("search", search, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if search_type is not None: + _params["searchType"] = _SERIALIZER.query("search_type", search_type, "str") # Construct headers if accept is not None: @@ -1607,7 +1761,7 @@ def build_search_indexer_create_skillset_request(**kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1630,7 +1784,7 @@ def build_search_indexer_reset_skills_request(name: str, **kwargs: Any) -> HttpR _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -1672,7 +1826,7 @@ def _create_or_update_synonym_map( def _create_or_update_synonym_map( self, name: str, - synonym_map: JSON, + synonym_map: _types_models1.SynonymMap, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -1695,7 +1849,7 @@ def _create_or_update_synonym_map( def _create_or_update_synonym_map( self, name: str, - synonym_map: Union[_models1.SynonymMap, JSON, IO[bytes]], + synonym_map: Union[_models1.SynonymMap, _types_models1.SynonymMap, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -1705,9 +1859,10 @@ def _create_or_update_synonym_map( :param name: The name of the synonym map. Required. :type name: str - :param synonym_map: The definition of the synonym map to create or update. Is one of the - following types: SynonymMap, JSON, IO[bytes] Required. - :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or JSON or IO[bytes] + :param synonym_map: The definition of the synonym map to create or update. Is either a + SynonymMap type or a IO[bytes] type. Required. + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or + ~azure.search.documents.indexes.types.SynonymMap or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -1925,8 +2080,18 @@ def get_synonym_map(self, name: str, **kwargs: Any) -> _models1.SynonymMap: return deserialized # type: ignore @distributed_trace + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) def _get_synonym_maps( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> _models1._models.ListSynonymMapsResult: """Lists all synonym maps available for a search service. @@ -1934,6 +2099,16 @@ def _get_synonym_maps( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListSynonymMapsResult. The ListSynonymMapsResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListSynonymMapsResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1953,6 +2128,9 @@ def _get_synonym_maps( _request = build_search_index_get_synonym_maps_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2013,12 +2191,12 @@ def create_synonym_map( @overload def create_synonym_map( - self, synonym_map: JSON, *, content_type: str = "application/json", **kwargs: Any + self, synonym_map: _types_models1.SynonymMap, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.SynonymMap: """Creates a new synonym map. :param synonym_map: The definition of the synonym map to create. Required. - :type synonym_map: JSON + :type synonym_map: ~azure.search.documents.indexes.types.SynonymMap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2045,13 +2223,14 @@ def create_synonym_map( @distributed_trace def create_synonym_map( - self, synonym_map: Union[_models1.SynonymMap, JSON, IO[bytes]], **kwargs: Any + self, synonym_map: Union[_models1.SynonymMap, _types_models1.SynonymMap, IO[bytes]], **kwargs: Any ) -> _models1.SynonymMap: """Creates a new synonym map. - :param synonym_map: The definition of the synonym map to create. Is one of the following types: - SynonymMap, JSON, IO[bytes] Required. - :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or JSON or IO[bytes] + :param synonym_map: The definition of the synonym map to create. Is either a SynonymMap type or + a IO[bytes] type. Required. + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or + ~azure.search.documents.indexes.types.SynonymMap or IO[bytes] :return: SynonymMap. The SynonymMap is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises ~azure.core.exceptions.HttpResponseError: @@ -2136,7 +2315,7 @@ def _create_or_update_index( def _create_or_update_index( self, name: str, - index: JSON, + index: _types_models1.SearchIndex, *, allow_index_downtime: Optional[bool] = None, content_type: str = "application/json", @@ -2161,7 +2340,7 @@ def _create_or_update_index( def _create_or_update_index( self, name: str, - index: Union[_models1.SearchIndex, JSON, IO[bytes]], + index: Union[_models1.SearchIndex, _types_models1.SearchIndex, IO[bytes]], *, allow_index_downtime: Optional[bool] = None, etag: Optional[str] = None, @@ -2172,9 +2351,10 @@ def _create_or_update_index( :param name: The name of the index. Required. :type name: str - :param index: The definition of the index to create or update. Is one of the following types: - SearchIndex, JSON, IO[bytes] Required. - :type index: ~azure.search.documents.indexes.models.SearchIndex or JSON or IO[bytes] + :param index: The definition of the index to create or update. Is either a SearchIndex type or + a IO[bytes] type. Required. + :type index: ~azure.search.documents.indexes.models.SearchIndex or + ~azure.search.documents.indexes.types.SearchIndex or IO[bytes] :keyword allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of @@ -2402,22 +2582,32 @@ def get_index(self, name: str, **kwargs: Any) -> _models1.SearchIndex: @distributed_trace @api_version_validation( - params_added_on={"2026-05-01-preview": ["top", "skip", "count"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "accept", "search", "page_size", "search_type", "client_request_id"] + }, + api_versions_list=["2026-08-01-preview"], ) def _list_indexes( - self, *, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None, **kwargs: Any + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> ItemPaged["_models1.SearchIndex"]: """Lists all indexes available for a search service. - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchIndex :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchIndex] :raises ~azure.core.exceptions.HttpResponseError: @@ -2439,9 +2629,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_indexes_request( - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2464,7 +2654,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2508,16 +2701,27 @@ def get_next(next_link=None): @distributed_trace @api_version_validation( - params_added_on={"2026-05-01-preview": ["top", "skip", "count"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "accept", + "select", + "search", + "page_size", + "search_type", + "client_request_id", + ] + }, + api_versions_list=["2026-08-01-preview"], ) def _list_indexes_with_selected_properties( self, *, select: Optional[list[str]] = None, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, **kwargs: Any, ) -> ItemPaged["_models1._models.SearchIndexResponse"]: """Lists all indexes available for a search service. @@ -2526,14 +2730,16 @@ def _list_indexes_with_selected_properties( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchIndexResponse :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models._models.SearchIndexResponse] @@ -2557,9 +2763,9 @@ def prepare_request(next_link=None): _request = build_search_index_list_indexes_with_selected_properties_request( select=select, - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2582,7 +2788,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2596,7 +2805,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access + list[_models1._models.SearchIndexResponse], deserialized.get("value", []), ) if cls: @@ -2642,12 +2851,12 @@ def create_index( @overload def create_index( - self, index: JSON, *, content_type: str = "application/json", **kwargs: Any + self, index: _types_models1.SearchIndex, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.SearchIndex: """Creates a new search index. :param index: The definition of the index to create. Required. - :type index: JSON + :type index: ~azure.search.documents.indexes.types.SearchIndex :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2673,12 +2882,15 @@ def create_index( """ @distributed_trace - def create_index(self, index: Union[_models1.SearchIndex, JSON, IO[bytes]], **kwargs: Any) -> _models1.SearchIndex: + def create_index( + self, index: Union[_models1.SearchIndex, _types_models1.SearchIndex, IO[bytes]], **kwargs: Any + ) -> _models1.SearchIndex: """Creates a new search index. - :param index: The definition of the index to create. Is one of the following types: - SearchIndex, JSON, IO[bytes] Required. - :type index: ~azure.search.documents.indexes.models.SearchIndex or JSON or IO[bytes] + :param index: The definition of the index to create. Is either a SearchIndex type or a + IO[bytes] type. Required. + :type index: ~azure.search.documents.indexes.models.SearchIndex or + ~azure.search.documents.indexes.types.SearchIndex or IO[bytes] :return: SearchIndex. The SearchIndex is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises ~azure.core.exceptions.HttpResponseError: @@ -2819,7 +3031,12 @@ def _analyze_text( ) -> _models1.AnalyzeResult: ... @overload def _analyze_text( - self, name: str, request: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + request: _types_models1.AnalyzeTextOptions, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models1.AnalyzeResult: ... @overload def _analyze_text( @@ -2828,15 +3045,19 @@ def _analyze_text( @distributed_trace def _analyze_text( - self, name: str, request: Union[_models1.AnalyzeTextOptions, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + request: Union[_models1.AnalyzeTextOptions, _types_models1.AnalyzeTextOptions, IO[bytes]], + **kwargs: Any, ) -> _models1.AnalyzeResult: """Shows how an analyzer breaks text into tokens. :param name: The name of the index. Required. :type name: str - :param request: The text and analyzer or analysis components to test. Is one of the following - types: AnalyzeTextOptions, JSON, IO[bytes] Required. - :type request: ~azure.search.documents.indexes.models.AnalyzeTextOptions or JSON or IO[bytes] + :param request: The text and analyzer or analysis components to test. Is either a + AnalyzeTextOptions type or a IO[bytes] type. Required. + :type request: ~azure.search.documents.indexes.models.AnalyzeTextOptions or + ~azure.search.documents.indexes.types.AnalyzeTextOptions or IO[bytes] :return: AnalyzeResult. The AnalyzeResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.AnalyzeResult :raises ~azure.core.exceptions.HttpResponseError: @@ -2921,7 +3142,7 @@ def _create_or_update_alias( def _create_or_update_alias( self, name: str, - alias: JSON, + alias: _types_models1.SearchAlias, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -2944,7 +3165,7 @@ def _create_or_update_alias( def _create_or_update_alias( self, name: str, - alias: Union[_models1.SearchAlias, JSON, IO[bytes]], + alias: Union[_models1.SearchAlias, _types_models1.SearchAlias, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -2954,9 +3175,10 @@ def _create_or_update_alias( :param name: The name of the alias. Required. :type name: str - :param alias: The definition of the alias to create or update. Is one of the following types: - SearchAlias, JSON, IO[bytes] Required. - :type alias: ~azure.search.documents.indexes.models.SearchAlias or JSON or IO[bytes] + :param alias: The definition of the alias to create or update. Is either a SearchAlias type or + a IO[bytes] type. Required. + :type alias: ~azure.search.documents.indexes.models.SearchAlias or + ~azure.search.documents.indexes.types.SearchAlias or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -3175,9 +3397,30 @@ def get_alias(self, name: str, **kwargs: Any) -> _models1.SearchAlias: return deserialized # type: ignore @distributed_trace - def list_aliases(self, **kwargs: Any) -> ItemPaged["_models1.SearchAlias"]: + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) + def list_aliases( + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, + ) -> ItemPaged["_models1.SearchAlias"]: """Lists all aliases available for a search service. + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchAlias :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchAlias] :raises ~azure.core.exceptions.HttpResponseError: @@ -3199,6 +3442,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_aliases_request( + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3221,7 +3467,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3240,7 +3489,7 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -3281,12 +3530,12 @@ def create_alias( @overload def create_alias( - self, alias: JSON, *, content_type: str = "application/json", **kwargs: Any + self, alias: _types_models1.SearchAlias, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.SearchAlias: """Creates a new search alias. :param alias: The definition of the alias to create. Required. - :type alias: JSON + :type alias: ~azure.search.documents.indexes.types.SearchAlias :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3312,12 +3561,15 @@ def create_alias( """ @distributed_trace - def create_alias(self, alias: Union[_models1.SearchAlias, JSON, IO[bytes]], **kwargs: Any) -> _models1.SearchAlias: + def create_alias( + self, alias: Union[_models1.SearchAlias, _types_models1.SearchAlias, IO[bytes]], **kwargs: Any + ) -> _models1.SearchAlias: """Creates a new search alias. - :param alias: The definition of the alias to create. Is one of the following types: - SearchAlias, JSON, IO[bytes] Required. - :type alias: ~azure.search.documents.indexes.models.SearchAlias or JSON or IO[bytes] + :param alias: The definition of the alias to create. Is either a SearchAlias type or a + IO[bytes] type. Required. + :type alias: ~azure.search.documents.indexes.models.SearchAlias or + ~azure.search.documents.indexes.types.SearchAlias or IO[bytes] :return: SearchAlias. The SearchAlias is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchAlias :raises ~azure.core.exceptions.HttpResponseError: @@ -3401,7 +3653,7 @@ def _create_or_update_knowledge_base( def _create_or_update_knowledge_base( self, name: str, - knowledge_base: JSON, + knowledge_base: _types_models1.KnowledgeBase, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -3424,7 +3676,7 @@ def _create_or_update_knowledge_base( def _create_or_update_knowledge_base( self, name: str, - knowledge_base: Union[_models1.KnowledgeBase, JSON, IO[bytes]], + knowledge_base: Union[_models1.KnowledgeBase, _types_models1.KnowledgeBase, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -3434,9 +3686,10 @@ def _create_or_update_knowledge_base( :param name: The name of the knowledge base. Required. :type name: str - :param knowledge_base: The definition of the knowledge base to create or update. Is one of the - following types: KnowledgeBase, JSON, IO[bytes] Required. - :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or JSON or IO[bytes] + :param knowledge_base: The definition of the knowledge base to create or update. Is either a + KnowledgeBase type or a IO[bytes] type. Required. + :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or + ~azure.search.documents.indexes.types.KnowledgeBase or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -3654,9 +3907,30 @@ def get_knowledge_base(self, name: str, **kwargs: Any) -> _models1.KnowledgeBase return deserialized # type: ignore @distributed_trace - def list_knowledge_bases(self, **kwargs: Any) -> ItemPaged["_models1.KnowledgeBase"]: + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) + def list_knowledge_bases( + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, + ) -> ItemPaged["_models1.KnowledgeBase"]: """Lists all knowledge bases available for a search service. + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of KnowledgeBase :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.KnowledgeBase] :raises ~azure.core.exceptions.HttpResponseError: @@ -3678,6 +3952,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_knowledge_bases_request( + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3700,7 +3977,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3719,7 +3999,7 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -3760,12 +4040,12 @@ def create_knowledge_base( @overload def create_knowledge_base( - self, knowledge_base: JSON, *, content_type: str = "application/json", **kwargs: Any + self, knowledge_base: _types_models1.KnowledgeBase, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.KnowledgeBase: """Creates a new knowledge base. :param knowledge_base: The definition of the knowledge base to create. Required. - :type knowledge_base: JSON + :type knowledge_base: ~azure.search.documents.indexes.types.KnowledgeBase :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3792,13 +4072,14 @@ def create_knowledge_base( @distributed_trace def create_knowledge_base( - self, knowledge_base: Union[_models1.KnowledgeBase, JSON, IO[bytes]], **kwargs: Any + self, knowledge_base: Union[_models1.KnowledgeBase, _types_models1.KnowledgeBase, IO[bytes]], **kwargs: Any ) -> _models1.KnowledgeBase: """Creates a new knowledge base. - :param knowledge_base: The definition of the knowledge base to create. Is one of the following - types: KnowledgeBase, JSON, IO[bytes] Required. - :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or JSON or IO[bytes] + :param knowledge_base: The definition of the knowledge base to create. Is either a + KnowledgeBase type or a IO[bytes] type. Required. + :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or + ~azure.search.documents.indexes.types.KnowledgeBase or IO[bytes] :return: KnowledgeBase. The KnowledgeBase is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.KnowledgeBase :raises ~azure.core.exceptions.HttpResponseError: @@ -3882,7 +4163,7 @@ def _create_or_update_knowledge_source( def _create_or_update_knowledge_source( self, name: str, - knowledge_source: JSON, + knowledge_source: _types_models1.KnowledgeSource, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -3905,7 +4186,7 @@ def _create_or_update_knowledge_source( def _create_or_update_knowledge_source( self, name: str, - knowledge_source: Union[_models1.KnowledgeSource, JSON, IO[bytes]], + knowledge_source: Union[_models1.KnowledgeSource, _types_models1.KnowledgeSource, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -3915,10 +4196,10 @@ def _create_or_update_knowledge_source( :param name: The name of the knowledge source. Required. :type name: str - :param knowledge_source: The definition of the knowledge source to create or update. Is one of - the following types: KnowledgeSource, JSON, IO[bytes] Required. - :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or JSON or - IO[bytes] + :param knowledge_source: The definition of the knowledge source to create or update. Is either + a KnowledgeSource type or a IO[bytes] type. Required. + :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or + ~azure.search.documents.indexes.types.KnowledgeSource or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -4136,9 +4417,30 @@ def get_knowledge_source(self, name: str, **kwargs: Any) -> _models1.KnowledgeSo return deserialized # type: ignore @distributed_trace - def list_knowledge_sources(self, **kwargs: Any) -> ItemPaged["_models1.KnowledgeSource"]: + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) + def list_knowledge_sources( + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, + ) -> ItemPaged["_models1.KnowledgeSource"]: """Lists all knowledge sources available for a search service. + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of KnowledgeSource :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.KnowledgeSource] :raises ~azure.core.exceptions.HttpResponseError: @@ -4160,6 +4462,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_knowledge_sources_request( + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4182,7 +4487,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4201,7 +4509,7 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -4242,12 +4550,12 @@ def create_knowledge_source( @overload def create_knowledge_source( - self, knowledge_source: JSON, *, content_type: str = "application/json", **kwargs: Any + self, knowledge_source: _types_models1.KnowledgeSource, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.KnowledgeSource: """Creates a new knowledge source. :param knowledge_source: The definition of the knowledge source to create. Required. - :type knowledge_source: JSON + :type knowledge_source: ~azure.search.documents.indexes.types.KnowledgeSource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4274,14 +4582,16 @@ def create_knowledge_source( @distributed_trace def create_knowledge_source( - self, knowledge_source: Union[_models1.KnowledgeSource, JSON, IO[bytes]], **kwargs: Any + self, + knowledge_source: Union[_models1.KnowledgeSource, _types_models1.KnowledgeSource, IO[bytes]], + **kwargs: Any, ) -> _models1.KnowledgeSource: """Creates a new knowledge source. - :param knowledge_source: The definition of the knowledge source to create. Is one of the - following types: KnowledgeSource, JSON, IO[bytes] Required. - :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or JSON or - IO[bytes] + :param knowledge_source: The definition of the knowledge source to create. Is either a + KnowledgeSource type or a IO[bytes] type. Required. + :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or + ~azure.search.documents.indexes.types.KnowledgeSource or IO[bytes] :return: KnowledgeSource. The KnowledgeSource is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.KnowledgeSource :raises ~azure.core.exceptions.HttpResponseError: @@ -4428,7 +4738,7 @@ def get_knowledge_source_status(self, name: str, **kwargs: Any) -> _knowledgebas "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _upload_knowledge_source_file( self, name: str, file: bytes, *, content_disposition: str, **kwargs: Any @@ -4509,17 +4819,165 @@ def _upload_knowledge_source_file( return deserialized # type: ignore + @overload + def upload_knowledge_source_file_multipart( + self, name: str, body: _models1.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any + ) -> _models1.KnowledgeSourceFile: + """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part + (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part + with the raw file bytes. + + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def upload_knowledge_source_file_multipart( + self, name: str, body: _types_models1.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any + ) -> _models1.KnowledgeSourceFile: + """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part + (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part + with the raw file bytes. + + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.types.UploadKnowledgeSourceFileMultipartRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={"2026-08-01-preview": ["api_version", "client_request_id", "name", "content_type", "accept"]}, + api_versions_list=["2026-08-01-preview"], + ) + def upload_knowledge_source_file_multipart( + self, + name: str, + body: Union[ + _models1.UploadKnowledgeSourceFileMultipartRequest, _types_models1.UploadKnowledgeSourceFileMultipartRequest + ], + **kwargs: Any, + ) -> _models1.KnowledgeSourceFile: + """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part + (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part + with the raw file bytes. + + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Is one of + the following types: UploadKnowledgeSourceFileMultipartRequest Required. + :type body: ~azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest or + ~azure.search.documents.indexes.types.UploadKnowledgeSourceFileMultipartRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models1.KnowledgeSourceFile] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _Model) else body + _file_fields: list[str] = ["content"] + _data_fields: list[str] = ["metadata"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_search_index_upload_knowledge_source_file_multipart_request( + name=name, + api_version=self._config.api_version, + files=_files, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models1.KnowledgeSourceFile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", - params_added_on={"2026-05-01-preview": ["api_version", "accept", "client_request_id", "name"]}, - api_versions_list=["2026-05-01-preview"], + params_added_on={ + "2026-05-01-preview": ["api_version", "accept", "client_request_id", "name"], + "2026-08-01-preview": ["prefix", "search", "page_size", "search_type"], + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - def list_knowledge_source_files(self, name: str, **kwargs: Any) -> ItemPaged["_models1.KnowledgeSourceFile"]: + def list_knowledge_source_files( + self, + name: str, + *, + prefix: Optional[str] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, + ) -> ItemPaged["_models1.KnowledgeSourceFile"]: """Lists all files in a File knowledge source. :param name: The name of the knowledge source. Required. :type name: str + :keyword prefix: Optional prefix to filter files by their directory-like path. Default value is + None. + :paramtype prefix: str + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of KnowledgeSourceFile :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.KnowledgeSourceFile] @@ -4543,6 +5001,10 @@ def prepare_request(next_link=None): _request = build_search_index_list_knowledge_source_files_request( name=name, + prefix=prefix, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4565,7 +5027,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4584,7 +5049,7 @@ def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -4611,7 +5076,7 @@ def get_next(next_link=None): @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "file_id", "accept", "client_request_id", "name"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _delete_knowledge_source_file( # pylint: disable=inconsistent-return-statements self, file_id: str, name: str, **kwargs: Any @@ -4669,6 +5134,137 @@ def _delete_knowledge_source_file( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) # type: ignore + @overload + def update_knowledge_source_file( + self, file_id: str, name: str, body: _models1.UpdateKnowledgeSourceFileRequest, **kwargs: Any + ) -> _models1.KnowledgeSourceFile: + """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, custom metadata, and optional + extraction override) and a 'content' part with the raw file bytes. + + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_knowledge_source_file( + self, file_id: str, name: str, body: _types_models1.UpdateKnowledgeSourceFileRequest, **kwargs: Any + ) -> _models1.KnowledgeSourceFile: + """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, custom metadata, and optional + extraction override) and a 'content' part with the raw file bytes. + + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "file_id", "client_request_id", "name", "content_type", "accept"] + }, + api_versions_list=["2026-08-01-preview"], + ) + def update_knowledge_source_file( + self, + file_id: str, + name: str, + body: Union[_models1.UpdateKnowledgeSourceFileRequest, _types_models1.UpdateKnowledgeSourceFileRequest], + **kwargs: Any, + ) -> _models1.KnowledgeSourceFile: + """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, custom metadata, and optional + extraction override) and a 'content' part with the raw file bytes. + + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Is one of + the following types: UpdateKnowledgeSourceFileRequest Required. + :type body: ~azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest or + ~azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models1.KnowledgeSourceFile] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _Model) else body + _file_fields: list[str] = ["content"] + _data_fields: list[str] = ["metadata"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_search_index_update_knowledge_source_file_request( + file_id=file_id, + name=name, + api_version=self._config.api_version, + files=_files, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models1.KnowledgeSourceFile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace def get_service_statistics(self, **kwargs: Any) -> _models1.SearchServiceStatistics: """Gets service level statistics for a search service. @@ -4733,23 +5329,32 @@ def get_service_statistics(self, **kwargs: Any) -> _models1.SearchServiceStatist @distributed_trace @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={"2026-05-01-preview": ["api_version", "accept", "top", "skip", "count", "client_request_id"]}, - api_versions_list=["2026-05-01-preview"], + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "accept", "search", "page_size", "search_type", "client_request_id"] + }, + api_versions_list=["2026-08-01-preview"], ) def list_index_stats_summary( - self, *, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None, **kwargs: Any + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> ItemPaged["_models1.IndexStatisticsSummary"]: """Retrieves a summary of statistics for all indexes in the search service. - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of IndexStatisticsSummary :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.IndexStatisticsSummary] @@ -4772,9 +5377,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_index_stats_summary_request( - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4797,7 +5402,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4860,7 +5468,7 @@ def _create_or_update_data_source_connection( def _create_or_update_data_source_connection( self, name: str, - data_source: JSON, + data_source: _types_models1.SearchIndexerDataSourceConnection, *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, content_type: str = "application/json", @@ -4884,12 +5492,14 @@ def _create_or_update_data_source_connection( @distributed_trace @api_version_validation( params_added_on={"2026-05-01-preview": ["skip_indexer_reset_requirement_for_cache"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def _create_or_update_data_source_connection( self, name: str, - data_source: Union[_models1.SearchIndexerDataSourceConnection, JSON, IO[bytes]], + data_source: Union[ + _models1.SearchIndexerDataSourceConnection, _types_models1.SearchIndexerDataSourceConnection, IO[bytes] + ], *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, etag: Optional[str] = None, @@ -4900,10 +5510,10 @@ def _create_or_update_data_source_connection( :param name: The name of the datasource. Required. :type name: str - :param data_source: The definition of the datasource to create or update. Is one of the - following types: SearchIndexerDataSourceConnection, JSON, IO[bytes] Required. + :param data_source: The definition of the datasource to create or update. Is either a + SearchIndexerDataSourceConnection type or a IO[bytes] type. Required. :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection or - JSON or IO[bytes] + ~azure.search.documents.indexes.types.SearchIndexerDataSourceConnection or IO[bytes] :keyword skip_indexer_reset_requirement_for_cache: Ignores cache reset requirements. Default value is None. :paramtype skip_indexer_reset_requirement_for_cache: bool @@ -5127,8 +5737,18 @@ def get_data_source_connection(self, name: str, **kwargs: Any) -> _models1.Searc return deserialized # type: ignore @distributed_trace + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) def _get_data_source_connections( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> _models1._models.ListDataSourcesResult: """Lists all datasources available for a search service. @@ -5136,6 +5756,16 @@ def _get_data_source_connections( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListDataSourcesResult. The ListDataSourcesResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListDataSourcesResult :raises ~azure.core.exceptions.HttpResponseError: @@ -5155,6 +5785,9 @@ def _get_data_source_connections( _request = build_search_indexer_get_data_source_connections_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5221,12 +5854,17 @@ def create_data_source_connection( @overload def create_data_source_connection( - self, data_source_connection: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + data_source_connection: _types_models1.SearchIndexerDataSourceConnection, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> _models1.SearchIndexerDataSourceConnection: """Creates a new datasource. :param data_source_connection: The definition of the datasource to create. Required. - :type data_source_connection: JSON + :type data_source_connection: + ~azure.search.documents.indexes.types.SearchIndexerDataSourceConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5255,14 +5893,19 @@ def create_data_source_connection( @distributed_trace def create_data_source_connection( - self, data_source_connection: Union[_models1.SearchIndexerDataSourceConnection, JSON, IO[bytes]], **kwargs: Any + self, + data_source_connection: Union[ + _models1.SearchIndexerDataSourceConnection, _types_models1.SearchIndexerDataSourceConnection, IO[bytes] + ], + **kwargs: Any, ) -> _models1.SearchIndexerDataSourceConnection: """Creates a new datasource. - :param data_source_connection: The definition of the datasource to create. Is one of the - following types: SearchIndexerDataSourceConnection, JSON, IO[bytes] Required. + :param data_source_connection: The definition of the datasource to create. Is either a + SearchIndexerDataSourceConnection type or a IO[bytes] type. Required. :type data_source_connection: - ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection or JSON or IO[bytes] + ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection or + ~azure.search.documents.indexes.types.SearchIndexerDataSourceConnection or IO[bytes] :return: SearchIndexerDataSourceConnection. The SearchIndexerDataSourceConnection is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection @@ -5395,7 +6038,12 @@ def _resync( ) -> None: ... @overload def _resync( - self, name: str, indexer_resync: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + indexer_resync: _types_models1.IndexerResyncBody, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> None: ... @overload def _resync( @@ -5406,19 +6054,22 @@ def _resync( @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "accept", "client_request_id", "name", "content_type"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _resync( # pylint: disable=inconsistent-return-statements - self, name: str, indexer_resync: Union[_models1.IndexerResyncBody, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + indexer_resync: Union[_models1.IndexerResyncBody, _types_models1.IndexerResyncBody, IO[bytes]], + **kwargs: Any, ) -> None: """Resync selective options from the datasource to be re-ingested by the indexer.". :param name: The name of the indexer. Required. :type name: str - :param indexer_resync: The definition of the indexer resync options. Is one of the following - types: IndexerResyncBody, JSON, IO[bytes] Required. - :type indexer_resync: ~azure.search.documents.indexes.models.IndexerResyncBody or JSON or - IO[bytes] + :param indexer_resync: The definition of the indexer resync options. Is either a + IndexerResyncBody type or a IO[bytes] type. Required. + :type indexer_resync: ~azure.search.documents.indexes.models.IndexerResyncBody or + ~azure.search.documents.indexes.types.IndexerResyncBody or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -5489,7 +6140,7 @@ def _reset_documents( def _reset_documents( self, name: str, - keys_or_ids: Optional[JSON] = None, + keys_or_ids: Optional[_types_models1.DocumentKeysOrIds] = None, *, overwrite: Optional[bool] = None, content_type: str = "application/json", @@ -5512,12 +6163,12 @@ def _reset_documents( params_added_on={ "2026-05-01-preview": ["api_version", "accept", "overwrite", "client_request_id", "name", "content_type"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _reset_documents( # pylint: disable=inconsistent-return-statements self, name: str, - keys_or_ids: Optional[Union[_models1.DocumentKeysOrIds, JSON, IO[bytes]]] = None, + keys_or_ids: Optional[Union[_models1.DocumentKeysOrIds, _types_models1.DocumentKeysOrIds, IO[bytes]]] = None, *, overwrite: Optional[bool] = None, **kwargs: Any, @@ -5528,10 +6179,10 @@ def _reset_documents( # pylint: disable=inconsistent-return-statements :type name: str :param keys_or_ids: 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. Is one of the following types: DocumentKeysOrIds, JSON, - IO[bytes] Default value is None. - :type keys_or_ids: ~azure.search.documents.indexes.models.DocumentKeysOrIds or JSON or - IO[bytes] + document key field is ignored. Is either a DocumentKeysOrIds type or a IO[bytes] type. Default + value is None. + :type keys_or_ids: ~azure.search.documents.indexes.models.DocumentKeysOrIds or + ~azure.search.documents.indexes.types.DocumentKeysOrIds or IO[bytes] :keyword 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. Default value is None. :paramtype overwrite: bool @@ -5665,7 +6316,7 @@ def _create_or_update_indexer( def _create_or_update_indexer( self, name: str, - indexer: JSON, + indexer: _types_models1.SearchIndexer, *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -5696,12 +6347,12 @@ def _create_or_update_indexer( "disable_cache_reprocessing_change_detection", ] }, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def _create_or_update_indexer( self, name: str, - indexer: Union[_models1.SearchIndexer, JSON, IO[bytes]], + indexer: Union[_models1.SearchIndexer, _types_models1.SearchIndexer, IO[bytes]], *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -5713,9 +6364,10 @@ def _create_or_update_indexer( :param name: The name of the indexer. Required. :type name: str - :param indexer: The definition of the indexer to create or update. Is one of the following - types: SearchIndexer, JSON, IO[bytes] Required. - :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or JSON or IO[bytes] + :param indexer: The definition of the indexer to create or update. Is either a SearchIndexer + type or a IO[bytes] type. Required. + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or + ~azure.search.documents.indexes.types.SearchIndexer or IO[bytes] :keyword skip_indexer_reset_requirement_for_cache: Ignores cache reset requirements. Default value is None. :paramtype skip_indexer_reset_requirement_for_cache: bool @@ -5941,8 +6593,18 @@ def get_indexer(self, name: str, **kwargs: Any) -> _models1.SearchIndexer: return deserialized # type: ignore @distributed_trace + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) def _get_indexers( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> _models1._models.ListIndexersResult: """Lists all indexers available for a search service. @@ -5950,6 +6612,16 @@ def _get_indexers( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListIndexersResult. The ListIndexersResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListIndexersResult :raises ~azure.core.exceptions.HttpResponseError: @@ -5969,6 +6641,9 @@ def _get_indexers( _request = build_search_indexer_get_indexers_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6029,12 +6704,12 @@ def create_indexer( @overload def create_indexer( - self, indexer: JSON, *, content_type: str = "application/json", **kwargs: Any + self, indexer: _types_models1.SearchIndexer, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.SearchIndexer: """Creates a new indexer. :param indexer: The definition of the indexer to create. Required. - :type indexer: JSON + :type indexer: ~azure.search.documents.indexes.types.SearchIndexer :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6061,13 +6736,14 @@ def create_indexer( @distributed_trace def create_indexer( - self, indexer: Union[_models1.SearchIndexer, JSON, IO[bytes]], **kwargs: Any + self, indexer: Union[_models1.SearchIndexer, _types_models1.SearchIndexer, IO[bytes]], **kwargs: Any ) -> _models1.SearchIndexer: """Creates a new indexer. - :param indexer: The definition of the indexer to create. Is one of the following types: - SearchIndexer, JSON, IO[bytes] Required. - :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or JSON or IO[bytes] + :param indexer: The definition of the indexer to create. Is either a SearchIndexer type or a + IO[bytes] type. Required. + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or + ~azure.search.documents.indexes.types.SearchIndexer or IO[bytes] :return: SearchIndexer. The SearchIndexer is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises ~azure.core.exceptions.HttpResponseError: @@ -6218,7 +6894,7 @@ def _create_or_update_skillset( def _create_or_update_skillset( self, name: str, - skillset: JSON, + skillset: _types_models1.SearchIndexerSkillset, *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -6249,12 +6925,12 @@ def _create_or_update_skillset( "disable_cache_reprocessing_change_detection", ] }, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def _create_or_update_skillset( self, name: str, - skillset: Union[_models1.SearchIndexerSkillset, JSON, IO[bytes]], + skillset: Union[_models1.SearchIndexerSkillset, _types_models1.SearchIndexerSkillset, IO[bytes]], *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -6267,9 +6943,9 @@ def _create_or_update_skillset( :param name: The name of the skillset. Required. :type name: str :param skillset: The skillset containing one or more skills to create or update in a search - service. Is one of the following types: SearchIndexerSkillset, JSON, IO[bytes] Required. - :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or JSON or - IO[bytes] + service. Is either a SearchIndexerSkillset type or a IO[bytes] type. Required. + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or + ~azure.search.documents.indexes.types.SearchIndexerSkillset or IO[bytes] :keyword skip_indexer_reset_requirement_for_cache: Ignores cache reset requirements. Default value is None. :paramtype skip_indexer_reset_requirement_for_cache: bool @@ -6495,8 +7171,18 @@ def get_skillset(self, name: str, **kwargs: Any) -> _models1.SearchIndexerSkills return deserialized # type: ignore @distributed_trace + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) def _get_skillsets( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models1.ListingSearchType]] = None, + **kwargs: Any, ) -> _models1._models.ListSkillsetsResult: """List all skillsets in a search service. @@ -6504,6 +7190,16 @@ def _get_skillsets( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListSkillsetsResult. The ListSkillsetsResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListSkillsetsResult :raises ~azure.core.exceptions.HttpResponseError: @@ -6523,6 +7219,9 @@ def _get_skillsets( _request = build_search_indexer_get_skillsets_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6584,13 +7283,13 @@ def create_skillset( @overload def create_skillset( - self, skillset: JSON, *, content_type: str = "application/json", **kwargs: Any + self, skillset: _types_models1.SearchIndexerSkillset, *, content_type: str = "application/json", **kwargs: Any ) -> _models1.SearchIndexerSkillset: """Creates a new skillset in a search service. :param skillset: The skillset containing one or more skills to create in a search service. Required. - :type skillset: JSON + :type skillset: ~azure.search.documents.indexes.types.SearchIndexerSkillset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6618,14 +7317,16 @@ def create_skillset( @distributed_trace def create_skillset( - self, skillset: Union[_models1.SearchIndexerSkillset, JSON, IO[bytes]], **kwargs: Any + self, + skillset: Union[_models1.SearchIndexerSkillset, _types_models1.SearchIndexerSkillset, IO[bytes]], + **kwargs: Any, ) -> _models1.SearchIndexerSkillset: """Creates a new skillset in a search service. :param skillset: The skillset containing one or more skills to create in a search service. Is - one of the following types: SearchIndexerSkillset, JSON, IO[bytes] Required. - :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or JSON or - IO[bytes] + either a SearchIndexerSkillset type or a IO[bytes] type. Required. + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or + ~azure.search.documents.indexes.types.SearchIndexerSkillset or IO[bytes] :return: SearchIndexerSkillset. The SearchIndexerSkillset is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises ~azure.core.exceptions.HttpResponseError: @@ -6700,7 +7401,12 @@ def _reset_skills( ) -> None: ... @overload def _reset_skills( - self, name: str, skill_names: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + skill_names: _types_models1.SkillNames, + *, + content_type: str = "application/json", + **kwargs: Any, ) -> None: ... @overload def _reset_skills( @@ -6711,18 +7417,19 @@ def _reset_skills( @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "accept", "client_request_id", "name", "content_type"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _reset_skills( # pylint: disable=inconsistent-return-statements - self, name: str, skill_names: Union[_models1.SkillNames, JSON, IO[bytes]], **kwargs: Any + self, name: str, skill_names: Union[_models1.SkillNames, _types_models1.SkillNames, IO[bytes]], **kwargs: Any ) -> None: """Reset an existing skillset in a search service. :param name: The name of the skillset. Required. :type name: str :param skill_names: The names of the skills to reset. If not specified, all skills in the - skillset will be reset. Is one of the following types: SkillNames, JSON, IO[bytes] Required. - :type skill_names: ~azure.search.documents.indexes.models.SkillNames or JSON or IO[bytes] + skillset will be reset. Is either a SkillNames type or a IO[bytes] type. Required. + :type skill_names: ~azure.search.documents.indexes.models.SkillNames or + ~azure.search.documents.indexes.types.SkillNames or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py index 9eda53c64b99..3ec6d6602cbe 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py @@ -26,7 +26,7 @@ class SearchIndexClient(_SearchIndexClient): ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The @@ -52,7 +52,7 @@ class SearchIndexerClient(_SearchIndexerClient): ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py index db24930fdca9..0f2c5bdfe70f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -296,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -325,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -420,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +624,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,11 +867,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } + dict_to_pass: dict[str, typing.Any] = {} if args: if isinstance(args[0], ET.Element): dict_to_pass.update(self._init_from_xml(args[0])) @@ -619,9 +887,19 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) - def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: """Deserialize an XML element into a dict mapping rest field names to values. :param ET.Element element: The XML element to deserialize from. @@ -629,53 +907,89 @@ def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: :rtype: dict """ result: dict[str, typing.Any] = {} - model_meta = getattr(self, "_xml", {}) existed_attr_keys: list[str] = [] - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) + result[rf._rest_name] = _deserialize(rf._type, item) # rest thing is additional properties for e in element: @@ -708,6 +1022,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -1082,6 +1399,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1094,6 +1412,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1113,7 +1432,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1126,7 +1448,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1172,6 +1498,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1181,6 +1508,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1414,6 +1742,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py index 81ec1de5922b..75906e2eb77f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -516,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1472,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1482,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/utils.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/utils.py index 927adb7c8ae2..b0131200252f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/utils.py @@ -6,10 +6,14 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import Generic, Optional, TYPE_CHECKING, TypeVar +import json +import os +from typing import Any, Generic, IO, Mapping, Optional, TYPE_CHECKING, TypeVar, Union from azure.core import MatchConditions +from .._utils.model_base import Model, SdkJSONEncoder + if TYPE_CHECKING: from .serialization import Deserializer, Serializer @@ -55,3 +59,81 @@ def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchCondi if match_condition == MatchConditions.IfMissing: return "*" return None + + +# file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` +FileContent = Union[str, bytes, IO[str], IO[bytes]] + +FileType = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + tuple[Optional[str], FileContent, Optional[str]], +] + + +def serialize_multipart_data_entry(data_entry: Any) -> Any: + if isinstance(data_entry, (list, tuple, dict, Model)): + return json.dumps(data_entry, cls=SdkJSONEncoder, exclude_readonly=True) + return data_entry + + +def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any: + """Ensure a multipart file entry carries a filename for Content-Disposition. + + Servers distinguish file parts from plain form fields by the presence of + ``filename=`` in the ``Content-Disposition`` header. When callers pass + bare bytes/str/IO the HTTP client omits the filename and the server may + reject the upload. This helper wraps bare values into a (filename, content) + tuple, deriving the name from IO.name when available. + + :param str field_name: The multipart field name used as a filename fallback. + :param entry: The user-provided file entry (tuple, bytes, str, or IO). + :type entry: any + :param int index: The positional index of the entry within the field, used + to disambiguate fallback filenames when multiple entries are provided. + :return: Either the original tuple entry, or a ``(filename, content)`` tuple + wrapping the bare value. + :rtype: any + """ + if isinstance(entry, tuple): + return entry + filename: Optional[str] = None + name_attr = getattr(entry, "name", None) + if isinstance(name_attr, str) and name_attr: + filename = os.path.basename(name_attr) + if not filename: + filename = f"{field_name}_{index}" if index else field_name + + # Return a 3-tuple with an explicit "application/octet-stream" content type. + # A 2-tuple (filename, content) would leave the part's Content-Type unset, and + # the sdk core library only defaults to "application/octet-stream" for bare + # (non-tuple) values - a tuple bypasses that default and falls back to the + # HTTP "text/plain" default instead. Setting it explicitly preserves the + # pre-existing behavior for bare bytes/IO across all transports. + return (filename, entry, "application/octet-stream") + + +def prepare_multipart_form_data( + body: Mapping[str, Any], multipart_fields: list[str], data_fields: list[str] +) -> list[FileType]: + files: list[FileType] = [] + + # Data fields first so streaming server-side parsers see metadata before + # binary file parts. + for data_field in data_fields: + data_entry = body.get(data_field) + if data_entry: + files.append((data_field, str(serialize_multipart_data_entry(data_entry)))) + + for multipart_field in multipart_fields: + multipart_entry = body.get(multipart_field) + if isinstance(multipart_entry, list): + for idx, e in enumerate(multipart_entry): + files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx))) + elif multipart_entry is not None: + files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0))) + + return files diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py index 78e71a744af2..e906abeef969 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, TYPE_CHECKING, Union -from typing_extensions import Self from azure.core import AsyncPipelineClient from azure.core.credentials import AzureKeyCredential @@ -19,6 +19,11 @@ from ._configuration import SearchIndexClientConfiguration, SearchIndexerClientConfiguration from ._operations import _SearchIndexClientOperationsMixin, _SearchIndexerClientOperationsMixin +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -33,8 +38,9 @@ class SearchIndexClient(_SearchIndexClientOperationsMixin): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -116,8 +122,9 @@ class SearchIndexerClient(_SearchIndexerClientOperationsMixin): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py index fdfd0c820779..4ba519bf8061 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py @@ -30,15 +30,16 @@ class SearchIndexClientConfiguration: # pylint: disable=too-many-instance-attri :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ def __init__( self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -87,15 +88,16 @@ class SearchIndexerClientConfiguration: # pylint: disable=too-many-instance-att :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ def __init__( self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py index 88a417b69913..c07ed891c164 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py @@ -31,10 +31,10 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models2, types as _types_models2 from .... import models as _models3 -from ...._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ...._utils.utils import ClientMixinABC +from ...._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ...._utils.utils import ClientMixinABC, prepare_multipart_form_data from ...._validation import api_version_validation from ....knowledgebases import models as _knowledgebases_models4 from ..._operations._operations import ( @@ -71,6 +71,8 @@ build_search_index_list_knowledge_bases_request, build_search_index_list_knowledge_source_files_request, build_search_index_list_knowledge_sources_request, + build_search_index_update_knowledge_source_file_request, + build_search_index_upload_knowledge_source_file_multipart_request, build_search_index_upload_knowledge_source_file_request, build_search_indexer_create_data_source_connection_request, build_search_indexer_create_indexer_request, @@ -96,7 +98,6 @@ ) from .._configuration import SearchIndexClientConfiguration, SearchIndexerClientConfiguration -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] @@ -120,7 +121,7 @@ async def _create_or_update_synonym_map( async def _create_or_update_synonym_map( self, name: str, - synonym_map: JSON, + synonym_map: _types_models2.SynonymMap, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -143,7 +144,7 @@ async def _create_or_update_synonym_map( async def _create_or_update_synonym_map( self, name: str, - synonym_map: Union[_models2.SynonymMap, JSON, IO[bytes]], + synonym_map: Union[_models2.SynonymMap, _types_models2.SynonymMap, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -153,9 +154,10 @@ async def _create_or_update_synonym_map( :param name: The name of the synonym map. Required. :type name: str - :param synonym_map: The definition of the synonym map to create or update. Is one of the - following types: SynonymMap, JSON, IO[bytes] Required. - :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or JSON or IO[bytes] + :param synonym_map: The definition of the synonym map to create or update. Is either a + SynonymMap type or a IO[bytes] type. Required. + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or + ~azure.search.documents.indexes.types.SynonymMap or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -373,8 +375,18 @@ async def get_synonym_map(self, name: str, **kwargs: Any) -> _models2.SynonymMap return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) async def _get_synonym_maps( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any ) -> _models2._models.ListSynonymMapsResult: """Lists all synonym maps available for a search service. @@ -382,6 +394,16 @@ async def _get_synonym_maps( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListSynonymMapsResult. The ListSynonymMapsResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListSynonymMapsResult :raises ~azure.core.exceptions.HttpResponseError: @@ -401,6 +423,9 @@ async def _get_synonym_maps( _request = build_search_index_get_synonym_maps_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -461,12 +486,12 @@ async def create_synonym_map( @overload async def create_synonym_map( - self, synonym_map: JSON, *, content_type: str = "application/json", **kwargs: Any + self, synonym_map: _types_models2.SynonymMap, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.SynonymMap: """Creates a new synonym map. :param synonym_map: The definition of the synonym map to create. Required. - :type synonym_map: JSON + :type synonym_map: ~azure.search.documents.indexes.types.SynonymMap :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -493,13 +518,14 @@ async def create_synonym_map( @distributed_trace_async async def create_synonym_map( - self, synonym_map: Union[_models2.SynonymMap, JSON, IO[bytes]], **kwargs: Any + self, synonym_map: Union[_models2.SynonymMap, _types_models2.SynonymMap, IO[bytes]], **kwargs: Any ) -> _models2.SynonymMap: """Creates a new synonym map. - :param synonym_map: The definition of the synonym map to create. Is one of the following types: - SynonymMap, JSON, IO[bytes] Required. - :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or JSON or IO[bytes] + :param synonym_map: The definition of the synonym map to create. Is either a SynonymMap type or + a IO[bytes] type. Required. + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap or + ~azure.search.documents.indexes.types.SynonymMap or IO[bytes] :return: SynonymMap. The SynonymMap is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises ~azure.core.exceptions.HttpResponseError: @@ -584,7 +610,7 @@ async def _create_or_update_index( async def _create_or_update_index( self, name: str, - index: JSON, + index: _types_models2.SearchIndex, *, allow_index_downtime: Optional[bool] = None, content_type: str = "application/json", @@ -609,7 +635,7 @@ async def _create_or_update_index( async def _create_or_update_index( self, name: str, - index: Union[_models2.SearchIndex, JSON, IO[bytes]], + index: Union[_models2.SearchIndex, _types_models2.SearchIndex, IO[bytes]], *, allow_index_downtime: Optional[bool] = None, etag: Optional[str] = None, @@ -620,9 +646,10 @@ async def _create_or_update_index( :param name: The name of the index. Required. :type name: str - :param index: The definition of the index to create or update. Is one of the following types: - SearchIndex, JSON, IO[bytes] Required. - :type index: ~azure.search.documents.indexes.models.SearchIndex or JSON or IO[bytes] + :param index: The definition of the index to create or update. Is either a SearchIndex type or + a IO[bytes] type. Required. + :type index: ~azure.search.documents.indexes.models.SearchIndex or + ~azure.search.documents.indexes.types.SearchIndex or IO[bytes] :keyword allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of @@ -850,22 +877,32 @@ async def get_index(self, name: str, **kwargs: Any) -> _models2.SearchIndex: @distributed_trace @api_version_validation( - params_added_on={"2026-05-01-preview": ["top", "skip", "count"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "accept", "search", "page_size", "search_type", "client_request_id"] + }, + api_versions_list=["2026-08-01-preview"], ) def _list_indexes( - self, *, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None, **kwargs: Any + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any ) -> AsyncItemPaged["_models2.SearchIndex"]: """Lists all indexes available for a search service. - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchIndex :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SearchIndex] @@ -888,9 +925,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_indexes_request( - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -913,7 +950,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -957,16 +997,27 @@ async def get_next(next_link=None): @distributed_trace @api_version_validation( - params_added_on={"2026-05-01-preview": ["top", "skip", "count"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "accept", + "select", + "search", + "page_size", + "search_type", + "client_request_id", + ] + }, + api_versions_list=["2026-08-01-preview"], ) def _list_indexes_with_selected_properties( self, *, select: Optional[list[str]] = None, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, **kwargs: Any ) -> AsyncItemPaged["_models2._models.SearchIndexResponse"]: """Lists all indexes available for a search service. @@ -975,14 +1026,16 @@ def _list_indexes_with_selected_properties( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchIndexResponse :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models._models.SearchIndexResponse] @@ -1006,9 +1059,9 @@ def prepare_request(next_link=None): _request = build_search_index_list_indexes_with_selected_properties_request( select=select, - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1031,7 +1084,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1045,7 +1101,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access + list[_models2._models.SearchIndexResponse], deserialized.get("value", []), ) if cls: @@ -1091,12 +1147,12 @@ async def create_index( @overload async def create_index( - self, index: JSON, *, content_type: str = "application/json", **kwargs: Any + self, index: _types_models2.SearchIndex, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.SearchIndex: """Creates a new search index. :param index: The definition of the index to create. Required. - :type index: JSON + :type index: ~azure.search.documents.indexes.types.SearchIndex :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1123,13 +1179,14 @@ async def create_index( @distributed_trace_async async def create_index( - self, index: Union[_models2.SearchIndex, JSON, IO[bytes]], **kwargs: Any + self, index: Union[_models2.SearchIndex, _types_models2.SearchIndex, IO[bytes]], **kwargs: Any ) -> _models2.SearchIndex: """Creates a new search index. - :param index: The definition of the index to create. Is one of the following types: - SearchIndex, JSON, IO[bytes] Required. - :type index: ~azure.search.documents.indexes.models.SearchIndex or JSON or IO[bytes] + :param index: The definition of the index to create. Is either a SearchIndex type or a + IO[bytes] type. Required. + :type index: ~azure.search.documents.indexes.models.SearchIndex or + ~azure.search.documents.indexes.types.SearchIndex or IO[bytes] :return: SearchIndex. The SearchIndex is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises ~azure.core.exceptions.HttpResponseError: @@ -1270,7 +1327,12 @@ async def _analyze_text( ) -> _models2.AnalyzeResult: ... @overload async def _analyze_text( - self, name: str, request: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + request: _types_models2.AnalyzeTextOptions, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models2.AnalyzeResult: ... @overload async def _analyze_text( @@ -1279,15 +1341,19 @@ async def _analyze_text( @distributed_trace_async async def _analyze_text( - self, name: str, request: Union[_models2.AnalyzeTextOptions, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + request: Union[_models2.AnalyzeTextOptions, _types_models2.AnalyzeTextOptions, IO[bytes]], + **kwargs: Any ) -> _models2.AnalyzeResult: """Shows how an analyzer breaks text into tokens. :param name: The name of the index. Required. :type name: str - :param request: The text and analyzer or analysis components to test. Is one of the following - types: AnalyzeTextOptions, JSON, IO[bytes] Required. - :type request: ~azure.search.documents.indexes.models.AnalyzeTextOptions or JSON or IO[bytes] + :param request: The text and analyzer or analysis components to test. Is either a + AnalyzeTextOptions type or a IO[bytes] type. Required. + :type request: ~azure.search.documents.indexes.models.AnalyzeTextOptions or + ~azure.search.documents.indexes.types.AnalyzeTextOptions or IO[bytes] :return: AnalyzeResult. The AnalyzeResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.AnalyzeResult :raises ~azure.core.exceptions.HttpResponseError: @@ -1372,7 +1438,7 @@ async def _create_or_update_alias( async def _create_or_update_alias( self, name: str, - alias: JSON, + alias: _types_models2.SearchAlias, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -1395,7 +1461,7 @@ async def _create_or_update_alias( async def _create_or_update_alias( self, name: str, - alias: Union[_models2.SearchAlias, JSON, IO[bytes]], + alias: Union[_models2.SearchAlias, _types_models2.SearchAlias, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -1405,9 +1471,10 @@ async def _create_or_update_alias( :param name: The name of the alias. Required. :type name: str - :param alias: The definition of the alias to create or update. Is one of the following types: - SearchAlias, JSON, IO[bytes] Required. - :type alias: ~azure.search.documents.indexes.models.SearchAlias or JSON or IO[bytes] + :param alias: The definition of the alias to create or update. Is either a SearchAlias type or + a IO[bytes] type. Required. + :type alias: ~azure.search.documents.indexes.models.SearchAlias or + ~azure.search.documents.indexes.types.SearchAlias or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -1626,9 +1693,30 @@ async def get_alias(self, name: str, **kwargs: Any) -> _models2.SearchAlias: return deserialized # type: ignore @distributed_trace - def list_aliases(self, **kwargs: Any) -> AsyncItemPaged["_models2.SearchAlias"]: + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) + def list_aliases( + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models2.SearchAlias"]: """Lists all aliases available for a search service. + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchAlias :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SearchAlias] @@ -1651,6 +1739,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_aliases_request( + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1673,7 +1764,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1692,7 +1786,7 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -1733,12 +1827,12 @@ async def create_alias( @overload async def create_alias( - self, alias: JSON, *, content_type: str = "application/json", **kwargs: Any + self, alias: _types_models2.SearchAlias, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.SearchAlias: """Creates a new search alias. :param alias: The definition of the alias to create. Required. - :type alias: JSON + :type alias: ~azure.search.documents.indexes.types.SearchAlias :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1765,13 +1859,14 @@ async def create_alias( @distributed_trace_async async def create_alias( - self, alias: Union[_models2.SearchAlias, JSON, IO[bytes]], **kwargs: Any + self, alias: Union[_models2.SearchAlias, _types_models2.SearchAlias, IO[bytes]], **kwargs: Any ) -> _models2.SearchAlias: """Creates a new search alias. - :param alias: The definition of the alias to create. Is one of the following types: - SearchAlias, JSON, IO[bytes] Required. - :type alias: ~azure.search.documents.indexes.models.SearchAlias or JSON or IO[bytes] + :param alias: The definition of the alias to create. Is either a SearchAlias type or a + IO[bytes] type. Required. + :type alias: ~azure.search.documents.indexes.models.SearchAlias or + ~azure.search.documents.indexes.types.SearchAlias or IO[bytes] :return: SearchAlias. The SearchAlias is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchAlias :raises ~azure.core.exceptions.HttpResponseError: @@ -1855,7 +1950,7 @@ async def _create_or_update_knowledge_base( async def _create_or_update_knowledge_base( self, name: str, - knowledge_base: JSON, + knowledge_base: _types_models2.KnowledgeBase, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -1878,7 +1973,7 @@ async def _create_or_update_knowledge_base( async def _create_or_update_knowledge_base( self, name: str, - knowledge_base: Union[_models2.KnowledgeBase, JSON, IO[bytes]], + knowledge_base: Union[_models2.KnowledgeBase, _types_models2.KnowledgeBase, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -1888,9 +1983,10 @@ async def _create_or_update_knowledge_base( :param name: The name of the knowledge base. Required. :type name: str - :param knowledge_base: The definition of the knowledge base to create or update. Is one of the - following types: KnowledgeBase, JSON, IO[bytes] Required. - :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or JSON or IO[bytes] + :param knowledge_base: The definition of the knowledge base to create or update. Is either a + KnowledgeBase type or a IO[bytes] type. Required. + :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or + ~azure.search.documents.indexes.types.KnowledgeBase or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -2108,9 +2204,30 @@ async def get_knowledge_base(self, name: str, **kwargs: Any) -> _models2.Knowled return deserialized # type: ignore @distributed_trace - def list_knowledge_bases(self, **kwargs: Any) -> AsyncItemPaged["_models2.KnowledgeBase"]: + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) + def list_knowledge_bases( + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models2.KnowledgeBase"]: """Lists all knowledge bases available for a search service. + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of KnowledgeBase :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.KnowledgeBase] @@ -2133,6 +2250,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_knowledge_bases_request( + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2155,7 +2275,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2174,7 +2297,7 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -2215,12 +2338,12 @@ async def create_knowledge_base( @overload async def create_knowledge_base( - self, knowledge_base: JSON, *, content_type: str = "application/json", **kwargs: Any + self, knowledge_base: _types_models2.KnowledgeBase, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.KnowledgeBase: """Creates a new knowledge base. :param knowledge_base: The definition of the knowledge base to create. Required. - :type knowledge_base: JSON + :type knowledge_base: ~azure.search.documents.indexes.types.KnowledgeBase :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2247,13 +2370,14 @@ async def create_knowledge_base( @distributed_trace_async async def create_knowledge_base( - self, knowledge_base: Union[_models2.KnowledgeBase, JSON, IO[bytes]], **kwargs: Any + self, knowledge_base: Union[_models2.KnowledgeBase, _types_models2.KnowledgeBase, IO[bytes]], **kwargs: Any ) -> _models2.KnowledgeBase: """Creates a new knowledge base. - :param knowledge_base: The definition of the knowledge base to create. Is one of the following - types: KnowledgeBase, JSON, IO[bytes] Required. - :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or JSON or IO[bytes] + :param knowledge_base: The definition of the knowledge base to create. Is either a + KnowledgeBase type or a IO[bytes] type. Required. + :type knowledge_base: ~azure.search.documents.indexes.models.KnowledgeBase or + ~azure.search.documents.indexes.types.KnowledgeBase or IO[bytes] :return: KnowledgeBase. The KnowledgeBase is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.KnowledgeBase :raises ~azure.core.exceptions.HttpResponseError: @@ -2337,7 +2461,7 @@ async def _create_or_update_knowledge_source( async def _create_or_update_knowledge_source( self, name: str, - knowledge_source: JSON, + knowledge_source: _types_models2.KnowledgeSource, *, content_type: str = "application/json", etag: Optional[str] = None, @@ -2360,7 +2484,7 @@ async def _create_or_update_knowledge_source( async def _create_or_update_knowledge_source( self, name: str, - knowledge_source: Union[_models2.KnowledgeSource, JSON, IO[bytes]], + knowledge_source: Union[_models2.KnowledgeSource, _types_models2.KnowledgeSource, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -2370,10 +2494,10 @@ async def _create_or_update_knowledge_source( :param name: The name of the knowledge source. Required. :type name: str - :param knowledge_source: The definition of the knowledge source to create or update. Is one of - the following types: KnowledgeSource, JSON, IO[bytes] Required. - :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or JSON or - IO[bytes] + :param knowledge_source: The definition of the knowledge source to create or update. Is either + a KnowledgeSource type or a IO[bytes] type. Required. + :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or + ~azure.search.documents.indexes.types.KnowledgeSource or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -2591,9 +2715,30 @@ async def get_knowledge_source(self, name: str, **kwargs: Any) -> _models2.Knowl return deserialized # type: ignore @distributed_trace - def list_knowledge_sources(self, **kwargs: Any) -> AsyncItemPaged["_models2.KnowledgeSource"]: + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) + def list_knowledge_sources( + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models2.KnowledgeSource"]: """Lists all knowledge sources available for a search service. + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of KnowledgeSource :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.KnowledgeSource] @@ -2616,6 +2761,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_knowledge_sources_request( + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2638,7 +2786,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2657,7 +2808,7 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -2698,12 +2849,12 @@ async def create_knowledge_source( @overload async def create_knowledge_source( - self, knowledge_source: JSON, *, content_type: str = "application/json", **kwargs: Any + self, knowledge_source: _types_models2.KnowledgeSource, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.KnowledgeSource: """Creates a new knowledge source. :param knowledge_source: The definition of the knowledge source to create. Required. - :type knowledge_source: JSON + :type knowledge_source: ~azure.search.documents.indexes.types.KnowledgeSource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2730,14 +2881,16 @@ async def create_knowledge_source( @distributed_trace_async async def create_knowledge_source( - self, knowledge_source: Union[_models2.KnowledgeSource, JSON, IO[bytes]], **kwargs: Any + self, + knowledge_source: Union[_models2.KnowledgeSource, _types_models2.KnowledgeSource, IO[bytes]], + **kwargs: Any ) -> _models2.KnowledgeSource: """Creates a new knowledge source. - :param knowledge_source: The definition of the knowledge source to create. Is one of the - following types: KnowledgeSource, JSON, IO[bytes] Required. - :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or JSON or - IO[bytes] + :param knowledge_source: The definition of the knowledge source to create. Is either a + KnowledgeSource type or a IO[bytes] type. Required. + :type knowledge_source: ~azure.search.documents.indexes.models.KnowledgeSource or + ~azure.search.documents.indexes.types.KnowledgeSource or IO[bytes] :return: KnowledgeSource. The KnowledgeSource is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.KnowledgeSource :raises ~azure.core.exceptions.HttpResponseError: @@ -2886,7 +3039,7 @@ async def get_knowledge_source_status( "accept", ] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _upload_knowledge_source_file( self, name: str, file: bytes, *, content_disposition: str, **kwargs: Any @@ -2967,17 +3120,165 @@ async def _upload_knowledge_source_file( return deserialized # type: ignore + @overload + async def upload_knowledge_source_file_multipart( + self, name: str, body: _models2.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any + ) -> _models2.KnowledgeSourceFile: + """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part + (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part + with the raw file bytes. + + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def upload_knowledge_source_file_multipart( + self, name: str, body: _types_models2.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any + ) -> _models2.KnowledgeSourceFile: + """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part + (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part + with the raw file bytes. + + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.types.UploadKnowledgeSourceFileMultipartRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={"2026-08-01-preview": ["api_version", "client_request_id", "name", "content_type", "accept"]}, + api_versions_list=["2026-08-01-preview"], + ) + async def upload_knowledge_source_file_multipart( + self, + name: str, + body: Union[ + _models2.UploadKnowledgeSourceFileMultipartRequest, _types_models2.UploadKnowledgeSourceFileMultipartRequest + ], + **kwargs: Any + ) -> _models2.KnowledgeSourceFile: + """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part + (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part + with the raw file bytes. + + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Is one of + the following types: UploadKnowledgeSourceFileMultipartRequest Required. + :type body: ~azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest or + ~azure.search.documents.indexes.types.UploadKnowledgeSourceFileMultipartRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models2.KnowledgeSourceFile] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _Model) else body + _file_fields: list[str] = ["content"] + _data_fields: list[str] = ["metadata"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_search_index_upload_knowledge_source_file_multipart_request( + name=name, + api_version=self._config.api_version, + files=_files, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models2.KnowledgeSourceFile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", - params_added_on={"2026-05-01-preview": ["api_version", "accept", "client_request_id", "name"]}, - api_versions_list=["2026-05-01-preview"], + params_added_on={ + "2026-05-01-preview": ["api_version", "accept", "client_request_id", "name"], + "2026-08-01-preview": ["prefix", "search", "page_size", "search_type"], + }, + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) - def list_knowledge_source_files(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models2.KnowledgeSourceFile"]: + def list_knowledge_source_files( + self, + name: str, + *, + prefix: Optional[str] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models2.KnowledgeSourceFile"]: """Lists all files in a File knowledge source. :param name: The name of the knowledge source. Required. :type name: str + :keyword prefix: Optional prefix to filter files by their directory-like path. Default value is + None. + :paramtype prefix: str + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of KnowledgeSourceFile :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.KnowledgeSourceFile] @@ -3001,6 +3302,10 @@ def prepare_request(next_link=None): _request = build_search_index_list_knowledge_source_files_request( name=name, + prefix=prefix, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3023,7 +3328,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3042,7 +3350,7 @@ async def extract_data(pipeline_response): ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -3069,7 +3377,7 @@ async def get_next(next_link=None): @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "file_id", "accept", "client_request_id", "name"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _delete_knowledge_source_file(self, file_id: str, name: str, **kwargs: Any) -> None: """Deletes a file from a File knowledge source and removes all indexed content derived from it. @@ -3125,6 +3433,137 @@ async def _delete_knowledge_source_file(self, file_id: str, name: str, **kwargs: if cls: return cls(pipeline_response, None, {}) # type: ignore + @overload + async def update_knowledge_source_file( + self, file_id: str, name: str, body: _models2.UpdateKnowledgeSourceFileRequest, **kwargs: Any + ) -> _models2.KnowledgeSourceFile: + """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, custom metadata, and optional + extraction override) and a 'content' part with the raw file bytes. + + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_knowledge_source_file( + self, file_id: str, name: str, body: _types_models2.UpdateKnowledgeSourceFileRequest, **kwargs: Any + ) -> _models2.KnowledgeSourceFile: + """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, custom metadata, and optional + extraction override) and a 'content' part with the raw file bytes. + + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Required. + :type body: ~azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "file_id", "client_request_id", "name", "content_type", "accept"] + }, + api_versions_list=["2026-08-01-preview"], + ) + async def update_knowledge_source_file( + self, + file_id: str, + name: str, + body: Union[_models2.UpdateKnowledgeSourceFileRequest, _types_models2.UpdateKnowledgeSourceFileRequest], + **kwargs: Any + ) -> _models2.KnowledgeSourceFile: + """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, custom metadata, and optional + extraction override) and a 'content' part with the raw file bytes. + + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param name: The name of the knowledge source. Required. + :type name: str + :param body: The multipart/form-data body containing the metadata and content parts. Is one of + the following types: UpdateKnowledgeSourceFileRequest Required. + :type body: ~azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest or + ~azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest + :return: KnowledgeSourceFile. The KnowledgeSourceFile is compatible with MutableMapping + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models2.KnowledgeSourceFile] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _Model) else body + _file_fields: list[str] = ["content"] + _data_fields: list[str] = ["metadata"] + _files = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_search_index_update_knowledge_source_file_request( + file_id=file_id, + name=name, + api_version=self._config.api_version, + files=_files, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models2.KnowledgeSourceFile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @distributed_trace_async async def get_service_statistics(self, **kwargs: Any) -> _models2.SearchServiceStatistics: """Gets service level statistics for a search service. @@ -3189,23 +3628,32 @@ async def get_service_statistics(self, **kwargs: Any) -> _models2.SearchServiceS @distributed_trace @api_version_validation( - method_added_on="2026-05-01-preview", - params_added_on={"2026-05-01-preview": ["api_version", "accept", "top", "skip", "count", "client_request_id"]}, - api_versions_list=["2026-05-01-preview"], + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": ["api_version", "accept", "search", "page_size", "search_type", "client_request_id"] + }, + api_versions_list=["2026-08-01-preview"], ) def list_index_stats_summary( - self, *, top: Optional[int] = None, skip: Optional[int] = None, count: Optional[bool] = None, **kwargs: Any + self, + *, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any ) -> AsyncItemPaged["_models2.IndexStatisticsSummary"]: """Retrieves a summary of statistics for all indexes in the search service. - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of IndexStatisticsSummary :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.IndexStatisticsSummary] @@ -3228,9 +3676,9 @@ def prepare_request(next_link=None): if not next_link: _request = build_search_index_list_index_stats_summary_request( - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3253,7 +3701,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3316,7 +3767,7 @@ async def _create_or_update_data_source_connection( async def _create_or_update_data_source_connection( self, name: str, - data_source: JSON, + data_source: _types_models2.SearchIndexerDataSourceConnection, *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, content_type: str = "application/json", @@ -3340,12 +3791,14 @@ async def _create_or_update_data_source_connection( @distributed_trace_async @api_version_validation( params_added_on={"2026-05-01-preview": ["skip_indexer_reset_requirement_for_cache"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def _create_or_update_data_source_connection( self, name: str, - data_source: Union[_models2.SearchIndexerDataSourceConnection, JSON, IO[bytes]], + data_source: Union[ + _models2.SearchIndexerDataSourceConnection, _types_models2.SearchIndexerDataSourceConnection, IO[bytes] + ], *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, etag: Optional[str] = None, @@ -3356,10 +3809,10 @@ async def _create_or_update_data_source_connection( :param name: The name of the datasource. Required. :type name: str - :param data_source: The definition of the datasource to create or update. Is one of the - following types: SearchIndexerDataSourceConnection, JSON, IO[bytes] Required. + :param data_source: The definition of the datasource to create or update. Is either a + SearchIndexerDataSourceConnection type or a IO[bytes] type. Required. :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection or - JSON or IO[bytes] + ~azure.search.documents.indexes.types.SearchIndexerDataSourceConnection or IO[bytes] :keyword skip_indexer_reset_requirement_for_cache: Ignores cache reset requirements. Default value is None. :paramtype skip_indexer_reset_requirement_for_cache: bool @@ -3583,8 +4036,18 @@ async def get_data_source_connection(self, name: str, **kwargs: Any) -> _models2 return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) async def _get_data_source_connections( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any ) -> _models2._models.ListDataSourcesResult: """Lists all datasources available for a search service. @@ -3592,6 +4055,16 @@ async def _get_data_source_connections( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListDataSourcesResult. The ListDataSourcesResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListDataSourcesResult :raises ~azure.core.exceptions.HttpResponseError: @@ -3611,6 +4084,9 @@ async def _get_data_source_connections( _request = build_search_indexer_get_data_source_connections_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3677,12 +4153,17 @@ async def create_data_source_connection( @overload async def create_data_source_connection( - self, data_source_connection: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + data_source_connection: _types_models2.SearchIndexerDataSourceConnection, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models2.SearchIndexerDataSourceConnection: """Creates a new datasource. :param data_source_connection: The definition of the datasource to create. Required. - :type data_source_connection: JSON + :type data_source_connection: + ~azure.search.documents.indexes.types.SearchIndexerDataSourceConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3711,14 +4192,19 @@ async def create_data_source_connection( @distributed_trace_async async def create_data_source_connection( - self, data_source_connection: Union[_models2.SearchIndexerDataSourceConnection, JSON, IO[bytes]], **kwargs: Any + self, + data_source_connection: Union[ + _models2.SearchIndexerDataSourceConnection, _types_models2.SearchIndexerDataSourceConnection, IO[bytes] + ], + **kwargs: Any ) -> _models2.SearchIndexerDataSourceConnection: """Creates a new datasource. - :param data_source_connection: The definition of the datasource to create. Is one of the - following types: SearchIndexerDataSourceConnection, JSON, IO[bytes] Required. + :param data_source_connection: The definition of the datasource to create. Is either a + SearchIndexerDataSourceConnection type or a IO[bytes] type. Required. :type data_source_connection: - ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection or JSON or IO[bytes] + ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection or + ~azure.search.documents.indexes.types.SearchIndexerDataSourceConnection or IO[bytes] :return: SearchIndexerDataSourceConnection. The SearchIndexerDataSourceConnection is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection @@ -3851,7 +4337,12 @@ async def _resync( ) -> None: ... @overload async def _resync( - self, name: str, indexer_resync: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + indexer_resync: _types_models2.IndexerResyncBody, + *, + content_type: str = "application/json", + **kwargs: Any ) -> None: ... @overload async def _resync( @@ -3862,19 +4353,22 @@ async def _resync( @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "accept", "client_request_id", "name", "content_type"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _resync( - self, name: str, indexer_resync: Union[_models2.IndexerResyncBody, JSON, IO[bytes]], **kwargs: Any + self, + name: str, + indexer_resync: Union[_models2.IndexerResyncBody, _types_models2.IndexerResyncBody, IO[bytes]], + **kwargs: Any ) -> None: """Resync selective options from the datasource to be re-ingested by the indexer.". :param name: The name of the indexer. Required. :type name: str - :param indexer_resync: The definition of the indexer resync options. Is one of the following - types: IndexerResyncBody, JSON, IO[bytes] Required. - :type indexer_resync: ~azure.search.documents.indexes.models.IndexerResyncBody or JSON or - IO[bytes] + :param indexer_resync: The definition of the indexer resync options. Is either a + IndexerResyncBody type or a IO[bytes] type. Required. + :type indexer_resync: ~azure.search.documents.indexes.models.IndexerResyncBody or + ~azure.search.documents.indexes.types.IndexerResyncBody or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -3945,7 +4439,7 @@ async def _reset_documents( async def _reset_documents( self, name: str, - keys_or_ids: Optional[JSON] = None, + keys_or_ids: Optional[_types_models2.DocumentKeysOrIds] = None, *, overwrite: Optional[bool] = None, content_type: str = "application/json", @@ -3968,12 +4462,12 @@ async def _reset_documents( params_added_on={ "2026-05-01-preview": ["api_version", "accept", "overwrite", "client_request_id", "name", "content_type"] }, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _reset_documents( self, name: str, - keys_or_ids: Optional[Union[_models2.DocumentKeysOrIds, JSON, IO[bytes]]] = None, + keys_or_ids: Optional[Union[_models2.DocumentKeysOrIds, _types_models2.DocumentKeysOrIds, IO[bytes]]] = None, *, overwrite: Optional[bool] = None, **kwargs: Any @@ -3984,10 +4478,10 @@ async def _reset_documents( :type name: str :param keys_or_ids: 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. Is one of the following types: DocumentKeysOrIds, JSON, - IO[bytes] Default value is None. - :type keys_or_ids: ~azure.search.documents.indexes.models.DocumentKeysOrIds or JSON or - IO[bytes] + document key field is ignored. Is either a DocumentKeysOrIds type or a IO[bytes] type. Default + value is None. + :type keys_or_ids: ~azure.search.documents.indexes.models.DocumentKeysOrIds or + ~azure.search.documents.indexes.types.DocumentKeysOrIds or IO[bytes] :keyword 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. Default value is None. :paramtype overwrite: bool @@ -4121,7 +4615,7 @@ async def _create_or_update_indexer( async def _create_or_update_indexer( self, name: str, - indexer: JSON, + indexer: _types_models2.SearchIndexer, *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -4152,12 +4646,12 @@ async def _create_or_update_indexer( "disable_cache_reprocessing_change_detection", ] }, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def _create_or_update_indexer( self, name: str, - indexer: Union[_models2.SearchIndexer, JSON, IO[bytes]], + indexer: Union[_models2.SearchIndexer, _types_models2.SearchIndexer, IO[bytes]], *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -4169,9 +4663,10 @@ async def _create_or_update_indexer( :param name: The name of the indexer. Required. :type name: str - :param indexer: The definition of the indexer to create or update. Is one of the following - types: SearchIndexer, JSON, IO[bytes] Required. - :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or JSON or IO[bytes] + :param indexer: The definition of the indexer to create or update. Is either a SearchIndexer + type or a IO[bytes] type. Required. + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or + ~azure.search.documents.indexes.types.SearchIndexer or IO[bytes] :keyword skip_indexer_reset_requirement_for_cache: Ignores cache reset requirements. Default value is None. :paramtype skip_indexer_reset_requirement_for_cache: bool @@ -4397,8 +4892,18 @@ async def get_indexer(self, name: str, **kwargs: Any) -> _models2.SearchIndexer: return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) async def _get_indexers( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any ) -> _models2._models.ListIndexersResult: """Lists all indexers available for a search service. @@ -4406,6 +4911,16 @@ async def _get_indexers( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListIndexersResult. The ListIndexersResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListIndexersResult :raises ~azure.core.exceptions.HttpResponseError: @@ -4425,6 +4940,9 @@ async def _get_indexers( _request = build_search_indexer_get_indexers_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4485,12 +5003,12 @@ async def create_indexer( @overload async def create_indexer( - self, indexer: JSON, *, content_type: str = "application/json", **kwargs: Any + self, indexer: _types_models2.SearchIndexer, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.SearchIndexer: """Creates a new indexer. :param indexer: The definition of the indexer to create. Required. - :type indexer: JSON + :type indexer: ~azure.search.documents.indexes.types.SearchIndexer :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4517,13 +5035,14 @@ async def create_indexer( @distributed_trace_async async def create_indexer( - self, indexer: Union[_models2.SearchIndexer, JSON, IO[bytes]], **kwargs: Any + self, indexer: Union[_models2.SearchIndexer, _types_models2.SearchIndexer, IO[bytes]], **kwargs: Any ) -> _models2.SearchIndexer: """Creates a new indexer. - :param indexer: The definition of the indexer to create. Is one of the following types: - SearchIndexer, JSON, IO[bytes] Required. - :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or JSON or IO[bytes] + :param indexer: The definition of the indexer to create. Is either a SearchIndexer type or a + IO[bytes] type. Required. + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer or + ~azure.search.documents.indexes.types.SearchIndexer or IO[bytes] :return: SearchIndexer. The SearchIndexer is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises ~azure.core.exceptions.HttpResponseError: @@ -4674,7 +5193,7 @@ async def _create_or_update_skillset( async def _create_or_update_skillset( self, name: str, - skillset: JSON, + skillset: _types_models2.SearchIndexerSkillset, *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -4705,12 +5224,12 @@ async def _create_or_update_skillset( "disable_cache_reprocessing_change_detection", ] }, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def _create_or_update_skillset( self, name: str, - skillset: Union[_models2.SearchIndexerSkillset, JSON, IO[bytes]], + skillset: Union[_models2.SearchIndexerSkillset, _types_models2.SearchIndexerSkillset, IO[bytes]], *, skip_indexer_reset_requirement_for_cache: Optional[bool] = None, disable_cache_reprocessing_change_detection: Optional[bool] = None, @@ -4723,9 +5242,9 @@ async def _create_or_update_skillset( :param name: The name of the skillset. Required. :type name: str :param skillset: The skillset containing one or more skills to create or update in a search - service. Is one of the following types: SearchIndexerSkillset, JSON, IO[bytes] Required. - :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or JSON or - IO[bytes] + service. Is either a SearchIndexerSkillset type or a IO[bytes] type. Required. + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or + ~azure.search.documents.indexes.types.SearchIndexerSkillset or IO[bytes] :keyword skip_indexer_reset_requirement_for_cache: Ignores cache reset requirements. Default value is None. :paramtype skip_indexer_reset_requirement_for_cache: bool @@ -4951,8 +5470,18 @@ async def get_skillset(self, name: str, **kwargs: Any) -> _models2.SearchIndexer return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], + ) async def _get_skillsets( - self, *, select: Optional[list[str]] = None, **kwargs: Any + self, + *, + select: Optional[list[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models2.ListingSearchType]] = None, + **kwargs: Any ) -> _models2._models.ListSkillsetsResult: """List all skillsets in a search service. @@ -4960,6 +5489,16 @@ async def _get_skillsets( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A 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. Default value + is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. The server enforces + a maximum; if omitted, the server determines a suitable default. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. "prefix" Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: ListSkillsetsResult. The ListSkillsetsResult is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models._models.ListSkillsetsResult :raises ~azure.core.exceptions.HttpResponseError: @@ -4979,6 +5518,9 @@ async def _get_skillsets( _request = build_search_indexer_get_skillsets_request( select=select, + search=search, + page_size=page_size, + search_type=search_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5040,13 +5582,13 @@ async def create_skillset( @overload async def create_skillset( - self, skillset: JSON, *, content_type: str = "application/json", **kwargs: Any + self, skillset: _types_models2.SearchIndexerSkillset, *, content_type: str = "application/json", **kwargs: Any ) -> _models2.SearchIndexerSkillset: """Creates a new skillset in a search service. :param skillset: The skillset containing one or more skills to create in a search service. Required. - :type skillset: JSON + :type skillset: ~azure.search.documents.indexes.types.SearchIndexerSkillset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5074,14 +5616,16 @@ async def create_skillset( @distributed_trace_async async def create_skillset( - self, skillset: Union[_models2.SearchIndexerSkillset, JSON, IO[bytes]], **kwargs: Any + self, + skillset: Union[_models2.SearchIndexerSkillset, _types_models2.SearchIndexerSkillset, IO[bytes]], + **kwargs: Any ) -> _models2.SearchIndexerSkillset: """Creates a new skillset in a search service. :param skillset: The skillset containing one or more skills to create in a search service. Is - one of the following types: SearchIndexerSkillset, JSON, IO[bytes] Required. - :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or JSON or - IO[bytes] + either a SearchIndexerSkillset type or a IO[bytes] type. Required. + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset or + ~azure.search.documents.indexes.types.SearchIndexerSkillset or IO[bytes] :return: SearchIndexerSkillset. The SearchIndexerSkillset is compatible with MutableMapping :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises ~azure.core.exceptions.HttpResponseError: @@ -5156,7 +5700,12 @@ async def _reset_skills( ) -> None: ... @overload async def _reset_skills( - self, name: str, skill_names: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + skill_names: _types_models2.SkillNames, + *, + content_type: str = "application/json", + **kwargs: Any ) -> None: ... @overload async def _reset_skills( @@ -5167,18 +5716,19 @@ async def _reset_skills( @api_version_validation( method_added_on="2026-05-01-preview", params_added_on={"2026-05-01-preview": ["api_version", "accept", "client_request_id", "name", "content_type"]}, - api_versions_list=["2026-05-01-preview"], + api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _reset_skills( - self, name: str, skill_names: Union[_models2.SkillNames, JSON, IO[bytes]], **kwargs: Any + self, name: str, skill_names: Union[_models2.SkillNames, _types_models2.SkillNames, IO[bytes]], **kwargs: Any ) -> None: """Reset an existing skillset in a search service. :param name: The name of the skillset. Required. :type name: str :param skill_names: The names of the skills to reset. If not specified, all skills in the - skillset will be reset. Is one of the following types: SkillNames, JSON, IO[bytes] Required. - :type skill_names: ~azure.search.documents.indexes.models.SkillNames or JSON or IO[bytes] + skillset will be reset. Is either a SkillNames type or a IO[bytes] type. Required. + :type skill_names: ~azure.search.documents.indexes.models.SkillNames or + ~azure.search.documents.indexes.types.SkillNames or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py index ad8fc29ea442..a6b864c592a8 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py @@ -27,7 +27,7 @@ class SearchIndexClient(_SearchIndexClient): ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The @@ -55,7 +55,7 @@ class SearchIndexerClient(_SearchIndexerClient): ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py index 792fa82c35d6..1596770e0364 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/__init__.py @@ -75,6 +75,7 @@ EmbeddingColumnMapping, EntityLinkingSkill, EntityRecognitionSkillV3, + EntraAppAuthentication, ExhaustiveKnnAlgorithmConfiguration, ExhaustiveKnnParameters, FabricDataAgentKnowledgeSource, @@ -85,6 +86,7 @@ FieldMappingFunction, FileKnowledgeSource, FileKnowledgeSourceParameters, + FileUploadMetadata, FreshnessScoringFunction, FreshnessScoringParameters, GetIndexStatisticsResult, @@ -115,6 +117,7 @@ KnowledgeBase, KnowledgeBaseAzureOpenAIModel, KnowledgeBaseModel, + KnowledgeBaseRetrieveDefaults, KnowledgeSource, KnowledgeSourceFile, KnowledgeSourceReference, @@ -176,7 +179,12 @@ SearchIndex, SearchIndexFieldReference, SearchIndexKnowledgeSource, + SearchIndexKnowledgeSourceBoost, + SearchIndexKnowledgeSourceFieldValueBoost, + SearchIndexKnowledgeSourceFilterHint, + SearchIndexKnowledgeSourceMultiWordExpressionBoost, SearchIndexKnowledgeSourceParameters, + SearchIndexKnowledgeSourceQueryHints, SearchIndexer, SearchIndexerCache, SearchIndexerDataContainer, @@ -235,6 +243,8 @@ TruncateTokenFilter, UaxUrlEmailTokenizer, UniqueTokenFilter, + UpdateKnowledgeSourceFileRequest, + UploadKnowledgeSourceFileMultipartRequest, VectorSearch, VectorSearchAlgorithmConfiguration, VectorSearchCompression, @@ -251,6 +261,7 @@ WebKnowledgeSourceParameters, WordDelimiterTokenFilter, WorkIQKnowledgeSource, + WorkIQKnowledgeSourceParameters, ) from ._enums import ( # type: ignore @@ -276,6 +287,7 @@ EdgeNGramTokenFilterSide, EntityCategory, EntityRecognitionSkillLanguage, + FileKnowledgeSourceExtractionMode, ImageAnalysisSkillLanguage, ImageDetail, IndexProjectionMode, @@ -292,15 +304,16 @@ KnowledgeSourceContentExtractionMode, KnowledgeSourceIngestionPermissionOption, KnowledgeSourceKind, + KnowledgeSourceResultsProcessing, KnowledgeSourceSynchronizationStatus, LexicalAnalyzerName, LexicalNormalizerName, LexicalTokenizerName, + ListingSearchType, MarkdownHeaderDepth, MarkdownParsingSubmode, McpServerAuthenticationKind, McpServerOutputParsingKind, - McpServerToolInclusionMode, MicrosoftStemmingTokenizerLanguage, MicrosoftTokenizerLanguage, OcrLineEnding, @@ -313,6 +326,7 @@ ScoringFunctionAggregation, ScoringFunctionInterpolation, SearchFieldDataType, + SearchIndexKnowledgeSourceBoostKind, SearchIndexPermissionFilterOption, SearchIndexerDataSourceType, SentimentSkillLanguage, @@ -401,6 +415,7 @@ "EmbeddingColumnMapping", "EntityLinkingSkill", "EntityRecognitionSkillV3", + "EntraAppAuthentication", "ExhaustiveKnnAlgorithmConfiguration", "ExhaustiveKnnParameters", "FabricDataAgentKnowledgeSource", @@ -411,6 +426,7 @@ "FieldMappingFunction", "FileKnowledgeSource", "FileKnowledgeSourceParameters", + "FileUploadMetadata", "FreshnessScoringFunction", "FreshnessScoringParameters", "GetIndexStatisticsResult", @@ -441,6 +457,7 @@ "KnowledgeBase", "KnowledgeBaseAzureOpenAIModel", "KnowledgeBaseModel", + "KnowledgeBaseRetrieveDefaults", "KnowledgeSource", "KnowledgeSourceFile", "KnowledgeSourceReference", @@ -502,7 +519,12 @@ "SearchIndex", "SearchIndexFieldReference", "SearchIndexKnowledgeSource", + "SearchIndexKnowledgeSourceBoost", + "SearchIndexKnowledgeSourceFieldValueBoost", + "SearchIndexKnowledgeSourceFilterHint", + "SearchIndexKnowledgeSourceMultiWordExpressionBoost", "SearchIndexKnowledgeSourceParameters", + "SearchIndexKnowledgeSourceQueryHints", "SearchIndexer", "SearchIndexerCache", "SearchIndexerDataContainer", @@ -561,6 +583,8 @@ "TruncateTokenFilter", "UaxUrlEmailTokenizer", "UniqueTokenFilter", + "UpdateKnowledgeSourceFileRequest", + "UploadKnowledgeSourceFileMultipartRequest", "VectorSearch", "VectorSearchAlgorithmConfiguration", "VectorSearchCompression", @@ -577,6 +601,7 @@ "WebKnowledgeSourceParameters", "WordDelimiterTokenFilter", "WorkIQKnowledgeSource", + "WorkIQKnowledgeSourceParameters", "AIFoundryModelCatalogName", "AzureOpenAIModelName", "BlobIndexerDataToExtract", @@ -599,6 +624,7 @@ "EdgeNGramTokenFilterSide", "EntityCategory", "EntityRecognitionSkillLanguage", + "FileKnowledgeSourceExtractionMode", "ImageAnalysisSkillLanguage", "ImageDetail", "IndexProjectionMode", @@ -615,15 +641,16 @@ "KnowledgeSourceContentExtractionMode", "KnowledgeSourceIngestionPermissionOption", "KnowledgeSourceKind", + "KnowledgeSourceResultsProcessing", "KnowledgeSourceSynchronizationStatus", "LexicalAnalyzerName", "LexicalNormalizerName", "LexicalTokenizerName", + "ListingSearchType", "MarkdownHeaderDepth", "MarkdownParsingSubmode", "McpServerAuthenticationKind", "McpServerOutputParsingKind", - "McpServerToolInclusionMode", "MicrosoftStemmingTokenizerLanguage", "MicrosoftTokenizerLanguage", "OcrLineEnding", @@ -636,6 +663,7 @@ "ScoringFunctionAggregation", "ScoringFunctionInterpolation", "SearchFieldDataType", + "SearchIndexKnowledgeSourceBoostKind", "SearchIndexPermissionFilterOption", "SearchIndexerDataSourceType", "SentimentSkillLanguage", diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_enums.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_enums.py index bbda9f8a7ba4..1a9086d61ce3 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_enums.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_enums.py @@ -51,9 +51,9 @@ class AzureOpenAIModelName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gpt41Nano model.""" GPT5 = "gpt-5" """Gpt5 model.""" - GPT_5_MINI = "gpt-5-mini" + GPT5_MINI = "gpt-5-mini" """Gpt5Mini model.""" - GPT_5_NANO = "gpt-5-nano" + GPT5_NANO = "gpt-5-nano" """Gpt5Nano model.""" GPT51 = "gpt-5.1" """Gpt51 model.""" @@ -61,10 +61,18 @@ class AzureOpenAIModelName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gpt52 model.""" GPT54 = "gpt-5.4" """Gpt54 model.""" - GPT_5_4_MINI = "gpt-5.4-mini" + GPT5_4_MINI = "gpt-5.4-mini" """Gpt54Mini model.""" - GPT_5_4_NANO = "gpt-5.4-nano" + GPT5_4_NANO = "gpt-5.4-nano" """Gpt54Nano model.""" + GPT55 = "gpt-5.5" + """Gpt55 model.""" + GPT56_SOL = "gpt-5.6-sol" + """Gpt56Sol model.""" + GPT56_TERRA = "gpt-5.6-terra" + """Gpt56Terra model.""" + GPT56_LUNA = "gpt-5.6-luna" + """Gpt56Luna model.""" class BlobIndexerDataToExtract(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -370,6 +378,17 @@ class EntityRecognitionSkillLanguage(str, Enum, metaclass=CaseInsensitiveEnumMet """Turkish.""" +class FileKnowledgeSourceExtractionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The extraction effort applied to an individual file. 'minimal' (the default) uses built-in + extraction; 'standard' uses Content Understanding. + """ + + MINIMAL = "minimal" + """Built-in extraction was performed.""" + STANDARD = "standard" + """Content Understanding extraction was performed.""" + + class ImageAnalysisSkillLanguage(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The language codes supported for input by ImageAnalysisSkill.""" @@ -682,6 +701,16 @@ class KnowledgeSourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A knowledge source that retrieves data from Microsoft Fabric Ontology ontologies.""" +class KnowledgeSourceResultsProcessing(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Controls whether a knowledge source's results are reranked.""" + + RERANK = "rerank" + """Results from this knowledge source go through the reranking pipeline. This is the default + behavior.""" + NONE = "none" + """Results from this knowledge source bypass reranking and preserve their underlying order.""" + + class KnowledgeSourceSynchronizationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current synchronization status of the knowledge source.""" @@ -978,6 +1007,15 @@ class LexicalTokenizerName(str, Enum, metaclass=CaseInsensitiveEnumMeta): `_.""" +class ListingSearchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies how the search parameter is interpreted when narrowing down a listing result set. + Currently only 'prefix' is supported. + """ + + PREFIX = "prefix" + """Matches items whose name starts with the value of the search parameter.""" + + class MarkdownHeaderDepth(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the max header depth that will be considered while grouping markdown content. Default is ``h6``. @@ -1033,16 +1071,6 @@ class McpServerOutputParsingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Treat the output as a single block without any parsing.""" -class McpServerToolInclusionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Controls how parsed MCP tool results are integrated into the final result set.""" - - RERANKED = "reranked" - """Tool results go through the reranking and aggregation pipeline alongside results from other - knowledge sources. This is the default behavior.""" - ALWAYS = "always" - """Tool results bypass reranking and are always included in the agent context.""" - - class MicrosoftStemmingTokenizerLanguage(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Lists the languages supported by the Microsoft language stemming tokenizer.""" @@ -1765,6 +1793,15 @@ class SearchIndexerDataSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates a SharePoint datasource.""" +class SearchIndexKnowledgeSourceBoostKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of boost hint for a search index knowledge source.""" + + FIELD_VALUE = "fieldValue" + """Boost documents based on a field value.""" + MULTI_WORD_EXPRESSION = "multiWordExpression" + """Boost documents based on a multi-word expression.""" + + class SearchIndexPermissionFilterOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """A value indicating whether permission filtering is enabled for the index.""" diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py index f90b1e255d41..4c9e478cf930 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py @@ -12,11 +12,13 @@ from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from ..._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ..._utils.utils import FileType from ._enums import ( KnowledgeBaseModelKind, KnowledgeSourceKind, McpServerAuthenticationKind, McpServerOutputParsingKind, + SearchIndexKnowledgeSourceBoostKind, VectorSearchAlgorithmKind, VectorSearchCompressionKind, VectorSearchVectorizerKind, @@ -625,6 +627,11 @@ class KnowledgeSource(_Model): "azureBlob", "indexedSharePoint", "indexedOneLake", "indexedSql", "web", "remoteSharePoint", "workIQ", "file", "mcpServer", "fabricDataAgent", and "fabricOntology". :vartype kind: str or ~azure.search.documents.indexes.models.KnowledgeSourceKind + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -647,6 +654,12 @@ class KnowledgeSource(_Model): """The type of the knowledge source. Required. Known values are: \"searchIndex\", \"azureBlob\", \"indexedSharePoint\", \"indexedOneLake\", \"indexedSql\", \"web\", \"remoteSharePoint\", \"workIQ\", \"file\", \"mcpServer\", \"fabricDataAgent\", and \"fabricOntology\".""" + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = rest_field( + name="resultsProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Controls whether results from this knowledge source are reranked before they are included in + the final result set. Defaults to 'rerank' when not specified. Known values are: \"rerank\" and + \"none\".""" e_tag: Optional[str] = rest_field(name="@odata.etag", visibility=["read", "create", "update", "delete", "query"]) """The ETag of the knowledge source.""" encryption_key: Optional["_models.SearchResourceEncryptionKey"] = rest_field( @@ -668,6 +681,7 @@ def __init__( name: str, kind: str, description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -690,6 +704,11 @@ class AzureBlobKnowledgeSource(KnowledgeSource, discriminator="azureBlob"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -724,6 +743,7 @@ def __init__( name: str, azure_blob_parameters: "_models.AzureBlobKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -756,6 +776,11 @@ class AzureBlobKnowledgeSourceParameters(_Model): :ivar ingestion_parameters: Consolidates all general ingestion settings. :vartype ingestion_parameters: ~azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints :ivar created_resources: Resources created by the knowledge source. :vartype created_resources: ~azure.search.documents.indexes.models.CreatedResources """ @@ -778,6 +803,11 @@ class AzureBlobKnowledgeSourceParameters(_Model): name="ingestionParameters", visibility=["read", "create", "update", "delete", "query"] ) """Consolidates all general ingestion settings.""" + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHints", visibility=["read", "create", "update", "delete", "query"] + ) + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" created_resources: Optional["_models.CreatedResources"] = rest_field(name="createdResources", visibility=["read"]) """Resources created by the knowledge source.""" @@ -790,6 +820,7 @@ def __init__( folder_path: Optional[str] = None, is_adls_gen2: Optional[bool] = None, ingestion_parameters: Optional["_knowledgebases_models3.KnowledgeSourceIngestionParameters"] = None, + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -1136,8 +1167,8 @@ class AzureOpenAIEmbeddingSkill(SearchIndexerSkill, discriminator="#Microsoft.Sk :ivar model_name: The name of the embedding model that is deployed at the provided deploymentId path. Known values are: "text-embedding-ada-002", "text-embedding-3-large", "text-embedding-3-small", "gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", - "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", and - "gpt-5.4-nano". + "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", + "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", and "gpt-5.6-luna". :vartype model_name: str or ~azure.search.documents.indexes.models.AzureOpenAIModelName :ivar dimensions: The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. @@ -1167,8 +1198,8 @@ class AzureOpenAIEmbeddingSkill(SearchIndexerSkill, discriminator="#Microsoft.Sk """The name of the embedding model that is deployed at the provided deploymentId path. Known values are: \"text-embedding-ada-002\", \"text-embedding-3-large\", \"text-embedding-3-small\", \"gpt-4o\", \"gpt-4o-mini\", \"gpt-4.1\", \"gpt-4.1-mini\", \"gpt-4.1-nano\", \"gpt-5\", - \"gpt-5-mini\", \"gpt-5-nano\", \"gpt-5.1\", \"gpt-5.2\", \"gpt-5.4\", \"gpt-5.4-mini\", and - \"gpt-5.4-nano\".""" + \"gpt-5-mini\", \"gpt-5-nano\", \"gpt-5.1\", \"gpt-5.2\", \"gpt-5.4\", \"gpt-5.4-mini\", + \"gpt-5.4-nano\", \"gpt-5.5\", \"gpt-5.6-sol\", \"gpt-5.6-terra\", and \"gpt-5.6-luna\".""" dimensions: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.""" @@ -1305,8 +1336,8 @@ class AzureOpenAIVectorizerParameters(_Model): :ivar model_name: The name of the embedding model that is deployed at the provided deploymentId path. Known values are: "text-embedding-ada-002", "text-embedding-3-large", "text-embedding-3-small", "gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", - "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", and - "gpt-5.4-nano". + "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", + "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", and "gpt-5.6-luna". :vartype model_name: str or ~azure.search.documents.indexes.models.AzureOpenAIModelName """ @@ -1330,8 +1361,8 @@ class AzureOpenAIVectorizerParameters(_Model): """The name of the embedding model that is deployed at the provided deploymentId path. Known values are: \"text-embedding-ada-002\", \"text-embedding-3-large\", \"text-embedding-3-small\", \"gpt-4o\", \"gpt-4o-mini\", \"gpt-4.1\", \"gpt-4.1-mini\", \"gpt-4.1-nano\", \"gpt-5\", - \"gpt-5-mini\", \"gpt-5-nano\", \"gpt-5.1\", \"gpt-5.2\", \"gpt-5.4\", \"gpt-5.4-mini\", and - \"gpt-5.4-nano\".""" + \"gpt-5-mini\", \"gpt-5-nano\", \"gpt-5.1\", \"gpt-5.2\", \"gpt-5.4\", \"gpt-5.4-mini\", + \"gpt-5.4-nano\", \"gpt-5.5\", \"gpt-5.6-sol\", \"gpt-5.6-terra\", and \"gpt-5.6-luna\".""" @overload def __init__( @@ -3989,6 +4020,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.V3.EntityRecognitionSkill" # type: ignore +class EntraAppAuthentication(_Model): + """Configuration for a customer-owned Microsoft Entra app registration used for federated + credential-based on-behalf-of authentication. + + :ivar application_id: The application (client) ID of the customer-owned Entra app registration. + Required. + :vartype application_id: str + :ivar federated_credential_id: The federated credential ID configured on the app registration, + enabling the search service to authenticate as the app without a stored client secret. + Required. + :vartype federated_credential_id: str + :ivar tenant_id: 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. + :vartype tenant_id: str + """ + + application_id: str = rest_field(name="applicationId", visibility=["read", "create", "update", "delete", "query"]) + """The application (client) ID of the customer-owned Entra app registration. Required.""" + federated_credential_id: str = rest_field( + name="federatedCredentialId", visibility=["read", "create", "update", "delete", "query"] + ) + """The federated credential ID configured on the app registration, enabling the search service to + authenticate as the app without a stored client secret. Required.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """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.""" + + @overload + def __init__( + self, + *, + application_id: str, + federated_credential_id: str, + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class VectorSearchAlgorithmConfiguration(_Model): """Contains configuration options specific to the algorithm used during indexing or querying. @@ -4108,6 +4186,11 @@ class FabricDataAgentKnowledgeSource(KnowledgeSource, discriminator="fabricDataA :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4143,6 +4226,7 @@ def __init__( name: str, fabric_data_agent_parameters: "_models.FabricDataAgentKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -4199,6 +4283,11 @@ class FabricOntologyKnowledgeSource(KnowledgeSource, discriminator="fabricOntolo :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4234,6 +4323,7 @@ def __init__( name: str, fabric_ontology_parameters: "_models.FabricOntologyKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -4370,6 +4460,11 @@ class FileKnowledgeSource(KnowledgeSource, discriminator="file"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4386,6 +4481,9 @@ class FileKnowledgeSource(KnowledgeSource, discriminator="file"): :vartype kind: str or ~azure.search.documents.indexes.models.FILE :ivar file_parameters: The parameters for the File knowledge source. Required. :vartype file_parameters: ~azure.search.documents.indexes.models.FileKnowledgeSourceParameters + :ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the File + knowledge source's file endpoints (upload, list, update, delete). + :vartype cors_options: ~azure.search.documents.indexes.models.CorsOptions """ kind: Literal[KnowledgeSourceKind.FILE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -4395,6 +4493,11 @@ class FileKnowledgeSource(KnowledgeSource, discriminator="file"): name="fileParameters", visibility=["read", "create", "update", "delete", "query"] ) """The parameters for the File knowledge source. Required.""" + cors_options: Optional["_models.CorsOptions"] = rest_field( + name="corsOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """Options to control Cross-Origin Resource Sharing (CORS) for the File knowledge source's file + endpoints (upload, list, update, delete).""" @overload def __init__( @@ -4403,8 +4506,10 @@ def __init__( name: str, file_parameters: "_models.FileKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, + cors_options: Optional["_models.CorsOptions"] = None, ) -> None: ... @overload @@ -4422,10 +4527,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FileKnowledgeSourceParameters(_Model): """Parameters for File knowledge source. - :ivar ingestion_parameters: Consolidates all general ingestion settings. Only 'minimal' content - extraction mode and embeddingModel are supported for file knowledge sources. + :ivar ingestion_parameters: Consolidates all general ingestion settings for the File knowledge + source, including the content extraction mode and an optional embeddingModel. :vartype ingestion_parameters: ~azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints :ivar created_resources: Resources created by the file knowledge source. :vartype created_resources: ~azure.search.documents.indexes.models.CreatedResources """ @@ -4433,8 +4543,13 @@ class FileKnowledgeSourceParameters(_Model): ingestion_parameters: Optional["_knowledgebases_models3.KnowledgeSourceIngestionParameters"] = rest_field( name="ingestionParameters", visibility=["read", "create", "update", "delete", "query"] ) - """Consolidates all general ingestion settings. Only 'minimal' content extraction mode and - embeddingModel are supported for file knowledge sources.""" + """Consolidates all general ingestion settings for the File knowledge source, including the + content extraction mode and an optional embeddingModel.""" + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHints", visibility=["read", "create", "update", "delete", "query"] + ) + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" created_resources: Optional["_models.CreatedResources"] = rest_field(name="createdResources", visibility=["read"]) """Resources created by the file knowledge source.""" @@ -4443,6 +4558,43 @@ def __init__( self, *, ingestion_parameters: Optional["_knowledgebases_models3.KnowledgeSourceIngestionParameters"] = None, + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FileUploadMetadata(_Model): + """The JSON 'metadata' part of a multipart/form-data file upload: the full file name/path and + custom key/value metadata. The parsing mode and extraction mode are both chosen by the service + and are not supplied by the caller. + + :ivar file_name: The full relative file name/path to store the file under (prefixes are derived + from it). + :vartype file_name: str + :ivar metadata: Custom key/value metadata to store with the file. + :vartype metadata: dict[str, str] + """ + + file_name: Optional[str] = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"]) + """The full relative file name/path to store the file under (prefixes are derived from it).""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Custom key/value metadata to store with the file.""" + + @overload + def __init__( + self, + *, + file_name: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4796,6 +4948,11 @@ class IndexedOneLakeKnowledgeSource(KnowledgeSource, discriminator="indexedOneLa :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4828,6 +4985,7 @@ def __init__( name: str, indexed_one_lake_parameters: "_models.IndexedOneLakeKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -4856,6 +5014,11 @@ class IndexedOneLakeKnowledgeSourceParameters(_Model): :ivar ingestion_parameters: Consolidates all general ingestion settings. :vartype ingestion_parameters: ~azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints :ivar created_resources: Resources created by the knowledge source. :vartype created_resources: ~azure.search.documents.indexes.models.CreatedResources """ @@ -4874,6 +5037,11 @@ class IndexedOneLakeKnowledgeSourceParameters(_Model): name="ingestionParameters", visibility=["read", "create", "update", "delete", "query"] ) """Consolidates all general ingestion settings.""" + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHints", visibility=["read", "create", "update", "delete", "query"] + ) + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" created_resources: Optional["_models.CreatedResources"] = rest_field(name="createdResources", visibility=["read"]) """Resources created by the knowledge source.""" @@ -4885,6 +5053,7 @@ def __init__( lakehouse_id: str, target_path: Optional[str] = None, ingestion_parameters: Optional["_knowledgebases_models3.KnowledgeSourceIngestionParameters"] = None, + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -4905,6 +5074,11 @@ class IndexedSharePointKnowledgeSource(KnowledgeSource, discriminator="indexedSh :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4937,6 +5111,7 @@ def __init__( name: str, indexed_share_point_parameters: "_models.IndexedSharePointKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -4970,6 +5145,11 @@ class IndexedSharePointKnowledgeSourceParameters(_Model): # pylint: disable=nam :ivar ingestion_parameters: Consolidates all general ingestion settings. :vartype ingestion_parameters: ~azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints :ivar created_resources: Resources created by the knowledge source. :vartype created_resources: ~azure.search.documents.indexes.models.CreatedResources """ @@ -4991,6 +5171,11 @@ class IndexedSharePointKnowledgeSourceParameters(_Model): # pylint: disable=nam name="ingestionParameters", visibility=["read", "create", "update", "delete", "query"] ) """Consolidates all general ingestion settings.""" + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHints", visibility=["read", "create", "update", "delete", "query"] + ) + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" created_resources: Optional["_models.CreatedResources"] = rest_field(name="createdResources", visibility=["read"]) """Resources created by the knowledge source.""" @@ -5002,6 +5187,7 @@ def __init__( container_name: Union[str, "_models.IndexedSharePointContainerName"], query: Optional[str] = None, ingestion_parameters: Optional["_knowledgebases_models3.KnowledgeSourceIngestionParameters"] = None, + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -5022,6 +5208,11 @@ class IndexedSqlKnowledgeSource(KnowledgeSource, discriminator="indexedSql"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -5056,6 +5247,7 @@ def __init__( name: str, indexed_sql_parameters: "_models.IndexedSqlKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -5094,6 +5286,11 @@ class IndexedSqlKnowledgeSourceParameters(_Model): model, schedule, and identity. :vartype ingestion_parameters: ~azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints :ivar created_resources: Resources created by the knowledge source. :vartype created_resources: ~azure.search.documents.indexes.models.CreatedResources """ @@ -5122,6 +5319,11 @@ class IndexedSqlKnowledgeSourceParameters(_Model): name="ingestionParameters", visibility=["read", "create", "update", "delete", "query"] ) """Consolidates all general ingestion settings including embedding model, schedule, and identity.""" + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHints", visibility=["read", "create", "update", "delete", "query"] + ) + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" created_resources: Optional["_models.CreatedResources"] = rest_field(name="createdResources", visibility=["read"]) """Resources created by the knowledge source.""" @@ -5135,6 +5337,7 @@ def __init__( content_columns: Optional[list["_models.ContentColumnMapping"]] = None, embedding_columns: Optional[list["_models.EmbeddingColumnMapping"]] = None, ingestion_parameters: Optional["_knowledgebases_models3.KnowledgeSourceIngestionParameters"] = None, + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -6052,6 +6255,9 @@ class KnowledgeBase(_Model): :vartype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey :ivar description: The description of the knowledge base. :vartype description: str + :ivar tags: User-defined key-value pairs for categorizing the knowledge base and attributing + its usage and costs. + :vartype tags: dict[str, str] :ivar retrieval_instructions: Instructions considered by the knowledge base when developing query plan. :vartype retrieval_instructions: str @@ -6061,6 +6267,11 @@ class KnowledgeBase(_Model): :ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the knowledge base. :vartype cors_options: ~azure.search.documents.indexes.models.CorsOptions + :ivar retrieve_defaults: 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. + :vartype retrieve_defaults: + ~azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -6090,6 +6301,9 @@ class KnowledgeBase(_Model): """A description of an encryption key that you create in Azure Key Vault.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The description of the knowledge base.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """User-defined key-value pairs for categorizing the knowledge base and attributing its usage and + costs.""" retrieval_instructions: Optional[str] = rest_field( name="retrievalInstructions", visibility=["read", "create", "update", "delete", "query"] ) @@ -6102,6 +6316,12 @@ class KnowledgeBase(_Model): name="corsOptions", visibility=["read", "create", "update", "delete", "query"] ) """Options to control Cross-Origin Resource Sharing (CORS) for the knowledge base.""" + retrieve_defaults: Optional["_models.KnowledgeBaseRetrieveDefaults"] = rest_field( + name="retrieveDefaults", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -6115,9 +6335,11 @@ def __init__( e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, retrieval_instructions: Optional[str] = None, answer_instructions: Optional[str] = None, cors_options: Optional["_models.CorsOptions"] = None, + retrieve_defaults: Optional["_models.KnowledgeBaseRetrieveDefaults"] = None, ) -> None: ... @overload @@ -6199,6 +6421,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeBaseModelKind.AZURE_OPEN_AI # type: ignore +class KnowledgeBaseRetrieveDefaults(_Model): + """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. + + :ivar max_runtime_in_seconds: The default maximum runtime in seconds for a retrieve request. + :vartype max_runtime_in_seconds: int + :ivar max_output_documents: The default maximum number of documents in the retrieve output. + :vartype max_output_documents: int + :ivar max_output_size_in_tokens: The default maximum size, in tokens, of the content in the + retrieve output. + :vartype max_output_size_in_tokens: int + """ + + max_runtime_in_seconds: Optional[int] = rest_field( + name="maxRuntimeInSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """The default maximum runtime in seconds for a retrieve request.""" + max_output_documents: Optional[int] = rest_field( + name="maxOutputDocuments", visibility=["read", "create", "update", "delete", "query"] + ) + """The default maximum number of documents in the retrieve output.""" + max_output_size_in_tokens: Optional[int] = rest_field( + name="maxOutputSizeInTokens", visibility=["read", "create", "update", "delete", "query"] + ) + """The default maximum size, in tokens, of the content in the retrieve output.""" + + @overload + def __init__( + self, + *, + max_runtime_in_seconds: Optional[int] = None, + max_output_documents: Optional[int] = None, + max_output_size_in_tokens: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeSourceFile(_Model): """Metadata for a file uploaded to a File knowledge source. @@ -6214,6 +6483,19 @@ class KnowledgeSourceFile(_Model): :vartype last_updated_at: ~datetime.datetime :ivar error_message: The error message if file processing failed, null otherwise. :vartype error_message: str + :ivar prefix: The prefix (directory-like path) derived from the full file name. + :vartype prefix: str + :ivar metadata: Custom key/value metadata stored with the file. Returned but not searchable or + filterable. + :vartype metadata: dict[str, str] + :ivar parsing_mode: The parsing mode applied to the file (auto-detected from the file). Known + values are: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines", and + "markdown". + :vartype parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode + :ivar extraction_mode: The extraction mode applied to the file. Known values are: "minimal" and + "standard". + :vartype extraction_mode: str or + ~azure.search.documents.indexes.models.FileKnowledgeSourceExtractionMode """ file_id: Optional[str] = rest_field(name="fileId", visibility=["read"]) @@ -6230,6 +6512,20 @@ class KnowledgeSourceFile(_Model): """The timestamp when the file was last updated.""" error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) """The error message if file processing failed, null otherwise.""" + prefix: Optional[str] = rest_field(visibility=["read"]) + """The prefix (directory-like path) derived from the full file name.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """Custom key/value metadata stored with the file. Returned but not searchable or filterable.""" + parsing_mode: Optional[Union[str, "_models.BlobIndexerParsingMode"]] = rest_field( + name="parsingMode", visibility=["read"] + ) + """The parsing mode applied to the file (auto-detected from the file). Known values are: + \"default\", \"text\", \"delimitedText\", \"json\", \"jsonArray\", \"jsonLines\", and + \"markdown\".""" + extraction_mode: Optional[Union[str, "_models.FileKnowledgeSourceExtractionMode"]] = rest_field( + name="extractionMode", visibility=["read"] + ) + """The extraction mode applied to the file. Known values are: \"minimal\" and \"standard\".""" class KnowledgeSourceReference(_Model): @@ -6461,10 +6757,14 @@ class ListDataSourcesResult(_Model): :ivar data_sources: The datasources in the Search service. Required. :vartype data_sources: list[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection] + :ivar odata_next_link: The URL that can be used to fetch the next set of results. + :vartype odata_next_link: str """ data_sources: list["_models.SearchIndexerDataSourceConnection"] = rest_field(name="value", visibility=["read"]) """The datasources in the Search service. Required.""" + odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) + """The URL that can be used to fetch the next set of results.""" class ListIndexersResult(_Model): @@ -6473,10 +6773,14 @@ class ListIndexersResult(_Model): :ivar indexers: The indexers in the Search service. Required. :vartype indexers: list[~azure.search.documents.indexes.models.SearchIndexer] + :ivar odata_next_link: The URL that can be used to fetch the next set of results. + :vartype odata_next_link: str """ indexers: list["_models.SearchIndexer"] = rest_field(name="value", visibility=["read"]) """The indexers in the Search service. Required.""" + odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) + """The URL that can be used to fetch the next set of results.""" class ListSkillsetsResult(_Model): @@ -6485,10 +6789,14 @@ class ListSkillsetsResult(_Model): :ivar skillsets: The skillsets defined in the Search service. Required. :vartype skillsets: list[~azure.search.documents.indexes.models.SearchIndexerSkillset] + :ivar odata_next_link: The URL that can be used to fetch the next set of results. + :vartype odata_next_link: str """ skillsets: list["_models.SearchIndexerSkillset"] = rest_field(name="value", visibility=["read"]) """The skillsets defined in the Search service. Required.""" + odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) + """The URL that can be used to fetch the next set of results.""" class ListSynonymMapsResult(_Model): @@ -6497,10 +6805,14 @@ class ListSynonymMapsResult(_Model): :ivar synonym_maps: The synonym maps in the Search service. Required. :vartype synonym_maps: list[~azure.search.documents.indexes.models.SynonymMap] + :ivar odata_next_link: The URL that can be used to fetch the next set of results. + :vartype odata_next_link: str """ synonym_maps: list["_models.SynonymMap"] = rest_field(name="value", visibility=["read"]) """The synonym maps in the Search service. Required.""" + odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) + """The URL that can be used to fetch the next set of results.""" class LuceneStandardAnalyzer(LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.StandardAnalyzer"): @@ -6999,6 +7311,11 @@ class McpServerKnowledgeSource(KnowledgeSource, discriminator="mcpServer"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -7033,6 +7350,7 @@ def __init__( name: str, mcp_server_parameters: "_models.McpServerKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -7329,11 +7647,10 @@ class McpServerTool(_Model): :vartype name: str :ivar output_parsing: Optional configuration for parsing the tool's output. :vartype output_parsing: ~azure.search.documents.indexes.models.McpServerOutputParsing - :ivar inclusion_mode: Controls how the parsed results from this tool are integrated into the - final result set. Defaults to 'reranked' when not specified. Known values are: "reranked" and - "always". - :vartype inclusion_mode: str or - ~azure.search.documents.indexes.models.McpServerToolInclusionMode + :ivar results_processing: Controls whether the parsed results from this tool are reranked. + Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_tokens: Optional post-parsing token cap for this tool's output. Must be greater than 0 when specified. :vartype max_output_tokens: int @@ -7345,11 +7662,11 @@ class McpServerTool(_Model): name="outputParsing", visibility=["read", "create", "update", "delete", "query"] ) """Optional configuration for parsing the tool's output.""" - inclusion_mode: Optional[Union[str, "_models.McpServerToolInclusionMode"]] = rest_field( - name="inclusionMode", visibility=["read", "create", "update", "delete", "query"] + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = rest_field( + name="resultsProcessing", visibility=["read", "create", "update", "delete", "query"] ) - """Controls how the parsed results from this tool are integrated into the final result set. - Defaults to 'reranked' when not specified. Known values are: \"reranked\" and \"always\".""" + """Controls whether the parsed results from this tool are reranked. Defaults to 'rerank' when not + specified. Known values are: \"rerank\" and \"none\".""" max_output_tokens: Optional[int] = rest_field( name="maxOutputTokens", visibility=["read", "create", "update", "delete", "query"] ) @@ -7361,7 +7678,7 @@ def __init__( *, name: Optional[str] = None, output_parsing: Optional["_models.McpServerOutputParsing"] = None, - inclusion_mode: Optional[Union[str, "_models.McpServerToolInclusionMode"]] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, max_output_tokens: Optional[int] = None, ) -> None: ... @@ -8439,6 +8756,11 @@ class RemoteSharePointKnowledgeSource(KnowledgeSource, discriminator="remoteShar :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -8470,6 +8792,7 @@ def __init__( *, name: str, description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, remote_share_point_parameters: Optional["_models.RemoteSharePointKnowledgeSourceParameters"] = None, @@ -10683,6 +11006,11 @@ class SearchIndexKnowledgeSource(KnowledgeSource, discriminator="searchIndex"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -10715,6 +11043,7 @@ def __init__( name: str, search_index_parameters: "_models.SearchIndexKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -10731,6 +11060,190 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.SEARCH_INDEX # type: ignore +class SearchIndexKnowledgeSourceBoost(_Model): + """A hint that identifies a condition the query planner can use to influence document ranking. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + SearchIndexKnowledgeSourceFieldValueBoost, SearchIndexKnowledgeSourceMultiWordExpressionBoost + + :ivar kind: The kind of boost hint. Required. Known values are: "fieldValue" and + "multiWordExpression". + :vartype kind: str or + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoostKind + :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + boost. + :vartype boost_instructions: str + """ + + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of boost hint. Required. Known values are: \"fieldValue\" and \"multiWordExpression\".""" + boost_instructions: Optional[str] = rest_field( + name="boostInstructions", visibility=["read", "create", "update", "delete", "query"] + ) + """Natural-language instructions that explain when and how to apply the boost.""" + + @overload + def __init__( + self, + *, + kind: str, + boost_instructions: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SearchIndexKnowledgeSourceFieldValueBoost( + SearchIndexKnowledgeSourceBoost, discriminator="fieldValue" +): # pylint: disable=name-too-long + """A hint that boosts documents based on a field value. + + :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + boost. + :vartype boost_instructions: str + :ivar kind: The discriminator value. Required. Boost documents based on a field value. + :vartype kind: str or ~azure.search.documents.indexes.models.FIELD_VALUE + :ivar field: The name of the search index field. Required. + :vartype field: str + :ivar field_values: Representative values for the field. + :vartype field_values: list[str] + :ivar boost: A multiplier for the document score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + """ + + kind: Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The discriminator value. Required. Boost documents based on a field value.""" + field: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the search index field. Required.""" + field_values: Optional[list[str]] = rest_field( + name="fieldValues", visibility=["read", "create", "update", "delete", "query"] + ) + """Representative values for the field.""" + boost: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A multiplier for the document score. Must be a positive number not equal to 1.0. Required.""" + + @overload + def __init__( + self, + *, + field: str, + boost: float, + boost_instructions: Optional[str] = None, + field_values: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE # type: ignore + + +class SearchIndexKnowledgeSourceFilterHint(_Model): + """A hint that identifies a field and representative values the query planner can use when + constructing a filter. + + :ivar field: The name of the filterable search index field. Required. + :vartype field: str + :ivar field_values: Representative values for the field. Required. + :vartype field_values: list[str] + :ivar filter_instructions: Natural-language instructions that explain when and how to filter on + the field. + :vartype filter_instructions: str + """ + + field: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the filterable search index field. Required.""" + field_values: list[str] = rest_field(name="fieldValues", visibility=["read", "create", "update", "delete", "query"]) + """Representative values for the field. Required.""" + filter_instructions: Optional[str] = rest_field( + name="filterInstructions", visibility=["read", "create", "update", "delete", "query"] + ) + """Natural-language instructions that explain when and how to filter on the field.""" + + @overload + def __init__( + self, + *, + field: str, + field_values: list[str], + filter_instructions: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SearchIndexKnowledgeSourceMultiWordExpressionBoost( + SearchIndexKnowledgeSourceBoost, discriminator="multiWordExpression" +): # pylint: disable=name-too-long + """A hint that boosts documents based on a multi-word expression. + + :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + boost. + :vartype boost_instructions: str + :ivar kind: The discriminator value. Required. Boost documents based on a multi-word + expression. + :vartype kind: str or ~azure.search.documents.indexes.models.MULTI_WORD_EXPRESSION + :ivar field_values: Representative values for the boost. + :vartype field_values: list[str] + :ivar boost: A multiplier for the document score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + """ + + kind: Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The discriminator value. Required. Boost documents based on a multi-word expression.""" + field_values: Optional[list[str]] = rest_field( + name="fieldValues", visibility=["read", "create", "update", "delete", "query"] + ) + """Representative values for the boost.""" + boost: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A multiplier for the document score. Must be a positive number not equal to 1.0. Required.""" + + @overload + def __init__( + self, + *, + boost: float, + boost_instructions: Optional[str] = None, + field_values: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION # type: ignore + + class SearchIndexKnowledgeSourceParameters(_Model): """Parameters for search index knowledge source. @@ -10747,6 +11260,11 @@ class SearchIndexKnowledgeSourceParameters(_Model): :ivar base_filter: A default filter condition applied to the index at retrieval time (e.g., 'State eq VA'). Can be overridden at query time via knowledge source runtime parameters. :vartype base_filter: str + :ivar query_hints: 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. + :vartype query_hints: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ search_index_name: str = rest_field( @@ -10771,6 +11289,11 @@ class SearchIndexKnowledgeSourceParameters(_Model): ) """A default filter condition applied to the index at retrieval time (e.g., 'State eq VA'). Can be overridden at query time via knowledge source runtime parameters.""" + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHints", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -10781,6 +11304,49 @@ def __init__( search_fields: Optional[list["_models.SearchIndexFieldReference"]] = None, semantic_configuration_name: Optional[str] = None, base_filter: Optional[str] = None, + query_hints: Optional["_models.SearchIndexKnowledgeSourceQueryHints"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SearchIndexKnowledgeSourceQueryHints(_Model): + """Hints that guide query planning toward useful filters and boosts for a search index knowledge + source. + + :ivar filters: Filter hints that identify fields and representative values the query planner + can use when constructing filters. + :vartype filters: + list[~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint] + :ivar boosts: Boost hints that identify conditions the query planner can use to influence + document ranking. + :vartype boosts: list[~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoost] + """ + + filters: Optional[list["_models.SearchIndexKnowledgeSourceFilterHint"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Filter hints that identify fields and representative values the query planner can use when + constructing filters.""" + boosts: Optional[list["_models.SearchIndexKnowledgeSourceBoost"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Boost hints that identify conditions the query planner can use to influence document ranking.""" + + @overload + def __init__( + self, + *, + filters: Optional[list["_models.SearchIndexKnowledgeSourceFilterHint"]] = None, + boosts: Optional[list["_models.SearchIndexKnowledgeSourceBoost"]] = None, ) -> None: ... @overload @@ -11189,6 +11755,9 @@ class SearchServiceLimits(_Model): :ivar max_cumulative_indexer_runtime_seconds: The maximum cumulative indexer runtime in seconds allowed for the service. :vartype max_cumulative_indexer_runtime_seconds: int + :ivar max_vector_index_size_per_index_in_bytes: The maximum vector index size (vector memory + quota) allowed per index in bytes. + :vartype max_vector_index_size_per_index_in_bytes: int """ max_fields_per_index: Optional[int] = rest_field( @@ -11216,6 +11785,10 @@ class SearchServiceLimits(_Model): name="maxCumulativeIndexerRuntimeSeconds", visibility=["read", "create", "update", "delete", "query"] ) """The maximum cumulative indexer runtime in seconds allowed for the service.""" + max_vector_index_size_per_index_in_bytes: Optional[int] = rest_field( + name="maxVectorIndexSizePerIndexInBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum vector index size (vector memory quota) allowed per index in bytes.""" @overload def __init__( @@ -11227,6 +11800,7 @@ def __init__( max_complex_objects_in_collections_per_document: Optional[int] = None, max_storage_per_index_in_bytes: Optional[int] = None, max_cumulative_indexer_runtime_seconds: Optional[int] = None, + max_vector_index_size_per_index_in_bytes: Optional[int] = None, ) -> None: ... @overload @@ -12851,6 +13425,76 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.UniqueTokenFilter" # type: ignore +class UpdateKnowledgeSourceFileRequest(_Model): + """Multipart request for updating a file in a File knowledge source. + + :ivar metadata: The JSON metadata describing the file. Required. + :vartype metadata: ~azure.search.documents.indexes.models.FileUploadMetadata + :ivar content: The raw file content. Required. + :vartype content: ~azure.search.documents._utils.utils.FileType + """ + + metadata: "_models.FileUploadMetadata" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON metadata describing the file. Required.""" + content: FileType = rest_field( + visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True + ) + """The raw file content. Required.""" + + @overload + def __init__( + self, + *, + metadata: "_models.FileUploadMetadata", + content: FileType, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UploadKnowledgeSourceFileMultipartRequest(_Model): # pylint: disable=name-too-long + """Multipart request for uploading a file to a File knowledge source. + + :ivar metadata: The JSON metadata describing the file. Required. + :vartype metadata: ~azure.search.documents.indexes.models.FileUploadMetadata + :ivar content: The raw file content. Required. + :vartype content: ~azure.search.documents._utils.utils.FileType + """ + + metadata: "_models.FileUploadMetadata" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JSON metadata describing the file. Required.""" + content: FileType = rest_field( + visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True + ) + """The raw file content. Required.""" + + @overload + def __init__( + self, + *, + metadata: "_models.FileUploadMetadata", + content: FileType, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class VectorSearch(_Model): """Contains configuration options related to vector search. @@ -13269,6 +13913,11 @@ class WebKnowledgeSource(KnowledgeSource, discriminator="web"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -13299,6 +13948,7 @@ def __init__( *, name: str, description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, web_parameters: Optional["_models.WebKnowledgeSourceParameters"] = None, @@ -13576,6 +14226,11 @@ class WorkIQKnowledgeSource(KnowledgeSource, discriminator="workIQ"): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str + :ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar e_tag: The ETag of the knowledge source. :vartype e_tag: str :ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -13589,17 +14244,28 @@ class WorkIQKnowledgeSource(KnowledgeSource, discriminator="workIQ"): :vartype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey :ivar kind: The discriminator value. Required. A knowledge source that reads data from work IQ. :vartype kind: str or ~azure.search.documents.indexes.models.WORK_IQ + :ivar work_iq_parameters: The parameters for the WorkIQ knowledge source, including the + customer-owned Entra app configuration used for on-behalf-of authentication. Required. + :vartype work_iq_parameters: + ~azure.search.documents.indexes.models.WorkIQKnowledgeSourceParameters """ kind: Literal[KnowledgeSourceKind.WORK_IQ] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. A knowledge source that reads data from work IQ.""" + work_iq_parameters: "_models.WorkIQKnowledgeSourceParameters" = rest_field( + name="workIQParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """The parameters for the WorkIQ knowledge source, including the customer-owned Entra app + configuration used for on-behalf-of authentication. Required.""" @overload def __init__( self, *, name: str, + work_iq_parameters: "_models.WorkIQKnowledgeSourceParameters", description: Optional[str] = None, + results_processing: Optional[Union[str, "_models.KnowledgeSourceResultsProcessing"]] = None, e_tag: Optional[str] = None, encryption_key: Optional["_models.SearchResourceEncryptionKey"] = None, ) -> None: ... @@ -13614,3 +14280,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.kind = KnowledgeSourceKind.WORK_IQ # type: ignore + + +class WorkIQKnowledgeSourceParameters(_Model): + """Parameters for a WorkIQ knowledge source. + + :ivar entra_app_authentication: 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. Required. + :vartype entra_app_authentication: + ~azure.search.documents.indexes.models.EntraAppAuthentication + """ + + entra_app_authentication: "_models.EntraAppAuthentication" = rest_field( + name="entraAppAuthentication", visibility=["read", "create", "update", "delete", "query"] + ) + """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. Required.""" + + @overload + def __init__( + self, + *, + entra_app_authentication: "_models.EntraAppAuthentication", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py new file mode 100644 index 000000000000..a7095f069d0c --- /dev/null +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py @@ -0,0 +1,7160 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .._utils.utils import FileType +from .models._enums import ( + KnowledgeBaseModelKind, + KnowledgeSourceKind, + McpServerAuthenticationKind, + McpServerOutputParsingKind, + SearchIndexKnowledgeSourceBoostKind, + VectorSearchAlgorithmKind, + VectorSearchCompressionKind, + VectorSearchVectorizerKind, +) + +if TYPE_CHECKING: + from ..knowledgebases.types import KnowledgeRetrievalReasoningEffort, KnowledgeSourceIngestionParameters + from ..knowledgebasesmodels import KnowledgeRetrievalOutputMode + from .models import ( + AIFoundryModelCatalogName, + AzureOpenAIModelName, + BlobIndexerDataToExtract, + BlobIndexerImageAction, + BlobIndexerPDFTextRotationAlgorithm, + BlobIndexerParsingMode, + CharFilterName, + ChatCompletionExtraParametersBehavior, + ChatCompletionResponseFormatType, + CjkBigramTokenFilterScripts, + ContentUnderstandingSkillChunkingMethod, + ContentUnderstandingSkillChunkingUnit, + ContentUnderstandingSkillExtractionOptions, + CustomEntityLookupSkillLanguage, + DocumentIntelligenceLayoutSkillChunkingUnit, + DocumentIntelligenceLayoutSkillExtractionOptions, + DocumentIntelligenceLayoutSkillMarkdownHeaderDepth, + DocumentIntelligenceLayoutSkillOutputFormat, + DocumentIntelligenceLayoutSkillOutputMode, + EdgeNGramTokenFilterSide, + EntityCategory, + EntityRecognitionSkillLanguage, + ImageAnalysisSkillLanguage, + ImageDetail, + IndexProjectionMode, + IndexedSharePointContainerName, + IndexerExecutionEnvironment, + IndexerPermissionOption, + IndexerResyncOption, + KeyPhraseExtractionSkillLanguage, + KnowledgeSourceResultsProcessing, + LexicalAnalyzerName, + LexicalNormalizerName, + LexicalTokenizerName, + MarkdownHeaderDepth, + MarkdownParsingSubmode, + MicrosoftStemmingTokenizerLanguage, + MicrosoftTokenizerLanguage, + OcrLineEnding, + OcrSkillLanguage, + PIIDetectionSkillMaskingMode, + PermissionFilter, + PhoneticEncoder, + RankingOrder, + RegexFlags, + ScoringFunctionAggregation, + ScoringFunctionInterpolation, + SearchFieldDataType, + SearchIndexPermissionFilterOption, + SearchIndexerDataSourceType, + SentimentSkillLanguage, + SnowballTokenFilterLanguage, + SplitSkillEncoderModelName, + SplitSkillLanguage, + SplitSkillUnit, + StemmerTokenFilterLanguage, + StopwordsList, + TextSplitMode, + TextTranslationSkillLanguage, + TokenCharacterKind, + TokenFilterName, + VectorEncodingFormat, + VectorSearchAlgorithmMetric, + VectorSearchCompressionRescoreStorageMethod, + VectorSearchCompressionTarget, + VisualFeature, + ) + + +AIServicesAccountIdentity = TypedDict( + "AIServicesAccountIdentity", + { + "description": str, + "identity": Optional["SearchIndexerDataIdentity"], + "subdomainUrl": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.AIServicesByIdentity"]], + }, + total=False, +) +AIServicesAccountIdentity.__doc__ = """The multi-region account of an Azure AI service resource that's attached to a skillset. + +:ivar description: Description of the Azure AI service resource attached to a skillset. +:vartype description: str +:ivar identity: The user-assigned managed identity used for connections to AI Service. If not + specified, the system-assigned managed identity is used. On updates to the skillset, if the + identity is unspecified, the value remains unchanged. If set to "none", the value of this + property is cleared. +:vartype identity: "SearchIndexerDataIdentity" +:ivar subdomain_url: The subdomain/Azure AI Services endpoint url for the corresponding AI + Service. Required. +:vartype subdomain_url: str +:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a + skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByIdentity". +:vartype odata_type: Literal["#Microsoft.Azure.Search.AIServicesByIdentity"] +""" + + +AIServicesAccountKey = TypedDict( + "AIServicesAccountKey", + { + "description": str, + "key": Required[str], + "subdomainUrl": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.AIServicesByKey"]], + }, + total=False, +) +AIServicesAccountKey.__doc__ = """The account key of an Azure AI service resource that's attached to a skillset, to be used with +the resource's subdomain. + +:ivar description: Description of the Azure AI service resource attached to a skillset. +:vartype description: str +:ivar key: The key used to provision the Azure AI service resource attached to a skillset. + Required. +:vartype key: str +:ivar subdomain_url: The subdomain/Azure AI Services endpoint url for the corresponding AI + Service. Required. +:vartype subdomain_url: str +:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a + skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByKey". +:vartype odata_type: Literal["#Microsoft.Azure.Search.AIServicesByKey"] +""" + + +class AIServicesVisionParameters(TypedDict, total=False): + """Specifies the AI Services Vision parameters for vectorizing a query image or text. + + :ivar model_version: The version of the model to use when calling the AI Services Vision + service. It will default to the latest available when not specified. Required. + :vartype model_version: str + :ivar resource_uri: The resource URI of the AI Services resource. Required. + :vartype resource_uri: str + :ivar api_key: API key of the designated AI Services resource. + :vartype api_key: str + :ivar auth_identity: 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. + :vartype auth_identity: "SearchIndexerDataIdentity" + """ + + modelVersion: Required[Optional[str]] + """The version of the model to use when calling the AI Services Vision service. It will default to + the latest available when not specified. Required.""" + resourceUri: Required[str] + """The resource URI of the AI Services resource. Required.""" + apiKey: str + """API key of the designated AI Services resource.""" + authIdentity: Optional["SearchIndexerDataIdentity"] + """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.""" + + +class AIServicesVisionVectorizer(TypedDict, total=False): + """Clears the identity property of a datasource. + + :ivar vectorizer_name: The name to associate with this particular vectorization method. + Required. + :vartype vectorizer_name: str + :ivar ai_services_vision_parameters: Contains the parameters specific to AI Services Vision + embedding vectorization. + :vartype ai_services_vision_parameters: "AIServicesVisionParameters" + :ivar kind: The name of the kind of vectorization method being configured for use with vector + search. Required. Generate embeddings for an image or text input at query time using the Azure + AI Services Vision Vectorize API. + :vartype kind: Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION] + """ + + name: Required[str] + """The name to associate with this particular vectorization method. Required.""" + aiServicesVisionParameters: "AIServicesVisionParameters" + """Contains the parameters specific to AI Services Vision embedding vectorization.""" + kind: Required[Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION]] + """The name of the kind of vectorization method being configured for use with vector search. + Required. Generate embeddings for an image or text input at query time using the Azure AI + Services Vision Vectorize API.""" + + +class AnalyzedTokenInfo(TypedDict, total=False): + """Information about a token returned by an analyzer. + + :ivar token: The token returned by the analyzer. Required. + :vartype token: str + :ivar start_offset: The index of the first character of the token in the input text. Required. + :vartype start_offset: int + :ivar end_offset: The index of the last character of the token in the input text. Required. + :vartype end_offset: int + :ivar position: The position of the token in the input text relative to other tokens. The first + token in the input text has position 0, the next has position 1, and so on. Depending on the + analyzer used, some tokens might have the same position, for example if they are synonyms of + each other. Required. + :vartype position: int + """ + + token: Required[str] + """The token returned by the analyzer. Required.""" + startOffset: Required[int] + """The index of the first character of the token in the input text. Required.""" + endOffset: Required[int] + """The index of the last character of the token in the input text. Required.""" + position: Required[int] + """The position of the token in the input text relative to other tokens. The first token in the + input text has position 0, the next has position 1, and so on. Depending on the analyzer used, + some tokens might have the same position, for example if they are synonyms of each other. + Required.""" + + +class AnalyzeResult(TypedDict, total=False): + """The result of testing an analyzer on text. + + :ivar tokens: The list of tokens returned by the analyzer specified in the request. Required. + :vartype tokens: list["AnalyzedTokenInfo"] + """ + + tokens: Required[list["AnalyzedTokenInfo"]] + """The list of tokens returned by the analyzer specified in the request. Required.""" + + +class AnalyzeTextOptions(TypedDict, total=False): + """Specifies some text and analysis components used to break that text into tokens. + + :ivar text: The text to break into tokens. Required. + :vartype text: str + :ivar analyzer_name: The name of the analyzer to use to break the given text. If this parameter + is not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters + are mutually exclusive. Known values are: "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", and "whitespace". + :vartype analyzer_name: Union[str, "LexicalAnalyzerName"] + :ivar tokenizer_name: The name of the tokenizer to use to break the given text. If this + parameter is not specified, you must specify an analyzer instead. The tokenizer and analyzer + parameters are mutually exclusive. Known values are: "classic", "edgeNGram", "keyword_v2", + "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", + "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", and "whitespace". + :vartype tokenizer_name: Union[str, "LexicalTokenizerName"] + :ivar normalizer_name: The name of the normalizer to use to normalize the given text. Known + values are: "asciifolding", "elision", "lowercase", "standard", and "uppercase". + :vartype normalizer_name: Union[str, "LexicalNormalizerName"] + :ivar token_filters: An optional list of token filters to use when breaking the given text. + This parameter can only be set when using the tokenizer parameter. + :vartype token_filters: list[Union[str, "TokenFilterName"]] + :ivar char_filters: An optional list of character filters to use when breaking the given text. + This parameter can only be set when using the tokenizer parameter. + :vartype char_filters: list[Union[str, "CharFilterName"]] + """ + + text: Required[str] + """The text to break into tokens. Required.""" + analyzer: Union[str, "LexicalAnalyzerName"] + """The name of the analyzer to use to break the given text. If this parameter is not specified, + you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually + exclusive. Known values are: \"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\", and + \"whitespace\".""" + tokenizer: Union[str, "LexicalTokenizerName"] + """The name of the tokenizer to use to break the given text. If this parameter is not specified, + you must specify an analyzer instead. The tokenizer and analyzer parameters are mutually + exclusive. Known values are: \"classic\", \"edgeNGram\", \"keyword_v2\", \"letter\", + \"lowercase\", \"microsoft_language_tokenizer\", \"microsoft_language_stemming_tokenizer\", + \"nGram\", \"path_hierarchy_v2\", \"pattern\", \"standard_v2\", \"uax_url_email\", and + \"whitespace\".""" + normalizer: Union[str, "LexicalNormalizerName"] + """The name of the normalizer to use to normalize the given text. Known values are: + \"asciifolding\", \"elision\", \"lowercase\", \"standard\", and \"uppercase\".""" + tokenFilters: list[Union[str, "TokenFilterName"]] + """An optional list of token filters to use when breaking the given text. This parameter can only + be set when using the tokenizer parameter.""" + charFilters: list[Union[str, "CharFilterName"]] + """An optional list of character filters to use when breaking the given text. This parameter can + only be set when using the tokenizer parameter.""" + + +AsciiFoldingTokenFilter = TypedDict( + "AsciiFoldingTokenFilter", + { + "name": Required[str], + "preserveOriginal": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.AsciiFoldingTokenFilter"]], + }, + total=False, +) +AsciiFoldingTokenFilter.__doc__ = """Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 +ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such +equivalents exist. This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar preserve_original: A value indicating whether the original token will be kept. Default is + false. +:vartype preserve_original: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.AsciiFoldingTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.AsciiFoldingTokenFilter"] +""" + + +class AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): # pylint: disable=name-too-long + """Credentials of a registered application created for your search service, used for authenticated + access to the encryption keys stored in Azure Key Vault. + + :ivar application_id: An AAD Application ID that was granted the required access permissions to + the Azure Key Vault that is to be used when encrypting your data at rest. The Application ID + should not be confused with the Object ID for your AAD Application. Required. + :vartype application_id: str + :ivar application_secret: The authentication key of the specified AAD application. + :vartype application_secret: str + """ + + applicationId: Required[str] + """An AAD Application ID that was granted the required access permissions to the Azure Key Vault + that is to be used when encrypting your data at rest. The Application ID should not be confused + with the Object ID for your AAD Application. Required.""" + applicationSecret: str + """The authentication key of the specified AAD application.""" + + +AzureBlobKnowledgeSource = TypedDict( + "AzureBlobKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.AZURE_BLOB]], + "azureBlobParameters": Required["AzureBlobKnowledgeSourceParameters"], + }, + total=False, +) +AzureBlobKnowledgeSource.__doc__ = """Configuration for Azure Blob Storage knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: Required. A knowledge source that read and ingest data from Azure Blob Storage to a + Search Index. +:vartype kind: Literal[KnowledgeSourceKind.AZURE_BLOB] +:ivar azure_blob_parameters: The type of the knowledge source. Required. +:vartype azure_blob_parameters: "AzureBlobKnowledgeSourceParameters" +""" + + +class AzureBlobKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for Azure Blob Storage knowledge source. + + :ivar connection_string: Key-based connection string or the ResourceId format if using a + managed identity. Required. + :vartype connection_string: str + :ivar container_name: The name of the blob storage container. Required. + :vartype container_name: str + :ivar folder_path: Optional folder path within the container. + :vartype folder_path: str + :ivar is_adls_gen2: Set to true if connecting to an ADLS Gen2 storage account. Default is + false. + :vartype is_adls_gen2: bool + :ivar ingestion_parameters: Consolidates all general ingestion settings. + :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + :ivar created_resources: Resources created by the knowledge source. + :vartype created_resources: "CreatedResources" + """ + + connectionString: Required[str] + """Key-based connection string or the ResourceId format if using a managed identity. Required.""" + containerName: Required[str] + """The name of the blob storage container. Required.""" + folderPath: Optional[str] + """Optional folder path within the container.""" + isADLSGen2: bool + """Set to true if connecting to an ADLS Gen2 storage account. Default is false.""" + ingestionParameters: Optional["KnowledgeSourceIngestionParameters"] + """Consolidates all general ingestion settings.""" + queryHints: "SearchIndexKnowledgeSourceQueryHints" + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" + createdResources: "CreatedResources" + """Resources created by the knowledge source.""" + + +class AzureMachineLearningParameters(TypedDict, total=False): + """Specifies the properties for connecting to an AML vectorizer. + + :ivar scoring_uri: (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. + Required. + :vartype scoring_uri: str + :ivar authentication_key: (Required for key authentication) The key for the AML service. + :vartype authentication_key: str + :ivar resource_id: (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}. + :vartype resource_id: str + :ivar timeout: (Optional) When specified, indicates the timeout for the http client making the + API call. + :vartype timeout: str + :ivar region: (Optional for token authentication). The region the AML service is deployed in. + :vartype region: str + :ivar model_name: The name of the embedding model from the Azure AI Foundry Catalog that is + deployed at the provided endpoint. Known values are: + "OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32", + "OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336", + "Facebook-DinoV2-Image-Embeddings-ViT-Base", "Facebook-DinoV2-Image-Embeddings-ViT-Giant", + "Cohere-embed-v3-english", "Cohere-embed-v3-multilingual", and "Cohere-embed-v4". + :vartype model_name: Union[str, "AIFoundryModelCatalogName"] + """ + + uri: Required[Optional[str]] + """(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. Required.""" + key: Optional[str] + """(Required for key authentication) The key for the AML service.""" + resourceId: Optional[str] + """(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}.""" + timeout: Optional[str] + """(Optional) When specified, indicates the timeout for the http client making the API call.""" + region: Optional[str] + """(Optional for token authentication). The region the AML service is deployed in.""" + modelName: Union[str, "AIFoundryModelCatalogName"] + """The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the + provided endpoint. Known values are: \"OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32\", + \"OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336\", + \"Facebook-DinoV2-Image-Embeddings-ViT-Base\", \"Facebook-DinoV2-Image-Embeddings-ViT-Giant\", + \"Cohere-embed-v3-english\", \"Cohere-embed-v3-multilingual\", and \"Cohere-embed-v4\".""" + + +AzureMachineLearningSkill = TypedDict( + "AzureMachineLearningSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "uri": Optional[str], + "key": Optional[str], + "resourceId": Optional[str], + "timeout": Optional[str], + "region": Optional[str], + "degreeOfParallelism": Optional[int], + "@odata.type": Required[Literal["#Microsoft.Skills.Custom.AmlSkill"]], + }, + total=False, +) +AzureMachineLearningSkill.__doc__ = """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. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar scoring_uri: (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. +:vartype scoring_uri: str +:ivar authentication_key: (Required for key authentication) The key for the AML service. +:vartype authentication_key: str +:ivar resource_id: (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}. +:vartype resource_id: str +:ivar timeout: (Optional) When specified, indicates the timeout for the http client making the + API call. +:vartype timeout: str +:ivar region: (Optional for token authentication). The region the AML service is deployed in. +:vartype region: str +:ivar degree_of_parallelism: (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. +:vartype degree_of_parallelism: int +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Custom.AmlSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Custom.AmlSkill"] +""" + + +class AzureMachineLearningVectorizer(TypedDict, total=False): + """Specifies an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog + for generating the vector embedding of a query string. + + :ivar vectorizer_name: The name to associate with this particular vectorization method. + Required. + :vartype vectorizer_name: str + :ivar aml_parameters: Specifies the properties of the AML vectorizer. + :vartype aml_parameters: "AzureMachineLearningParameters" + :ivar kind: The name of the kind of vectorization method being configured for use with vector + search. Required. Generate embeddings using an Azure Machine Learning endpoint deployed via the + Azure AI Foundry Model Catalog at query time. + :vartype kind: Literal[VectorSearchVectorizerKind.AML] + """ + + name: Required[str] + """The name to associate with this particular vectorization method. Required.""" + amlParameters: "AzureMachineLearningParameters" + """Specifies the properties of the AML vectorizer.""" + kind: Required[Literal[VectorSearchVectorizerKind.AML]] + """The name of the kind of vectorization method being configured for use with vector search. + Required. Generate embeddings using an Azure Machine Learning endpoint deployed via the Azure + AI Foundry Model Catalog at query time.""" + + +AzureOpenAIEmbeddingSkill = TypedDict( + "AzureOpenAIEmbeddingSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "resourceUri": str, + "deploymentId": str, + "apiKey": str, + "authIdentity": "SearchIndexerDataIdentity", + "modelName": Union[str, "AzureOpenAIModelName"], + "dimensions": Optional[int], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"]], + }, + total=False, +) +AzureOpenAIEmbeddingSkill.__doc__ = """Allows you to generate a vector embedding for a given text input using the Azure OpenAI +resource. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar resource_url: The resource URI of the Azure OpenAI resource. +:vartype resource_url: str +:ivar deployment_name: ID of the Azure OpenAI model deployment on the designated resource. +:vartype deployment_name: str +:ivar api_key: API key of the designated Azure OpenAI resource. +:vartype api_key: str +:ivar auth_identity: The user-assigned managed identity used for outbound connections. +:vartype auth_identity: "SearchIndexerDataIdentity" +:ivar model_name: The name of the embedding model that is deployed at the provided deploymentId + path. Known values are: "text-embedding-ada-002", "text-embedding-3-large", + "text-embedding-3-small", "gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", + "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", + "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", and "gpt-5.6-luna". +:vartype model_name: Union[str, "AzureOpenAIModelName"] +:ivar dimensions: The number of dimensions the resulting output embeddings should have. Only + supported in text-embedding-3 and later models. +:vartype dimensions: int +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"] +""" + + +class AzureOpenAITokenizerParameters(TypedDict, total=False): + """Azure OpenAI Tokenizer parameters. + + :ivar encoder_model_name: 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'. + Known values are: "r50k_base", "p50k_base", "p50k_edit", and "cl100k_base". + :vartype encoder_model_name: Union[str, "SplitSkillEncoderModelName"] + :ivar allowed_special_tokens: (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. + :vartype allowed_special_tokens: list[str] + """ + + encoderModelName: Optional[Union[str, "SplitSkillEncoderModelName"]] + """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'. Known values are: + \"r50k_base\", \"p50k_base\", \"p50k_edit\", and \"cl100k_base\".""" + allowedSpecialTokens: list[str] + """(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.""" + + +class AzureOpenAIVectorizer(TypedDict, total=False): + """Specifies the Azure OpenAI resource used to vectorize a query string. + + :ivar vectorizer_name: The name to associate with this particular vectorization method. + Required. + :vartype vectorizer_name: str + :ivar parameters: Contains the parameters specific to Azure OpenAI embedding vectorization. + :vartype parameters: "AzureOpenAIVectorizerParameters" + :ivar kind: The name of the kind of vectorization method being configured for use with vector + search. Required. Generate embeddings using an Azure OpenAI resource at query time. + :vartype kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] + """ + + name: Required[str] + """The name to associate with this particular vectorization method. Required.""" + azureOpenAIParameters: "AzureOpenAIVectorizerParameters" + """Contains the parameters specific to Azure OpenAI embedding vectorization.""" + kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + """The name of the kind of vectorization method being configured for use with vector search. + Required. Generate embeddings using an Azure OpenAI resource at query time.""" + + +class AzureOpenAIVectorizerParameters(TypedDict, total=False): + """Specifies the parameters for connecting to the Azure OpenAI resource. + + :ivar resource_url: The resource URI of the Azure OpenAI resource. + :vartype resource_url: str + :ivar deployment_name: ID of the Azure OpenAI model deployment on the designated resource. + :vartype deployment_name: str + :ivar api_key: API key of the designated Azure OpenAI resource. + :vartype api_key: str + :ivar auth_identity: The user-assigned managed identity used for outbound connections. + :vartype auth_identity: "SearchIndexerDataIdentity" + :ivar model_name: The name of the embedding model that is deployed at the provided deploymentId + path. Known values are: "text-embedding-ada-002", "text-embedding-3-large", + "text-embedding-3-small", "gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", + "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", + "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", and "gpt-5.6-luna". + :vartype model_name: Union[str, "AzureOpenAIModelName"] + """ + + resourceUri: str + """The resource URI of the Azure OpenAI resource.""" + deploymentId: str + """ID of the Azure OpenAI model deployment on the designated resource.""" + apiKey: str + """API key of the designated Azure OpenAI resource.""" + authIdentity: "SearchIndexerDataIdentity" + """The user-assigned managed identity used for outbound connections.""" + modelName: Union[str, "AzureOpenAIModelName"] + """The name of the embedding model that is deployed at the provided deploymentId path. Known + values are: \"text-embedding-ada-002\", \"text-embedding-3-large\", \"text-embedding-3-small\", + \"gpt-4o\", \"gpt-4o-mini\", \"gpt-4.1\", \"gpt-4.1-mini\", \"gpt-4.1-nano\", \"gpt-5\", + \"gpt-5-mini\", \"gpt-5-nano\", \"gpt-5.1\", \"gpt-5.2\", \"gpt-5.4\", \"gpt-5.4-mini\", + \"gpt-5.4-nano\", \"gpt-5.5\", \"gpt-5.6-sol\", \"gpt-5.6-terra\", and \"gpt-5.6-luna\".""" + + +class BinaryQuantizationCompression(TypedDict, total=False): + """Contains configuration options specific to the binary quantization compression method used + during indexing and querying. + + :ivar compression_name: The name to associate with this particular configuration. Required. + :vartype compression_name: str + :ivar rescoring_options: Contains the options for rescoring. + :vartype rescoring_options: "RescoringOptions" + :ivar truncation_dimension: The number of dimensions to truncate the vectors to. Truncating the + vectors reduces the size of the vectors and the amount of data that needs to be transferred + during search. This can save storage cost and improve search performance at the expense of + recall. It should be only used for embeddings trained with Matryoshka Representation Learning + (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no + truncation. + :vartype truncation_dimension: int + :ivar kind: The name of the kind of compression method being configured for use with vector + search. Required. Binary Quantization, a type of compression method. In binary quantization, + the original vectors values are compressed to the narrower binary type by discretizing and + representing each component of a vector using binary values, thereby reducing the overall data + size. + :vartype kind: Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION] + """ + + name: Required[str] + """The name to associate with this particular configuration. Required.""" + rescoringOptions: Optional["RescoringOptions"] + """Contains the options for rescoring.""" + truncationDimension: Optional[int] + """The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of + the vectors and the amount of data that needs to be transferred during search. This can save + storage cost and improve search performance at the expense of recall. It should be only used + for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI + text-embedding-3-large (small). The default value is null, which means no truncation.""" + kind: Required[Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION]] + """The name of the kind of compression method being configured for use with vector search. + Required. Binary Quantization, a type of compression method. In binary quantization, the + original vectors values are compressed to the narrower binary type by discretizing and + representing each component of a vector using binary values, thereby reducing the overall data + size.""" + + +BM25SimilarityAlgorithm = TypedDict( + "BM25SimilarityAlgorithm", + { + "k1": Optional[float], + "b": Optional[float], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.BM25Similarity"]], + }, + total=False, +) +BM25SimilarityAlgorithm.__doc__ = """Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a TF-IDF-like algorithm +that includes length normalization (controlled by the 'b' parameter) as well as term frequency +saturation (controlled by the 'k1' parameter). + +:ivar k1: This property controls the scaling function between the term frequency of each + matching terms and the final relevance score of a document-query pair. By default, a value of + 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. +:vartype k1: float +:ivar b: This property controls how the length of a document affects the relevance score. By + default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, + while a value of 1.0 means the score is fully normalized by the length of the document. +:vartype b: float +:ivar odata_type: The discriminator for derived types. Required. Default value is + "#Microsoft.Azure.Search.BM25Similarity". +:vartype odata_type: Literal["#Microsoft.Azure.Search.BM25Similarity"] +""" + + +class ChatCompletionCommonModelParameters(TypedDict, total=False): + """Common language model parameters for Chat Completions. If omitted, default values are used. + + :ivar model_name: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not + specified. + :vartype model_name: str + :ivar frequency_penalty: A float in the range [-2,2] that reduces or increases likelihood of + repeated tokens. Default is 0. + :vartype frequency_penalty: float + :ivar presence_penalty: A float in the range [-2,2] that penalizes new tokens based on their + existing presence. Default is 0. + :vartype presence_penalty: float + :ivar max_tokens: Maximum number of tokens to generate. + :vartype max_tokens: int + :ivar temperature: Sampling temperature. Default is 0.7. + :vartype temperature: float + :ivar seed: Random seed for controlling deterministic outputs. If omitted, randomization is + used. + :vartype seed: int + :ivar stop: List of stop sequences that will cut off text generation. Default is none. + :vartype stop: list[str] + """ + + model: Optional[str] + """The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.""" + frequencyPenalty: Optional[float] + """A float in the range [-2,2] that reduces or increases likelihood of repeated tokens. Default is + 0.""" + presencePenalty: Optional[float] + """A float in the range [-2,2] that penalizes new tokens based on their existing presence. Default + is 0.""" + maxTokens: Optional[int] + """Maximum number of tokens to generate.""" + temperature: Optional[float] + """Sampling temperature. Default is 0.7.""" + seed: Optional[int] + """Random seed for controlling deterministic outputs. If omitted, randomization is used.""" + stop: Optional[list[str]] + """List of stop sequences that will cut off text generation. Default is none.""" + + +class ChatCompletionResponseFormat(TypedDict, total=False): + """Determines how the language model's response should be serialized. Defaults to 'text'. + + :ivar type: Specifies how the LLM should format the response. Known values are: "text", + "jsonObject", and "jsonSchema". + :vartype type: Union[str, "ChatCompletionResponseFormatType"] + :ivar json_schema_properties: An open dictionary for extended properties. Required if 'type' == + 'json_schema'. + :vartype json_schema_properties: "ChatCompletionSchemaProperties" + """ + + type: Union[str, "ChatCompletionResponseFormatType"] + """Specifies how the LLM should format the response. Known values are: \"text\", \"jsonObject\", + and \"jsonSchema\".""" + jsonSchemaProperties: Optional["ChatCompletionSchemaProperties"] + """An open dictionary for extended properties. Required if 'type' == 'json_schema'.""" + + +class ChatCompletionSchema(TypedDict, total=False): + """Object defining the custom schema the model will use to structure its output. + + :ivar type: Type of schema representation. Usually 'object'. Default is 'object'. + :vartype type: str + :ivar properties: A JSON-formatted string that defines the output schema's properties and + constraints for the model. + :vartype properties: str + :ivar required: An array of the property names that are required to be part of the model's + response. All properties must be included for structured outputs. + :vartype required: list[str] + :ivar additional_properties: Controls whether it is allowable for an object to contain + additional keys / values that were not defined in the JSON Schema. Default is false. + :vartype additional_properties: bool + """ + + type: str + """Type of schema representation. Usually 'object'. Default is 'object'.""" + properties: str + """A JSON-formatted string that defines the output schema's properties and constraints for the + model.""" + required: list[str] + """An array of the property names that are required to be part of the model's response. All + properties must be included for structured outputs.""" + additionalProperties: bool + """Controls whether it is allowable for an object to contain additional keys / values that were + not defined in the JSON Schema. Default is false.""" + + +class ChatCompletionSchemaProperties(TypedDict, total=False): + """Properties for JSON schema response format. + + :ivar name: Name of the json schema the model will adhere to. + :vartype name: str + :ivar description: Description of the json schema the model will adhere to. + :vartype description: str + :ivar strict: Whether or not the model's response should use structured outputs. Default is + true. + :vartype strict: bool + :ivar schema: The schema definition. + :vartype schema: "ChatCompletionSchema" + """ + + name: Optional[str] + """Name of the json schema the model will adhere to.""" + description: Optional[str] + """Description of the json schema the model will adhere to.""" + strict: bool + """Whether or not the model's response should use structured outputs. Default is true.""" + schema: "ChatCompletionSchema" + """The schema definition.""" + + +ChatCompletionSkill = TypedDict( + "ChatCompletionSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "uri": Required[str], + "authIdentity": Optional["SearchIndexerDataIdentity"], + "apiKey": str, + "commonModelParameters": "ChatCompletionCommonModelParameters", + "extraParameters": Optional[dict[str, Any]], + "extraParametersBehavior": Union[str, "ChatCompletionExtraParametersBehavior"], + "responseFormat": "ChatCompletionResponseFormat", + "@odata.type": Required[Literal["#Microsoft.Skills.Custom.ChatCompletionSkill"]], + }, + total=False, +) +ChatCompletionSkill.__doc__ = """A skill that calls a language model via Azure AI Foundry's Chat Completions endpoint. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar uri: The url for the Web API. Required. +:vartype uri: str +:ivar auth_identity: The user-assigned managed identity used for outbound connections. If an + authResourceId is provided and it's not specified, the system-assigned managed identity is + used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. + If set to "none", the value of this property is cleared. +:vartype auth_identity: "SearchIndexerDataIdentity" +:ivar api_key: API key for authenticating to the model. Both apiKey and authIdentity cannot be + specified at the same time. +:vartype api_key: str +:ivar common_model_parameters: Common language model parameters that customers can tweak. If + omitted, reasonable defaults will be applied. +:vartype common_model_parameters: "ChatCompletionCommonModelParameters" +:ivar extra_parameters: Open-type dictionary for model-specific parameters that should be + appended to the chat completions call. Follows Azure AI Foundry's extensibility pattern. +:vartype extra_parameters: dict[str, Any] +:ivar extra_parameters_behavior: How extra parameters are handled by Azure AI Foundry. Default + is 'error'. Known values are: "passThrough", "drop", and "error". +:vartype extra_parameters_behavior: Union[str, "ChatCompletionExtraParametersBehavior"] +:ivar response_format: Determines how the LLM should format its response. Defaults to 'text' + response type. +:vartype response_format: "ChatCompletionResponseFormat" +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Custom.ChatCompletionSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Custom.ChatCompletionSkill"] +""" + + +CjkBigramTokenFilter = TypedDict( + "CjkBigramTokenFilter", + { + "name": Required[str], + "ignoreScripts": list[Union[str, "CjkBigramTokenFilterScripts"]], + "outputUnigrams": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.CjkBigramTokenFilter"]], + }, + total=False, +) +CjkBigramTokenFilter.__doc__ = """Forms bigrams of CJK terms that are generated from the standard tokenizer. This token filter is +implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar ignore_scripts: The scripts to ignore. +:vartype ignore_scripts: list[Union[str, "CjkBigramTokenFilterScripts"]] +:ivar output_unigrams: A value indicating whether to output both unigrams and bigrams (if + true), or just bigrams (if false). Default is false. +:vartype output_unigrams: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.CjkBigramTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.CjkBigramTokenFilter"] +""" + + +ClassicSimilarityAlgorithm = TypedDict( + "ClassicSimilarityAlgorithm", + { + "@odata.type": Required[Literal["#Microsoft.Azure.Search.ClassicSimilarity"]], + }, + total=False, +) +ClassicSimilarityAlgorithm.__doc__ = """Legacy similarity algorithm which uses the Lucene TFIDFSimilarity implementation of TF-IDF. +This variation of TF-IDF introduces static document length normalization as well as +coordinating factors that penalize documents that only partially match the searched queries. + +:ivar odata_type: The discriminator for derived types. Required. Default value is + "#Microsoft.Azure.Search.ClassicSimilarity". +:vartype odata_type: Literal["#Microsoft.Azure.Search.ClassicSimilarity"] +""" + + +ClassicTokenizer = TypedDict( + "ClassicTokenizer", + { + "name": Required[str], + "maxTokenLength": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.ClassicTokenizer"]], + }, + total=False, +) +ClassicTokenizer.__doc__ = """Grammar-based tokenizer that is suitable for processing most European-language documents. This +tokenizer is implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the + maximum length are split. The maximum token length that can be used is 300 characters. +:vartype max_token_length: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.ClassicTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.ClassicTokenizer"] +""" + + +CognitiveServicesAccountKey = TypedDict( + "CognitiveServicesAccountKey", + { + "description": str, + "key": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.CognitiveServicesByKey"]], + }, + total=False, +) +CognitiveServicesAccountKey.__doc__ = """The multi-region account key of an Azure AI service resource that's attached to a skillset. + +:ivar description: Description of the Azure AI service resource attached to a skillset. +:vartype description: str +:ivar key: The key used to provision the Azure AI service resource attached to a skillset. + Required. +:vartype key: str +:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a + skillset. Required. Default value is "#Microsoft.Azure.Search.CognitiveServicesByKey". +:vartype odata_type: Literal["#Microsoft.Azure.Search.CognitiveServicesByKey"] +""" + + +CommonGramTokenFilter = TypedDict( + "CommonGramTokenFilter", + { + "name": Required[str], + "commonWords": Required[list[str]], + "ignoreCase": bool, + "queryMode": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.CommonGramTokenFilter"]], + }, + total=False, +) +CommonGramTokenFilter.__doc__ = """Construct bigrams for frequently occurring terms while indexing. Single terms are still indexed +too, with bigrams overlaid. This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar common_words: The set of common words. Required. +:vartype common_words: list[str] +:ivar ignore_case: A value indicating whether common words matching will be case insensitive. + Default is false. +:vartype ignore_case: bool +:ivar use_query_mode: A value that indicates whether the token filter is in query mode. When in + query mode, the token filter generates bigrams and then removes common words and single terms + followed by a common word. Default is false. +:vartype use_query_mode: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.CommonGramTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.CommonGramTokenFilter"] +""" + + +ConditionalSkill = TypedDict( + "ConditionalSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "@odata.type": Required[Literal["#Microsoft.Skills.Util.ConditionalSkill"]], + }, + total=False, +) +ConditionalSkill.__doc__ = """A skill that enables scenarios that require a Boolean operation to determine the data to assign +to an output. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Util.ConditionalSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Util.ConditionalSkill"] +""" + + +class ContentColumnMapping(TypedDict, total=False): + """Maps a SQL column to a search index field. + + :ivar name: Target index field name. Required. + :vartype name: str + :ivar source_field: SQL column name. Required. + :vartype source_field: str + :ivar search_field_type: Azure AI Search field type (e.g., Edm.String, Edm.Int32). Required. + :vartype search_field_type: str + """ + + name: Required[str] + """Target index field name. Required.""" + sourceField: Required[str] + """SQL column name. Required.""" + searchFieldType: Required[str] + """Azure AI Search field type (e.g., Edm.String, Edm.Int32). Required.""" + + +ContentUnderstandingSkill = TypedDict( + "ContentUnderstandingSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "extractionOptions": Optional[list[Union[str, "ContentUnderstandingSkillExtractionOptions"]]], + "chunkingProperties": Optional["ContentUnderstandingSkillChunkingProperties"], + "@odata.type": Required[Literal["#Microsoft.Skills.Util.ContentUnderstandingSkill"]], + }, + total=False, +) +ContentUnderstandingSkill.__doc__ = """A skill that leverages Azure AI Content Understanding to process and extract structured +insights from documents, enabling enriched, searchable content for enhanced document indexing +and retrieval. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar extraction_options: Controls the cardinality of the content extracted from the document + by the skill. +:vartype extraction_options: list[Union[str, "ContentUnderstandingSkillExtractionOptions"]] +:ivar chunking_properties: Controls the cardinality for chunking the content. +:vartype chunking_properties: "ContentUnderstandingSkillChunkingProperties" +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Util.ContentUnderstandingSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Util.ContentUnderstandingSkill"] +""" + + +class ContentUnderstandingSkillChunkingProperties(TypedDict, total=False): # pylint: disable=name-too-long + """Controls the cardinality for chunking the content. + + :ivar method: The chunking strategy. 'fixedSize' (default) or 'semantic'. Known values are: + "fixedSize" and "semantic". + :vartype method: Union[str, "ContentUnderstandingSkillChunkingMethod"] + :ivar unit: The unit of the chunk. Known values are: "characters" and "tokens". + :vartype unit: Union[str, "ContentUnderstandingSkillChunkingUnit"] + :ivar maximum_length: The maximum chunk length in characters. Default is 500. + :vartype maximum_length: int + :ivar overlap_length: The length of overlap provided between two text chunks. Default is 0. + :vartype overlap_length: int + """ + + method: Union[str, "ContentUnderstandingSkillChunkingMethod"] + """The chunking strategy. 'fixedSize' (default) or 'semantic'. Known values are: \"fixedSize\" and + \"semantic\".""" + unit: Optional[Union[str, "ContentUnderstandingSkillChunkingUnit"]] + """The unit of the chunk. Known values are: \"characters\" and \"tokens\".""" + maximumLength: Optional[int] + """The maximum chunk length in characters. Default is 500.""" + overlapLength: Optional[int] + """The length of overlap provided between two text chunks. Default is 0.""" + + +class CorsOptions(TypedDict, total=False): + """Defines options to control Cross-Origin Resource Sharing (CORS) for an index. + + :ivar allowed_origins: The list of origins from which JavaScript code will be granted access to + your index. Can contain a list of hosts of the form + {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not + recommended). Required. + :vartype allowed_origins: list[str] + :ivar max_age_in_seconds: The duration for which browsers should cache CORS preflight + responses. Defaults to 5 minutes. + :vartype max_age_in_seconds: int + """ + + allowedOrigins: Required[list[str]] + """The list of origins from which JavaScript code will be granted access to your index. Can + contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a + single '*' to allow all origins (not recommended). Required.""" + maxAgeInSeconds: Optional[int] + """The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes.""" + + +class CreatedResources(TypedDict, total=False): + """Resources created by the knowledge source. Keys represent resource types (e.g., 'datasource', + 'indexer', 'skillset', 'index') and values represent resource names. + + """ + + +CustomAnalyzer = TypedDict( + "CustomAnalyzer", + { + "name": Required[str], + "tokenizer": Required[Union[str, "LexicalTokenizerName"]], + "tokenFilters": list[Union[str, "TokenFilterName"]], + "charFilters": list[Union[str, "CharFilterName"]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.CustomAnalyzer"]], + }, + total=False, +) +CustomAnalyzer.__doc__ = """Allows you to take control over the process of converting text into indexable/searchable +tokens. It's a user-defined configuration consisting of a single predefined tokenizer and one +or more filters. The tokenizer is responsible for breaking text into tokens, and the filters +for modifying tokens emitted by the tokenizer. + +:ivar name: The name of the analyzer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar tokenizer_name: The name of the tokenizer to use to divide continuous text into a + sequence of tokens, such as breaking a sentence into words. Required. Known values are: + "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", + "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", + "standard_v2", "uax_url_email", and "whitespace". +:vartype tokenizer_name: Union[str, "LexicalTokenizerName"] +:ivar token_filters: A list of token filters used to filter out or modify the tokens generated + by a tokenizer. For example, you can specify a lowercase filter that converts all characters to + lowercase. The filters are run in the order in which they are listed. +:vartype token_filters: list[Union[str, "TokenFilterName"]] +:ivar char_filters: A list of character filters used to prepare input text before it is + processed by the tokenizer. For instance, they can replace certain characters or symbols. The + filters are run in the order in which they are listed. +:vartype char_filters: list[Union[str, "CharFilterName"]] +:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is + "#Microsoft.Azure.Search.CustomAnalyzer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.CustomAnalyzer"] +""" + + +class CustomEntity(TypedDict, total=False): + """An object that contains information about the matches that were found, and related metadata. + + :ivar name: The top-level entity descriptor. Matches in the skill output will be grouped by + this name, and it should represent the "normalized" form of the text being found. Required. + :vartype name: str + :ivar description: This field can be used as a passthrough for custom metadata about the + matched text(s). The value of this field will appear with every match of its entity in the + skill output. + :vartype description: str + :ivar type: This field can be used as a passthrough for custom metadata about the matched + text(s). The value of this field will appear with every match of its entity in the skill + output. + :vartype type: str + :ivar subtype: This field can be used as a passthrough for custom metadata about the matched + text(s). The value of this field will appear with every match of its entity in the skill + output. + :vartype subtype: str + :ivar id: This field can be used as a passthrough for custom metadata about the matched + text(s). The value of this field will appear with every match of its entity in the skill + output. + :vartype id: str + :ivar case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the + entity name should be sensitive to character casing. Sample case insensitive matches of + "Microsoft" could be: microsoft, microSoft, MICROSOFT. + :vartype case_sensitive: bool + :ivar accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with the + entity name should be sensitive to accent. + :vartype accent_sensitive: bool + :ivar fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of + divergent characters that would still constitute a match with the entity name. The smallest + possible fuzziness for any given match is returned. For instance, if the edit distance is set + to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case + sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but + otherwise do. + :vartype fuzzy_edit_distance: int + :ivar default_case_sensitive: Changes the default case sensitivity value for this entity. It be + used to change the default value of all aliases caseSensitive values. + :vartype default_case_sensitive: bool + :ivar default_accent_sensitive: Changes the default accent sensitivity value for this entity. + It be used to change the default value of all aliases accentSensitive values. + :vartype default_accent_sensitive: bool + :ivar default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this + entity. It can be used to change the default value of all aliases fuzzyEditDistance values. + :vartype default_fuzzy_edit_distance: int + :ivar aliases: An array of complex objects that can be used to specify alternative spellings or + synonyms to the root entity name. + :vartype aliases: list["CustomEntityAlias"] + """ + + name: Required[str] + """The top-level entity descriptor. Matches in the skill output will be grouped by this name, and + it should represent the \"normalized\" form of the text being found. Required.""" + description: Optional[str] + """This field can be used as a passthrough for custom metadata about the matched text(s). The + value of this field will appear with every match of its entity in the skill output.""" + type: Optional[str] + """This field can be used as a passthrough for custom metadata about the matched text(s). The + value of this field will appear with every match of its entity in the skill output.""" + subtype: Optional[str] + """This field can be used as a passthrough for custom metadata about the matched text(s). The + value of this field will appear with every match of its entity in the skill output.""" + id: Optional[str] + """This field can be used as a passthrough for custom metadata about the matched text(s). The + value of this field will appear with every match of its entity in the skill output.""" + caseSensitive: Optional[bool] + """Defaults to false. Boolean value denoting whether comparisons with the entity name should be + sensitive to character casing. Sample case insensitive matches of \"Microsoft\" could be: + microsoft, microSoft, MICROSOFT.""" + accentSensitive: Optional[bool] + """Defaults to false. Boolean value denoting whether comparisons with the entity name should be + sensitive to accent.""" + fuzzyEditDistance: Optional[int] + """Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent characters that + would still constitute a match with the entity name. The smallest possible fuzziness for any + given match is returned. For instance, if the edit distance is set to 3, \"Windows10\" would + still match \"Windows\", \"Windows10\" and \"Windows 7\". When case sensitivity is set to + false, case differences do NOT count towards fuzziness tolerance, but otherwise do.""" + defaultCaseSensitive: Optional[bool] + """Changes the default case sensitivity value for this entity. It be used to change the default + value of all aliases caseSensitive values.""" + defaultAccentSensitive: Optional[bool] + """Changes the default accent sensitivity value for this entity. It be used to change the default + value of all aliases accentSensitive values.""" + defaultFuzzyEditDistance: Optional[int] + """Changes the default fuzzy edit distance value for this entity. It can be used to change the + default value of all aliases fuzzyEditDistance values.""" + aliases: Optional[list["CustomEntityAlias"]] + """An array of complex objects that can be used to specify alternative spellings or synonyms to + the root entity name.""" + + +class CustomEntityAlias(TypedDict, total=False): + """A complex object that can be used to specify alternative spellings or synonyms to the root + entity name. + + :ivar text: The text of the alias. Required. + :vartype text: str + :ivar case_sensitive: Determine if the alias is case sensitive. + :vartype case_sensitive: bool + :ivar accent_sensitive: Determine if the alias is accent sensitive. + :vartype accent_sensitive: bool + :ivar fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. + :vartype fuzzy_edit_distance: int + """ + + text: Required[str] + """The text of the alias. Required.""" + caseSensitive: Optional[bool] + """Determine if the alias is case sensitive.""" + accentSensitive: Optional[bool] + """Determine if the alias is accent sensitive.""" + fuzzyEditDistance: Optional[int] + """Determine the fuzzy edit distance of the alias.""" + + +CustomEntityLookupSkill = TypedDict( + "CustomEntityLookupSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Optional[Union[str, "CustomEntityLookupSkillLanguage"]], + "entitiesDefinitionUri": Optional[str], + "inlineEntitiesDefinition": Optional[list["CustomEntity"]], + "globalDefaultCaseSensitive": Optional[bool], + "globalDefaultAccentSensitive": Optional[bool], + "globalDefaultFuzzyEditDistance": Optional[int], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.CustomEntityLookupSkill"]], + }, + total=False, +) +CustomEntityLookupSkill.__doc__ = """A skill looks for text from a custom, user-defined list of words and phrases. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "da", "de", "en", "es", "fi", "fr", "it", "ko", and "pt". +:vartype default_language_code: Union[str, "CustomEntityLookupSkillLanguage"] +:ivar entities_definition_uri: Path to a JSON or CSV file containing all the target text to + match against. This entity definition is read at the beginning of an indexer run. Any updates + to this file during an indexer run will not take effect until subsequent runs. This config must + be accessible over HTTPS. +:vartype entities_definition_uri: str +:ivar inline_entities_definition: The inline CustomEntity definition. +:vartype inline_entities_definition: list["CustomEntity"] +:ivar global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not + set in CustomEntity, this value will be the default value. +:vartype global_default_case_sensitive: bool +:ivar global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive is + not set in CustomEntity, this value will be the default value. +:vartype global_default_accent_sensitive: bool +:ivar global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If + FuzzyEditDistance is not set in CustomEntity, this value will be the default value. +:vartype global_default_fuzzy_edit_distance: int +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.CustomEntityLookupSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.CustomEntityLookupSkill"] +""" + + +CustomNormalizer = TypedDict( + "CustomNormalizer", + { + "name": Required[str], + "tokenFilters": list[Union[str, "TokenFilterName"]], + "charFilters": list[Union[str, "CharFilterName"]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.CustomNormalizer"]], + }, + total=False, +) +CustomNormalizer.__doc__ = """Allows you to configure normalization for filterable, sortable, and facetable fields, which by +default operate with strict matching. This is a user-defined configuration consisting of at +least one or more filters, which modify the token that is stored. + +:ivar name: The name of the char filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar token_filters: A list of token filters used to filter out or modify the input token. For + example, you can specify a lowercase filter that converts all characters to lowercase. The + filters are run in the order in which they are listed. +:vartype token_filters: list[Union[str, "TokenFilterName"]] +:ivar char_filters: A list of character filters used to prepare input text before it is + processed. For instance, they can replace certain characters or symbols. The filters are run in + the order in which they are listed. +:vartype char_filters: list[Union[str, "CharFilterName"]] +:ivar odata_type: A URI fragment specifying the type of normalizer. Required. Default value is + "#Microsoft.Azure.Search.CustomNormalizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.CustomNormalizer"] +""" + + +class DataSourceCredentials(TypedDict, total=False): + """Represents credentials that can be used to connect to a datasource. + + :ivar connection_string: The connection string for the datasource. Set to ```` (with + brackets) if you don't want the connection string updated. Set to ```` if you want to + remove the connection string value from the datasource. + :vartype connection_string: str + """ + + connectionString: str + """The connection string for the datasource. Set to ```` (with brackets) if you don't + want the connection string updated. Set to ```` if you want to remove the connection + string value from the datasource.""" + + +DefaultCognitiveServicesAccount = TypedDict( + "DefaultCognitiveServicesAccount", + { + "description": str, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.DefaultCognitiveServices"]], + }, + total=False, +) +DefaultCognitiveServicesAccount.__doc__ = """An empty object that represents the default Azure AI service resource for a skillset. + +:ivar description: Description of the Azure AI service resource attached to a skillset. +:vartype description: str +:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a + skillset. Required. Default value is "#Microsoft.Azure.Search.DefaultCognitiveServices". +:vartype odata_type: Literal["#Microsoft.Azure.Search.DefaultCognitiveServices"] +""" + + +DictionaryDecompounderTokenFilter = TypedDict( + "DictionaryDecompounderTokenFilter", + { + "name": Required[str], + "wordList": Required[list[str]], + "minWordSize": int, + "minSubwordSize": int, + "maxSubwordSize": int, + "onlyLongestMatch": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"]], + }, + total=False, +) +DictionaryDecompounderTokenFilter.__doc__ = """Decomposes compound words found in many Germanic languages. This token filter is implemented +using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar word_list: The list of words to match against. Required. +:vartype word_list: list[str] +:ivar min_word_size: The minimum word size. Only words longer than this get processed. Default + is 5. Maximum is 300. +:vartype min_word_size: int +:ivar min_subword_size: The minimum subword size. Only subwords longer than this are outputted. + Default is 2. Maximum is 300. +:vartype min_subword_size: int +:ivar max_subword_size: The maximum subword size. Only subwords shorter than this are + outputted. Default is 15. Maximum is 300. +:vartype max_subword_size: int +:ivar only_longest_match: A value indicating whether to add only the longest matching subword + to the output. Default is false. +:vartype only_longest_match: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"] +""" + + +class DistanceScoringFunction(TypedDict, total=False): + """Defines a function that boosts scores based on distance from a geographic location. + + :ivar field_name: The name of the field used as input to the scoring function. Required. + :vartype field_name: str + :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + :ivar interpolation: A value indicating how boosting will be interpolated across document + scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and + "logarithmic". + :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] + :ivar parameters: Parameter values for the distance scoring function. Required. + :vartype parameters: "DistanceScoringParameters" + :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, + distance, and tag. The function type must be lower case. Required. Default value is "distance". + :vartype type: Literal["distance"] + """ + + fieldName: Required[str] + """The name of the field used as input to the scoring function. Required.""" + boost: Required[float] + """A multiplier for the raw score. Must be a positive number not equal to 1.0. Required.""" + interpolation: Union[str, "ScoringFunctionInterpolation"] + """A value indicating how boosting will be interpolated across document scores; defaults to + \"Linear\". Known values are: \"linear\", \"constant\", \"quadratic\", and \"logarithmic\".""" + distance: Required["DistanceScoringParameters"] + """Parameter values for the distance scoring function. Required.""" + type: Required[Literal["distance"]] + """Indicates the type of function to use. Valid values include magnitude, freshness, distance, and + tag. The function type must be lower case. Required. Default value is \"distance\".""" + + +class DistanceScoringParameters(TypedDict, total=False): + """Provides parameter values to a distance scoring function. + + :ivar reference_point_parameter: The name of the parameter passed in search queries to specify + the reference location. Required. + :vartype reference_point_parameter: str + :ivar boosting_distance: The distance in kilometers from the reference location where the + boosting range ends. Required. + :vartype boosting_distance: float + """ + + referencePointParameter: Required[str] + """The name of the parameter passed in search queries to specify the reference location. Required.""" + boostingDistance: Required[float] + """The distance in kilometers from the reference location where the boosting range ends. Required.""" + + +DocumentExtractionSkill = TypedDict( + "DocumentExtractionSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "parsingMode": Optional[str], + "dataToExtract": Optional[str], + "configuration": Optional[dict[str, Any]], + "@odata.type": Required[Literal["#Microsoft.Skills.Util.DocumentExtractionSkill"]], + }, + total=False, +) +DocumentExtractionSkill.__doc__ = """A skill that extracts content from a file within the enrichment pipeline. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. +:vartype parsing_mode: str +:ivar data_to_extract: The type of data to be extracted for the skill. Will be set to + 'contentAndMetadata' if not defined. +:vartype data_to_extract: str +:ivar configuration: A dictionary of configurations for the skill. +:vartype configuration: dict[str, Any] +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Util.DocumentExtractionSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Util.DocumentExtractionSkill"] +""" + + +DocumentIntelligenceLayoutSkill = TypedDict( + "DocumentIntelligenceLayoutSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "outputFormat": Optional[Union[str, "DocumentIntelligenceLayoutSkillOutputFormat"]], + "outputMode": Optional[Union[str, "DocumentIntelligenceLayoutSkillOutputMode"]], + "markdownHeaderDepth": Optional[Union[str, "DocumentIntelligenceLayoutSkillMarkdownHeaderDepth"]], + "extractionOptions": Optional[list[Union[str, "DocumentIntelligenceLayoutSkillExtractionOptions"]]], + "chunkingProperties": Optional["DocumentIntelligenceLayoutSkillChunkingProperties"], + "@odata.type": Required[Literal["#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"]], + }, + total=False, +) +DocumentIntelligenceLayoutSkill.__doc__ = """A skill that extracts content and layout information, via Azure AI Services, from files within +the enrichment pipeline. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar output_format: Controls the output format. Default is 'markdown'. Known values are: + "text" and "markdown". +:vartype output_format: Union[str, "DocumentIntelligenceLayoutSkillOutputFormat"] +:ivar output_mode: Controls the cardinality of the output produced by the skill. Default is + 'oneToMany'. "oneToMany" +:vartype output_mode: Union[str, "DocumentIntelligenceLayoutSkillOutputMode"] +:ivar markdown_header_depth: The depth of headers in the markdown output. Default is h6. Known + values are: "h1", "h2", "h3", "h4", "h5", and "h6". +:vartype markdown_header_depth: Union[str, + "DocumentIntelligenceLayoutSkillMarkdownHeaderDepth"] +:ivar extraction_options: Controls the cardinality of the content extracted from the document + by the skill. +:vartype extraction_options: list[Union[str, + "DocumentIntelligenceLayoutSkillExtractionOptions"]] +:ivar chunking_properties: Controls the cardinality for chunking the content. +:vartype chunking_properties: "DocumentIntelligenceLayoutSkillChunkingProperties" +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"] +""" + + +class DocumentIntelligenceLayoutSkillChunkingProperties(TypedDict, total=False): # pylint: disable=name-too-long + """Controls the cardinality for chunking the content. + + :ivar unit: The unit of the chunk. "characters" + :vartype unit: Union[str, "DocumentIntelligenceLayoutSkillChunkingUnit"] + :ivar maximum_length: The maximum chunk length in characters. Default is 500. + :vartype maximum_length: int + :ivar overlap_length: The length of overlap provided between two text chunks. Default is 0. + :vartype overlap_length: int + """ + + unit: Optional[Union[str, "DocumentIntelligenceLayoutSkillChunkingUnit"]] + """The unit of the chunk. \"characters\"""" + maximumLength: Optional[int] + """The maximum chunk length in characters. Default is 500.""" + overlapLength: Optional[int] + """The length of overlap provided between two text chunks. Default is 0.""" + + +class DocumentKeysOrIds(TypedDict, total=False): + """The type of the keysOrIds. + + :ivar document_keys: document keys to be reset. + :vartype document_keys: list[str] + :ivar datasource_document_ids: datasource document identifiers to be reset. + :vartype datasource_document_ids: list[str] + """ + + documentKeys: list[str] + """document keys to be reset.""" + datasourceDocumentIds: list[str] + """datasource document identifiers to be reset.""" + + +EdgeNGramTokenFilter = TypedDict( + "EdgeNGramTokenFilter", + { + "name": Required[str], + "minGram": int, + "maxGram": int, + "side": Union[str, "EdgeNGramTokenFilterSide"], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilter"]], + }, + total=False, +) +EdgeNGramTokenFilter.__doc__ = """Generates n-grams of the given size(s) starting from the front or the back of an input token. +This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_gram: The minimum n-gram length. Default is 1. Must be less than the value of + maxGram. +:vartype min_gram: int +:ivar max_gram: The maximum n-gram length. Default is 2. +:vartype max_gram: int +:ivar side: Specifies which side of the input the n-gram should be generated from. Default is + "front". Known values are: "front" and "back". +:vartype side: Union[str, "EdgeNGramTokenFilterSide"] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.EdgeNGramTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilter"] +""" + + +EdgeNGramTokenFilterV2 = TypedDict( + "EdgeNGramTokenFilterV2", + { + "name": Required[str], + "minGram": int, + "maxGram": int, + "side": Union[str, "EdgeNGramTokenFilterSide"], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"]], + }, + total=False, +) +EdgeNGramTokenFilterV2.__doc__ = """Generates n-grams of the given size(s) starting from the front or the back of an input token. +This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + value of maxGram. +:vartype min_gram: int +:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype max_gram: int +:ivar side: Specifies which side of the input the n-gram should be generated from. Default is + "front". Known values are: "front" and "back". +:vartype side: Union[str, "EdgeNGramTokenFilterSide"] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2". +:vartype odata_type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"] +""" + + +EdgeNGramTokenizer = TypedDict( + "EdgeNGramTokenizer", + { + "name": Required[str], + "minGram": int, + "maxGram": int, + "tokenChars": list[Union[str, "TokenCharacterKind"]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.EdgeNGramTokenizer"]], + }, + total=False, +) +EdgeNGramTokenizer.__doc__ = """Tokenizes the input from an edge into n-grams of the given size(s). This tokenizer is +implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + value of maxGram. +:vartype min_gram: int +:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype max_gram: int +:ivar token_chars: Character classes to keep in the tokens. +:vartype token_chars: list[Union[str, "TokenCharacterKind"]] +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.EdgeNGramTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenizer"] +""" + + +ElisionTokenFilter = TypedDict( + "ElisionTokenFilter", + { + "name": Required[str], + "articles": list[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.ElisionTokenFilter"]], + }, + total=False, +) +ElisionTokenFilter.__doc__ = """Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). This +token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar articles: The set of articles to remove. +:vartype articles: list[str] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.ElisionTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.ElisionTokenFilter"] +""" + + +class EmbeddingColumnMapping(TypedDict, total=False): + """Maps a SQL column to a vector field for embedding. + + :ivar name: Target vector field name in the search index. Required. + :vartype name: str + :ivar source_field: SQL column used as input for embedding generation. Required. + :vartype source_field: str + """ + + name: Required[str] + """Target vector field name in the search index. Required.""" + sourceField: Required[str] + """SQL column used as input for embedding generation. Required.""" + + +EntityLinkingSkill = TypedDict( + "EntityLinkingSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Optional[str], + "minimumPrecision": float, + "modelVersion": Optional[str], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.V3.EntityLinkingSkill"]], + }, + total=False, +) +EntityLinkingSkill.__doc__ = """Using the Text Analytics API, extracts linked entities from text. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:vartype default_language_code: str +:ivar minimum_precision: A value between 0 and 1 that be used to only include entities whose + confidence score is greater than the value specified. If not set (default), or if explicitly + set to null, all entities will be included. +:vartype minimum_precision: float +:ivar model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. +:vartype model_version: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.V3.EntityLinkingSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.V3.EntityLinkingSkill"] +""" + + +EntityRecognitionSkillV3 = TypedDict( + "EntityRecognitionSkillV3", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "categories": list[Union[str, "EntityCategory"]], + "defaultLanguageCode": Optional[Union[str, "EntityRecognitionSkillLanguage"]], + "minimumPrecision": float, + "modelVersion": Optional[str], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.V3.EntityRecognitionSkill"]], + }, + total=False, +) +EntityRecognitionSkillV3.__doc__ = """Using the Text Analytics API, extracts entities of different types from text. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar categories: A list of entity categories that should be extracted. +:vartype categories: list[Union[str, "EntityCategory"]] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", + "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", and "tr". +:vartype default_language_code: Union[str, "EntityRecognitionSkillLanguage"] +:ivar minimum_precision: A value between 0 and 1 that be used to only include entities whose + confidence score is greater than the value specified. If not set (default), or if explicitly + set to null, all entities will be included. +:vartype minimum_precision: float +:ivar model_version: The version of the model to use when calling the Text Analytics API. It + will default to the latest available when not specified. We recommend you do not specify this + value unless absolutely necessary. +:vartype model_version: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.V3.EntityRecognitionSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.V3.EntityRecognitionSkill"] +""" + + +class EntraAppAuthentication(TypedDict, total=False): + """Configuration for a customer-owned Microsoft Entra app registration used for federated + credential-based on-behalf-of authentication. + + :ivar application_id: The application (client) ID of the customer-owned Entra app registration. + Required. + :vartype application_id: str + :ivar federated_credential_id: The federated credential ID configured on the app registration, + enabling the search service to authenticate as the app without a stored client secret. + Required. + :vartype federated_credential_id: str + :ivar tenant_id: 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. + :vartype tenant_id: str + """ + + applicationId: Required[str] + """The application (client) ID of the customer-owned Entra app registration. Required.""" + federatedCredentialId: Required[str] + """The federated credential ID configured on the app registration, enabling the search service to + authenticate as the app without a stored client secret. Required.""" + tenantId: str + """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.""" + + +class ExhaustiveKnnAlgorithmConfiguration(TypedDict, total=False): + """Contains configuration options specific to the exhaustive KNN algorithm used during querying, + which will perform brute-force search across the entire vector index. + + :ivar name: The name to associate with this particular configuration. Required. + :vartype name: str + :ivar parameters: Contains the parameters specific to exhaustive KNN algorithm. + :vartype parameters: "ExhaustiveKnnParameters" + :ivar kind: The name of the kind of algorithm being configured for use with vector search. + Required. Exhaustive KNN algorithm which will perform brute-force search. + :vartype kind: Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN] + """ + + name: Required[str] + """The name to associate with this particular configuration. Required.""" + exhaustiveKnnParameters: "ExhaustiveKnnParameters" + """Contains the parameters specific to exhaustive KNN algorithm.""" + kind: Required[Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN]] + """The name of the kind of algorithm being configured for use with vector search. Required. + Exhaustive KNN algorithm which will perform brute-force search.""" + + +class ExhaustiveKnnParameters(TypedDict, total=False): + """Contains the parameters specific to exhaustive KNN algorithm. + + :ivar metric: The similarity metric to use for vector comparisons. Known values are: "cosine", + "euclidean", "dotProduct", and "hamming". + :vartype metric: Union[str, "VectorSearchAlgorithmMetric"] + """ + + metric: Optional[Union[str, "VectorSearchAlgorithmMetric"]] + """The similarity metric to use for vector comparisons. Known values are: \"cosine\", + \"euclidean\", \"dotProduct\", and \"hamming\".""" + + +FabricDataAgentKnowledgeSource = TypedDict( + "FabricDataAgentKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]], + "fabricDataAgentParameters": Required["FabricDataAgentKnowledgeSourceParameters"], + }, + total=False, +) +FabricDataAgentKnowledgeSource.__doc__ = """Configuration for Fabric Data Agent knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: The discriminator value. Required. A knowledge source that retrieves data from a + Fabric Data Agent. +:vartype kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] +:ivar fabric_data_agent_parameters: The parameters for the Fabric Data Agent knowledge source. + Required. +:vartype fabric_data_agent_parameters: "FabricDataAgentKnowledgeSourceParameters" +""" + + +class FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for Fabric Data Agent knowledge source. + + :ivar workspace_id: Fabric workspace ID. Required. + :vartype workspace_id: str + :ivar data_agent_id: Specifies which Fabric Data Agent to access. Required. + :vartype data_agent_id: str + """ + + workspaceId: Required[str] + """Fabric workspace ID. Required.""" + dataAgentId: Required[str] + """Specifies which Fabric Data Agent to access. Required.""" + + +FabricOntologyKnowledgeSource = TypedDict( + "FabricOntologyKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]], + "fabricOntologyParameters": Required["FabricOntologyKnowledgeSourceParameters"], + }, + total=False, +) +FabricOntologyKnowledgeSource.__doc__ = """Configuration for Fabric Ontology knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: The discriminator value. Required. A knowledge source that retrieves data from + Microsoft Fabric Ontology ontologies. +:vartype kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] +:ivar fabric_ontology_parameters: The parameters for the Fabric Ontology knowledge source. + Required. +:vartype fabric_ontology_parameters: "FabricOntologyKnowledgeSourceParameters" +""" + + +class FabricOntologyKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for Fabric Ontology knowledge source. + + :ivar workspace_id: The Fabric workspace ID containing the ontology. Required. + :vartype workspace_id: str + :ivar ontology_id: The ID of the ontology to use from the Fabric workspace. Required. + :vartype ontology_id: str + """ + + workspaceId: Required[str] + """The Fabric workspace ID containing the ontology. Required.""" + ontologyId: Required[str] + """The ID of the ontology to use from the Fabric workspace. Required.""" + + +class FieldMapping(TypedDict, total=False): + """Defines a mapping between a field in a data source and a target field in an index. + + :ivar source_field_name: The name of the field in the data source. Required. + :vartype source_field_name: str + :ivar target_field_name: The name of the target field in the index. Same as the source field + name by default. + :vartype target_field_name: str + :ivar mapping_function: A function to apply to each source field value before indexing. + :vartype mapping_function: "FieldMappingFunction" + """ + + sourceFieldName: Required[str] + """The name of the field in the data source. Required.""" + targetFieldName: str + """The name of the target field in the index. Same as the source field name by default.""" + mappingFunction: Optional["FieldMappingFunction"] + """A function to apply to each source field value before indexing.""" + + +class FieldMappingFunction(TypedDict, total=False): + """Represents a function that transforms a value from a data source before indexing. + + :ivar name: The name of the field mapping function. Required. + :vartype name: str + :ivar parameters: A dictionary of parameter name/value pairs to pass to the function. Each + value must be of a primitive type. + :vartype parameters: dict[str, Any] + """ + + name: Required[str] + """The name of the field mapping function. Required.""" + parameters: Optional[dict[str, Any]] + """A dictionary of parameter name/value pairs to pass to the function. Each value must be of a + primitive type.""" + + +FileKnowledgeSource = TypedDict( + "FileKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.FILE]], + "fileParameters": Required["FileKnowledgeSourceParameters"], + "corsOptions": "CorsOptions", + }, + total=False, +) +FileKnowledgeSource.__doc__ = """Configuration for File knowledge source that supports direct file upload and indexing. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: The discriminator value. Required. A knowledge source that supports direct file + upload and indexing. +:vartype kind: Literal[KnowledgeSourceKind.FILE] +:ivar file_parameters: The parameters for the File knowledge source. Required. +:vartype file_parameters: "FileKnowledgeSourceParameters" +:ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the File + knowledge source's file endpoints (upload, list, update, delete). +:vartype cors_options: "CorsOptions" +""" + + +class FileKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for File knowledge source. + + :ivar ingestion_parameters: Consolidates all general ingestion settings for the File knowledge + source, including the content extraction mode and an optional embeddingModel. + :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + :ivar created_resources: Resources created by the file knowledge source. + :vartype created_resources: "CreatedResources" + """ + + ingestionParameters: "KnowledgeSourceIngestionParameters" + """Consolidates all general ingestion settings for the File knowledge source, including the + content extraction mode and an optional embeddingModel.""" + queryHints: "SearchIndexKnowledgeSourceQueryHints" + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" + createdResources: "CreatedResources" + """Resources created by the file knowledge source.""" + + +class FileUploadMetadata(TypedDict, total=False): + """The JSON 'metadata' part of a multipart/form-data file upload: the full file name/path and + custom key/value metadata. The parsing mode and extraction mode are both chosen by the service + and are not supplied by the caller. + + :ivar file_name: The full relative file name/path to store the file under (prefixes are derived + from it). + :vartype file_name: str + :ivar metadata: Custom key/value metadata to store with the file. + :vartype metadata: dict[str, str] + """ + + fileName: str + """The full relative file name/path to store the file under (prefixes are derived from it).""" + metadata: dict[str, str] + """Custom key/value metadata to store with the file.""" + + +class FreshnessScoringFunction(TypedDict, total=False): + """Defines a function that boosts scores based on the value of a date-time field. + + :ivar field_name: The name of the field used as input to the scoring function. Required. + :vartype field_name: str + :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + :ivar interpolation: A value indicating how boosting will be interpolated across document + scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and + "logarithmic". + :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] + :ivar parameters: Parameter values for the freshness scoring function. Required. + :vartype parameters: "FreshnessScoringParameters" + :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, + distance, and tag. The function type must be lower case. Required. Default value is + "freshness". + :vartype type: Literal["freshness"] + """ + + fieldName: Required[str] + """The name of the field used as input to the scoring function. Required.""" + boost: Required[float] + """A multiplier for the raw score. Must be a positive number not equal to 1.0. Required.""" + interpolation: Union[str, "ScoringFunctionInterpolation"] + """A value indicating how boosting will be interpolated across document scores; defaults to + \"Linear\". Known values are: \"linear\", \"constant\", \"quadratic\", and \"logarithmic\".""" + freshness: Required["FreshnessScoringParameters"] + """Parameter values for the freshness scoring function. Required.""" + type: Required[Literal["freshness"]] + """Indicates the type of function to use. Valid values include magnitude, freshness, distance, and + tag. The function type must be lower case. Required. Default value is \"freshness\".""" + + +class FreshnessScoringParameters(TypedDict, total=False): + """Provides parameter values to a freshness scoring function. + + :ivar boosting_duration: The expiration period after which boosting will stop for a particular + document. Required. + :vartype boosting_duration: str + """ + + boostingDuration: Required[str] + """The expiration period after which boosting will stop for a particular document. Required.""" + + +class GetIndexStatisticsResult(TypedDict, total=False): + """Statistics for a given index. Statistics are collected periodically and are not guaranteed to + always be up-to-date. + + :ivar document_count: The number of documents in the index. Required. + :vartype document_count: int + :ivar storage_size: The amount of storage in bytes consumed by the index. Required. + :vartype storage_size: int + :ivar vector_index_size: The amount of memory in bytes consumed by vectors in the index. + Required. + :vartype vector_index_size: int + """ + + documentCount: Required[int] + """The number of documents in the index. Required.""" + storageSize: Required[int] + """The amount of storage in bytes consumed by the index. Required.""" + vectorIndexSize: Required[int] + """The amount of memory in bytes consumed by vectors in the index. Required.""" + + +HighWaterMarkChangeDetectionPolicy = TypedDict( + "HighWaterMarkChangeDetectionPolicy", + { + "highWaterMarkColumnName": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"]], + }, + total=False, +) +HighWaterMarkChangeDetectionPolicy.__doc__ = """Defines a data change detection policy that captures changes based on the value of a high water +mark column. + +:ivar high_water_mark_column_name: The name of the high water mark column. Required. +:vartype high_water_mark_column_name: str +:ivar odata_type: A URI fragment specifying the type of data change detection policy. Required. + Default value is "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy". +:vartype odata_type: Literal["#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"] +""" + + +class HnswAlgorithmConfiguration(TypedDict, total=False): + """Contains configuration options specific to the HNSW approximate nearest neighbors algorithm + used during indexing and querying. The HNSW algorithm offers a tunable trade-off between search + speed and accuracy. + + :ivar name: The name to associate with this particular configuration. Required. + :vartype name: str + :ivar parameters: Contains the parameters specific to HNSW algorithm. + :vartype parameters: "HnswParameters" + :ivar kind: The name of the kind of algorithm being configured for use with vector search. + Required. HNSW (Hierarchical Navigable Small World), a type of approximate nearest neighbors + algorithm. + :vartype kind: Literal[VectorSearchAlgorithmKind.HNSW] + """ + + name: Required[str] + """The name to associate with this particular configuration. Required.""" + hnswParameters: "HnswParameters" + """Contains the parameters specific to HNSW algorithm.""" + kind: Required[Literal[VectorSearchAlgorithmKind.HNSW]] + """The name of the kind of algorithm being configured for use with vector search. Required. HNSW + (Hierarchical Navigable Small World), a type of approximate nearest neighbors algorithm.""" + + +class HnswParameters(TypedDict, total=False): + """Contains the parameters specific to the HNSW algorithm. + + :ivar m: The number of bi-directional links created for every new element during construction. + Increasing this parameter value may improve recall and reduce retrieval times for datasets with + high intrinsic dimensionality at the expense of increased memory consumption and longer + indexing time. + :vartype m: int + :ivar ef_construction: The size of the dynamic list containing the nearest neighbors, which is + used during index time. Increasing this parameter may improve index quality, at the expense of + increased indexing time. At a certain point, increasing this parameter leads to diminishing + returns. + :vartype ef_construction: int + :ivar ef_search: The size of the dynamic list containing the nearest neighbors, which is used + during search time. Increasing this parameter may improve search results, at the expense of + slower search. At a certain point, increasing this parameter leads to diminishing returns. + :vartype ef_search: int + :ivar metric: The similarity metric to use for vector comparisons. Known values are: "cosine", + "euclidean", "dotProduct", and "hamming". + :vartype metric: Union[str, "VectorSearchAlgorithmMetric"] + """ + + m: int + """The number of bi-directional links created for every new element during construction. + Increasing this parameter value may improve recall and reduce retrieval times for datasets with + high intrinsic dimensionality at the expense of increased memory consumption and longer + indexing time.""" + efConstruction: int + """The size of the dynamic list containing the nearest neighbors, which is used during index time. + Increasing this parameter may improve index quality, at the expense of increased indexing time. + At a certain point, increasing this parameter leads to diminishing returns.""" + efSearch: int + """The size of the dynamic list containing the nearest neighbors, which is used during search + time. Increasing this parameter may improve search results, at the expense of slower search. At + a certain point, increasing this parameter leads to diminishing returns.""" + metric: Optional[Union[str, "VectorSearchAlgorithmMetric"]] + """The similarity metric to use for vector comparisons. Known values are: \"cosine\", + \"euclidean\", \"dotProduct\", and \"hamming\".""" + + +ImageAnalysisSkill = TypedDict( + "ImageAnalysisSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Union[str, "ImageAnalysisSkillLanguage"], + "visualFeatures": list[Union[str, "VisualFeature"]], + "details": list[Union[str, "ImageDetail"]], + "@odata.type": Required[Literal["#Microsoft.Skills.Vision.ImageAnalysisSkill"]], + }, + total=False, +) +ImageAnalysisSkill.__doc__ = """A skill that analyzes image files. It extracts a rich set of visual features based on the image +content. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "ar", "az", "bg", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "es", "et", + "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hu", "id", "it", "ja", "kk", "ko", "lt", "lv", + "mk", "ms", "nb", "nl", "pl", "prs", "pt-BR", "pt", "pt-PT", "ro", "ru", "sk", "sl", "sr-Cyrl", + "sr-Latn", "sv", "th", "tr", "uk", "vi", "zh", "zh-Hans", and "zh-Hant". +:vartype default_language_code: Union[str, "ImageAnalysisSkillLanguage"] +:ivar visual_features: A list of visual features. +:vartype visual_features: list[Union[str, "VisualFeature"]] +:ivar details: A string indicating which domain-specific details to return. +:vartype details: list[Union[str, "ImageDetail"]] +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Vision.ImageAnalysisSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Vision.ImageAnalysisSkill"] +""" + + +IndexedOneLakeKnowledgeSource = TypedDict( + "IndexedOneLakeKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]], + "indexedOneLakeParameters": Required["IndexedOneLakeKnowledgeSourceParameters"], + }, + total=False, +) +IndexedOneLakeKnowledgeSource.__doc__ = """Configuration for OneLake knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: Required. A knowledge source that reads data from indexed OneLake. +:vartype kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] +:ivar indexed_one_lake_parameters: The parameters for the knowledge source. Required. +:vartype indexed_one_lake_parameters: "IndexedOneLakeKnowledgeSourceParameters" +""" + + +class IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for OneLake knowledge source. + + :ivar fabric_workspace_id: OneLake workspace ID. Required. + :vartype fabric_workspace_id: str + :ivar lakehouse_id: Specifies which OneLake lakehouse to access. Required. + :vartype lakehouse_id: str + :ivar target_path: Optional OneLakehouse folder or shortcut to filter OneLake content. + :vartype target_path: str + :ivar ingestion_parameters: Consolidates all general ingestion settings. + :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + :ivar created_resources: Resources created by the knowledge source. + :vartype created_resources: "CreatedResources" + """ + + fabricWorkspaceId: Required[str] + """OneLake workspace ID. Required.""" + lakehouseId: Required[str] + """Specifies which OneLake lakehouse to access. Required.""" + targetPath: Optional[str] + """Optional OneLakehouse folder or shortcut to filter OneLake content.""" + ingestionParameters: "KnowledgeSourceIngestionParameters" + """Consolidates all general ingestion settings.""" + queryHints: "SearchIndexKnowledgeSourceQueryHints" + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" + createdResources: "CreatedResources" + """Resources created by the knowledge source.""" + + +IndexedSharePointKnowledgeSource = TypedDict( + "IndexedSharePointKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]], + "indexedSharePointParameters": Required["IndexedSharePointKnowledgeSourceParameters"], + }, + total=False, +) +IndexedSharePointKnowledgeSource.__doc__ = """Configuration for SharePoint knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: Required. A knowledge source that reads data from indexed SharePoint. +:vartype kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] +:ivar indexed_share_point_parameters: The parameters for the knowledge source. Required. +:vartype indexed_share_point_parameters: "IndexedSharePointKnowledgeSourceParameters" +""" + + +class IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): # pylint: disable=name-too-long + """Parameters for SharePoint knowledge source. + + :ivar connection_string: SharePoint connection string with format: + SharePointOnlineEndpoint=[SharePoint site url];ApplicationId=[Azure AD App + ID];ApplicationSecret=[Azure AD App client secret];TenantId=[SharePoint site tenant id]. + Required. + :vartype connection_string: str + :ivar container_name: Specifies which SharePoint libraries to access. Required. Known values + are: "defaultSiteLibrary", "allSiteLibraries", and "useQuery". + :vartype container_name: Union[str, "IndexedSharePointContainerName"] + :ivar query: Optional query to filter SharePoint content. + :vartype query: str + :ivar ingestion_parameters: Consolidates all general ingestion settings. + :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + :ivar created_resources: Resources created by the knowledge source. + :vartype created_resources: "CreatedResources" + """ + + connectionString: Required[str] + """SharePoint connection string with format: SharePointOnlineEndpoint=[SharePoint site + url];ApplicationId=[Azure AD App ID];ApplicationSecret=[Azure AD App client + secret];TenantId=[SharePoint site tenant id]. Required.""" + containerName: Required[Union[str, "IndexedSharePointContainerName"]] + """Specifies which SharePoint libraries to access. Required. Known values are: + \"defaultSiteLibrary\", \"allSiteLibraries\", and \"useQuery\".""" + query: Optional[str] + """Optional query to filter SharePoint content.""" + ingestionParameters: Optional["KnowledgeSourceIngestionParameters"] + """Consolidates all general ingestion settings.""" + queryHints: "SearchIndexKnowledgeSourceQueryHints" + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" + createdResources: "CreatedResources" + """Resources created by the knowledge source.""" + + +IndexedSqlKnowledgeSource = TypedDict( + "IndexedSqlKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SQL]], + "indexedSqlParameters": Required["IndexedSqlKnowledgeSourceParameters"], + }, + total=False, +) +IndexedSqlKnowledgeSource.__doc__ = """Configuration for indexed SQL knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: The discriminator value. Required. A knowledge source that retrieves and ingests + data from Azure SQL Database or SQL Managed Instance to a Search Index. +:vartype kind: Literal[KnowledgeSourceKind.INDEXED_SQL] +:ivar indexed_sql_parameters: The parameters for the SQL knowledge source. Required. +:vartype indexed_sql_parameters: "IndexedSqlKnowledgeSourceParameters" +""" + + +class IndexedSqlKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for indexed SQL knowledge source. + + :ivar connection_string: The connection string for the Azure SQL Database or SQL Managed + Instance. Required. + :vartype connection_string: str + :ivar table_or_view: The name of the table or view to index. Can be schema-qualified (e.g., + 'dbo.MyTable'). Required. + :vartype table_or_view: str + :ivar high_water_mark_column_name: Optional column name for high water mark change detection. + If provided, uses HighWaterMarkChangeDetectionPolicy. + :vartype high_water_mark_column_name: str + :ivar content_columns: Optional column mappings for content fields. If omitted, all columns are + auto-discovered. + :vartype content_columns: list["ContentColumnMapping"] + :ivar embedding_columns: Optional column mappings for embedding vector fields. If omitted, no + vector fields are created. + :vartype embedding_columns: list["EmbeddingColumnMapping"] + :ivar ingestion_parameters: Consolidates all general ingestion settings including embedding + model, schedule, and identity. + :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" + :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + this index-backed knowledge source. Request-time query hints replace these defaults as a + complete object. + :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + :ivar created_resources: Resources created by the knowledge source. + :vartype created_resources: "CreatedResources" + """ + + connectionString: Required[str] + """The connection string for the Azure SQL Database or SQL Managed Instance. Required.""" + tableOrView: Required[str] + """The name of the table or view to index. Can be schema-qualified (e.g., 'dbo.MyTable'). + Required.""" + highWaterMarkColumnName: str + """Optional column name for high water mark change detection. If provided, uses + HighWaterMarkChangeDetectionPolicy.""" + contentColumns: list["ContentColumnMapping"] + """Optional column mappings for content fields. If omitted, all columns are auto-discovered.""" + embeddingColumns: list["EmbeddingColumnMapping"] + """Optional column mappings for embedding vector fields. If omitted, no vector fields are created.""" + ingestionParameters: "KnowledgeSourceIngestionParameters" + """Consolidates all general ingestion settings including embedding model, schedule, and identity.""" + queryHints: "SearchIndexKnowledgeSourceQueryHints" + """Default hints that guide query planning toward useful filters and boosts for this index-backed + knowledge source. Request-time query hints replace these defaults as a complete object.""" + createdResources: "CreatedResources" + """Resources created by the knowledge source.""" + + +class IndexerResyncBody(TypedDict, total=False): + """Request body for resync indexer operation. + + :ivar options: Re-sync options that have been pre-defined from data source. + :vartype options: list[Union[str, "IndexerResyncOption"]] + """ + + options: Optional[list[Union[str, "IndexerResyncOption"]]] + """Re-sync options that have been pre-defined from data source.""" + + +class IndexingParameters(TypedDict, total=False): + """Represents parameters for indexer execution. + + :ivar batch_size: The number of items that are read from the data source and indexed as a + single batch in order to improve performance. The default depends on the data source type. + :vartype batch_size: int + :ivar max_failed_items: The maximum number of items that can fail indexing for indexer + execution to still be considered successful. -1 means no limit. Default is 0. + :vartype max_failed_items: int + :ivar max_failed_items_per_batch: The maximum number of items in a single batch that can fail + indexing for the batch to still be considered successful. -1 means no limit. Default is 0. + :vartype max_failed_items_per_batch: int + :ivar configuration: A dictionary of indexer-specific configuration properties. Each name is + the name of a specific property. Each value must be of a primitive type. + :vartype configuration: "IndexingParametersConfiguration" + """ + + batchSize: Optional[int] + """The number of items that are read from the data source and indexed as a single batch in order + to improve performance. The default depends on the data source type.""" + maxFailedItems: Optional[int] + """The maximum number of items that can fail indexing for indexer execution to still be considered + successful. -1 means no limit. Default is 0.""" + maxFailedItemsPerBatch: Optional[int] + """The maximum number of items in a single batch that can fail indexing for the batch to still be + considered successful. -1 means no limit. Default is 0.""" + configuration: "IndexingParametersConfiguration" + """A dictionary of indexer-specific configuration properties. Each name is the name of a specific + property. Each value must be of a primitive type.""" + + +class IndexingParametersConfiguration(TypedDict, total=False): + """A dictionary of indexer-specific configuration properties. Each name is the name of a specific + property. Each value must be of a primitive type. + + :ivar parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. + Known values are: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines", and + "markdown". + :vartype parsing_mode: Union[str, "BlobIndexerParsingMode"] + :ivar excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore when + processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip over + those files during indexing. + :vartype excluded_file_name_extensions: str + :ivar indexed_file_name_extensions: Comma-delimited list of filename extensions to select when + processing from Azure blob storage. For example, you could focus indexing on specific + application files ".docx, .pptx, .msg" to specifically include those file types. + :vartype indexed_file_name_extensions: str + :ivar fail_on_unsupported_content_type: For Azure blobs, set to false if you want to continue + indexing when an unsupported content type is encountered, and you don't know all the content + types (file extensions) in advance. + :vartype fail_on_unsupported_content_type: bool + :ivar fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue + indexing if a document fails indexing. + :vartype fail_on_unprocessable_document: bool + :ivar index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this property + to true to still index storage metadata for blob content that is too large to process. + Oversized blobs are treated as errors by default. For limits on blob size, see + `https://learn.microsoft.com/azure/search/search-limits-quotas-capacity + `_. + :vartype index_storage_metadata_only_for_oversized_documents: bool + :ivar delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column + headers, useful for mapping source fields to destination fields in an index. + :vartype delimited_text_headers: str + :ivar delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character + delimiter for CSV files where each line starts a new document (for example, "|"). + :vartype delimited_text_delimiter: str + :ivar first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line of + each blob contains headers. + :vartype first_line_contains_headers: bool + :ivar markdown_parsing_submode: Specifies the submode that will determine whether a markdown + file will be parsed into exactly one search document or multiple search documents. Default is + ``oneToMany``. Known values are: "oneToMany" and "oneToOne". + :vartype markdown_parsing_submode: Union[str, "MarkdownParsingSubmode"] + :ivar markdown_header_depth: Specifies the max header depth that will be considered while + grouping markdown content. Default is ``h6``. Known values are: "h1", "h2", "h3", "h4", "h5", + and "h6". + :vartype markdown_header_depth: Union[str, "MarkdownHeaderDepth"] + :ivar document_root: For JSON arrays, given a structured or semi-structured document, you can + specify a path to the array using this property. + :vartype document_root: str + :ivar data_to_extract: Specifies the data to extract from Azure blob storage and tells the + indexer which data to extract from image content when "imageAction" is set to a value other + than "none". This applies to embedded image content in a .PDF or other application, or image + files such as .jpg and .png, in Azure blobs. Known values are: "storageMetadata", + "allMetadata", and "contentAndMetadata". + :vartype data_to_extract: Union[str, "BlobIndexerDataToExtract"] + :ivar image_action: Determines how to process embedded images and image files in Azure blob + storage. Setting the "imageAction" configuration to any value other than "none" requires that + a skillset also be attached to that indexer. Known values are: "none", + "generateNormalizedImages", and "generateNormalizedImagePerPage". + :vartype image_action: Union[str, "BlobIndexerImageAction"] + :ivar allow_skillset_to_read_file_data: If true, will create a path //document//file_data that + is an object representing the original file data downloaded from your blob data source. This + allows you to pass the original file data to a custom skill for processing within the + enrichment pipeline, or to the Document Extraction skill. + :vartype allow_skillset_to_read_file_data: bool + :ivar pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in + Azure blob storage. Known values are: "none" and "detectAngles". + :vartype pdf_text_rotation_algorithm: Union[str, "BlobIndexerPDFTextRotationAlgorithm"] + :ivar execution_environment: Specifies the environment in which the indexer should execute. + Known values are: "standard" and "private". + :vartype execution_environment: Union[str, "IndexerExecutionEnvironment"] + :ivar query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database + data sources, specified in the format "hh:mm:ss". + :vartype query_timeout: str + """ + + parsingMode: Union[str, "BlobIndexerParsingMode"] + """Represents the parsing mode for indexing from an Azure blob data source. Known values are: + \"default\", \"text\", \"delimitedText\", \"json\", \"jsonArray\", \"jsonLines\", and + \"markdown\".""" + excludedFileNameExtensions: str + """Comma-delimited list of filename extensions to ignore when processing from Azure blob storage. + For example, you could exclude \".png, .mp4\" to skip over those files during indexing.""" + indexedFileNameExtensions: str + """Comma-delimited list of filename extensions to select when processing from Azure blob storage. + For example, you could focus indexing on specific application files \".docx, .pptx, .msg\" to + specifically include those file types.""" + failOnUnsupportedContentType: bool + """For Azure blobs, set to false if you want to continue indexing when an unsupported content type + is encountered, and you don't know all the content types (file extensions) in advance.""" + failOnUnprocessableDocument: bool + """For Azure blobs, set to false if you want to continue indexing if a document fails indexing.""" + indexStorageMetadataOnlyForOversizedDocuments: bool + """For Azure blobs, set this property to true to still index storage metadata for blob content + that is too large to process. Oversized blobs are treated as errors by default. For limits on + blob size, see `https://learn.microsoft.com/azure/search/search-limits-quotas-capacity + `_.""" + delimitedTextHeaders: str + """For CSV blobs, specifies a comma-delimited list of column headers, useful for mapping source + fields to destination fields in an index.""" + delimitedTextDelimiter: str + """For CSV blobs, specifies the end-of-line single-character delimiter for CSV files where each + line starts a new document (for example, \"|\").""" + firstLineContainsHeaders: bool + """For CSV blobs, indicates that the first (non-blank) line of each blob contains headers.""" + markdownParsingSubmode: Optional[Union[str, "MarkdownParsingSubmode"]] + """Specifies the submode that will determine whether a markdown file will be parsed into exactly + one search document or multiple search documents. Default is ``oneToMany``. Known values are: + \"oneToMany\" and \"oneToOne\".""" + markdownHeaderDepth: Optional[Union[str, "MarkdownHeaderDepth"]] + """Specifies the max header depth that will be considered while grouping markdown content. Default + is ``h6``. Known values are: \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", and \"h6\".""" + documentRoot: str + """For JSON arrays, given a structured or semi-structured document, you can specify a path to the + array using this property.""" + dataToExtract: Union[str, "BlobIndexerDataToExtract"] + """Specifies the data to extract from Azure blob storage and tells the indexer which data to + extract from image content when \"imageAction\" is set to a value other than \"none\". This + applies to embedded image content in a .PDF or other application, or image files such as .jpg + and .png, in Azure blobs. Known values are: \"storageMetadata\", \"allMetadata\", and + \"contentAndMetadata\".""" + imageAction: Union[str, "BlobIndexerImageAction"] + """Determines how to process embedded images and image files in Azure blob storage. Setting the + \"imageAction\" configuration to any value other than \"none\" requires that a skillset also be + attached to that indexer. Known values are: \"none\", \"generateNormalizedImages\", and + \"generateNormalizedImagePerPage\".""" + allowSkillsetToReadFileData: bool + """If true, will create a path //document//file_data that is an object representing the original + file data downloaded from your blob data source. This allows you to pass the original file data + to a custom skill for processing within the enrichment pipeline, or to the Document Extraction + skill.""" + pdfTextRotationAlgorithm: Union[str, "BlobIndexerPDFTextRotationAlgorithm"] + """Determines algorithm for text extraction from PDF files in Azure blob storage. Known values + are: \"none\" and \"detectAngles\".""" + executionEnvironment: Union[str, "IndexerExecutionEnvironment"] + """Specifies the environment in which the indexer should execute. Known values are: \"standard\" + and \"private\".""" + queryTimeout: str + """Increases the timeout beyond the 5-minute default for Azure SQL database data sources, + specified in the format \"hh:mm:ss\".""" + + +class IndexingSchedule(TypedDict, total=False): + """Represents a schedule for indexer execution. + + :ivar interval: The interval of time between indexer executions. Required. + :vartype interval: str + :ivar start_time: The time when an indexer should start running. + :vartype start_time: str + """ + + interval: Required[str] + """The interval of time between indexer executions. Required.""" + startTime: str + """The time when an indexer should start running.""" + + +class InputFieldMappingEntry(TypedDict, total=False): + """Input field mapping for a skill. + + :ivar name: The name of the input. Required. + :vartype name: str + :ivar source: The source of the input. + :vartype source: str + :ivar source_context: The source context used for selecting recursive inputs. + :vartype source_context: str + :ivar inputs: The recursive inputs used when creating a complex type. + :vartype inputs: list["InputFieldMappingEntry"] + """ + + name: Required[str] + """The name of the input. Required.""" + source: str + """The source of the input.""" + sourceContext: str + """The source context used for selecting recursive inputs.""" + inputs: list["InputFieldMappingEntry"] + """The recursive inputs used when creating a complex type.""" + + +KeepTokenFilter = TypedDict( + "KeepTokenFilter", + { + "name": Required[str], + "keepWords": Required[list[str]], + "keepWordsCase": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.KeepTokenFilter"]], + }, + total=False, +) +KeepTokenFilter.__doc__ = """A token filter that only keeps tokens with text contained in a specified list of words. This +token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar keep_words: The list of words to keep. Required. +:vartype keep_words: list[str] +:ivar lower_case_keep_words: A value indicating whether to lower case all words first. Default + is false. +:vartype lower_case_keep_words: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.KeepTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.KeepTokenFilter"] +""" + + +KeyPhraseExtractionSkill = TypedDict( + "KeyPhraseExtractionSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Union[str, "KeyPhraseExtractionSkillLanguage"], + "maxKeyPhraseCount": Optional[int], + "modelVersion": Optional[str], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.KeyPhraseExtractionSkill"]], + }, + total=False, +) +KeyPhraseExtractionSkill.__doc__ = """A skill that uses text analytics for key phrase extraction. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt-PT", + "pt-BR", "ru", "es", and "sv". +:vartype default_language_code: Union[str, "KeyPhraseExtractionSkillLanguage"] +:ivar max_key_phrase_count: A number indicating how many key phrases to return. If absent, all + identified key phrases will be returned. +:vartype max_key_phrase_count: int +:ivar model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. +:vartype model_version: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.KeyPhraseExtractionSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.KeyPhraseExtractionSkill"] +""" + + +KeywordMarkerTokenFilter = TypedDict( + "KeywordMarkerTokenFilter", + { + "name": Required[str], + "keywords": Required[list[str]], + "ignoreCase": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.KeywordMarkerTokenFilter"]], + }, + total=False, +) +KeywordMarkerTokenFilter.__doc__ = """Marks terms as keywords. This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar keywords: A list of words to mark as keywords. Required. +:vartype keywords: list[str] +:ivar ignore_case: A value indicating whether to ignore case. If true, all words are converted + to lower case first. Default is false. +:vartype ignore_case: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.KeywordMarkerTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.KeywordMarkerTokenFilter"] +""" + + +KeywordTokenizer = TypedDict( + "KeywordTokenizer", + { + "name": Required[str], + "bufferSize": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.KeywordTokenizer"]], + }, + total=False, +) +KeywordTokenizer.__doc__ = """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar buffer_size: The read buffer size in bytes. Default is 256. +:vartype buffer_size: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.KeywordTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.KeywordTokenizer"] +""" + + +KeywordTokenizerV2 = TypedDict( + "KeywordTokenizerV2", + { + "name": Required[str], + "maxTokenLength": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.KeywordTokenizerV2"]], + }, + total=False, +) +KeywordTokenizerV2.__doc__ = """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Default is 256. Tokens longer than the + maximum length are split. The maximum token length that can be used is 300 characters. +:vartype max_token_length: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.KeywordTokenizerV2". +:vartype odata_type: Literal["#Microsoft.Azure.Search.KeywordTokenizerV2"] +""" + + +KnowledgeBase = TypedDict( + "KnowledgeBase", + { + "name": Required[str], + "knowledgeSources": Required[list["KnowledgeSourceReference"]], + "models": list["KnowledgeBaseModel"], + "retrievalReasoningEffort": "KnowledgeRetrievalReasoningEffort", + "outputMode": Union[str, "KnowledgeRetrievalOutputMode"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "description": str, + "tags": dict[str, str], + "retrievalInstructions": str, + "answerInstructions": str, + "corsOptions": "CorsOptions", + "retrieveDefaults": "KnowledgeBaseRetrieveDefaults", + }, + total=False, +) +KnowledgeBase.__doc__ = """Represents a knowledge base definition. + +:ivar name: The name of the knowledge base. Required. +:vartype name: str +:ivar knowledge_sources: Knowledge sources referenced by this knowledge base. Required. +:vartype knowledge_sources: list["KnowledgeSourceReference"] +:ivar models: Contains configuration options on how to connect to AI models. +:vartype models: list["KnowledgeBaseModel"] +:ivar retrieval_reasoning_effort: The retrieval reasoning effort configuration. +:vartype retrieval_reasoning_effort: "KnowledgeRetrievalReasoningEffort" +:ivar output_mode: The output mode for the knowledge base. Known values are: "extractiveData" + and "answerSynthesis". +:vartype output_mode: Union[str, "KnowledgeRetrievalOutputMode"] +:ivar e_tag: The ETag of the knowledge base. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar description: The description of the knowledge base. +:vartype description: str +:ivar tags: User-defined key-value pairs for categorizing the knowledge base and attributing + its usage and costs. +:vartype tags: dict[str, str] +:ivar retrieval_instructions: Instructions considered by the knowledge base when developing + query plan. +:vartype retrieval_instructions: str +:ivar answer_instructions: Instructions considered by the knowledge base when generating + answers. +:vartype answer_instructions: str +:ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the knowledge + base. +:vartype cors_options: "CorsOptions" +:ivar retrieve_defaults: 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. +:vartype retrieve_defaults: "KnowledgeBaseRetrieveDefaults" +""" + + +class KnowledgeBaseAzureOpenAIModel(TypedDict, total=False): + """Specifies the Azure OpenAI resource used to do query planning. + + :ivar kind: Required. Use Azure Open AI models for query planning. + :vartype kind: Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI] + :ivar azure_open_ai_parameters: Azure OpenAI parameters. Required. + :vartype azure_open_ai_parameters: "AzureOpenAIVectorizerParameters" + """ + + kind: Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] + """Required. Use Azure Open AI models for query planning.""" + azureOpenAIParameters: Required["AzureOpenAIVectorizerParameters"] + """Azure OpenAI parameters. Required.""" + + +class KnowledgeBaseRetrieveDefaults(TypedDict, total=False): + """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. + + :ivar max_runtime_in_seconds: The default maximum runtime in seconds for a retrieve request. + :vartype max_runtime_in_seconds: int + :ivar max_output_documents: The default maximum number of documents in the retrieve output. + :vartype max_output_documents: int + :ivar max_output_size_in_tokens: The default maximum size, in tokens, of the content in the + retrieve output. + :vartype max_output_size_in_tokens: int + """ + + maxRuntimeInSeconds: int + """The default maximum runtime in seconds for a retrieve request.""" + maxOutputDocuments: int + """The default maximum number of documents in the retrieve output.""" + maxOutputSizeInTokens: int + """The default maximum size, in tokens, of the content in the retrieve output.""" + + +class KnowledgeSourceReference(TypedDict, total=False): + """Reference to a knowledge source. + + :ivar name: The name of the knowledge source. Required. + :vartype name: str + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar enable_freshness: 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. + :vartype enable_freshness: bool + """ + + name: Required[str] + """The name of the knowledge source. Required.""" + enableImageServing: bool + """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.""" + enableFreshness: bool + """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.""" + + +LanguageDetectionSkill = TypedDict( + "LanguageDetectionSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultCountryHint": Optional[str], + "modelVersion": Optional[str], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.LanguageDetectionSkill"]], + }, + total=False, +) +LanguageDetectionSkill.__doc__ = """A skill that detects the language of input text and reports a single language code for every +document submitted on the request. The language code is paired with a score indicating the +confidence of the analysis. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_country_hint: A country code to use as a hint to the language detection model if + it cannot disambiguate the language. +:vartype default_country_hint: str +:ivar model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. +:vartype model_version: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.LanguageDetectionSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.LanguageDetectionSkill"] +""" + + +LengthTokenFilter = TypedDict( + "LengthTokenFilter", + { + "name": Required[str], + "min": int, + "max": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.LengthTokenFilter"]], + }, + total=False, +) +LengthTokenFilter.__doc__ = """Removes words that are too long or too short. This token filter is implemented using Apache +Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be less + than the value of max. +:vartype min_length: int +:ivar max_length: The maximum length in characters. Default and maximum is 300. +:vartype max_length: int +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.LengthTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.LengthTokenFilter"] +""" + + +LimitTokenFilter = TypedDict( + "LimitTokenFilter", + { + "name": Required[str], + "maxTokenCount": int, + "consumeAllTokens": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.LimitTokenFilter"]], + }, + total=False, +) +LimitTokenFilter.__doc__ = """Limits the number of tokens while indexing. This token filter is implemented using Apache +Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_count: The maximum number of tokens to produce. Default is 1. +:vartype max_token_count: int +:ivar consume_all_tokens: A value indicating whether all tokens from the input must be consumed + even if maxTokenCount is reached. Default is false. +:vartype consume_all_tokens: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.LimitTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.LimitTokenFilter"] +""" + + +LuceneStandardAnalyzer = TypedDict( + "LuceneStandardAnalyzer", + { + "name": Required[str], + "maxTokenLength": int, + "stopwords": list[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StandardAnalyzer"]], + }, + total=False, +) +LuceneStandardAnalyzer.__doc__ = """Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop +filter. + +:ivar name: The name of the analyzer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the + maximum length are split. The maximum token length that can be used is 300 characters. +:vartype max_token_length: int +:ivar stopwords: A list of stopwords. +:vartype stopwords: list[str] +:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is + "#Microsoft.Azure.Search.StandardAnalyzer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StandardAnalyzer"] +""" + + +LuceneStandardTokenizer = TypedDict( + "LuceneStandardTokenizer", + { + "name": Required[str], + "maxTokenLength": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StandardTokenizer"]], + }, + total=False, +) +LuceneStandardTokenizer.__doc__ = """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using +Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the + maximum length are split. +:vartype max_token_length: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.StandardTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StandardTokenizer"] +""" + + +LuceneStandardTokenizerV2 = TypedDict( + "LuceneStandardTokenizerV2", + { + "name": Required[str], + "maxTokenLength": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StandardTokenizerV2"]], + }, + total=False, +) +LuceneStandardTokenizerV2.__doc__ = """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using +Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the + maximum length are split. The maximum token length that can be used is 300 characters. +:vartype max_token_length: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.StandardTokenizerV2". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StandardTokenizerV2"] +""" + + +class MagnitudeScoringFunction(TypedDict, total=False): + """Defines a function that boosts scores based on the magnitude of a numeric field. + + :ivar field_name: The name of the field used as input to the scoring function. Required. + :vartype field_name: str + :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + :ivar interpolation: A value indicating how boosting will be interpolated across document + scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and + "logarithmic". + :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] + :ivar parameters: Parameter values for the magnitude scoring function. Required. + :vartype parameters: "MagnitudeScoringParameters" + :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, + distance, and tag. The function type must be lower case. Required. Default value is + "magnitude". + :vartype type: Literal["magnitude"] + """ + + fieldName: Required[str] + """The name of the field used as input to the scoring function. Required.""" + boost: Required[float] + """A multiplier for the raw score. Must be a positive number not equal to 1.0. Required.""" + interpolation: Union[str, "ScoringFunctionInterpolation"] + """A value indicating how boosting will be interpolated across document scores; defaults to + \"Linear\". Known values are: \"linear\", \"constant\", \"quadratic\", and \"logarithmic\".""" + magnitude: Required["MagnitudeScoringParameters"] + """Parameter values for the magnitude scoring function. Required.""" + type: Required[Literal["magnitude"]] + """Indicates the type of function to use. Valid values include magnitude, freshness, distance, and + tag. The function type must be lower case. Required. Default value is \"magnitude\".""" + + +class MagnitudeScoringParameters(TypedDict, total=False): + """Provides parameter values to a magnitude scoring function. + + :ivar boosting_range_start: The field value at which boosting starts. Required. + :vartype boosting_range_start: float + :ivar boosting_range_end: The field value at which boosting ends. Required. + :vartype boosting_range_end: float + :ivar should_boost_beyond_range_by_constant: A value indicating whether to apply a constant + boost for field values beyond the range end value; default is false. + :vartype should_boost_beyond_range_by_constant: bool + """ + + boostingRangeStart: Required[float] + """The field value at which boosting starts. Required.""" + boostingRangeEnd: Required[float] + """The field value at which boosting ends. Required.""" + constantBoostBeyondRange: bool + """A value indicating whether to apply a constant boost for field values beyond the range end + value; default is false.""" + + +MappingCharFilter = TypedDict( + "MappingCharFilter", + { + "name": Required[str], + "mappings": Required[list[str]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.MappingCharFilter"]], + }, + total=False, +) +MappingCharFilter.__doc__ = """A character filter that applies mappings defined with the mappings option. Matching is greedy +(longest pattern matching at a given point wins). Replacement is allowed to be the empty +string. This character filter is implemented using Apache Lucene. + +:ivar name: The name of the char filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar mappings: A list of mappings of the following format: "a=>b" (all occurrences of the + character "a" will be replaced with character "b"). Required. +:vartype mappings: list[str] +:ivar odata_type: A URI fragment specifying the type of char filter. Required. Default value is + "#Microsoft.Azure.Search.MappingCharFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.MappingCharFilter"] +""" + + +class McpServerAutoOutputParsing(TypedDict, total=False): + """Automatically detect the output format and parse accordingly. + + :ivar kind: The discriminator value. Required. Automatically detect the output format and parse + accordingly. + :vartype kind: Literal[McpServerOutputParsingKind.AUTO] + """ + + kind: Required[Literal[McpServerOutputParsingKind.AUTO]] + """The discriminator value. Required. Automatically detect the output format and parse + accordingly.""" + + +class McpServerFoundryConnectionAuthentication(TypedDict, total=False): + """Authentication using an Azure AI Foundry connection. + + :ivar kind: The discriminator value. Required. Authenticate using an Azure AI Foundry + connection. + :vartype kind: Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION] + :ivar foundry_connection_parameters: Parameters for Foundry connection authentication. + Required. + :vartype foundry_connection_parameters: "McpServerFoundryConnectionParameters" + """ + + kind: Required[Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION]] + """The discriminator value. Required. Authenticate using an Azure AI Foundry connection.""" + foundryConnectionParameters: Required["McpServerFoundryConnectionParameters"] + """Parameters for Foundry connection authentication. Required.""" + + +class McpServerFoundryConnectionParameters(TypedDict, total=False): + """Parameters for Foundry connection authentication. + + :ivar connection_id: The Azure AI Foundry connection identifier. + :vartype connection_id: str + """ + + connectionId: str + """The Azure AI Foundry connection identifier.""" + + +class McpServerHeaders(TypedDict, total=False): + """A dictionary of HTTP header names and values.""" + + +class McpServerJsonOutputParsing(TypedDict, total=False): + """Parse the output as a JSON document using the configured JSON parameters. + + :ivar kind: The discriminator value. Required. Parse the output as a JSON document using the + configured JSON parameters. + :vartype kind: Literal[McpServerOutputParsingKind.JSON] + :ivar json_parameters: Parameters for JSON output parsing. Required when kind is 'json'. + Required. + :vartype json_parameters: "McpServerOutputParsingJsonParameters" + """ + + kind: Required[Literal[McpServerOutputParsingKind.JSON]] + """The discriminator value. Required. Parse the output as a JSON document using the configured + JSON parameters.""" + jsonParameters: Required["McpServerOutputParsingJsonParameters"] + """Parameters for JSON output parsing. Required when kind is 'json'. Required.""" + + +McpServerKnowledgeSource = TypedDict( + "McpServerKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.MCP_SERVER]], + "mcpServerParameters": Required["McpServerKnowledgeSourceParameters"], + }, + total=False, +) +McpServerKnowledgeSource.__doc__ = """Configuration for a knowledge source backed by an MCP (Model Context Protocol) server. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: The discriminator value. Required. A knowledge source backed by an MCP (Model + Context Protocol) server. +:vartype kind: Literal[KnowledgeSourceKind.MCP_SERVER] +:ivar mcp_server_parameters: The parameters for the MCP server knowledge source. Required. +:vartype mcp_server_parameters: "McpServerKnowledgeSourceParameters" +""" + + +class McpServerKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for an MCP server knowledge source. + + :ivar server_url: The URL of the MCP server endpoint. Required. + :vartype server_url: str + :ivar authentication: The authentication configuration for the MCP server. + :vartype authentication: "McpServerAuthentication" + :ivar tools: The list of tools to invoke on the MCP server. Required. + :vartype tools: list["McpServerTool"] + """ + + serverURL: Required[str] + """The URL of the MCP server endpoint. Required.""" + authentication: "McpServerAuthentication" + """The authentication configuration for the MCP server.""" + tools: Required[list["McpServerTool"]] + """The list of tools to invoke on the MCP server. Required.""" + + +class McpServerNoneOutputParsing(TypedDict, total=False): + """Treat the output as a single block without any parsing. + + :ivar kind: The discriminator value. Required. Treat the output as a single block without any + parsing. + :vartype kind: Literal[McpServerOutputParsingKind.NONE] + """ + + kind: Required[Literal[McpServerOutputParsingKind.NONE]] + """The discriminator value. Required. Treat the output as a single block without any parsing.""" + + +class McpServerOutputParsingJsonParameters(TypedDict, total=False): + """Parameters for JSON output parsing. + + :ivar documents_path: The JSON path to the array of documents in the tool output. Required. + :vartype documents_path: str + :ivar include_context: Whether to include surrounding context from the JSON output alongside + extracted documents. + :vartype include_context: bool + """ + + documentsPath: Required[str] + """The JSON path to the array of documents in the tool output. Required.""" + includeContext: bool + """Whether to include surrounding context from the JSON output alongside extracted documents.""" + + +class McpServerOutputParsingSplitParameters(TypedDict, total=False): + """Parameters for split output parsing. + + :ivar text_split_mode: The text split mode to use. Known values are: "pages" and "sentences". + :vartype text_split_mode: Union[str, "TextSplitMode"] + :ivar maximum_page_length: The maximum number of characters per page. + :vartype maximum_page_length: int + :ivar page_overlap_length: The number of characters to overlap between pages. + :vartype page_overlap_length: int + :ivar maximum_pages_to_take: The maximum number of pages to take from the output. + :vartype maximum_pages_to_take: int + :ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "am", "bs", "cs", "da", "de", "en", "es", "et", "fi", "fr", "he", "hi", "hr", + "hu", "id", "is", "it", "ja", "ko", "lv", "nb", "nl", "pl", "pt", "pt-br", "ru", "sk", "sl", + "sr", "sv", "tr", "ur", and "zh". + :vartype default_language_code: Union[str, "SplitSkillLanguage"] + """ + + textSplitMode: Union[str, "TextSplitMode"] + """The text split mode to use. Known values are: \"pages\" and \"sentences\".""" + maximumPageLength: int + """The maximum number of characters per page.""" + pageOverlapLength: int + """The number of characters to overlap between pages.""" + maximumPagesToTake: int + """The maximum number of pages to take from the output.""" + defaultLanguageCode: Union[str, "SplitSkillLanguage"] + """A value indicating which language code to use. Default is ``en``. Known values are: \"am\", + \"bs\", \"cs\", \"da\", \"de\", \"en\", \"es\", \"et\", \"fi\", \"fr\", \"he\", \"hi\", \"hr\", + \"hu\", \"id\", \"is\", \"it\", \"ja\", \"ko\", \"lv\", \"nb\", \"nl\", \"pl\", \"pt\", + \"pt-br\", \"ru\", \"sk\", \"sl\", \"sr\", \"sv\", \"tr\", \"ur\", and \"zh\".""" + + +class McpServerSplitOutputParsing(TypedDict, total=False): + """Split the output into pages using the configured split parameters. + + :ivar kind: The discriminator value. Required. Split the output into pages using the configured + split parameters. + :vartype kind: Literal[McpServerOutputParsingKind.SPLIT] + :ivar split_parameters: Parameters for split output parsing. + :vartype split_parameters: "McpServerOutputParsingSplitParameters" + """ + + kind: Required[Literal[McpServerOutputParsingKind.SPLIT]] + """The discriminator value. Required. Split the output into pages using the configured split + parameters.""" + splitParameters: "McpServerOutputParsingSplitParameters" + """Parameters for split output parsing.""" + + +class McpServerStoredHeadersAuthentication(TypedDict, total=False): + """Authentication using stored HTTP headers. + + :ivar kind: The discriminator value. Required. Authenticate using stored HTTP headers. + :vartype kind: Literal[McpServerAuthenticationKind.STORED_HEADERS] + :ivar stored_headers_parameters: Parameters for stored headers authentication. Required. + :vartype stored_headers_parameters: "McpServerStoredHeadersParameters" + """ + + kind: Required[Literal[McpServerAuthenticationKind.STORED_HEADERS]] + """The discriminator value. Required. Authenticate using stored HTTP headers.""" + storedHeadersParameters: Required["McpServerStoredHeadersParameters"] + """Parameters for stored headers authentication. Required.""" + + +class McpServerStoredHeadersParameters(TypedDict, total=False): + """Parameters for stored headers authentication. + + :ivar headers: The stored HTTP headers to include in MCP server requests. + :vartype headers: "McpServerHeaders" + """ + + headers: "McpServerHeaders" + """The stored HTTP headers to include in MCP server requests.""" + + +class McpServerTool(TypedDict, total=False): + """Represents a single tool within an MCP server knowledge source. + + :ivar name: The name of the MCP tool to invoke. + :vartype name: str + :ivar output_parsing: Optional configuration for parsing the tool's output. + :vartype output_parsing: "McpServerOutputParsing" + :ivar results_processing: Controls whether the parsed results from this tool are reranked. + Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_tokens: Optional post-parsing token cap for this tool's output. Must be + greater than 0 when specified. + :vartype max_output_tokens: int + """ + + name: str + """The name of the MCP tool to invoke.""" + outputParsing: "McpServerOutputParsing" + """Optional configuration for parsing the tool's output.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Controls whether the parsed results from this tool are reranked. Defaults to 'rerank' when not + specified. Known values are: \"rerank\" and \"none\".""" + maxOutputTokens: int + """Optional post-parsing token cap for this tool's output. Must be greater than 0 when specified.""" + + +MergeSkill = TypedDict( + "MergeSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "insertPreTag": str, + "insertPostTag": str, + "@odata.type": Required[Literal["#Microsoft.Skills.Text.MergeSkill"]], + }, + total=False, +) +MergeSkill.__doc__ = """A skill for merging two or more strings into a single unified string, with an optional +user-defined delimiter separating each component part. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is an + empty space. +:vartype insert_pre_tag: str +:ivar insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an + empty space. +:vartype insert_post_tag: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.MergeSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.MergeSkill"] +""" + + +MicrosoftLanguageStemmingTokenizer = TypedDict( + "MicrosoftLanguageStemmingTokenizer", + { + "name": Required[str], + "maxTokenLength": int, + "isSearchTokenizer": bool, + "language": Union[str, "MicrosoftStemmingTokenizerLanguage"], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"]], + }, + total=False, +) +MicrosoftLanguageStemmingTokenizer.__doc__ = """Divides text using language-specific rules and reduces words to their base forms. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Tokens longer than the maximum length are + split. Maximum token length that can be used is 300 characters. Tokens longer than 300 + characters are first split into tokens of length 300 and then each of those tokens is split + based on the max token length set. Default is 255. +:vartype max_token_length: int +:ivar is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as + the search tokenizer, set to false if used as the indexing tokenizer. Default is false. +:vartype is_search_tokenizer: bool +:ivar language: The language to use. The default is English. Known values are: "arabic", + "bangla", "bulgarian", "catalan", "croatian", "czech", "danish", "dutch", "english", + "estonian", "finnish", "french", "german", "greek", "gujarati", "hebrew", "hindi", "hungarian", + "icelandic", "indonesian", "italian", "kannada", "latvian", "lithuanian", "malay", "malayalam", + "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", + "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", + "swedish", "tamil", "telugu", "turkish", "ukrainian", and "urdu". +:vartype language: Union[str, "MicrosoftStemmingTokenizerLanguage"] +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"] +""" + + +MicrosoftLanguageTokenizer = TypedDict( + "MicrosoftLanguageTokenizer", + { + "name": Required[str], + "maxTokenLength": int, + "isSearchTokenizer": bool, + "language": Union[str, "MicrosoftTokenizerLanguage"], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"]], + }, + total=False, +) +MicrosoftLanguageTokenizer.__doc__ = """Divides text using language-specific rules. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Tokens longer than the maximum length are + split. Maximum token length that can be used is 300 characters. Tokens longer than 300 + characters are first split into tokens of length 300 and then each of those tokens is split + based on the max token length set. Default is 255. +:vartype max_token_length: int +:ivar is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as + the search tokenizer, set to false if used as the indexing tokenizer. Default is false. +:vartype is_search_tokenizer: bool +:ivar language: The language to use. The default is English. Known values are: "bangla", + "bulgarian", "catalan", "chineseSimplified", "chineseTraditional", "croatian", "czech", + "danish", "dutch", "english", "french", "german", "greek", "gujarati", "hindi", "icelandic", + "indonesian", "italian", "japanese", "kannada", "korean", "malay", "malayalam", "marathi", + "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", + "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", + "telugu", "thai", "ukrainian", "urdu", and "vietnamese". +:vartype language: Union[str, "MicrosoftTokenizerLanguage"] +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"] +""" + + +NativeBlobSoftDeleteDeletionDetectionPolicy = TypedDict( + "NativeBlobSoftDeleteDeletionDetectionPolicy", + { + "@odata.type": Required[Literal["#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy"]], + }, + total=False, +) +NativeBlobSoftDeleteDeletionDetectionPolicy.__doc__ = """Defines a data deletion detection policy utilizing Azure Blob Storage's native soft delete +feature for deletion detection. + +:ivar odata_type: A URI fragment specifying the type of data deletion detection policy. + Required. Default value is + "#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy". +:vartype odata_type: + Literal["#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy"] +""" + + +NGramTokenFilter = TypedDict( + "NGramTokenFilter", + { + "name": Required[str], + "minGram": int, + "maxGram": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.NGramTokenFilter"]], + }, + total=False, +) +NGramTokenFilter.__doc__ = """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_gram: The minimum n-gram length. Default is 1. Must be less than the value of + maxGram. +:vartype min_gram: int +:ivar max_gram: The maximum n-gram length. Default is 2. +:vartype max_gram: int +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.NGramTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.NGramTokenFilter"] +""" + + +NGramTokenFilterV2 = TypedDict( + "NGramTokenFilterV2", + { + "name": Required[str], + "minGram": int, + "maxGram": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.NGramTokenFilterV2"]], + }, + total=False, +) +NGramTokenFilterV2.__doc__ = """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + value of maxGram. +:vartype min_gram: int +:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype max_gram: int +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.NGramTokenFilterV2". +:vartype odata_type: Literal["#Microsoft.Azure.Search.NGramTokenFilterV2"] +""" + + +NGramTokenizer = TypedDict( + "NGramTokenizer", + { + "name": Required[str], + "minGram": int, + "maxGram": int, + "tokenChars": list[Union[str, "TokenCharacterKind"]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.NGramTokenizer"]], + }, + total=False, +) +NGramTokenizer.__doc__ = """Tokenizes the input into n-grams of the given size(s). This tokenizer is implemented using +Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the + value of maxGram. +:vartype min_gram: int +:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype max_gram: int +:ivar token_chars: Character classes to keep in the tokens. +:vartype token_chars: list[Union[str, "TokenCharacterKind"]] +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.NGramTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.NGramTokenizer"] +""" + + +OcrSkill = TypedDict( + "OcrSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Union[str, "OcrSkillLanguage"], + "detectOrientation": bool, + "lineEnding": Union[str, "OcrLineEnding"], + "@odata.type": Required[Literal["#Microsoft.Skills.Vision.OcrSkill"]], + }, + total=False, +) +OcrSkill.__doc__ = """A skill that extracts text from image files. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "af", "sq", "anp", "ar", "ast", "awa", "az", "bfy", "eu", "be", "be-cyrl", + "be-latn", "bho", "bi", "brx", "bs", "bra", "br", "bg", "bns", "bua", "ca", "ceb", "rab", "ch", + "hne", "zh-Hans", "zh-Hant", "kw", "co", "crh", "hr", "cs", "da", "prs", "dhi", "doi", "nl", + "en", "myv", "et", "fo", "fj", "fil", "fi", "fr", "fur", "gag", "gl", "de", "gil", "gon", "el", + "kl", "gvr", "ht", "hlb", "hni", "bgc", "haw", "hi", "mww", "hoc", "hu", "is", "smn", "id", + "ia", "iu", "ga", "it", "ja", "Jns", "jv", "kea", "kac", "xnr", "krc", "kaa-cyrl", "kaa", + "csb", "kk-cyrl", "kk-latn", "klr", "kha", "quc", "ko", "kfq", "kpy", "kos", "kum", "ku-arab", + "ku-latn", "kru", "ky", "lkt", "la", "lt", "dsb", "smj", "lb", "bfz", "ms", "mt", "kmj", "gv", + "mi", "mr", "mn", "cnr-cyrl", "cnr-latn", "nap", "ne", "niu", "nog", "sme", "nb", "no", "oc", + "os", "ps", "fa", "pl", "pt", "pa", "ksh", "ro", "rm", "ru", "sck", "sm", "sa", "sat", "sco", + "gd", "sr", "sr-Cyrl", "sr-Latn", "xsr", "srx", "sms", "sk", "sl", "so", "sma", "es", "sw", + "sv", "tg", "tt", "tet", "thf", "to", "tr", "tk", "tyv", "hsb", "ur", "ug", "uz-arab", + "uz-cyrl", "uz", "vo", "wae", "cy", "fy", "yua", "za", "zu", and "unk". +:vartype default_language_code: Union[str, "OcrSkillLanguage"] +:ivar should_detect_orientation: A value indicating to turn orientation detection on or not. + Default is false. +:vartype should_detect_orientation: bool +:ivar line_ending: Defines the sequence of characters to use between the lines of text + recognized by the OCR skill. The default value is "space". Known values are: "space", + "carriageReturn", "lineFeed", and "carriageReturnLineFeed". +:vartype line_ending: Union[str, "OcrLineEnding"] +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Vision.OcrSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Vision.OcrSkill"] +""" + + +class OutputFieldMappingEntry(TypedDict, total=False): + """Output field mapping for a skill. + + :ivar name: The name of the output defined by the skill. Required. + :vartype name: str + :ivar target_name: The target name of the output. It is optional and default to name. + :vartype target_name: str + """ + + name: Required[str] + """The name of the output defined by the skill. Required.""" + targetName: str + """The target name of the output. It is optional and default to name.""" + + +PathHierarchyTokenizerV2 = TypedDict( + "PathHierarchyTokenizerV2", + { + "name": Required[str], + "delimiter": str, + "replacement": str, + "maxTokenLength": int, + "reverse": bool, + "skip": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PathHierarchyTokenizerV2"]], + }, + total=False, +) +PathHierarchyTokenizerV2.__doc__ = """Tokenizer for path-like hierarchies. This tokenizer is implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar delimiter: The delimiter character to use. Default is "/". +:vartype delimiter: str +:ivar replacement: A value that, if set, replaces the delimiter character. Default is "/". +:vartype replacement: str +:ivar max_token_length: The maximum token length. Default and maximum is 300. +:vartype max_token_length: int +:ivar reverse_token_order: A value indicating whether to generate tokens in reverse order. + Default is false. +:vartype reverse_token_order: bool +:ivar number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. +:vartype number_of_tokens_to_skip: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.PathHierarchyTokenizerV2". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PathHierarchyTokenizerV2"] +""" + + +PatternAnalyzer = TypedDict( + "PatternAnalyzer", + { + "name": Required[str], + "lowercase": bool, + "pattern": str, + "flags": list[Union[str, "RegexFlags"]], + "stopwords": list[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PatternAnalyzer"]], + }, + total=False, +) +PatternAnalyzer.__doc__ = """Flexibly separates text into terms via a regular expression pattern. This analyzer is +implemented using Apache Lucene. + +:ivar name: The name of the analyzer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar lower_case_terms: A value indicating whether terms should be lower-cased. Default is + true. +:vartype lower_case_terms: bool +:ivar pattern: A regular expression pattern to match token separators. Default is an expression + that matches one or more non-word characters. +:vartype pattern: str +:ivar flags: Regular expression flags, specified as a '|' separated string of RegexFlags + values. +:vartype flags: list[Union[str, "RegexFlags"]] +:ivar stopwords: A list of stopwords. +:vartype stopwords: list[str] +:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is + "#Microsoft.Azure.Search.PatternAnalyzer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternAnalyzer"] +""" + + +PatternCaptureTokenFilter = TypedDict( + "PatternCaptureTokenFilter", + { + "name": Required[str], + "patterns": Required[list[str]], + "preserveOriginal": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PatternCaptureTokenFilter"]], + }, + total=False, +) +PatternCaptureTokenFilter.__doc__ = """Uses Java regexes to emit multiple tokens - one for each capture group in one or more patterns. +This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar patterns: A list of patterns to match against each token. Required. +:vartype patterns: list[str] +:ivar preserve_original: A value indicating whether to return the original token even if one of + the patterns matches. Default is true. +:vartype preserve_original: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.PatternCaptureTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternCaptureTokenFilter"] +""" + + +PatternReplaceCharFilter = TypedDict( + "PatternReplaceCharFilter", + { + "name": Required[str], + "pattern": Required[str], + "replacement": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PatternReplaceCharFilter"]], + }, + total=False, +) +PatternReplaceCharFilter.__doc__ = """A character filter that replaces characters in the input string. It uses a regular expression +to identify character sequences to preserve and a replacement pattern to identify characters to +replace. For example, given the input text "aa bb aa bb", pattern "(aa)\\\\s+(bb)", and +replacement "$1#$2", the result would be "aa#bb aa#bb". This character filter is implemented +using Apache Lucene. + +:ivar name: The name of the char filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar pattern: A regular expression pattern. Required. +:vartype pattern: str +:ivar replacement: The replacement text. Required. +:vartype replacement: str +:ivar odata_type: A URI fragment specifying the type of char filter. Required. Default value is + "#Microsoft.Azure.Search.PatternReplaceCharFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternReplaceCharFilter"] +""" + + +PatternReplaceTokenFilter = TypedDict( + "PatternReplaceTokenFilter", + { + "name": Required[str], + "pattern": Required[str], + "replacement": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PatternReplaceTokenFilter"]], + }, + total=False, +) +PatternReplaceTokenFilter.__doc__ = """A character filter that replaces characters in the input string. It uses a regular expression +to identify character sequences to preserve and a replacement pattern to identify characters to +replace. For example, given the input text "aa bb aa bb", pattern "(aa)\\\\s+(bb)", and +replacement "$1#$2", the result would be "aa#bb aa#bb". This token filter is implemented using +Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar pattern: A regular expression pattern. Required. +:vartype pattern: str +:ivar replacement: The replacement text. Required. +:vartype replacement: str +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.PatternReplaceTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternReplaceTokenFilter"] +""" + + +PatternTokenizer = TypedDict( + "PatternTokenizer", + { + "name": Required[str], + "pattern": str, + "flags": list[Union[str, "RegexFlags"]], + "group": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PatternTokenizer"]], + }, + total=False, +) +PatternTokenizer.__doc__ = """Tokenizer that uses regex pattern matching to construct distinct tokens. This tokenizer is +implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar pattern: A regular expression pattern to match token separators. Default is an expression + that matches one or more non-word characters. +:vartype pattern: str +:ivar flags: Regular expression flags, specified as a '|' separated string of RegexFlags + values. +:vartype flags: list[Union[str, "RegexFlags"]] +:ivar group: The zero-based ordinal of the matching group in the regular expression pattern to + extract into tokens. Use -1 if you want to use the entire pattern to split the input into + tokens, irrespective of matching groups. Default is -1. +:vartype group: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.PatternTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternTokenizer"] +""" + + +PhoneticTokenFilter = TypedDict( + "PhoneticTokenFilter", + { + "name": Required[str], + "encoder": Union[str, "PhoneticEncoder"], + "replace": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.PhoneticTokenFilter"]], + }, + total=False, +) +PhoneticTokenFilter.__doc__ = """Create tokens for phonetic matches. This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar encoder: The phonetic encoder to use. Default is "metaphone". Known values are: + "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", + "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", and "beiderMorse". +:vartype encoder: Union[str, "PhoneticEncoder"] +:ivar replace_original_tokens: A value indicating whether encoded tokens should replace + original tokens. If false, encoded tokens are added as synonyms. Default is true. +:vartype replace_original_tokens: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.PhoneticTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.PhoneticTokenFilter"] +""" + + +PIIDetectionSkill = TypedDict( + "PIIDetectionSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Optional[str], + "minimumPrecision": float, + "maskingMode": Union[str, "PIIDetectionSkillMaskingMode"], + "maskingCharacter": str, + "modelVersion": Optional[str], + "piiCategories": list[str], + "domain": Optional[str], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.PIIDetectionSkill"]], + }, + total=False, +) +PIIDetectionSkill.__doc__ = """Using the Text Analytics API, extracts personal information from an input text and gives you +the option of masking it. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:vartype default_language_code: str +:ivar minimum_precision: A value between 0 and 1 that be used to only include entities whose + confidence score is greater than the value specified. If not set (default), or if explicitly + set to null, all entities will be included. +:vartype minimum_precision: float +:ivar masking_mode: A parameter that provides various ways to mask the personal information + detected in the input text. Default is 'none'. Known values are: "none" and "replace". +:vartype masking_mode: Union[str, "PIIDetectionSkillMaskingMode"] +:ivar mask: The character used to mask the text if the maskingMode parameter is set to replace. + Default is '*'. +:vartype mask: str +:ivar model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. +:vartype model_version: str +:ivar pii_categories: A list of PII entity categories that should be extracted and masked. +:vartype pii_categories: list[str] +:ivar domain: If specified, will set the PII domain to include only a subset of the entity + categories. Possible values include: 'phi', 'none'. Default is 'none'. +:vartype domain: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.PIIDetectionSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.PIIDetectionSkill"] +""" + + +RemoteSharePointKnowledgeSource = TypedDict( + "RemoteSharePointKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]], + "remoteSharePointParameters": "RemoteSharePointKnowledgeSourceParameters", + }, + total=False, +) +RemoteSharePointKnowledgeSource.__doc__ = """Configuration for remote SharePoint knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: Required. A knowledge source that reads data from remote SharePoint. +:vartype kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] +:ivar remote_share_point_parameters: The parameters for the remote SharePoint knowledge source. +:vartype remote_share_point_parameters: "RemoteSharePointKnowledgeSourceParameters" +""" + + +class RemoteSharePointKnowledgeSourceParameters(TypedDict, total=False): # pylint: disable=name-too-long + """Parameters for remote SharePoint knowledge source. + + :ivar filter_expression: Keyword Query Language (KQL) expression with queryable SharePoint + properties and attributes to scope the retrieval before the query runs. + :vartype filter_expression: str + :ivar resource_metadata: 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. + :vartype resource_metadata: list[str] + :ivar container_type_id: Container ID for SharePoint Embedded connection. When this is null, it + will use SharePoint Online. + :vartype container_type_id: str + """ + + filterExpression: str + """Keyword Query Language (KQL) expression with queryable SharePoint properties and attributes to + scope the retrieval before the query runs.""" + resourceMetadata: list[str] + """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.""" + containerTypeId: str + """Container ID for SharePoint Embedded connection. When this is null, it will use SharePoint + Online.""" + + +class RescoringOptions(TypedDict, total=False): + """Contains the options for rescoring. + + :ivar enable_rescoring: If set to true, after the initial search on the compressed vectors, the + similarity scores are recalculated using the full-precision vectors. This will improve recall + at the expense of latency. + :vartype enable_rescoring: bool + :ivar default_oversampling: Default oversampling factor. Oversampling retrieves a greater set + of potential documents to offset the resolution loss due to quantization. This increases the + set of results that will be rescored on full-precision vectors. Minimum value is 1, meaning no + oversampling (1x). This parameter can only be set when 'enableRescoring' is true. Higher values + improve recall at the expense of latency. + :vartype default_oversampling: float + :ivar rescore_storage_method: Controls the storage method for original vectors. This setting is + immutable. Known values are: "preserveOriginals" and "discardOriginals". + :vartype rescore_storage_method: Union[str, "VectorSearchCompressionRescoreStorageMethod"] + """ + + enableRescoring: Optional[bool] + """If set to true, after the initial search on the compressed vectors, the similarity scores are + recalculated using the full-precision vectors. This will improve recall at the expense of + latency.""" + defaultOversampling: Optional[float] + """Default oversampling factor. Oversampling retrieves a greater set of potential documents to + offset the resolution loss due to quantization. This increases the set of results that will be + rescored on full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This + parameter can only be set when 'enableRescoring' is true. Higher values improve recall at the + expense of latency.""" + rescoreStorageMethod: Optional[Union[str, "VectorSearchCompressionRescoreStorageMethod"]] + """Controls the storage method for original vectors. This setting is immutable. Known values are: + \"preserveOriginals\" and \"discardOriginals\".""" + + +class ScalarQuantizationCompression(TypedDict, total=False): + """Contains configuration options specific to the scalar quantization compression method used + during indexing and querying. + + :ivar compression_name: The name to associate with this particular configuration. Required. + :vartype compression_name: str + :ivar rescoring_options: Contains the options for rescoring. + :vartype rescoring_options: "RescoringOptions" + :ivar truncation_dimension: The number of dimensions to truncate the vectors to. Truncating the + vectors reduces the size of the vectors and the amount of data that needs to be transferred + during search. This can save storage cost and improve search performance at the expense of + recall. It should be only used for embeddings trained with Matryoshka Representation Learning + (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no + truncation. + :vartype truncation_dimension: int + :ivar parameters: Contains the parameters specific to Scalar Quantization. + :vartype parameters: "ScalarQuantizationParameters" + :ivar kind: The name of the kind of compression method being configured for use with vector + search. Required. Scalar Quantization, a type of compression method. In scalar quantization, + the original vectors values are compressed to a narrower type by discretizing and representing + each component of a vector using a reduced set of quantized values, thereby reducing the + overall data size. + :vartype kind: Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION] + """ + + name: Required[str] + """The name to associate with this particular configuration. Required.""" + rescoringOptions: Optional["RescoringOptions"] + """Contains the options for rescoring.""" + truncationDimension: Optional[int] + """The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of + the vectors and the amount of data that needs to be transferred during search. This can save + storage cost and improve search performance at the expense of recall. It should be only used + for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI + text-embedding-3-large (small). The default value is null, which means no truncation.""" + scalarQuantizationParameters: "ScalarQuantizationParameters" + """Contains the parameters specific to Scalar Quantization.""" + kind: Required[Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION]] + """The name of the kind of compression method being configured for use with vector search. + Required. Scalar Quantization, a type of compression method. In scalar quantization, the + original vectors values are compressed to a narrower type by discretizing and representing each + component of a vector using a reduced set of quantized values, thereby reducing the overall + data size.""" + + +class ScalarQuantizationParameters(TypedDict, total=False): + """Contains the parameters specific to Scalar Quantization. + + :ivar quantized_data_type: The quantized data type of compressed vector values. "int8" + :vartype quantized_data_type: Union[str, "VectorSearchCompressionTarget"] + """ + + quantizedDataType: Optional[Union[str, "VectorSearchCompressionTarget"]] + """The quantized data type of compressed vector values. \"int8\"""" + + +class ScoringProfile(TypedDict, total=False): + """Defines parameters for a search index that influence scoring in search queries. + + :ivar name: The name of the scoring profile. Required. + :vartype name: str + :ivar text_weights: Parameters that boost scoring based on text matches in certain index + fields. + :vartype text_weights: "TextWeights" + :ivar functions: The collection of functions that influence the scoring of documents. + :vartype functions: list["ScoringFunction"] + :ivar function_aggregation: A value indicating how the results of individual scoring functions + should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Known values + are: "sum", "average", "minimum", "maximum", "firstMatching", and "product". + :vartype function_aggregation: Union[str, "ScoringFunctionAggregation"] + """ + + name: Required[str] + """The name of the scoring profile. Required.""" + text: Optional["TextWeights"] + """Parameters that boost scoring based on text matches in certain index fields.""" + functions: list["ScoringFunction"] + """The collection of functions that influence the scoring of documents.""" + functionAggregation: Union[str, "ScoringFunctionAggregation"] + """A value indicating how the results of individual scoring functions should be combined. Defaults + to \"Sum\". Ignored if there are no scoring functions. Known values are: \"sum\", \"average\", + \"minimum\", \"maximum\", \"firstMatching\", and \"product\".""" + + +SearchAlias = TypedDict( + "SearchAlias", + { + "name": Required[str], + "indexes": Required[list[str]], + "@odata.etag": str, + }, + total=False, +) +SearchAlias.__doc__ = """Represents an index alias, which describes a mapping from the alias name to an index. The alias +name can be used in place of the index name for supported operations. + +:ivar name: The name of the alias. Required. +:vartype name: str +:ivar indexes: The name of the index this alias maps to. Only one index name may be specified. + Required. +:vartype indexes: list[str] +:ivar e_tag: The ETag of the alias. +:vartype e_tag: str +""" + + +class SearchField(TypedDict, total=False): + """Represents a field in an index definition, which describes the name, data type, and search + behavior of a field. + + :ivar name: The name of the field, which must be unique within the fields collection of the + index or parent field. Required. + :vartype name: str + :ivar type: The data type of the field. Required. Known values are: "Edm.String", "Edm.Int32", + "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", "Edm.GeographyPoint", + "Edm.ComplexType", "Edm.Single", "Edm.Half", "Edm.Int16", "Edm.SByte", and "Edm.Byte". + :vartype type: Union[str, "SearchFieldDataType"] + :ivar key: A value indicating whether the field uniquely identifies documents in the index. + Exactly one top-level field in each index must be chosen as the key field and it must be of + type Edm.String. Key fields can be used to look up documents directly and update or delete + specific documents. Default is false for simple fields and null for complex fields. + :vartype key: bool + :ivar retrievable: A value indicating whether the field can be returned in a search result. You + can disable this option if you want to use a field (for example, margin) as a filter, sorting, + or scoring mechanism but do not want the field to be visible to the end user. This property + must be true for key fields, and it must be null for complex fields. This property can be + changed on existing fields. Enabling this property does not cause any increase in index storage + requirements. Default is true for simple fields, false for vector fields, and null for complex + fields. + :vartype retrievable: bool + :ivar stored: An immutable value indicating whether the field will be persisted separately on + disk to be returned in a search result. You can disable this option if you don't plan to return + the field contents in a search response to save on storage overhead. This can only be set + during index creation and only for vector fields. This property cannot be changed for existing + fields or set as false for new fields. If this property is set as false, the property + 'retrievable' must also be set to false. This property must be true or unset for key fields, + for new fields, and for non-vector fields, and it must be null for complex fields. Disabling + this property will reduce index storage requirements. The default is true for vector fields. + :vartype stored: bool + :ivar searchable: A value indicating whether the field is full-text searchable. This means it + will undergo analysis such as word-breaking during indexing. If you set a searchable field to a + value like "sunny day", internally it will be split into the individual tokens "sunny" and + "day". This enables full-text searches for these terms. Fields of type Edm.String or + Collection(Edm.String) are searchable by default. This property must be false for simple fields + of other non-string data types, and it must be null for complex fields. Note: searchable fields + consume extra space in your index to accommodate additional tokenized versions of the field + value for full-text searches. If you want to save space in your index and you don't need a + field to be included in searches, set searchable to false. + :vartype searchable: bool + :ivar filterable: A value indicating whether to enable the field to be referenced in $filter + queries. filterable differs from searchable in how strings are handled. Fields of type + Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so + comparisons are for exact matches only. For example, if you set such a field f to "sunny day", + $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property + must be null for complex fields. Default is true for simple fields and null for complex fields. + :vartype filterable: bool + :ivar sortable: A value indicating whether to enable the field to be referenced in $orderby + expressions. By default, the search engine sorts results by score, but in many experiences + users will want to sort by fields in the documents. A simple field can be sortable only if it + is single-valued (it has a single value in the scope of the parent document). Simple collection + fields cannot be sortable, since they are multi-valued. Simple sub-fields of complex + collections are also multi-valued, and therefore cannot be sortable. This is true whether it's + an immediate parent field, or an ancestor field, that's the complex collection. Complex fields + cannot be sortable and the sortable property must be null for such fields. The default for + sortable is true for single-valued simple fields, false for multi-valued simple fields, and + null for complex fields. + :vartype sortable: bool + :ivar facetable: A value indicating whether to enable the field to be referenced in facet + queries. Typically used in a presentation of search results that includes hit count by category + (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so + on). This property must be null for complex fields. Fields of type Edm.GeographyPoint or + Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple + fields. + :vartype facetable: bool + :ivar permission_filter: A value indicating whether the field should be used as a permission + filter. Known values are: "userIds", "groupIds", and "rbacScope". + :vartype permission_filter: Union[str, "PermissionFilter"] + :ivar sensitivity_label_id: 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. + :vartype sensitivity_label_id: bool + :ivar sensitivity_label_name: A value indicating whether the field contains the name of a + Microsoft Purview sensitivity label applied to the document. + :vartype sensitivity_label_name: bool + :ivar source_document_id: A value indicating whether the field contains the source document + identifier used for Purview audit tracking. + :vartype source_document_id: bool + :ivar sharepoint_site_url: A value indicating whether the field contains a SharePoint site URL + used for SharePoint group-based filtering. + :vartype sharepoint_site_url: bool + :ivar analyzer_name: The name of the analyzer to use for the field. This option can be used + only with searchable fields and it can't be set together with either searchAnalyzer or + indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null + for complex fields. Known values are: "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", and + "whitespace". + :vartype analyzer_name: Union[str, "LexicalAnalyzerName"] + :ivar search_analyzer_name: The name of the analyzer used at search time for the field. This + option can be used only with searchable fields. It must be set together with indexAnalyzer and + it cannot be set together with the analyzer option. This property cannot be set to the name of + a language analyzer; use the analyzer property instead if you need a language analyzer. This + analyzer can be updated on an existing field. Must be null for complex fields. Known values + are: "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", and + "whitespace". + :vartype search_analyzer_name: Union[str, "LexicalAnalyzerName"] + :ivar index_analyzer_name: The name of the analyzer used at indexing time for the field. This + option can be used only with searchable fields. It must be set together with searchAnalyzer and + it cannot be set together with the analyzer option. This property cannot be set to the name of + a language analyzer; use the analyzer property instead if you need a language analyzer. Once + the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. + Known values are: "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", and + "whitespace". + :vartype index_analyzer_name: Union[str, "LexicalAnalyzerName"] + :ivar normalizer_name: The name of the normalizer to use for the field. This option can be used + only with fields with filterable, sortable, or facetable enabled. Once the normalizer is + chosen, it cannot be changed for the field. Must be null for complex fields. Known values are: + "asciifolding", "elision", "lowercase", "standard", and "uppercase". + :vartype normalizer_name: Union[str, "LexicalNormalizerName"] + :ivar vector_search_dimensions: The dimensionality of the vector field. + :vartype vector_search_dimensions: int + :ivar vector_search_profile_name: The name of the vector search profile that specifies the + algorithm and vectorizer to use when searching the vector field. + :vartype vector_search_profile_name: str + :ivar vector_encoding_format: The encoding format to interpret the field contents. "packedBit" + :vartype vector_encoding_format: Union[str, "VectorEncodingFormat"] + :ivar synonym_map_names: A list of the names of synonym maps to associate with this field. This + option can be used only with searchable fields. Currently only one synonym map per field is + supported. Assigning a synonym map to a field ensures that query terms targeting that field are + expanded at query-time using the rules in the synonym map. This attribute can be changed on + existing fields. Must be null or an empty collection for complex fields. + :vartype synonym_map_names: list[str] + :ivar fields: A list of sub-fields if this is a field of type Edm.ComplexType or + Collection(Edm.ComplexType). Must be null or empty for simple fields. + :vartype fields: list["SearchField"] + """ + + name: Required[str] + """The name of the field, which must be unique within the fields collection of the index or parent + field. Required.""" + type: Required[Union[str, "SearchFieldDataType"]] + """The data type of the field. Required. Known values are: \"Edm.String\", \"Edm.Int32\", + \"Edm.Int64\", \"Edm.Double\", \"Edm.Boolean\", \"Edm.DateTimeOffset\", \"Edm.GeographyPoint\", + \"Edm.ComplexType\", \"Edm.Single\", \"Edm.Half\", \"Edm.Int16\", \"Edm.SByte\", and + \"Edm.Byte\".""" + key: bool + """A value indicating whether the field uniquely identifies documents in the index. Exactly one + top-level field in each index must be chosen as the key field and it must be of type + Edm.String. Key fields can be used to look up documents directly and update or delete specific + documents. Default is false for simple fields and null for complex fields.""" + retrievable: bool + """A value indicating whether the field can be returned in a search result. You can disable this + option if you want to use a field (for example, margin) as a filter, sorting, or scoring + mechanism but do not want the field to be visible to the end user. This property must be true + for key fields, and it must be null for complex fields. This property can be changed on + existing fields. Enabling this property does not cause any increase in index storage + requirements. Default is true for simple fields, false for vector fields, and null for complex + fields.""" + stored: bool + """An immutable value indicating whether the field will be persisted separately on disk to be + returned in a search result. You can disable this option if you don't plan to return the field + contents in a search response to save on storage overhead. This can only be set during index + creation and only for vector fields. This property cannot be changed for existing fields or set + as false for new fields. If this property is set as false, the property 'retrievable' must also + be set to false. This property must be true or unset for key fields, for new fields, and for + non-vector fields, and it must be null for complex fields. Disabling this property will reduce + index storage requirements. The default is true for vector fields.""" + searchable: bool + """A value indicating whether the field is full-text searchable. This means it will undergo + analysis such as word-breaking during indexing. If you set a searchable field to a value like + \"sunny day\", internally it will be split into the individual tokens \"sunny\" and \"day\". + This enables full-text searches for these terms. Fields of type Edm.String or + Collection(Edm.String) are searchable by default. This property must be false for simple fields + of other non-string data types, and it must be null for complex fields. Note: searchable fields + consume extra space in your index to accommodate additional tokenized versions of the field + value for full-text searches. If you want to save space in your index and you don't need a + field to be included in searches, set searchable to false.""" + filterable: bool + """A value indicating whether to enable the field to be referenced in $filter queries. filterable + differs from searchable in how strings are handled. Fields of type Edm.String or + Collection(Edm.String) that are filterable do not undergo word-breaking, so comparisons are for + exact matches only. For example, if you set such a field f to \"sunny day\", $filter=f eq + 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property must be null for + complex fields. Default is true for simple fields and null for complex fields.""" + sortable: bool + """A value indicating whether to enable the field to be referenced in $orderby expressions. By + default, the search engine sorts results by score, but in many experiences users will want to + sort by fields in the documents. A simple field can be sortable only if it is single-valued (it + has a single value in the scope of the parent document). Simple collection fields cannot be + sortable, since they are multi-valued. Simple sub-fields of complex collections are also + multi-valued, and therefore cannot be sortable. This is true whether it's an immediate parent + field, or an ancestor field, that's the complex collection. Complex fields cannot be sortable + and the sortable property must be null for such fields. The default for sortable is true for + single-valued simple fields, false for multi-valued simple fields, and null for complex fields.""" + facetable: bool + """A value indicating whether to enable the field to be referenced in facet queries. Typically + used in a presentation of search results that includes hit count by category (for example, + search for digital cameras and see hits by brand, by megapixels, by price, and so on). This + property must be null for complex fields. Fields of type Edm.GeographyPoint or + Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple + fields.""" + permissionFilter: Optional[Union[str, "PermissionFilter"]] + """A value indicating whether the field should be used as a permission filter. Known values are: + \"userIds\", \"groupIds\", and \"rbacScope\".""" + sensitivityLabelId: bool + """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.""" + sensitivityLabelName: bool + """A value indicating whether the field contains the name of a Microsoft Purview sensitivity label + applied to the document.""" + sourceDocumentId: bool + """A value indicating whether the field contains the source document identifier used for Purview + audit tracking.""" + sharepointSiteUrl: bool + """A value indicating whether the field contains a SharePoint site URL used for SharePoint + group-based filtering.""" + analyzer: Optional[Union[str, "LexicalAnalyzerName"]] + """The name of the analyzer to use for the field. This option can be used only with searchable + fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the + analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Known + values are: \"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\", and \"whitespace\".""" + searchAnalyzer: Optional[Union[str, "LexicalAnalyzerName"]] + """The name of the analyzer used at search time for the field. This option can be used only with + searchable fields. It must be set together with indexAnalyzer and it cannot be set together + with the analyzer option. This property cannot be set to the name of a language analyzer; use + the analyzer property instead if you need a language analyzer. This analyzer can be updated on + an existing field. Must be null for complex fields. Known values are: \"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\", and \"whitespace\".""" + indexAnalyzer: Optional[Union[str, "LexicalAnalyzerName"]] + """The name of the analyzer used at indexing time for the field. This option can be used only with + searchable fields. It must be set together with searchAnalyzer and it cannot be set together + with the analyzer option. This property cannot be set to the name of a language analyzer; use + the analyzer property instead if you need a language analyzer. Once the analyzer is chosen, it + cannot be changed for the field. Must be null for complex fields. Known values are: + \"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\", and \"whitespace\".""" + normalizer: Optional[Union[str, "LexicalNormalizerName"]] + """The name of the normalizer to use for the field. This option can be used only with fields with + filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed + for the field. Must be null for complex fields. Known values are: \"asciifolding\", + \"elision\", \"lowercase\", \"standard\", and \"uppercase\".""" + dimensions: int + """The dimensionality of the vector field.""" + vectorSearchProfile: Optional[str] + """The name of the vector search profile that specifies the algorithm and vectorizer to use when + searching the vector field.""" + vectorEncoding: Optional[Union[str, "VectorEncodingFormat"]] + """The encoding format to interpret the field contents. \"packedBit\"""" + synonymMaps: list[str] + """A list of the names of synonym maps to associate with this field. This option can be used only + with searchable fields. Currently only one synonym map per field is supported. Assigning a + synonym map to a field ensures that query terms targeting that field are expanded at query-time + using the rules in the synonym map. This attribute can be changed on existing fields. Must be + null or an empty collection for complex fields.""" + fields: list["SearchField"] + """A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). + Must be null or empty for simple fields.""" + + +SearchIndex = TypedDict( + "SearchIndex", + { + "name": Required[str], + "description": str, + "fields": Required[list["SearchField"]], + "scoringProfiles": list["ScoringProfile"], + "defaultScoringProfile": str, + "corsOptions": Optional["CorsOptions"], + "suggesters": list["SearchSuggester"], + "analyzers": list["LexicalAnalyzer"], + "tokenizers": list["LexicalTokenizer"], + "tokenFilters": list["TokenFilter"], + "charFilters": list["CharFilter"], + "normalizers": list["LexicalNormalizer"], + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "similarity": "SimilarityAlgorithm", + "semantic": Optional["SemanticSearch"], + "vectorSearch": Optional["VectorSearch"], + "permissionFilterOption": Optional[Union[str, "SearchIndexPermissionFilterOption"]], + "purviewEnabled": Optional[bool], + "sharePointConnectorAppRegistration": "SharePointConnectorAppRegistration", + "@odata.etag": str, + }, + total=False, +) +SearchIndex.__doc__ = """Represents a search index definition, which describes the fields and search behavior of an +index. + +:ivar name: The name of the index. Required. +:vartype name: str +:ivar description: The description of the index. +:vartype description: str +:ivar fields: The fields of the index. Required. +:vartype fields: list["SearchField"] +:ivar scoring_profiles: The scoring profiles for the index. +:vartype scoring_profiles: list["ScoringProfile"] +:ivar default_scoring_profile: The name of the scoring profile to use if none is specified in + the query. If this property is not set and no scoring profile is specified in the query, then + default scoring (tf-idf) will be used. +:vartype default_scoring_profile: str +:ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. +:vartype cors_options: "CorsOptions" +:ivar suggesters: The suggesters for the index. +:vartype suggesters: list["SearchSuggester"] +:ivar analyzers: The analyzers for the index. +:vartype analyzers: list["LexicalAnalyzer"] +:ivar tokenizers: The tokenizers for the index. +:vartype tokenizers: list["LexicalTokenizer"] +:ivar token_filters: The token filters for the index. +:vartype token_filters: list["TokenFilter"] +:ivar char_filters: The character filters for the index. +:vartype char_filters: list["CharFilter"] +:ivar normalizers: The normalizers for the index. +:vartype normalizers: list["LexicalNormalizer"] +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your data when you + want full assurance that no one, not even Microsoft, can decrypt your data. Once you have + encrypted your data, it will always remain encrypted. The search service will ignore attempts + to set this property to null. You can change this property as needed if you want to rotate your + encryption key; Your data will be unaffected. Encryption with customer-managed keys is not + available for free search services, and is only available for paid services created on or after + January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar similarity: The type of similarity algorithm to be used when scoring and ranking the + documents matching a search query. The similarity algorithm can only be defined at index + creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity + algorithm is used. +:vartype similarity: "SimilarityAlgorithm" +:ivar semantic_search: Defines parameters for a search index that influence semantic + capabilities. +:vartype semantic_search: "SemanticSearch" +:ivar vector_search: Contains configuration options related to vector search. +:vartype vector_search: "VectorSearch" +:ivar permission_filter_option: A value indicating whether permission filtering is enabled for + the index. Known values are: "enabled" and "disabled". +:vartype permission_filter_option: Union[str, "SearchIndexPermissionFilterOption"] +:ivar purview_enabled: A value indicating whether Purview is enabled for the index. +:vartype purview_enabled: bool +:ivar share_point_connector_app_registration: Configures a SharePoint connector app + registration for the index, enabling document-level permissions from SharePoint. If provided, + the applicationId and federatedCredentialId properties are required. +:vartype share_point_connector_app_registration: "SharePointConnectorAppRegistration" +:ivar e_tag: The ETag of the index. +:vartype e_tag: str +""" + + +SearchIndexer = TypedDict( + "SearchIndexer", + { + "name": Required[str], + "description": str, + "dataSourceName": Required[str], + "skillsetName": str, + "targetIndexName": Required[str], + "schedule": Optional["IndexingSchedule"], + "parameters": Optional["IndexingParameters"], + "fieldMappings": list["FieldMapping"], + "outputFieldMappings": list["FieldMapping"], + "disabled": Optional[bool], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "cache": Optional["SearchIndexerCache"], + }, + total=False, +) +SearchIndexer.__doc__ = """Represents an indexer. + +:ivar name: The name of the indexer. Required. +:vartype name: str +:ivar description: The description of the indexer. +:vartype description: str +:ivar data_source_name: The name of the datasource from which this indexer reads data. + Required. +:vartype data_source_name: str +:ivar skillset_name: The name of the skillset executing with this indexer. +:vartype skillset_name: str +:ivar target_index_name: The name of the index to which this indexer writes data. Required. +:vartype target_index_name: str +:ivar schedule: The schedule for this indexer. +:vartype schedule: "IndexingSchedule" +:ivar parameters: Parameters for indexer execution. +:vartype parameters: "IndexingParameters" +:ivar field_mappings: Defines mappings between fields in the data source and corresponding + target fields in the index. +:vartype field_mappings: list["FieldMapping"] +:ivar output_field_mappings: Output field mappings are applied after enrichment and immediately + before indexing. +:vartype output_field_mappings: list["FieldMapping"] +:ivar is_disabled: A value indicating whether the indexer is disabled. Default is false. +:vartype is_disabled: bool +:ivar e_tag: The ETag of the indexer. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your indexer + definition (as well as indexer execution status) when you want full assurance that no one, not + even Microsoft, can decrypt them. Once you have encrypted your indexer definition, it will + always remain encrypted. The search service will ignore attempts to set this property to null. + You can change this property as needed if you want to rotate your encryption key; Your indexer + definition (and indexer execution status) will be unaffected. Encryption with customer-managed + keys is not available for free search services, and is only available for paid services created + on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar cache: Adds caching to an enrichment pipeline to allow for incremental modification steps + without having to rebuild the index every time. +:vartype cache: "SearchIndexerCache" +""" + + +class SearchIndexerCache(TypedDict, total=False): + """The type of the cache. + + :ivar id: A guid for the SearchIndexerCache. + :vartype id: str + :ivar storage_connection_string: The connection string to the storage account where the cache + data will be persisted. + :vartype storage_connection_string: str + :ivar enable_reprocessing: Specifies whether incremental reprocessing is enabled. + :vartype enable_reprocessing: bool + :ivar identity: 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. + :vartype identity: "SearchIndexerDataIdentity" + """ + + id: str + """A guid for the SearchIndexerCache.""" + storageConnectionString: str + """The connection string to the storage account where the cache data will be persisted.""" + enableReprocessing: Optional[bool] + """Specifies whether incremental reprocessing is enabled.""" + identity: Optional["SearchIndexerDataIdentity"] + """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.""" + + +class SearchIndexerDataContainer(TypedDict, total=False): + """Represents information about the entity (such as Azure SQL table or CosmosDB collection) that + will be indexed. + + :ivar name: The name of the table or view (for Azure SQL data source) or collection (for + CosmosDB data source) that will be indexed. Required. + :vartype name: str + :ivar query: A query that is applied to this data container. The syntax and meaning of this + parameter is datasource-specific. Not supported by Azure SQL datasources. + :vartype query: str + """ + + name: Required[str] + """The name of the table or view (for Azure SQL data source) or collection (for CosmosDB data + source) that will be indexed. Required.""" + query: str + """A query that is applied to this data container. The syntax and meaning of this parameter is + datasource-specific. Not supported by Azure SQL datasources.""" + + +SearchIndexerDataNoneIdentity = TypedDict( + "SearchIndexerDataNoneIdentity", + { + "@odata.type": Required[Literal["#Microsoft.Azure.Search.DataNoneIdentity"]], + }, + total=False, +) +SearchIndexerDataNoneIdentity.__doc__ = """Clears the identity property of a datasource. + +:ivar odata_type: The discriminator for derived types. Required. Default value is + "#Microsoft.Azure.Search.DataNoneIdentity". +:vartype odata_type: Literal["#Microsoft.Azure.Search.DataNoneIdentity"] +""" + + +SearchIndexerDataSourceConnection = TypedDict( + "SearchIndexerDataSourceConnection", + { + "name": Required[str], + "description": str, + "type": Required[Union[str, "SearchIndexerDataSourceType"]], + "subType": str, + "credentials": Required["DataSourceCredentials"], + "container": Required["SearchIndexerDataContainer"], + "identity": Optional["SearchIndexerDataIdentity"], + "indexerPermissionOptions": Optional[list[Union[str, "IndexerPermissionOption"]]], + "dataChangeDetectionPolicy": Optional["DataChangeDetectionPolicy"], + "dataDeletionDetectionPolicy": Optional["DataDeletionDetectionPolicy"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + }, + total=False, +) +SearchIndexerDataSourceConnection.__doc__ = """Represents a datasource definition, which can be used to configure an indexer. + +:ivar name: The name of the datasource. Required. +:vartype name: str +:ivar description: The description of the datasource. +:vartype description: str +:ivar type: The type of the datasource. Required. Known values are: "azuresql", "cosmosdb", + "azureblob", "azuretable", "mysql", "adlsgen2", "onelake", and "sharepoint". +:vartype type: Union[str, "SearchIndexerDataSourceType"] +:ivar sub_type: A specific type of the data source, in case the resource is capable of + different modalities. For example, 'MongoDb' for certain 'cosmosDb' accounts. +:vartype sub_type: str +:ivar credentials: Credentials for the datasource. Required. +:vartype credentials: "DataSourceCredentials" +:ivar container: The data container for the datasource. Required. +:vartype container: "SearchIndexerDataContainer" +:ivar identity: An explicit managed identity to use for this datasource. If not specified and + the connection string is a managed identity, the system-assigned managed identity is used. If + not specified, the value remains unchanged. If "none" is specified, the value of this property + is cleared. +:vartype identity: "SearchIndexerDataIdentity" +:ivar indexer_permission_options: Ingestion options with various types of permission data. +:vartype indexer_permission_options: list[Union[str, "IndexerPermissionOption"]] +:ivar data_change_detection_policy: The data change detection policy for the datasource. +:vartype data_change_detection_policy: "DataChangeDetectionPolicy" +:ivar data_deletion_detection_policy: The data deletion detection policy for the datasource. +:vartype data_deletion_detection_policy: "DataDeletionDetectionPolicy" +:ivar e_tag: The ETag of the data source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your datasource + definition when you want full assurance that no one, not even Microsoft, can decrypt your data + source definition. Once you have encrypted your data source definition, it will always remain + encrypted. The search service will ignore attempts to set this property to null. You can change + this property as needed if you want to rotate your encryption key; Your datasource definition + will be unaffected. Encryption with customer-managed keys is not available for free search + services, and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +""" + + +SearchIndexerDataUserAssignedIdentity = TypedDict( + "SearchIndexerDataUserAssignedIdentity", + { + "userAssignedIdentity": Required[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.DataUserAssignedIdentity"]], + "federatedIdentityClientId": str, + }, + total=False, +) +SearchIndexerDataUserAssignedIdentity.__doc__ = """Specifies the identity for a datasource to use. + +:ivar resource_id: The fully qualified Azure resource Id of a user assigned managed identity + typically in the form + "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" + that should have been assigned to the search service. Required. +:vartype resource_id: str +:ivar odata_type: A URI fragment specifying the type of identity. Required. Default value is + "#Microsoft.Azure.Search.DataUserAssignedIdentity". +:vartype odata_type: Literal["#Microsoft.Azure.Search.DataUserAssignedIdentity"] +:ivar federated_identity_client_id: Multi-tenant User-Assigned Managed Identity Support: The + client id of the multi-tentant App that has been configured to federate with the user-assigned + managed identity. +:vartype federated_identity_client_id: str +""" + + +class SearchIndexerIndexProjection(TypedDict, total=False): + """Definition of additional projections to secondary search indexes. + + :ivar selectors: A list of projections to be performed to secondary search indexes. Required. + :vartype selectors: list["SearchIndexerIndexProjectionSelector"] + :ivar parameters: A dictionary of index projection-specific configuration properties. Each name + is the name of a specific property. Each value must be of a primitive type. + :vartype parameters: "SearchIndexerIndexProjectionsParameters" + """ + + selectors: Required[list["SearchIndexerIndexProjectionSelector"]] + """A list of projections to be performed to secondary search indexes. Required.""" + parameters: "SearchIndexerIndexProjectionsParameters" + """A dictionary of index projection-specific configuration properties. Each name is the name of a + specific property. Each value must be of a primitive type.""" + + +class SearchIndexerIndexProjectionSelector(TypedDict, total=False): + """Description for what data to store in the designated search index. + + :ivar target_index_name: Name of the search index to project to. Must have a key field with the + 'keyword' analyzer set. Required. + :vartype target_index_name: str + :ivar parent_key_field_name: Name of the field in the search index to map the parent document's + key value to. Must be a string field that is filterable and not the key field. Required. + :vartype parent_key_field_name: str + :ivar source_context: Source context for the projections. Represents the cardinality at which + the document will be split into multiple sub documents. Required. + :vartype source_context: str + :ivar mappings: Mappings for the projection, or which source should be mapped to which field in + the target index. Required. + :vartype mappings: list["InputFieldMappingEntry"] + """ + + targetIndexName: Required[str] + """Name of the search index to project to. Must have a key field with the 'keyword' analyzer set. + Required.""" + parentKeyFieldName: Required[str] + """Name of the field in the search index to map the parent document's key value to. Must be a + string field that is filterable and not the key field. Required.""" + sourceContext: Required[str] + """Source context for the projections. Represents the cardinality at which the document will be + split into multiple sub documents. Required.""" + mappings: Required[list["InputFieldMappingEntry"]] + """Mappings for the projection, or which source should be mapped to which field in the target + index. Required.""" + + +class SearchIndexerIndexProjectionsParameters(TypedDict, total=False): + """A dictionary of index projection-specific configuration properties. Each name is the name of a + specific property. Each value must be of a primitive type. + + :ivar projection_mode: Defines behavior of the index projections in relation to the rest of the + indexer. Known values are: "skipIndexingParentDocuments" and "includeIndexingParentDocuments". + :vartype projection_mode: Union[str, "IndexProjectionMode"] + """ + + projectionMode: Union[str, "IndexProjectionMode"] + """Defines behavior of the index projections in relation to the rest of the indexer. Known values + are: \"skipIndexingParentDocuments\" and \"includeIndexingParentDocuments\".""" + + +class SearchIndexerKnowledgeStore(TypedDict, total=False): + """Definition of additional projections to azure blob, table, or files, of enriched data. + + :ivar storage_connection_string: The connection string to the storage account projections will + be stored in. Required. + :vartype storage_connection_string: str + :ivar projections: A list of additional projections to perform during indexing. Required. + :vartype projections: list["SearchIndexerKnowledgeStoreProjection"] + :ivar identity: The user-assigned managed identity used for connections to Azure Storage when + writing knowledge store projections. If the connection string indicates an identity + (ResourceId) and it's not specified, the system-assigned managed identity is used. On updates + to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", + the value of this property is cleared. + :vartype identity: "SearchIndexerDataIdentity" + :ivar parameters: 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. + :vartype parameters: "SearchIndexerKnowledgeStoreParameters" + """ + + storageConnectionString: Required[str] + """The connection string to the storage account projections will be stored in. Required.""" + projections: Required[list["SearchIndexerKnowledgeStoreProjection"]] + """A list of additional projections to perform during indexing. Required.""" + identity: Optional["SearchIndexerDataIdentity"] + """The user-assigned managed identity used for connections to Azure Storage when writing knowledge + store projections. If the connection string indicates an identity (ResourceId) and it's not + specified, the system-assigned managed identity is used. On updates to the indexer, if the + identity is unspecified, the value remains unchanged. If set to \"none\", the value of this + property is cleared.""" + parameters: "SearchIndexerKnowledgeStoreParameters" + """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.""" + + +class SearchIndexerKnowledgeStoreProjectionSelector(TypedDict, total=False): # pylint: disable=name-too-long + """Abstract class to share properties between concrete selectors. + + :ivar reference_key_name: Name of reference key to different projection. + :vartype reference_key_name: str + :ivar generated_key_name: Name of generated key to store projection under. + :vartype generated_key_name: str + :ivar source: Source data to project. + :vartype source: str + :ivar source_context: Source context for complex projections. + :vartype source_context: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list["InputFieldMappingEntry"] + """ + + referenceKeyName: str + """Name of reference key to different projection.""" + generatedKeyName: str + """Name of generated key to store projection under.""" + source: str + """Source data to project.""" + sourceContext: str + """Source context for complex projections.""" + inputs: list["InputFieldMappingEntry"] + """Nested inputs for complex projections.""" + + +class SearchIndexerKnowledgeStoreBlobProjectionSelector( + SearchIndexerKnowledgeStoreProjectionSelector +): # pylint: disable=name-too-long + """Abstract class to share properties between concrete selectors. + + :ivar reference_key_name: Name of reference key to different projection. + :vartype reference_key_name: str + :ivar generated_key_name: Name of generated key to store projection under. + :vartype generated_key_name: str + :ivar source: Source data to project. + :vartype source: str + :ivar source_context: Source context for complex projections. + :vartype source_context: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list["InputFieldMappingEntry"] + :ivar storage_container: Blob container to store projections in. Required. + :vartype storage_container: str + """ + + storageContainer: Required[str] + """Blob container to store projections in. Required.""" + + +class SearchIndexerKnowledgeStoreFileProjectionSelector( + SearchIndexerKnowledgeStoreBlobProjectionSelector +): # pylint: disable=name-too-long + """Projection definition for what data to store in Azure Files. + + :ivar reference_key_name: Name of reference key to different projection. + :vartype reference_key_name: str + :ivar generated_key_name: Name of generated key to store projection under. + :vartype generated_key_name: str + :ivar source: Source data to project. + :vartype source: str + :ivar source_context: Source context for complex projections. + :vartype source_context: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list["InputFieldMappingEntry"] + :ivar storage_container: Blob container to store projections in. Required. + :vartype storage_container: str + """ + + +class SearchIndexerKnowledgeStoreObjectProjectionSelector( + SearchIndexerKnowledgeStoreBlobProjectionSelector +): # pylint: disable=name-too-long + """Projection definition for what data to store in Azure Blob. + + :ivar reference_key_name: Name of reference key to different projection. + :vartype reference_key_name: str + :ivar generated_key_name: Name of generated key to store projection under. + :vartype generated_key_name: str + :ivar source: Source data to project. + :vartype source: str + :ivar source_context: Source context for complex projections. + :vartype source_context: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list["InputFieldMappingEntry"] + :ivar storage_container: Blob container to store projections in. Required. + :vartype storage_container: str + """ + + +class SearchIndexerKnowledgeStoreParameters(TypedDict, total=False): + """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. + + :ivar synthesize_generated_key_name: Whether or not projections should synthesize a generated + key name if one isn't already present. + :vartype synthesize_generated_key_name: bool + """ + + synthesizeGeneratedKeyName: bool + """Whether or not projections should synthesize a generated key name if one isn't already present.""" + + +class SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): + """Container object for various projection selectors. + + :ivar tables: Projections to Azure Table storage. + :vartype tables: list["SearchIndexerKnowledgeStoreTableProjectionSelector"] + :ivar objects: Projections to Azure Blob storage. + :vartype objects: list["SearchIndexerKnowledgeStoreObjectProjectionSelector"] + :ivar files: Projections to Azure File storage. + :vartype files: list["SearchIndexerKnowledgeStoreFileProjectionSelector"] + """ + + tables: list["SearchIndexerKnowledgeStoreTableProjectionSelector"] + """Projections to Azure Table storage.""" + objects: list["SearchIndexerKnowledgeStoreObjectProjectionSelector"] + """Projections to Azure Blob storage.""" + files: list["SearchIndexerKnowledgeStoreFileProjectionSelector"] + """Projections to Azure File storage.""" + + +class SearchIndexerKnowledgeStoreTableProjectionSelector( + SearchIndexerKnowledgeStoreProjectionSelector +): # pylint: disable=name-too-long + """Description for what data to store in Azure Tables. + + :ivar reference_key_name: Name of reference key to different projection. + :vartype reference_key_name: str + :ivar source: Source data to project. + :vartype source: str + :ivar source_context: Source context for complex projections. + :vartype source_context: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list["InputFieldMappingEntry"] + :ivar generated_key_name: Name of generated key to store projection under. Required. + :vartype generated_key_name: str + :ivar table_name: Name of the Azure table to store projected data in. Required. + :vartype table_name: str + """ + + generatedKeyName: Required[str] + """Name of generated key to store projection under. Required.""" + tableName: Required[str] + """Name of the Azure table to store projected data in. Required.""" + + +SearchIndexerSkillset = TypedDict( + "SearchIndexerSkillset", + { + "name": Required[str], + "description": str, + "skills": Required[list["SearchIndexerSkill"]], + "cognitiveServices": "CognitiveServicesAccount", + "knowledgeStore": "SearchIndexerKnowledgeStore", + "indexProjections": "SearchIndexerIndexProjection", + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + }, + total=False, +) +SearchIndexerSkillset.__doc__ = """A list of skills. + +:ivar name: The name of the skillset. Required. +:vartype name: str +:ivar description: The description of the skillset. +:vartype description: str +:ivar skills: A list of skills in the skillset. Required. +:vartype skills: list["SearchIndexerSkill"] +:ivar cognitive_services_account: Details about the Azure AI service to be used when running + skills. +:vartype cognitive_services_account: "CognitiveServicesAccount" +:ivar knowledge_store: Definition of additional projections to Azure blob, table, or files, of + enriched data. +:vartype knowledge_store: "SearchIndexerKnowledgeStore" +:ivar index_projection: Definition of additional projections to secondary search index(es). +:vartype index_projection: "SearchIndexerIndexProjection" +:ivar e_tag: The ETag of the skillset. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your skillset + definition when you want full assurance that no one, not even Microsoft, can decrypt your + skillset definition. Once you have encrypted your skillset definition, it will always remain + encrypted. The search service will ignore attempts to set this property to null. You can change + this property as needed if you want to rotate your encryption key; Your skillset definition + will be unaffected. Encryption with customer-managed keys is not available for free search + services, and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +""" + + +class SearchIndexFieldReference(TypedDict, total=False): + """Field reference for a search index. + + :ivar name: The name of the field. Required. + :vartype name: str + """ + + name: Required[str] + """The name of the field. Required.""" + + +SearchIndexKnowledgeSource = TypedDict( + "SearchIndexKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]], + "searchIndexParameters": Required["SearchIndexKnowledgeSourceParameters"], + }, + total=False, +) +SearchIndexKnowledgeSource.__doc__ = """Knowledge Source targeting a search index. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: Required. A knowledge source that reads data from a Search Index. +:vartype kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] +:ivar search_index_parameters: The parameters for the knowledge source. Required. +:vartype search_index_parameters: "SearchIndexKnowledgeSourceParameters" +""" + + +class SearchIndexKnowledgeSourceFieldValueBoost(TypedDict, total=False): # pylint: disable=name-too-long + """A hint that boosts documents based on a field value. + + :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + boost. + :vartype boost_instructions: str + :ivar kind: The discriminator value. Required. Boost documents based on a field value. + :vartype kind: Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE] + :ivar field: The name of the search index field. Required. + :vartype field: str + :ivar field_values: Representative values for the field. + :vartype field_values: list[str] + :ivar boost: A multiplier for the document score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + """ + + boostInstructions: str + """Natural-language instructions that explain when and how to apply the boost.""" + kind: Required[Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE]] + """The discriminator value. Required. Boost documents based on a field value.""" + field: Required[str] + """The name of the search index field. Required.""" + fieldValues: list[str] + """Representative values for the field.""" + boost: Required[float] + """A multiplier for the document score. Must be a positive number not equal to 1.0. Required.""" + + +class SearchIndexKnowledgeSourceFilterHint(TypedDict, total=False): + """A hint that identifies a field and representative values the query planner can use when + constructing a filter. + + :ivar field: The name of the filterable search index field. Required. + :vartype field: str + :ivar field_values: Representative values for the field. Required. + :vartype field_values: list[str] + :ivar filter_instructions: Natural-language instructions that explain when and how to filter on + the field. + :vartype filter_instructions: str + """ + + field: Required[str] + """The name of the filterable search index field. Required.""" + fieldValues: Required[list[str]] + """Representative values for the field. Required.""" + filterInstructions: str + """Natural-language instructions that explain when and how to filter on the field.""" + + +class SearchIndexKnowledgeSourceMultiWordExpressionBoost(TypedDict, total=False): # pylint: disable=name-too-long + """A hint that boosts documents based on a multi-word expression. + + :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + boost. + :vartype boost_instructions: str + :ivar kind: The discriminator value. Required. Boost documents based on a multi-word + expression. + :vartype kind: Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION] + :ivar field_values: Representative values for the boost. + :vartype field_values: list[str] + :ivar boost: A multiplier for the document score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + """ + + boostInstructions: str + """Natural-language instructions that explain when and how to apply the boost.""" + kind: Required[Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION]] + """The discriminator value. Required. Boost documents based on a multi-word expression.""" + fieldValues: list[str] + """Representative values for the boost.""" + boost: Required[float] + """A multiplier for the document score. Must be a positive number not equal to 1.0. Required.""" + + +class SearchIndexKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for search index knowledge source. + + :ivar search_index_name: The name of the Search index. Required. + :vartype search_index_name: str + :ivar source_data_fields: Used to request additional fields for referenced source data. + :vartype source_data_fields: list["SearchIndexFieldReference"] + :ivar search_fields: Used to restrict which fields to search on the search index. + :vartype search_fields: list["SearchIndexFieldReference"] + :ivar semantic_configuration_name: Used to specify a different semantic configuration on the + target search index other than the default one. + :vartype semantic_configuration_name: str + :ivar base_filter: A default filter condition applied to the index at retrieval time (e.g., + 'State eq VA'). Can be overridden at query time via knowledge source runtime parameters. + :vartype base_filter: str + :ivar query_hints: 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. + :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + """ + + searchIndexName: Required[str] + """The name of the Search index. Required.""" + sourceDataFields: list["SearchIndexFieldReference"] + """Used to request additional fields for referenced source data.""" + searchFields: list["SearchIndexFieldReference"] + """Used to restrict which fields to search on the search index.""" + semanticConfigurationName: str + """Used to specify a different semantic configuration on the target search index other than the + default one.""" + baseFilter: str + """A default filter condition applied to the index at retrieval time (e.g., 'State eq VA'). Can be + overridden at query time via knowledge source runtime parameters.""" + queryHints: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class SearchIndexKnowledgeSourceQueryHints(TypedDict, total=False): + """Hints that guide query planning toward useful filters and boosts for a search index knowledge + source. + + :ivar filters: Filter hints that identify fields and representative values the query planner + can use when constructing filters. + :vartype filters: list["SearchIndexKnowledgeSourceFilterHint"] + :ivar boosts: Boost hints that identify conditions the query planner can use to influence + document ranking. + :vartype boosts: list["SearchIndexKnowledgeSourceBoost"] + """ + + filters: list["SearchIndexKnowledgeSourceFilterHint"] + """Filter hints that identify fields and representative values the query planner can use when + constructing filters.""" + boosts: list["SearchIndexKnowledgeSourceBoost"] + """Boost hints that identify conditions the query planner can use to influence document ranking.""" + + +class SearchResourceEncryptionKey(TypedDict, total=False): + """A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be + used to encrypt or decrypt data-at-rest, such as indexes and synonym maps. + + :ivar key_name: The name of your Azure Key Vault key to be used to encrypt your data at rest. + Required. + :vartype key_name: str + :ivar key_version: The version of your Azure Key Vault key to be used to encrypt your data at + rest. + :vartype key_version: str + :ivar vault_uri: The URI of your Azure Key Vault, also referred to as DNS name, that contains + the key to be used to encrypt your data at rest. An example URI might be + ``https://my-keyvault-name.vault.azure.net``. Required. + :vartype vault_uri: str + :ivar access_credentials: Optional Azure Active Directory credentials used for accessing your + Azure Key Vault. Not required if using managed identity instead. + :vartype access_credentials: "AzureActiveDirectoryApplicationCredentials" + :ivar identity: An explicit managed identity to use for this encryption key. If not specified + and the access credentials property is null, the system-assigned managed identity is used. On + update to the resource, if the explicit identity is unspecified, it remains unchanged. If + "none" is specified, the value of this property is cleared. + :vartype identity: "SearchIndexerDataIdentity" + :ivar is_service_level_key: An optional value indicating whether this key is a service-level + key. Default is false. + :vartype is_service_level_key: bool + """ + + keyVaultKeyName: Required[str] + """The name of your Azure Key Vault key to be used to encrypt your data at rest. Required.""" + keyVaultKeyVersion: str + """The version of your Azure Key Vault key to be used to encrypt your data at rest.""" + keyVaultUri: Required[str] + """The URI of your Azure Key Vault, also referred to as DNS name, that contains the key to be used + to encrypt your data at rest. An example URI might be + ``https://my-keyvault-name.vault.azure.net``. Required.""" + accessCredentials: "AzureActiveDirectoryApplicationCredentials" + """Optional Azure Active Directory credentials used for accessing your Azure Key Vault. Not + required if using managed identity instead.""" + identity: Optional["SearchIndexerDataIdentity"] + """An explicit managed identity to use for this encryption key. If not specified and the access + credentials property is null, the system-assigned managed identity is used. On update to the + resource, if the explicit identity is unspecified, it remains unchanged. If \"none\" is + specified, the value of this property is cleared.""" + isServiceLevelKey: bool + """An optional value indicating whether this key is a service-level key. Default is false.""" + + +class SearchSuggester(TypedDict, total=False): + """Defines how the Suggest API should apply to a group of fields in the index. + + :ivar name: The name of the suggester. Required. + :vartype name: str + :ivar search_mode: A value indicating the capabilities of the suggester. Required. Default + value is "analyzingInfixMatching". + :vartype search_mode: Literal["analyzingInfixMatching"] + :ivar source_fields: The list of field names to which the suggester applies. Each field must be + searchable. Required. + :vartype source_fields: list[str] + """ + + name: Required[str] + """The name of the suggester. Required.""" + searchMode: Required[Literal["analyzingInfixMatching"]] + """A value indicating the capabilities of the suggester. Required. Default value is + \"analyzingInfixMatching\".""" + sourceFields: Required[list[str]] + """The list of field names to which the suggester applies. Each field must be searchable. + Required.""" + + +class SemanticConfiguration(TypedDict, total=False): + """Defines a specific configuration to be used in the context of semantic capabilities. + + :ivar name: The name of the semantic configuration. Required. + :vartype name: str + :ivar prioritized_fields: Describes the title, content, and keyword fields to be used for + semantic ranking, captions, highlights, and answers. At least one of the three sub properties + (titleField, prioritizedKeywordsFields and prioritizedContentFields) need to be set. Required. + :vartype prioritized_fields: "SemanticPrioritizedFields" + :ivar ranking_order: Specifies the score type to be used for the sort order of the search + results. Known values are: "BoostedRerankerScore" and "RerankerScore". + :vartype ranking_order: Union[str, "RankingOrder"] + :ivar flighting_opt_in: Determines which semantic or query rewrite models to use during model + flighting/upgrades. + :vartype flighting_opt_in: bool + """ + + name: Required[str] + """The name of the semantic configuration. Required.""" + prioritizedFields: Required["SemanticPrioritizedFields"] + """Describes the title, content, and keyword fields to be used for semantic ranking, captions, + highlights, and answers. At least one of the three sub properties (titleField, + prioritizedKeywordsFields and prioritizedContentFields) need to be set. Required.""" + rankingOrder: Optional[Union[str, "RankingOrder"]] + """Specifies the score type to be used for the sort order of the search results. Known values are: + \"BoostedRerankerScore\" and \"RerankerScore\".""" + flightingOptIn: bool + """Determines which semantic or query rewrite models to use during model flighting/upgrades.""" + + +class SemanticField(TypedDict, total=False): + """A field that is used as part of the semantic configuration. + + :ivar field_name: File name. Required. + :vartype field_name: str + """ + + fieldName: Required[str] + """File name. Required.""" + + +class SemanticPrioritizedFields(TypedDict, total=False): + """Describes the title, content, and keywords fields to be used for semantic ranking, captions, + highlights, and answers. + + :ivar title_field: Defines the title field to be used for semantic ranking, captions, + highlights, and answers. If you don't have a title field in your index, leave this blank. + :vartype title_field: "SemanticField" + :ivar content_fields: Defines the content fields to be used for semantic ranking, captions, + highlights, and answers. For the best result, the selected fields should contain text in + natural language form. The order of the fields in the array represents their priority. Fields + with lower priority may get truncated if the content is long. + :vartype content_fields: list["SemanticField"] + :ivar keywords_fields: Defines the keyword fields to be used for semantic ranking, captions, + highlights, and answers. For the best result, the selected fields should contain a list of + keywords. The order of the fields in the array represents their priority. Fields with lower + priority may get truncated if the content is long. + :vartype keywords_fields: list["SemanticField"] + """ + + titleField: "SemanticField" + """Defines the title field to be used for semantic ranking, captions, highlights, and answers. If + you don't have a title field in your index, leave this blank.""" + prioritizedContentFields: list["SemanticField"] + """Defines the content fields to be used for semantic ranking, captions, highlights, and answers. + For the best result, the selected fields should contain text in natural language form. The + order of the fields in the array represents their priority. Fields with lower priority may get + truncated if the content is long.""" + prioritizedKeywordsFields: list["SemanticField"] + """Defines the keyword fields to be used for semantic ranking, captions, highlights, and answers. + For the best result, the selected fields should contain a list of keywords. The order of the + fields in the array represents their priority. Fields with lower priority may get truncated if + the content is long.""" + + +class SemanticSearch(TypedDict, total=False): + """Defines parameters for a search index that influence semantic capabilities. + + :ivar default_configuration_name: Allows you to set the name of a default semantic + configuration in your index, making it optional to pass it on as a query parameter every time. + :vartype default_configuration_name: str + :ivar configurations: The semantic configurations for the index. + :vartype configurations: list["SemanticConfiguration"] + """ + + defaultConfiguration: str + """Allows you to set the name of a default semantic configuration in your index, making it + optional to pass it on as a query parameter every time.""" + configurations: list["SemanticConfiguration"] + """The semantic configurations for the index.""" + + +SentimentSkillV3 = TypedDict( + "SentimentSkillV3", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Optional[Union[str, "SentimentSkillLanguage"]], + "includeOpinionMining": bool, + "modelVersion": Optional[str], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.V3.SentimentSkill"]], + }, + total=False, +) +SentimentSkillV3.__doc__ = """Using the Text Analytics API, evaluates unstructured text and for each record, provides +sentiment labels (such as "negative", "neutral" and "positive") based on the highest confidence +score found by the service at a sentence and document-level. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", + "es", "sv", and "tr". +:vartype default_language_code: Union[str, "SentimentSkillLanguage"] +:ivar include_opinion_mining: If set to true, the skill output will include information from + Text Analytics for opinion mining, namely targets (nouns or verbs) and their associated + assessment (adjective) in the text. Default is false. +:vartype include_opinion_mining: bool +:ivar model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. +:vartype model_version: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.V3.SentimentSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.V3.SentimentSkill"] +""" + + +ShaperSkill = TypedDict( + "ShaperSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "@odata.type": Required[Literal["#Microsoft.Skills.Util.ShaperSkill"]], + }, + total=False, +) +ShaperSkill.__doc__ = """A skill for reshaping the outputs. It creates a complex type to support composite fields (also +known as multipart fields). + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Util.ShaperSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Util.ShaperSkill"] +""" + + +class SharePointConnectorAppRegistration(TypedDict, total=False): + """Configures a SharePoint connector app registration for the index, enabling document-level + permissions from SharePoint. + + :ivar application_id: The application (client) ID of the app registration used to connect to + SharePoint. Required. + :vartype application_id: str + :ivar federated_credential_id: The federated credential ID configured on the app registration. + Required. + :vartype federated_credential_id: str + :ivar tenant_id: The tenant ID of the app registration. If not specified, the tenant of the + search service is used. + :vartype tenant_id: str + """ + + applicationId: Required[str] + """The application (client) ID of the app registration used to connect to SharePoint. Required.""" + federatedCredentialId: Required[str] + """The federated credential ID configured on the app registration. Required.""" + tenantId: str + """The tenant ID of the app registration. If not specified, the tenant of the search service is + used.""" + + +ShingleTokenFilter = TypedDict( + "ShingleTokenFilter", + { + "name": Required[str], + "maxShingleSize": int, + "minShingleSize": int, + "outputUnigrams": bool, + "outputUnigramsIfNoShingles": bool, + "tokenSeparator": str, + "filterToken": str, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.ShingleTokenFilter"]], + }, + total=False, +) +ShingleTokenFilter.__doc__ = """Creates combinations of tokens as a single token. This token filter is implemented using Apache +Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_shingle_size: The maximum shingle size. Default and minimum value is 2. +:vartype max_shingle_size: int +:ivar min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be less + than the value of maxShingleSize. +:vartype min_shingle_size: int +:ivar output_unigrams: A value indicating whether the output stream will contain the input + tokens (unigrams) as well as shingles. Default is true. +:vartype output_unigrams: bool +:ivar output_unigrams_if_no_shingles: A value indicating whether to output unigrams for those + times when no shingles are available. This property takes precedence when outputUnigrams is set + to false. Default is false. +:vartype output_unigrams_if_no_shingles: bool +:ivar token_separator: The string to use when joining adjacent tokens to form a shingle. + Default is a single space (" "). +:vartype token_separator: str +:ivar filter_token: The string to insert for each position at which there is no token. Default + is an underscore ("_"). +:vartype filter_token: str +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.ShingleTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.ShingleTokenFilter"] +""" + + +class SkillNames(TypedDict, total=False): + """The type of the skill names. + + :ivar skill_names: the names of skills to be reset. + :vartype skill_names: list[str] + """ + + skillNames: list[str] + """the names of skills to be reset.""" + + +SnowballTokenFilter = TypedDict( + "SnowballTokenFilter", + { + "name": Required[str], + "language": Required[Union[str, "SnowballTokenFilterLanguage"]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.SnowballTokenFilter"]], + }, + total=False, +) +SnowballTokenFilter.__doc__ = """A filter that stems words using a Snowball-generated stemmer. This token filter is implemented +using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar language: The language to use. Required. Known values are: "armenian", "basque", + "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", + "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", + "spanish", "swedish", and "turkish". +:vartype language: Union[str, "SnowballTokenFilterLanguage"] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.SnowballTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.SnowballTokenFilter"] +""" + + +SoftDeleteColumnDeletionDetectionPolicy = TypedDict( + "SoftDeleteColumnDeletionDetectionPolicy", + { + "softDeleteColumnName": str, + "softDeleteMarkerValue": str, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"]], + }, + total=False, +) +SoftDeleteColumnDeletionDetectionPolicy.__doc__ = """Defines a data deletion detection policy that implements a soft-deletion strategy. It +determines whether an item should be deleted based on the value of a designated 'soft delete' +column. + +:ivar soft_delete_column_name: The name of the column to use for soft-deletion detection. +:vartype soft_delete_column_name: str +:ivar soft_delete_marker_value: The marker value that identifies an item as deleted. +:vartype soft_delete_marker_value: str +:ivar odata_type: A URI fragment specifying the type of data deletion detection policy. + Required. Default value is "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy". +:vartype odata_type: Literal["#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"] +""" + + +SplitSkill = TypedDict( + "SplitSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultLanguageCode": Union[str, "SplitSkillLanguage"], + "textSplitMode": Union[str, "TextSplitMode"], + "maximumPageLength": Optional[int], + "pageOverlapLength": Optional[int], + "maximumPagesToTake": Optional[int], + "unit": Optional[Union[str, "SplitSkillUnit"]], + "azureOpenAITokenizerParameters": Optional["AzureOpenAITokenizerParameters"], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.SplitSkill"]], + }, + total=False, +) +SplitSkill.__doc__ = """A skill to split a string into chunks of text. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_language_code: A value indicating which language code to use. Default is ``en``. + Known values are: "am", "bs", "cs", "da", "de", "en", "es", "et", "fi", "fr", "he", "hi", "hr", + "hu", "id", "is", "it", "ja", "ko", "lv", "nb", "nl", "pl", "pt", "pt-br", "ru", "sk", "sl", + "sr", "sv", "tr", "ur", and "zh". +:vartype default_language_code: Union[str, "SplitSkillLanguage"] +:ivar text_split_mode: A value indicating which split mode to perform. Known values are: + "pages" and "sentences". +:vartype text_split_mode: Union[str, "TextSplitMode"] +:ivar maximum_page_length: The desired maximum page length. Default is 10000. +:vartype maximum_page_length: int +:ivar page_overlap_length: Only applicable when textSplitMode is set to 'pages'. If specified, + n+1th chunk will start with this number of characters/tokens from the end of the nth chunk. +:vartype page_overlap_length: int +:ivar maximum_pages_to_take: Only applicable when textSplitMode is set to 'pages'. If + specified, the SplitSkill will discontinue splitting after processing the first + 'maximumPagesToTake' pages, in order to improve performance when only a few initial pages are + needed from each document. +:vartype maximum_pages_to_take: int +:ivar unit: Only applies if textSplitMode is set to pages. There are two possible values. The + choice of the values will decide the length (maximumPageLength and pageOverlapLength) + measurement. The default is 'characters', which means the length will be measured by character. + Known values are: "characters" and "azureOpenAITokens". +:vartype unit: Union[str, "SplitSkillUnit"] +:ivar azure_open_ai_tokenizer_parameters: Only applies if the unit is set to azureOpenAITokens. + If specified, the splitSkill will use these parameters when performing the tokenization. The + parameters are a valid 'encoderModelName' and an optional 'allowedSpecialTokens' property. +:vartype azure_open_ai_tokenizer_parameters: "AzureOpenAITokenizerParameters" +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.SplitSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.SplitSkill"] +""" + + +SqlIntegratedChangeTrackingPolicy = TypedDict( + "SqlIntegratedChangeTrackingPolicy", + { + "@odata.type": Required[Literal["#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"]], + }, + total=False, +) +SqlIntegratedChangeTrackingPolicy.__doc__ = """Defines a data change detection policy that captures changes using the Integrated Change +Tracking feature of Azure SQL Database. + +:ivar odata_type: A URI fragment specifying the type of data change detection policy. Required. + Default value is "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy". +:vartype odata_type: Literal["#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"] +""" + + +StemmerOverrideTokenFilter = TypedDict( + "StemmerOverrideTokenFilter", + { + "name": Required[str], + "rules": Required[list[str]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StemmerOverrideTokenFilter"]], + }, + total=False, +) +StemmerOverrideTokenFilter.__doc__ = """Provides the ability to override other stemming filters with custom dictionary-based stemming. +Any dictionary-stemmed terms will be marked as keywords so that they will not be stemmed with +stemmers down the chain. Must be placed before any stemming filters. This token filter is +implemented using Apache Lucene. See +`http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.html +`_. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar rules: A list of stemming rules in the following format: "word => stem", for example: + "ran => run". Required. +:vartype rules: list[str] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.StemmerOverrideTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StemmerOverrideTokenFilter"] +""" + + +StemmerTokenFilter = TypedDict( + "StemmerTokenFilter", + { + "name": Required[str], + "language": Required[Union[str, "StemmerTokenFilterLanguage"]], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StemmerTokenFilter"]], + }, + total=False, +) +StemmerTokenFilter.__doc__ = """Language specific stemming filter. This token filter is implemented using Apache Lucene. See +`https://learn.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#TokenFilters +`_. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar language: The language to use. Required. Known values are: "arabic", "armenian", + "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "dutchKp", + "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", "lovins", + "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", + "minimalGalician", "german", "german2", "lightGerman", "minimalGerman", "greek", "hindi", + "hungarian", "lightHungarian", "indonesian", "irish", "italian", "lightItalian", "sorani", + "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", + "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", + "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", and "turkish". +:vartype language: Union[str, "StemmerTokenFilterLanguage"] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.StemmerTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StemmerTokenFilter"] +""" + + +StopAnalyzer = TypedDict( + "StopAnalyzer", + { + "name": Required[str], + "stopwords": list[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StopAnalyzer"]], + }, + total=False, +) +StopAnalyzer.__doc__ = """Divides text at non-letters; Applies the lowercase and stopword token filters. This analyzer is +implemented using Apache Lucene. + +:ivar name: The name of the analyzer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar stopwords: A list of stopwords. +:vartype stopwords: list[str] +:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is + "#Microsoft.Azure.Search.StopAnalyzer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StopAnalyzer"] +""" + + +StopwordsTokenFilter = TypedDict( + "StopwordsTokenFilter", + { + "name": Required[str], + "stopwords": list[str], + "stopwordsList": Union[str, "StopwordsList"], + "ignoreCase": bool, + "removeTrailing": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.StopwordsTokenFilter"]], + }, + total=False, +) +StopwordsTokenFilter.__doc__ = """Removes stop words from a token stream. This token filter is implemented using Apache Lucene. +See +`http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopFilter.html +`_. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar stopwords: The list of stopwords. This property and the stopwords list property cannot + both be set. +:vartype stopwords: list[str] +:ivar stopwords_list: A predefined list of stopwords to use. This property and the stopwords + property cannot both be set. Default is English. Known values are: "arabic", "armenian", + "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "english", + "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", + "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", + "sorani", "spanish", "swedish", "thai", and "turkish". +:vartype stopwords_list: Union[str, "StopwordsList"] +:ivar ignore_case: A value indicating whether to ignore case. If true, all words are converted + to lower case first. Default is false. +:vartype ignore_case: bool +:ivar remove_trailing_stop_words: A value indicating whether to ignore the last search term if + it's a stop word. Default is true. +:vartype remove_trailing_stop_words: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.StopwordsTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.StopwordsTokenFilter"] +""" + + +SynonymMap = TypedDict( + "SynonymMap", + { + "name": Required[str], + "format": Required[Literal["solr"]], + "synonyms": Required[list[str]], + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "@odata.etag": str, + }, + total=False, +) +SynonymMap.__doc__ = """Represents a synonym map definition. + +:ivar name: The name of the synonym map. Required. +:vartype name: str +:ivar format: The format of the synonym map. Only the 'solr' format is currently supported. + Required. Default value is "solr". +:vartype format: Literal["solr"] +:ivar synonyms: A series of synonym rules in the specified synonym map format. The rules must + be separated by newlines. Required. +:vartype synonyms: list[str] +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your data when you + want full assurance that no one, not even Microsoft, can decrypt your data. Once you have + encrypted your data, it will always remain encrypted. The search service will ignore attempts + to set this property to null. You can change this property as needed if you want to rotate your + encryption key; Your data will be unaffected. Encryption with customer-managed keys is not + available for free search services, and is only available for paid services created on or after + January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar e_tag: The ETag of the synonym map. +:vartype e_tag: str +""" + + +SynonymTokenFilter = TypedDict( + "SynonymTokenFilter", + { + "name": Required[str], + "synonyms": Required[list[str]], + "ignoreCase": bool, + "expand": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.SynonymTokenFilter"]], + }, + total=False, +) +SynonymTokenFilter.__doc__ = """Matches single or multi-word synonyms in a token stream. This token filter is implemented using +Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar synonyms: A list of synonyms in following one of two formats: 1. incredible, + unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced + with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma + separated list of equivalent words. Set the expand option to change how this list is + interpreted. Required. +:vartype synonyms: list[str] +:ivar ignore_case: A value indicating whether to case-fold input for matching. Default is + false. +:vartype ignore_case: bool +:ivar expand: A value indicating whether all words in the list of synonyms (if => notation is + not used) will map to one another. If true, all words in the list of synonyms (if => notation + is not used) will map to one another. The following list: incredible, unbelievable, fabulous, + amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, + unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, + fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => + incredible. Default is true. +:vartype expand: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.SynonymTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.SynonymTokenFilter"] +""" + + +class TagScoringFunction(TypedDict, total=False): + """Defines a function that boosts scores of documents with string values matching a given list of + tags. + + :ivar field_name: The name of the field used as input to the scoring function. Required. + :vartype field_name: str + :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. + Required. + :vartype boost: float + :ivar interpolation: A value indicating how boosting will be interpolated across document + scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and + "logarithmic". + :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] + :ivar parameters: Parameter values for the tag scoring function. Required. + :vartype parameters: "TagScoringParameters" + :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, + distance, and tag. The function type must be lower case. Required. Default value is "tag". + :vartype type: Literal["tag"] + """ + + fieldName: Required[str] + """The name of the field used as input to the scoring function. Required.""" + boost: Required[float] + """A multiplier for the raw score. Must be a positive number not equal to 1.0. Required.""" + interpolation: Union[str, "ScoringFunctionInterpolation"] + """A value indicating how boosting will be interpolated across document scores; defaults to + \"Linear\". Known values are: \"linear\", \"constant\", \"quadratic\", and \"logarithmic\".""" + tag: Required["TagScoringParameters"] + """Parameter values for the tag scoring function. Required.""" + type: Required[Literal["tag"]] + """Indicates the type of function to use. Valid values include magnitude, freshness, distance, and + tag. The function type must be lower case. Required. Default value is \"tag\".""" + + +class TagScoringParameters(TypedDict, total=False): + """Provides parameter values to a tag scoring function. + + :ivar tags_parameter: The name of the parameter passed in search queries to specify the list of + tags to compare against the target field. Required. + :vartype tags_parameter: str + """ + + tagsParameter: Required[str] + """The name of the parameter passed in search queries to specify the list of tags to compare + against the target field. Required.""" + + +TextTranslationSkill = TypedDict( + "TextTranslationSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "defaultToLanguageCode": Required[Union[str, "TextTranslationSkillLanguage"]], + "defaultFromLanguageCode": Union[str, "TextTranslationSkillLanguage"], + "suggestedFrom": Optional[Union[str, "TextTranslationSkillLanguage"]], + "@odata.type": Required[Literal["#Microsoft.Skills.Text.TranslationSkill"]], + }, + total=False, +) +TextTranslationSkill.__doc__ = """A skill to translate text from one language to another. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar default_to_language_code: The language code to translate documents into for documents + that don't specify the to language explicitly. Required. Known values are: "af", "ar", "bn", + "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", + "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", + "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", + "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", + "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". +:vartype default_to_language_code: Union[str, "TextTranslationSkillLanguage"] +:ivar default_from_language_code: The language code to translate documents from for documents + that don't specify the from language explicitly. Known values are: "af", "ar", "bn", "bs", + "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", "fi", + "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", + "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", + "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", + "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". +:vartype default_from_language_code: Union[str, "TextTranslationSkillLanguage"] +:ivar suggested_from: The language code to translate documents from when neither the + fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the + automatic language detection is unsuccessful. Default is ``en``. Known values are: "af", "ar", + "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", + "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", + "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", + "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", + "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". +:vartype suggested_from: Union[str, "TextTranslationSkillLanguage"] +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Text.TranslationSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Text.TranslationSkill"] +""" + + +class TextWeights(TypedDict, total=False): + """Defines weights on index fields for which matches should boost scoring in search queries. + + :ivar weights: The dictionary of per-field weights to boost document scoring. The keys are + field names and the values are the weights for each field. Required. + :vartype weights: dict[str, float] + """ + + weights: Required[dict[str, float]] + """The dictionary of per-field weights to boost document scoring. The keys are field names and the + values are the weights for each field. Required.""" + + +TruncateTokenFilter = TypedDict( + "TruncateTokenFilter", + { + "name": Required[str], + "length": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.TruncateTokenFilter"]], + }, + total=False, +) +TruncateTokenFilter.__doc__ = """Truncates the terms to a specific length. This token filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar length: The length at which terms will be truncated. Default and maximum is 300. +:vartype length: int +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.TruncateTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.TruncateTokenFilter"] +""" + + +UaxUrlEmailTokenizer = TypedDict( + "UaxUrlEmailTokenizer", + { + "name": Required[str], + "maxTokenLength": int, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.UaxUrlEmailTokenizer"]], + }, + total=False, +) +UaxUrlEmailTokenizer.__doc__ = """Tokenizes urls and emails as one token. This tokenizer is implemented using Apache Lucene. + +:ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or + underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the + maximum length are split. The maximum token length that can be used is 300 characters. +:vartype max_token_length: int +:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is + "#Microsoft.Azure.Search.UaxUrlEmailTokenizer". +:vartype odata_type: Literal["#Microsoft.Azure.Search.UaxUrlEmailTokenizer"] +""" + + +UniqueTokenFilter = TypedDict( + "UniqueTokenFilter", + { + "name": Required[str], + "onlyOnSamePosition": bool, + "@odata.type": Required[Literal["#Microsoft.Azure.Search.UniqueTokenFilter"]], + }, + total=False, +) +UniqueTokenFilter.__doc__ = """Filters out tokens with same text as the previous token. This token filter is implemented using +Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar only_on_same_position: A value indicating whether to remove duplicates only at the same + position. Default is false. +:vartype only_on_same_position: bool +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.UniqueTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.UniqueTokenFilter"] +""" + + +class UpdateKnowledgeSourceFileRequest(TypedDict, total=False): + """Multipart request for updating a file in a File knowledge source. + + :ivar metadata: The JSON metadata describing the file. Required. + :vartype metadata: "FileUploadMetadata" + :ivar content: The raw file content. Required. + :vartype content: FileType + """ + + metadata: Required["FileUploadMetadata"] + """The JSON metadata describing the file. Required.""" + content: Required[FileType] + """The raw file content. Required.""" + + +class UploadKnowledgeSourceFileMultipartRequest(TypedDict, total=False): # pylint: disable=name-too-long + """Multipart request for uploading a file to a File knowledge source. + + :ivar metadata: The JSON metadata describing the file. Required. + :vartype metadata: "FileUploadMetadata" + :ivar content: The raw file content. Required. + :vartype content: FileType + """ + + metadata: Required["FileUploadMetadata"] + """The JSON metadata describing the file. Required.""" + content: Required[FileType] + """The raw file content. Required.""" + + +class VectorSearch(TypedDict, total=False): + """Contains configuration options related to vector search. + + :ivar profiles: Defines combinations of configurations to use with vector search. + :vartype profiles: list["VectorSearchProfile"] + :ivar algorithms: Contains configuration options specific to the algorithm used during indexing + or querying. + :vartype algorithms: list["VectorSearchAlgorithmConfiguration"] + :ivar vectorizers: Contains configuration options on how to vectorize text vector queries. + :vartype vectorizers: list["VectorSearchVectorizer"] + :ivar compressions: Contains configuration options specific to the compression method used + during indexing or querying. + :vartype compressions: list["VectorSearchCompression"] + """ + + profiles: list["VectorSearchProfile"] + """Defines combinations of configurations to use with vector search.""" + algorithms: list["VectorSearchAlgorithmConfiguration"] + """Contains configuration options specific to the algorithm used during indexing or querying.""" + vectorizers: list["VectorSearchVectorizer"] + """Contains configuration options on how to vectorize text vector queries.""" + compressions: list["VectorSearchCompression"] + """Contains configuration options specific to the compression method used during indexing or + querying.""" + + +class VectorSearchProfile(TypedDict, total=False): + """Defines a combination of configurations to use with vector search. + + :ivar name: The name to associate with this particular vector search profile. Required. + :vartype name: str + :ivar algorithm_configuration_name: The name of the vector search algorithm configuration that + specifies the algorithm and optional parameters. Required. + :vartype algorithm_configuration_name: str + :ivar vectorizer_name: The name of the vectorization being configured for use with vector + search. + :vartype vectorizer_name: str + :ivar compression_name: The name of the compression method configuration that specifies the + compression method and optional parameters. + :vartype compression_name: str + """ + + name: Required[str] + """The name to associate with this particular vector search profile. Required.""" + algorithm: Required[str] + """The name of the vector search algorithm configuration that specifies the algorithm and optional + parameters. Required.""" + vectorizer: str + """The name of the vectorization being configured for use with vector search.""" + compression: str + """The name of the compression method configuration that specifies the compression method and + optional parameters.""" + + +VisionVectorizeSkill = TypedDict( + "VisionVectorizeSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "modelVersion": Required[Optional[str]], + "@odata.type": Required[Literal["#Microsoft.Skills.Vision.VectorizeSkill"]], + }, + total=False, +) +VisionVectorizeSkill.__doc__ = """Allows you to generate a vector embedding for a given image or text input using the Azure AI +Services Vision Vectorize API. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar model_version: The version of the model to use when calling the AI Services Vision + service. It will default to the latest available when not specified. Required. +:vartype model_version: str +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Vision.VectorizeSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Vision.VectorizeSkill"] +""" + + +class WebApiHttpHeaders(TypedDict, total=False): + """A dictionary of http request headers.""" + + +WebApiSkill = TypedDict( + "WebApiSkill", + { + "name": str, + "description": str, + "context": str, + "inputs": Required[list["InputFieldMappingEntry"]], + "outputs": Required[list["OutputFieldMappingEntry"]], + "uri": Required[str], + "httpHeaders": "WebApiHttpHeaders", + "httpMethod": str, + "timeout": str, + "batchSize": Optional[int], + "degreeOfParallelism": Optional[int], + "authResourceId": Optional[str], + "authIdentity": Optional["SearchIndexerDataIdentity"], + "@odata.type": Required[Literal["#Microsoft.Skills.Custom.WebApiSkill"]], + }, + total=False, +) +WebApiSkill.__doc__ = """A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call +your custom code. + +:ivar name: The name of the skill which uniquely identifies it within the skillset. A skill + with no name defined will be given a default name of its 1-based index in the skills array, + prefixed with the character '#'. +:vartype name: str +:ivar description: The description of the skill which describes the inputs, outputs, and usage + of the skill. +:vartype description: str +:ivar context: Represents the level at which operations take place, such as the document root + or document content (for example, /document or /document/content). The default is /document. +:vartype context: str +:ivar inputs: Inputs of the skills could be a column in the source data set, or the output of + an upstream skill. Required. +:vartype inputs: list["InputFieldMappingEntry"] +:ivar outputs: The output of a skill is either a field in a search index, or a value that can + be consumed as an input by another skill. Required. +:vartype outputs: list["OutputFieldMappingEntry"] +:ivar uri: The url for the Web API. Required. +:vartype uri: str +:ivar http_headers: The headers required to make the http request. +:vartype http_headers: "WebApiHttpHeaders" +:ivar http_method: The method for the http request. +:vartype http_method: str +:ivar timeout: The desired timeout for the request. Default is 30 seconds. +:vartype timeout: str +:ivar batch_size: The desired batch size which indicates number of documents. +:vartype batch_size: int +:ivar degree_of_parallelism: If set, the number of parallel calls that can be made to the Web + API. +:vartype degree_of_parallelism: int +:ivar auth_resource_id: Applies to custom skills that connect to external code in an Azure + function or some other application that provides the transformations. This value should be the + application ID created for the function or app when it was registered with Azure Active + Directory. When specified, the custom skill connects to the function or app using a managed ID + (either system or user-assigned) of the search service and the access token of the function or + app, using this value as the resource id for creating the scope of the access token. +:vartype auth_resource_id: str +:ivar auth_identity: The user-assigned managed identity used for outbound connections. If an + authResourceId is provided and it's not specified, the system-assigned managed identity is + used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. + If set to "none", the value of this property is cleared. +:vartype auth_identity: "SearchIndexerDataIdentity" +:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is + "#Microsoft.Skills.Custom.WebApiSkill". +:vartype odata_type: Literal["#Microsoft.Skills.Custom.WebApiSkill"] +""" + + +class WebApiVectorizer(TypedDict, total=False): + """Specifies a user-defined vectorizer for generating the vector embedding of a query string. + Integration of an external vectorizer is achieved using the custom Web API interface of a + skillset. + + :ivar vectorizer_name: The name to associate with this particular vectorization method. + Required. + :vartype vectorizer_name: str + :ivar web_api_parameters: Specifies the properties of the user-defined vectorizer. + :vartype web_api_parameters: "WebApiVectorizerParameters" + :ivar kind: The name of the kind of vectorization method being configured for use with vector + search. Required. Generate embeddings using a custom web endpoint at query time. + :vartype kind: Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API] + """ + + name: Required[str] + """The name to associate with this particular vectorization method. Required.""" + customWebApiParameters: "WebApiVectorizerParameters" + """Specifies the properties of the user-defined vectorizer.""" + kind: Required[Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API]] + """The name of the kind of vectorization method being configured for use with vector search. + Required. Generate embeddings using a custom web endpoint at query time.""" + + +class WebApiVectorizerParameters(TypedDict, total=False): + """Specifies the properties for connecting to a user-defined vectorizer. + + :ivar url: The URI of the Web API providing the vectorizer. + :vartype url: str + :ivar http_headers: The headers required to make the HTTP request. + :vartype http_headers: dict[str, str] + :ivar http_method: The method for the HTTP request. + :vartype http_method: str + :ivar timeout: The desired timeout for the request. Default is 30 seconds. + :vartype timeout: str + :ivar auth_resource_id: Applies to custom endpoints that connect to external code in an Azure + function or some other application that provides the transformations. This value should be the + application ID created for the function or app when it was registered with Azure Active + Directory. When specified, the vectorization connects to the function or app using a managed ID + (either system or user-assigned) of the search service and the access token of the function or + app, using this value as the resource id for creating the scope of the access token. + :vartype auth_resource_id: str + :ivar auth_identity: The user-assigned managed identity used for outbound connections. If an + authResourceId is provided and it's not specified, the system-assigned managed identity is + used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. + If set to "none", the value of this property is cleared. + :vartype auth_identity: "SearchIndexerDataIdentity" + """ + + uri: str + """The URI of the Web API providing the vectorizer.""" + httpHeaders: dict[str, str] + """The headers required to make the HTTP request.""" + httpMethod: str + """The method for the HTTP request.""" + timeout: str + """The desired timeout for the request. Default is 30 seconds.""" + authResourceId: Optional[str] + """Applies to custom endpoints that connect to external code in an Azure function or some other + application that provides the transformations. This value should be the application ID created + for the function or app when it was registered with Azure Active Directory. When specified, the + vectorization connects to the function or app using a managed ID (either system or + user-assigned) of the search service and the access token of the function or app, using this + value as the resource id for creating the scope of the access token.""" + authIdentity: Optional["SearchIndexerDataIdentity"] + """The user-assigned managed identity used for outbound connections. If an authResourceId is + provided and it's not specified, the system-assigned managed identity is used. On updates to + the indexer, if the identity is unspecified, the value remains unchanged. If set to \"none\", + the value of this property is cleared.""" + + +WebKnowledgeSource = TypedDict( + "WebKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.WEB]], + "webParameters": "WebKnowledgeSourceParameters", + }, + total=False, +) +WebKnowledgeSource.__doc__ = """Knowledge Source targeting web results. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: Required. A knowledge source that reads data from the web. +:vartype kind: Literal[KnowledgeSourceKind.WEB] +:ivar web_parameters: The parameters for the web knowledge source. +:vartype web_parameters: "WebKnowledgeSourceParameters" +""" + + +class WebKnowledgeSourceDomain(TypedDict, total=False): + """Configuration for web knowledge source domain. + + :ivar address: The address of the domain. Required. + :vartype address: str + :ivar include_subpages: Whether or not to include subpages from this domain. + :vartype include_subpages: bool + """ + + address: Required[str] + """The address of the domain. Required.""" + includeSubpages: bool + """Whether or not to include subpages from this domain.""" + + +class WebKnowledgeSourceDomains(TypedDict, total=False): + """Domain allow/block configuration for web knowledge source. + + :ivar allowed_domains: Domains that are allowed for web results. + :vartype allowed_domains: list["WebKnowledgeSourceDomain"] + :ivar blocked_domains: Domains that are blocked from web results. + :vartype blocked_domains: list["WebKnowledgeSourceDomain"] + """ + + allowedDomains: list["WebKnowledgeSourceDomain"] + """Domains that are allowed for web results.""" + blockedDomains: list["WebKnowledgeSourceDomain"] + """Domains that are blocked from web results.""" + + +class WebKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for web knowledge source. + + :ivar domains: Domain allow/block configuration for web results. + :vartype domains: "WebKnowledgeSourceDomains" + :ivar language: The default language for web results. Can be overridden at query time via + knowledge source runtime parameters. + :vartype language: str + :ivar market: The default market for web results. Can be overridden at query time via knowledge + source runtime parameters. + :vartype market: str + :ivar count: The default number of web results to return. Can be overridden at query time via + knowledge source runtime parameters. + :vartype count: int + :ivar freshness: The default freshness filter for web results. Can be overridden at query time + via knowledge source runtime parameters. + :vartype freshness: str + """ + + domains: "WebKnowledgeSourceDomains" + """Domain allow/block configuration for web results.""" + language: str + """The default language for web results. Can be overridden at query time via knowledge source + runtime parameters.""" + market: str + """The default market for web results. Can be overridden at query time via knowledge source + runtime parameters.""" + count: int + """The default number of web results to return. Can be overridden at query time via knowledge + source runtime parameters.""" + freshness: str + """The default freshness filter for web results. Can be overridden at query time via knowledge + source runtime parameters.""" + + +WordDelimiterTokenFilter = TypedDict( + "WordDelimiterTokenFilter", + { + "name": Required[str], + "generateWordParts": bool, + "generateNumberParts": bool, + "catenateWords": bool, + "catenateNumbers": bool, + "catenateAll": bool, + "splitOnCaseChange": bool, + "preserveOriginal": bool, + "splitOnNumerics": bool, + "stemEnglishPossessive": bool, + "protectedWords": list[str], + "@odata.type": Required[Literal["#Microsoft.Azure.Search.WordDelimiterTokenFilter"]], + }, + total=False, +) +WordDelimiterTokenFilter.__doc__ = """Splits words into subwords and performs optional transformations on subword groups. This token +filter is implemented using Apache Lucene. + +:ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes + or underscores, can only start and end with alphanumeric characters, and is limited to 128 + characters. Required. +:vartype name: str +:ivar generate_word_parts: A value indicating whether to generate part words. If set, causes + parts of words to be generated; for example "AzureSearch" becomes "Azure" "Search". Default is + true. +:vartype generate_word_parts: bool +:ivar generate_number_parts: A value indicating whether to generate number subwords. Default is + true. +:vartype generate_number_parts: bool +:ivar catenate_words: A value indicating whether maximum runs of word parts will be catenated. + For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default is false. +:vartype catenate_words: bool +:ivar catenate_numbers: A value indicating whether maximum runs of number parts will be + catenated. For example, if this is set to true, "1-2" becomes "12". Default is false. +:vartype catenate_numbers: bool +:ivar catenate_all: A value indicating whether all subword parts will be catenated. For + example, if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. +:vartype catenate_all: bool +:ivar split_on_case_change: A value indicating whether to split words on caseChange. For + example, if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. +:vartype split_on_case_change: bool +:ivar preserve_original: A value indicating whether original words will be preserved and added + to the subword list. Default is false. +:vartype preserve_original: bool +:ivar split_on_numerics: A value indicating whether to split on numbers. For example, if this + is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. +:vartype split_on_numerics: bool +:ivar stem_english_possessive: A value indicating whether to remove trailing "'s" for each + subword. Default is true. +:vartype stem_english_possessive: bool +:ivar protected_words: A list of tokens to protect from being delimited. +:vartype protected_words: list[str] +:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value + is "#Microsoft.Azure.Search.WordDelimiterTokenFilter". +:vartype odata_type: Literal["#Microsoft.Azure.Search.WordDelimiterTokenFilter"] +""" + + +WorkIQKnowledgeSource = TypedDict( + "WorkIQKnowledgeSource", + { + "name": Required[str], + "description": str, + "resultsProcessing": Union[str, "KnowledgeSourceResultsProcessing"], + "@odata.etag": str, + "encryptionKey": Optional["SearchResourceEncryptionKey"], + "kind": Required[Literal[KnowledgeSourceKind.WORK_IQ]], + "workIQParameters": Required["WorkIQKnowledgeSourceParameters"], + }, + total=False, +) +WorkIQKnowledgeSource.__doc__ = """Configuration for WorkIQ knowledge source. + +:ivar name: The name of the knowledge source. Required. +:vartype name: str +:ivar description: Optional user-defined description. +:vartype description: str +:ivar results_processing: Controls whether results from this knowledge source are reranked + before they are included in the final result set. Defaults to 'rerank' when not specified. + Known values are: "rerank" and "none". +:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar e_tag: The ETag of the knowledge source. +:vartype e_tag: str +:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. + This key is used to provide an additional level of encryption-at-rest for your knowledge source + definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once + you have encrypted your knowledge source definition, it will always remain encrypted. The + search service will ignore attempts to set this property to null. You can change this property + as needed if you want to rotate your encryption key; Your knowledge source definition will be + unaffected. Encryption with customer-managed keys is not available for free search services, + and is only available for paid services created on or after January 1, 2019. +:vartype encryption_key: "SearchResourceEncryptionKey" +:ivar kind: The discriminator value. Required. A knowledge source that reads data from work IQ. +:vartype kind: Literal[KnowledgeSourceKind.WORK_IQ] +:ivar work_iq_parameters: The parameters for the WorkIQ knowledge source, including the + customer-owned Entra app configuration used for on-behalf-of authentication. Required. +:vartype work_iq_parameters: "WorkIQKnowledgeSourceParameters" +""" + + +class WorkIQKnowledgeSourceParameters(TypedDict, total=False): + """Parameters for a WorkIQ knowledge source. + + :ivar entra_app_authentication: 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. Required. + :vartype entra_app_authentication: "EntraAppAuthentication" + """ + + entraAppAuthentication: Required["EntraAppAuthentication"] + """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. Required.""" + + +CognitiveServicesAccount = Union[ + AIServicesAccountIdentity, AIServicesAccountKey, CognitiveServicesAccountKey, DefaultCognitiveServicesAccount +] +VectorSearchVectorizer = Union[ + AIServicesVisionVectorizer, AzureMachineLearningVectorizer, AzureOpenAIVectorizer, WebApiVectorizer +] +TokenFilter = Union[ + AsciiFoldingTokenFilter, + CjkBigramTokenFilter, + CommonGramTokenFilter, + DictionaryDecompounderTokenFilter, + EdgeNGramTokenFilter, + EdgeNGramTokenFilterV2, + ElisionTokenFilter, + KeepTokenFilter, + KeywordMarkerTokenFilter, + LengthTokenFilter, + LimitTokenFilter, + NGramTokenFilter, + NGramTokenFilterV2, + PatternCaptureTokenFilter, + PatternReplaceTokenFilter, + PhoneticTokenFilter, + ShingleTokenFilter, + SnowballTokenFilter, + StemmerOverrideTokenFilter, + StemmerTokenFilter, + StopwordsTokenFilter, + SynonymTokenFilter, + TruncateTokenFilter, + UniqueTokenFilter, + WordDelimiterTokenFilter, +] +KnowledgeSource = Union[ + AzureBlobKnowledgeSource, + FabricDataAgentKnowledgeSource, + FabricOntologyKnowledgeSource, + FileKnowledgeSource, + IndexedOneLakeKnowledgeSource, + IndexedSharePointKnowledgeSource, + IndexedSqlKnowledgeSource, + McpServerKnowledgeSource, + RemoteSharePointKnowledgeSource, + SearchIndexKnowledgeSource, + WebKnowledgeSource, + WorkIQKnowledgeSource, +] +SearchIndexerSkill = Union[ + AzureMachineLearningSkill, + ChatCompletionSkill, + WebApiSkill, + AzureOpenAIEmbeddingSkill, + CustomEntityLookupSkill, + KeyPhraseExtractionSkill, + LanguageDetectionSkill, + MergeSkill, + PIIDetectionSkill, + SplitSkill, + TextTranslationSkill, + EntityLinkingSkill, + EntityRecognitionSkillV3, + SentimentSkillV3, + ConditionalSkill, + ContentUnderstandingSkill, + DocumentExtractionSkill, + DocumentIntelligenceLayoutSkill, + ShaperSkill, + ImageAnalysisSkill, + OcrSkill, + VisionVectorizeSkill, +] +VectorSearchCompression = Union[BinaryQuantizationCompression, ScalarQuantizationCompression] +SimilarityAlgorithm = Union[BM25SimilarityAlgorithm, ClassicSimilarityAlgorithm] +CharFilter = Union[MappingCharFilter, PatternReplaceCharFilter] +LexicalTokenizer = Union[ + ClassicTokenizer, + EdgeNGramTokenizer, + KeywordTokenizer, + KeywordTokenizerV2, + MicrosoftLanguageStemmingTokenizer, + MicrosoftLanguageTokenizer, + NGramTokenizer, + PathHierarchyTokenizerV2, + PatternTokenizer, + LuceneStandardTokenizer, + LuceneStandardTokenizerV2, + UaxUrlEmailTokenizer, +] +LexicalAnalyzer = Union[CustomAnalyzer, PatternAnalyzer, LuceneStandardAnalyzer, StopAnalyzer] +LexicalNormalizer = Union[CustomNormalizer] +DataChangeDetectionPolicy = Union[HighWaterMarkChangeDetectionPolicy, SqlIntegratedChangeTrackingPolicy] +DataDeletionDetectionPolicy = Union[ + NativeBlobSoftDeleteDeletionDetectionPolicy, SoftDeleteColumnDeletionDetectionPolicy +] +ScoringFunction = Union[DistanceScoringFunction, FreshnessScoringFunction, MagnitudeScoringFunction, TagScoringFunction] +VectorSearchAlgorithmConfiguration = Union[ExhaustiveKnnAlgorithmConfiguration, HnswAlgorithmConfiguration] +KnowledgeBaseModel = Union[KnowledgeBaseAzureOpenAIModel] +McpServerAuthentication = Union[McpServerFoundryConnectionAuthentication, McpServerStoredHeadersAuthentication] +McpServerOutputParsing = Union[ + McpServerAutoOutputParsing, McpServerJsonOutputParsing, McpServerNoneOutputParsing, McpServerSplitOutputParsing +] +SearchIndexerDataIdentity = Union[SearchIndexerDataNoneIdentity, SearchIndexerDataUserAssignedIdentity] +SearchIndexKnowledgeSourceBoost = Union[ + SearchIndexKnowledgeSourceFieldValueBoost, SearchIndexKnowledgeSourceMultiWordExpressionBoost +] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py index 7a5b0521fe82..67f5d998a85c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, TYPE_CHECKING, Union -from typing_extensions import Self from azure.core import PipelineClient from azure.core.credentials import AzureKeyCredential @@ -19,6 +19,11 @@ from ._configuration import KnowledgeBaseRetrievalClientConfiguration from ._operations import _KnowledgeBaseRetrievalClientOperationsMixin +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -35,8 +40,9 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClientOperationsMixin) :param knowledge_base_name: The name of the knowledge base. Required. :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py index 1d5627362187..a7650bc9a41a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py @@ -32,8 +32,9 @@ class KnowledgeBaseRetrievalClientConfiguration: # pylint: disable=too-many-ins :param knowledge_base_name: The name of the knowledge base. Required. :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -44,7 +45,7 @@ def __init__( knowledge_base_name: str, **kwargs: Any, ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_operations.py index 8d4903b5128c..39101cf02060 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_operations.py @@ -8,7 +8,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -26,7 +26,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models1, types as _types_models1 from ... import models as _models2 from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Serializer @@ -34,7 +34,6 @@ from ..._validation import api_version_validation from .._configuration import KnowledgeBaseRetrievalClientConfiguration -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -43,13 +42,17 @@ def build_knowledge_base_retrieval_retrieve_request( # pylint: disable=name-too-long - knowledge_base_name: str, *, query_source_authorization: Optional[str] = None, **kwargs: Any + knowledge_base_name: str, + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json;odata.metadata=minimal") # Construct URL @@ -70,6 +73,51 @@ def build_knowledge_base_retrieval_retrieve_request( # pylint: disable=name-too _headers["x-ms-query-source-authorization"] = _SERIALIZER.header( "query_source_authorization", query_source_authorization, "str" ) + if query_work_iq_source_authorization is not None: + _headers["x-ms-query-work-iq-source-authorization"] = _SERIALIZER.header( + "query_work_iq_source_authorization", query_work_iq_source_authorization, "str" + ) + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_knowledge_base_retrieval_retrieve_stream_request( # pylint: disable=name-too-long + knowledge_base_name: str, + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) + accept = _headers.pop("Accept", "text/event-stream") + + # Construct URL + _url = "/knowledgebases('{knowledgeBaseName}')/retrieve" + path_format_arguments = { + "knowledgeBaseName": _SERIALIZER.url("knowledge_base_name", knowledge_base_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if query_source_authorization is not None: + _headers["x-ms-query-source-authorization"] = _SERIALIZER.header( + "query_source_authorization", query_source_authorization, "str" + ) + if query_work_iq_source_authorization is not None: + _headers["x-ms-query-work-iq-source-authorization"] = _SERIALIZER.header( + "query_work_iq_source_authorization", query_work_iq_source_authorization, "str" + ) if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") @@ -86,6 +134,7 @@ def retrieve( retrieval_request: _models1.KnowledgeBaseRetrievalRequest, *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models1.KnowledgeBaseRetrievalResponse: @@ -98,6 +147,10 @@ def retrieve( executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -110,20 +163,26 @@ def retrieve( @overload def retrieve( self, - retrieval_request: JSON, + retrieval_request: _types_models1.KnowledgeBaseRetrievalRequest, *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models1.KnowledgeBaseRetrievalResponse: """KnowledgeBase retrieves relevant data from backing stores. :param retrieval_request: The retrieval request to process. Required. - :type retrieval_request: JSON + :type retrieval_request: + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest :keyword query_source_authorization: Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -139,6 +198,7 @@ def retrieve( retrieval_request: IO[bytes], *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models1.KnowledgeBaseRetrievalResponse: @@ -150,6 +210,10 @@ def retrieve( executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -161,27 +225,37 @@ def retrieve( @distributed_trace @api_version_validation( - params_added_on={"2026-05-01-preview": ["query_source_authorization"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + params_added_on={ + "2026-05-01-preview": ["query_source_authorization"], + "2026-08-01-preview": ["query_work_iq_source_authorization"], + }, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) def retrieve( self, - retrieval_request: Union[_models1.KnowledgeBaseRetrievalRequest, JSON, IO[bytes]], + retrieval_request: Union[ + _models1.KnowledgeBaseRetrievalRequest, _types_models1.KnowledgeBaseRetrievalRequest, IO[bytes] + ], *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, **kwargs: Any ) -> _models1.KnowledgeBaseRetrievalResponse: """KnowledgeBase retrieves relevant data from backing stores. - :param retrieval_request: The retrieval request to process. Is one of the following types: - KnowledgeBaseRetrievalRequest, JSON, IO[bytes] Required. + :param retrieval_request: The retrieval request to process. Is either a + KnowledgeBaseRetrievalRequest type or a IO[bytes] type. Required. :type retrieval_request: - ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest or JSON or - IO[bytes] + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest or + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest or IO[bytes] :keyword query_source_authorization: Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :return: KnowledgeBaseRetrievalResponse. The KnowledgeBaseRetrievalResponse is compatible with MutableMapping :rtype: ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResponse @@ -211,6 +285,7 @@ def retrieve( _request = build_knowledge_base_retrieval_retrieve_request( knowledge_base_name=self._config.knowledge_base_name, query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -252,3 +327,239 @@ def retrieve( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + def retrieve_stream( + self, + retrieval_request: _models1.KnowledgeBaseRetrievalRequest, + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def retrieve_stream( + self, + retrieval_request: _types_models1.KnowledgeBaseRetrievalRequest, + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def retrieve_stream( + self, + retrieval_request: IO[bytes], + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: IO[bytes] + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "accept", + "knowledge_base_name", + "query_source_authorization", + "query_work_iq_source_authorization", + "client_request_id", + "content_type", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + def retrieve_stream( + self, + retrieval_request: Union[ + _models1.KnowledgeBaseRetrievalRequest, _types_models1.KnowledgeBaseRetrievalRequest, IO[bytes] + ], + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + **kwargs: Any + ) -> Iterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Is either a + KnowledgeBaseRetrievalRequest type or a IO[bytes] type. Required. + :type retrieval_request: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest or + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest or IO[bytes] + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :return: Iterator[bytes] + :rtype: Iterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(retrieval_request, (IOBase, bytes)): + _content = retrieval_request + else: + _content = json.dumps(retrieval_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_knowledge_base_retrieval_retrieve_stream_request( + knowledge_base_name=self._config.knowledge_base_name, + query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py index d1cbe84ce31d..ef0d4dfa8b0b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py @@ -27,7 +27,7 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py index db24930fdca9..0f2c5bdfe70f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -296,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -325,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -420,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +624,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,11 +867,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } + dict_to_pass: dict[str, typing.Any] = {} if args: if isinstance(args[0], ET.Element): dict_to_pass.update(self._init_from_xml(args[0])) @@ -619,9 +887,19 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) - def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: """Deserialize an XML element into a dict mapping rest field names to values. :param ET.Element element: The XML element to deserialize from. @@ -629,53 +907,89 @@ def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: :rtype: dict """ result: dict[str, typing.Any] = {} - model_meta = getattr(self, "_xml", {}) existed_attr_keys: list[str] = [] - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) + result[rf._rest_name] = _deserialize(rf._type, item) # rest thing is additional properties for e in element: @@ -708,6 +1022,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -1082,6 +1399,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1094,6 +1412,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1113,7 +1432,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1126,7 +1448,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1172,6 +1498,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1181,6 +1508,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1414,6 +1742,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py index 81ec1de5922b..75906e2eb77f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -516,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1472,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1482,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/utils.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/utils.py index 927adb7c8ae2..b0131200252f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/utils.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/utils.py @@ -6,10 +6,14 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import Generic, Optional, TYPE_CHECKING, TypeVar +import json +import os +from typing import Any, Generic, IO, Mapping, Optional, TYPE_CHECKING, TypeVar, Union from azure.core import MatchConditions +from .._utils.model_base import Model, SdkJSONEncoder + if TYPE_CHECKING: from .serialization import Deserializer, Serializer @@ -55,3 +59,81 @@ def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchCondi if match_condition == MatchConditions.IfMissing: return "*" return None + + +# file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` +FileContent = Union[str, bytes, IO[str], IO[bytes]] + +FileType = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + tuple[Optional[str], FileContent, Optional[str]], +] + + +def serialize_multipart_data_entry(data_entry: Any) -> Any: + if isinstance(data_entry, (list, tuple, dict, Model)): + return json.dumps(data_entry, cls=SdkJSONEncoder, exclude_readonly=True) + return data_entry + + +def _normalize_multipart_file_entry(field_name: str, entry: Any, index: int) -> Any: + """Ensure a multipart file entry carries a filename for Content-Disposition. + + Servers distinguish file parts from plain form fields by the presence of + ``filename=`` in the ``Content-Disposition`` header. When callers pass + bare bytes/str/IO the HTTP client omits the filename and the server may + reject the upload. This helper wraps bare values into a (filename, content) + tuple, deriving the name from IO.name when available. + + :param str field_name: The multipart field name used as a filename fallback. + :param entry: The user-provided file entry (tuple, bytes, str, or IO). + :type entry: any + :param int index: The positional index of the entry within the field, used + to disambiguate fallback filenames when multiple entries are provided. + :return: Either the original tuple entry, or a ``(filename, content)`` tuple + wrapping the bare value. + :rtype: any + """ + if isinstance(entry, tuple): + return entry + filename: Optional[str] = None + name_attr = getattr(entry, "name", None) + if isinstance(name_attr, str) and name_attr: + filename = os.path.basename(name_attr) + if not filename: + filename = f"{field_name}_{index}" if index else field_name + + # Return a 3-tuple with an explicit "application/octet-stream" content type. + # A 2-tuple (filename, content) would leave the part's Content-Type unset, and + # the sdk core library only defaults to "application/octet-stream" for bare + # (non-tuple) values - a tuple bypasses that default and falls back to the + # HTTP "text/plain" default instead. Setting it explicitly preserves the + # pre-existing behavior for bare bytes/IO across all transports. + return (filename, entry, "application/octet-stream") + + +def prepare_multipart_form_data( + body: Mapping[str, Any], multipart_fields: list[str], data_fields: list[str] +) -> list[FileType]: + files: list[FileType] = [] + + # Data fields first so streaming server-side parsers see metadata before + # binary file parts. + for data_field in data_fields: + data_entry = body.get(data_field) + if data_entry: + files.append((data_field, str(serialize_multipart_data_entry(data_entry)))) + + for multipart_field in multipart_fields: + multipart_entry = body.get(multipart_field) + if isinstance(multipart_entry, list): + for idx, e in enumerate(multipart_entry): + files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, e, idx))) + elif multipart_entry is not None: + files.append((multipart_field, _normalize_multipart_file_entry(multipart_field, multipart_entry, 0))) + + return files diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py index 9fe2a69c6523..faa827b2e674 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, TYPE_CHECKING, Union -from typing_extensions import Self from azure.core import AsyncPipelineClient from azure.core.credentials import AzureKeyCredential @@ -19,6 +19,11 @@ from ._configuration import KnowledgeBaseRetrievalClientConfiguration from ._operations import _KnowledgeBaseRetrievalClientOperationsMixin +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -35,8 +40,9 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClientOperationsMixin) :param knowledge_base_name: The name of the knowledge base. Required. :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py index f9295f2485eb..06dd82cedb1e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py @@ -32,8 +32,9 @@ class KnowledgeBaseRetrievalClientConfiguration: # pylint: disable=too-many-ins :param knowledge_base_name: The name of the knowledge base. Required. :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are - "2026-05-01-preview". Default value is "2026-05-01-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-08-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -44,7 +45,7 @@ def __init__( knowledge_base_name: str, **kwargs: Any, ) -> None: - api_version: str = kwargs.pop("api_version", "2026-05-01-preview") + api_version: str = kwargs.pop("api_version", "2026-08-01-preview") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_operations.py index 2e656fd4c4da..02dfb1bdc0ef 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -27,15 +27,17 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models2, types as _types_models2 from .... import models as _models3 from ...._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ...._utils.utils import ClientMixinABC from ...._validation import api_version_validation -from ..._operations._operations import build_knowledge_base_retrieval_retrieve_request +from ..._operations._operations import ( + build_knowledge_base_retrieval_retrieve_request, + build_knowledge_base_retrieval_retrieve_stream_request, +) from .._configuration import KnowledgeBaseRetrievalClientConfiguration -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] @@ -50,6 +52,7 @@ async def retrieve( retrieval_request: _models2.KnowledgeBaseRetrievalRequest, *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models2.KnowledgeBaseRetrievalResponse: @@ -62,6 +65,10 @@ async def retrieve( executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -74,20 +81,26 @@ async def retrieve( @overload async def retrieve( self, - retrieval_request: JSON, + retrieval_request: _types_models2.KnowledgeBaseRetrievalRequest, *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models2.KnowledgeBaseRetrievalResponse: """KnowledgeBase retrieves relevant data from backing stores. :param retrieval_request: The retrieval request to process. Required. - :type retrieval_request: JSON + :type retrieval_request: + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest :keyword query_source_authorization: Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -103,6 +116,7 @@ async def retrieve( retrieval_request: IO[bytes], *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, content_type: str = "application/json", **kwargs: Any ) -> _models2.KnowledgeBaseRetrievalResponse: @@ -114,6 +128,10 @@ async def retrieve( executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -125,27 +143,37 @@ async def retrieve( @distributed_trace_async @api_version_validation( - params_added_on={"2026-05-01-preview": ["query_source_authorization"]}, - api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], + params_added_on={ + "2026-05-01-preview": ["query_source_authorization"], + "2026-08-01-preview": ["query_work_iq_source_authorization"], + }, + api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) async def retrieve( self, - retrieval_request: Union[_models2.KnowledgeBaseRetrievalRequest, JSON, IO[bytes]], + retrieval_request: Union[ + _models2.KnowledgeBaseRetrievalRequest, _types_models2.KnowledgeBaseRetrievalRequest, IO[bytes] + ], *, query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, **kwargs: Any ) -> _models2.KnowledgeBaseRetrievalResponse: """KnowledgeBase retrieves relevant data from backing stores. - :param retrieval_request: The retrieval request to process. Is one of the following types: - KnowledgeBaseRetrievalRequest, JSON, IO[bytes] Required. + :param retrieval_request: The retrieval request to process. Is either a + KnowledgeBaseRetrievalRequest type or a IO[bytes] type. Required. :type retrieval_request: - ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest or JSON or - IO[bytes] + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest or + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest or IO[bytes] :keyword query_source_authorization: Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. Default value is None. :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str :return: KnowledgeBaseRetrievalResponse. The KnowledgeBaseRetrievalResponse is compatible with MutableMapping :rtype: ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResponse @@ -175,6 +203,7 @@ async def retrieve( _request = build_knowledge_base_retrieval_retrieve_request( knowledge_base_name=self._config.knowledge_base_name, query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -216,3 +245,239 @@ async def retrieve( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + async def retrieve_stream( + self, + retrieval_request: _models2.KnowledgeBaseRetrievalRequest, + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def retrieve_stream( + self, + retrieval_request: _types_models2.KnowledgeBaseRetrievalRequest, + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def retrieve_stream( + self, + retrieval_request: IO[bytes], + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: IO[bytes] + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-08-01-preview", + params_added_on={ + "2026-08-01-preview": [ + "api_version", + "accept", + "knowledge_base_name", + "query_source_authorization", + "query_work_iq_source_authorization", + "client_request_id", + "content_type", + ] + }, + api_versions_list=["2026-08-01-preview"], + ) + async def retrieve_stream( + self, + retrieval_request: Union[ + _models2.KnowledgeBaseRetrievalRequest, _types_models2.KnowledgeBaseRetrievalRequest, IO[bytes] + ], + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + """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. + + :param retrieval_request: The retrieval request to process. Is either a + KnowledgeBaseRetrievalRequest type or a IO[bytes] type. Required. + :type retrieval_request: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest or + ~azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest or IO[bytes] + :keyword query_source_authorization: Token identifying the user for which the query is being + executed. This token is used to enforce security restrictions on documents. Default value is + None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: 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. Default value is None. + :paramtype query_work_iq_source_authorization: str + :return: AsyncIterator[bytes] + :rtype: AsyncIterator[bytes] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(retrieval_request, (IOBase, bytes)): + _content = retrieval_request + else: + _content = json.dumps(retrieval_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_knowledge_base_retrieval_retrieve_stream_request( + knowledge_base_name=self._config.knowledge_base_name, + query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py index 122eb259d9ef..21ca59a0335c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py @@ -28,7 +28,7 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is - ``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may + ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/__init__.py index cc9491bf92bb..a97f4d1ae08c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/__init__.py @@ -27,7 +27,10 @@ IndexedSharePointKnowledgeSourceParams, IndexedSqlKnowledgeSourceParams, KnowledgeBaseActivityRecord, + KnowledgeBaseActivityRecordModel, + KnowledgeBaseActivityStartedEvent, KnowledgeBaseAgenticReasoningActivityRecord, + KnowledgeBaseAnswerCompletedEvent, KnowledgeBaseAzureBlobActivityArguments, KnowledgeBaseAzureBlobActivityRecord, KnowledgeBaseAzureBlobReference, @@ -62,21 +65,26 @@ KnowledgeBaseModelAnswerSynthesisActivityRecord, KnowledgeBaseModelQueryPlanningActivityRecord, KnowledgeBaseModelWebSummarizationActivityRecord, + KnowledgeBaseQueryHintProcessing, KnowledgeBaseReference, KnowledgeBaseRemoteSharePointActivityArguments, KnowledgeBaseRemoteSharePointActivityRecord, KnowledgeBaseRemoteSharePointReference, + KnowledgeBaseResponseCompletedEvent, KnowledgeBaseRetrievalRequest, KnowledgeBaseRetrievalResponse, + KnowledgeBaseRetrievalStartedEvent, KnowledgeBaseSearchIndexActivityArguments, KnowledgeBaseSearchIndexActivityRecord, KnowledgeBaseSearchIndexReference, + KnowledgeBaseStreamErrorEvent, KnowledgeBaseWebActivityArguments, KnowledgeBaseWebActivityRecord, KnowledgeBaseWebReference, KnowledgeBaseWorkIQActivityArguments, KnowledgeBaseWorkIQActivityRecord, KnowledgeBaseWorkIQReference, + KnowledgeRetrievalAutoReasoningEffort, KnowledgeRetrievalIntent, KnowledgeRetrievalLowReasoningEffort, KnowledgeRetrievalMediumReasoningEffort, @@ -94,9 +102,9 @@ PurviewSensitivityLabelInfo, RemoteSharePointKnowledgeSourceParams, SearchIndexKnowledgeSourceParams, + ServedImage, SynchronizationState, WebKnowledgeSourceParams, - WorkIQAttribution, WorkIQKnowledgeSourceParams, ) @@ -104,9 +112,11 @@ KnowledgeBaseActivityRecordType, KnowledgeBaseMessageContentType, KnowledgeBaseReferenceType, + KnowledgeBaseRetrievalStatusCode, KnowledgeRetrievalIntentType, KnowledgeRetrievalOutputMode, KnowledgeRetrievalReasoningEffortKind, + KnowledgeSourceNetworkAccessMode, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -126,7 +136,10 @@ "IndexedSharePointKnowledgeSourceParams", "IndexedSqlKnowledgeSourceParams", "KnowledgeBaseActivityRecord", + "KnowledgeBaseActivityRecordModel", + "KnowledgeBaseActivityStartedEvent", "KnowledgeBaseAgenticReasoningActivityRecord", + "KnowledgeBaseAnswerCompletedEvent", "KnowledgeBaseAzureBlobActivityArguments", "KnowledgeBaseAzureBlobActivityRecord", "KnowledgeBaseAzureBlobReference", @@ -161,21 +174,26 @@ "KnowledgeBaseModelAnswerSynthesisActivityRecord", "KnowledgeBaseModelQueryPlanningActivityRecord", "KnowledgeBaseModelWebSummarizationActivityRecord", + "KnowledgeBaseQueryHintProcessing", "KnowledgeBaseReference", "KnowledgeBaseRemoteSharePointActivityArguments", "KnowledgeBaseRemoteSharePointActivityRecord", "KnowledgeBaseRemoteSharePointReference", + "KnowledgeBaseResponseCompletedEvent", "KnowledgeBaseRetrievalRequest", "KnowledgeBaseRetrievalResponse", + "KnowledgeBaseRetrievalStartedEvent", "KnowledgeBaseSearchIndexActivityArguments", "KnowledgeBaseSearchIndexActivityRecord", "KnowledgeBaseSearchIndexReference", + "KnowledgeBaseStreamErrorEvent", "KnowledgeBaseWebActivityArguments", "KnowledgeBaseWebActivityRecord", "KnowledgeBaseWebReference", "KnowledgeBaseWorkIQActivityArguments", "KnowledgeBaseWorkIQActivityRecord", "KnowledgeBaseWorkIQReference", + "KnowledgeRetrievalAutoReasoningEffort", "KnowledgeRetrievalIntent", "KnowledgeRetrievalLowReasoningEffort", "KnowledgeRetrievalMediumReasoningEffort", @@ -193,16 +211,18 @@ "PurviewSensitivityLabelInfo", "RemoteSharePointKnowledgeSourceParams", "SearchIndexKnowledgeSourceParams", + "ServedImage", "SynchronizationState", "WebKnowledgeSourceParams", - "WorkIQAttribution", "WorkIQKnowledgeSourceParams", "KnowledgeBaseActivityRecordType", "KnowledgeBaseMessageContentType", "KnowledgeBaseReferenceType", + "KnowledgeBaseRetrievalStatusCode", "KnowledgeRetrievalIntentType", "KnowledgeRetrievalOutputMode", "KnowledgeRetrievalReasoningEffortKind", + "KnowledgeSourceNetworkAccessMode", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_enums.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_enums.py index 5463be6fe21f..0b8a246ba553 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_enums.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_enums.py @@ -85,6 +85,15 @@ class KnowledgeBaseReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indexed SQL document reference.""" +class KnowledgeBaseRetrievalStatusCode(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The semantic HTTP status of a completed streaming retrieval.""" + + OK = 200 + """The retrieval completed successfully.""" + PARTIAL_CONTENT = 206 + """The retrieval completed with partial results.""" + + class KnowledgeRetrievalIntentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of knowledge base configuration to use.""" @@ -110,3 +119,16 @@ class KnowledgeRetrievalReasoningEffortKind(str, Enum, metaclass=CaseInsensitive """Use low reasoning during retrieval.""" MEDIUM = "medium" """Use a moderate amount of reasoning during retrieval.""" + AUTO = "auto" + """Automatically select the reasoning effort during retrieval, escalating from the cheapest tier + only as far as needed.""" + + +class KnowledgeSourceNetworkAccessMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the network access mode for knowledge source ingestion. Default is 'public'.""" + + PUBLIC = "public" + """Ingestion runs in the standard, publicly reachable execution environment. This is the default.""" + PRIVATE = "private" + """Ingestion runs in a private execution environment so it can reach data sources and dependencies + over a private network (private endpoint / shared private link).""" diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py index bd29b03d3aa1..af41417e7b28 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py @@ -23,6 +23,7 @@ if TYPE_CHECKING: from .. import models as _models + from ... import models as _models2 from ...indexes import models as _indexes_models3 @@ -118,12 +119,22 @@ class KnowledgeSourceParams(_Model): :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -156,6 +167,12 @@ class KnowledgeSourceParams(_Model): ) """Indicates that this knowledge source should bypass source selection and always be queried at retrieval time.""" + never_query_source: Optional[bool] = rest_field( + name="neverQuerySource", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" fail_on_error: Optional[bool] = rest_field( name="failOnError", visibility=["read", "create", "update", "delete", "query"] ) @@ -165,6 +182,11 @@ class KnowledgeSourceParams(_Model): name="rerankerThreshold", visibility=["read", "create", "update", "delete", "query"] ) """The reranker threshold all retrieved documents must meet to be included in the response.""" + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = rest_field( + name="resultsProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" max_output_documents: Optional[int] = rest_field( name="maxOutputDocuments", visibility=["read", "create", "update", "delete", "query"] ) @@ -188,8 +210,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, ) -> None: ... @@ -219,12 +243,22 @@ class AzureBlobKnowledgeSourceParams(KnowledgeSourceParams, discriminator="azure :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -235,11 +269,21 @@ class AzureBlobKnowledgeSourceParams(KnowledgeSourceParams, discriminator="azure :ivar kind: The discriminator value. Required. A knowledge source that read and ingest data from Azure Blob Storage to a Search Index. :vartype kind: str or ~azure.search.documents.indexes.models.AZURE_BLOB + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ kind: Literal[KnowledgeSourceKind.AZURE_BLOB] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. A knowledge source that read and ingest data from Azure Blob Storage to a Search Index.""" + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHintOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -249,10 +293,13 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -339,12 +386,22 @@ class FabricDataAgentKnowledgeSourceParams(KnowledgeSourceParams, discriminator= :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -369,8 +426,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, ) -> None: ... @@ -401,12 +460,22 @@ class FabricOntologyKnowledgeSourceParams(KnowledgeSourceParams, discriminator=" :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -431,8 +500,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, ) -> None: ... @@ -463,12 +534,22 @@ class FileKnowledgeSourceParams(KnowledgeSourceParams, discriminator="file"): :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -479,11 +560,21 @@ class FileKnowledgeSourceParams(KnowledgeSourceParams, discriminator="file"): :ivar kind: The discriminator value. Required. A knowledge source that supports direct file upload and indexing. :vartype kind: str or ~azure.search.documents.indexes.models.FILE + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ kind: Literal[KnowledgeSourceKind.FILE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. A knowledge source that supports direct file upload and indexing.""" + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHintOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -493,10 +584,13 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -556,6 +650,9 @@ class ImageServingStatistics(_Model): :ivar verbalization_used: Indicates whether image verbalization was used instead of direct image serving. :vartype verbalization_used: bool + :ivar served_images: The set of images the model selected to be served to the downstream model + for this retrieval activity. + :vartype served_images: list[~azure.search.documents.knowledgebases.models.ServedImage] """ images_retrieved: Optional[int] = rest_field( @@ -574,6 +671,11 @@ class ImageServingStatistics(_Model): name="verbalizationUsed", visibility=["read", "create", "update", "delete", "query"] ) """Indicates whether image verbalization was used instead of direct image serving.""" + served_images: Optional[list["_models.ServedImage"]] = rest_field( + name="servedImages", visibility=["read", "create", "update", "delete", "query"] + ) + """The set of images the model selected to be served to the downstream model for this retrieval + activity.""" @overload def __init__( @@ -583,6 +685,7 @@ def __init__( images_sent_to_model: Optional[int] = None, total_image_size_bytes: Optional[int] = None, verbalization_used: Optional[bool] = None, + served_images: Optional[list["_models.ServedImage"]] = None, ) -> None: ... @overload @@ -610,12 +713,22 @@ class IndexedOneLakeKnowledgeSourceParams(KnowledgeSourceParams, discriminator=" :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -626,10 +739,20 @@ class IndexedOneLakeKnowledgeSourceParams(KnowledgeSourceParams, discriminator=" :ivar kind: The discriminator value. Required. A knowledge source that reads data from indexed OneLake. :vartype kind: str or ~azure.search.documents.indexes.models.INDEXED_ONELAKE + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. A knowledge source that reads data from indexed OneLake.""" + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHintOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -639,10 +762,13 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -671,12 +797,22 @@ class IndexedSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminato :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -687,10 +823,20 @@ class IndexedSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminato :ivar kind: The discriminator value. Required. A knowledge source that reads data from indexed SharePoint. :vartype kind: str or ~azure.search.documents.indexes.models.INDEXED_SHARE_POINT + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. A knowledge source that reads data from indexed SharePoint.""" + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHintOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -700,10 +846,13 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -732,12 +881,22 @@ class IndexedSqlKnowledgeSourceParams(KnowledgeSourceParams, discriminator="inde :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -748,11 +907,21 @@ class IndexedSqlKnowledgeSourceParams(KnowledgeSourceParams, discriminator="inde :ivar kind: The discriminator value. Required. A knowledge source that retrieves and ingests data from Azure SQL Database or SQL Managed Instance to a Search Index. :vartype kind: str or ~azure.search.documents.indexes.models.INDEXED_SQL + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ kind: Literal[KnowledgeSourceKind.INDEXED_SQL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. A knowledge source that retrieves and ingests data from Azure SQL Database or SQL Managed Instance to a Search Index.""" + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHintOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -762,10 +931,13 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -803,6 +975,10 @@ class KnowledgeBaseActivityRecord(_Model): "modelAnswerSynthesis", "modelWebSummarization", and "agenticReasoning". :vartype type: str or ~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordType + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -823,6 +999,14 @@ class KnowledgeBaseActivityRecord(_Model): \"fabricDataAgent\", \"fabricOntology\", \"mcpServer\", \"file\", \"indexedSql\", \"modelQueryPlanning\", \"modelAnswerSynthesis\", \"modelWebSummarization\", and \"agenticReasoning\".""" + started_at: Optional[datetime.datetime] = rest_field( + name="startedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time at which the activity started.""" + completed_at: Optional[datetime.datetime] = rest_field( + name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time at which the activity completed.""" elapsed_ms: Optional[int] = rest_field(name="elapsedMs", visibility=["read", "create", "update", "delete", "query"]) """The elapsed time in milliseconds for the retrieval activity.""" error: Optional["_models.KnowledgeBaseErrorDetail"] = rest_field( @@ -840,6 +1024,8 @@ def __init__( *, id: int, # pylint: disable=redefined-builtin type: str, + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -856,6 +1042,102 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class KnowledgeBaseActivityRecordModel(_Model): + """Represents the model used for a knowledge base LLM activity, including its model name and + deployment identifier. + + :ivar model_name: The name of the model used for the activity. + :vartype model_name: str + :ivar deployment_id: The deployment identifier of the model used for the activity. + :vartype deployment_id: str + """ + + model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the model used for the activity.""" + deployment_id: Optional[str] = rest_field( + name="deploymentId", visibility=["read", "create", "update", "delete", "query"] + ) + """The deployment identifier of the model used for the activity.""" + + @overload + def __init__( + self, + *, + model_name: Optional[str] = None, + deployment_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KnowledgeBaseActivityStartedEvent(_Model): + """Emitted immediately before an individual retrieval activity begins executing. + + :ivar id: The ID of the activity record, matching the ``id`` on the corresponding + ``activity.completed`` event. Required. + :vartype id: int + :ivar type: The type of the activity that has started. Required. Known values are: + "searchIndex", "azureBlob", "indexedSharePoint", "indexedOneLake", "web", "remoteSharePoint", + "workIQ", "fabricDataAgent", "fabricOntology", "mcpServer", "file", "indexedSql", + "modelQueryPlanning", "modelAnswerSynthesis", "modelWebSummarization", and "agenticReasoning". + :vartype type: str or + ~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordType + :ivar started_at: The time at which the activity started. Required. + :vartype started_at: ~datetime.datetime + :ivar knowledge_source_name: The knowledge source used by the activity, when the activity + targets a knowledge source. + :vartype knowledge_source_name: str + """ + + id: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the activity record, matching the ``id`` on the corresponding ``activity.completed`` + event. Required.""" + type: Union[str, "_models.KnowledgeBaseActivityRecordType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the activity that has started. Required. Known values are: \"searchIndex\", + \"azureBlob\", \"indexedSharePoint\", \"indexedOneLake\", \"web\", \"remoteSharePoint\", + \"workIQ\", \"fabricDataAgent\", \"fabricOntology\", \"mcpServer\", \"file\", \"indexedSql\", + \"modelQueryPlanning\", \"modelAnswerSynthesis\", \"modelWebSummarization\", and + \"agenticReasoning\".""" + started_at: datetime.datetime = rest_field( + name="startedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time at which the activity started. Required.""" + knowledge_source_name: Optional[str] = rest_field( + name="knowledgeSourceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The knowledge source used by the activity, when the activity targets a knowledge source.""" + + @overload + def __init__( + self, + *, + id: int, # pylint: disable=redefined-builtin + type: Union[str, "_models.KnowledgeBaseActivityRecordType"], + started_at: datetime.datetime, + knowledge_source_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeBaseAgenticReasoningActivityRecord( KnowledgeBaseActivityRecord, discriminator="agenticReasoning" ): # pylint: disable=name-too-long @@ -863,6 +1145,10 @@ class KnowledgeBaseAgenticReasoningActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -879,6 +1165,11 @@ class KnowledgeBaseAgenticReasoningActivityRecord( :ivar retrieval_reasoning_effort: The retrieval reasoning effort configuration. :vartype retrieval_reasoning_effort: ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort + :ivar logical_reasoning_effort: The logical reasoning effort requested by the customer. This is + distinct from ``retrievalReasoningEffort``, which reports the reasoning effort used for + billing. + :vartype logical_reasoning_effort: + ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort """ type: Literal[KnowledgeBaseActivityRecordType.AGENTIC_REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -891,17 +1182,25 @@ class KnowledgeBaseAgenticReasoningActivityRecord( name="retrievalReasoningEffort", visibility=["read", "create", "update", "delete", "query"] ) """The retrieval reasoning effort configuration.""" + logical_reasoning_effort: Optional["_models.KnowledgeRetrievalReasoningEffort"] = rest_field( + name="logicalReasoningEffort", visibility=["read", "create", "update", "delete", "query"] + ) + """The logical reasoning effort requested by the customer. This is distinct from + ``retrievalReasoningEffort``, which reports the reasoning effort used for billing.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, reasoning_tokens: Optional[int] = None, retrieval_reasoning_effort: Optional["_models.KnowledgeRetrievalReasoningEffort"] = None, + logical_reasoning_effort: Optional["_models.KnowledgeRetrievalReasoningEffort"] = None, ) -> None: ... @overload @@ -916,6 +1215,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.AGENTIC_REASONING # type: ignore +class KnowledgeBaseAnswerCompletedEvent(_Model): + """Emitted when a fully validated and post-processed synthesized answer is available. + + :ivar message_index: The zero-based index of the completed message in the final response array. + Required. + :vartype message_index: int + :ivar message: The completed answer message. Required. + :vartype message: ~azure.search.documents.knowledgebases.models.KnowledgeBaseMessage + """ + + message_index: int = rest_field(name="messageIndex", visibility=["read", "create", "update", "delete", "query"]) + """The zero-based index of the completed message in the final response array. Required.""" + message: "_models.KnowledgeBaseMessage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The completed answer message. Required.""" + + @overload + def __init__( + self, + *, + message_index: int, + message: "_models.KnowledgeBaseMessage", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeBaseAzureBlobActivityArguments(_Model): """Represents the arguments the azure blob retrieval activity was run with. @@ -949,6 +1282,10 @@ class KnowledgeBaseAzureBlobActivityRecord(KnowledgeBaseActivityRecord, discrimi :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -972,6 +1309,10 @@ class KnowledgeBaseAzureBlobActivityRecord(KnowledgeBaseActivityRecord, discrimi :ivar azure_blob_arguments: The azure blob arguments for the retrieval activity. :vartype azure_blob_arguments: ~azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityArguments + :ivar query_hint_processing: Details about the expressions generated from query hints for this + activity. + :vartype query_hint_processing: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing """ knowledge_source_name: Optional[str] = rest_field( @@ -995,12 +1336,18 @@ class KnowledgeBaseAzureBlobActivityRecord(KnowledgeBaseActivityRecord, discrimi name="azureBlobArguments", visibility=["read", "create", "update", "delete", "query"] ) """The azure blob arguments for the retrieval activity.""" + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = rest_field( + name="queryHintProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the expressions generated from query hints for this activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -1009,6 +1356,7 @@ def __init__( count: Optional[int] = None, image_serving: Optional["_models.ImageServingStatistics"] = None, azure_blob_arguments: Optional["_models.KnowledgeBaseAzureBlobActivityArguments"] = None, + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = None, ) -> None: ... @overload @@ -1106,6 +1454,9 @@ class KnowledgeBaseAzureBlobReference(KnowledgeBaseReference, discriminator="azu :ivar search_sensitivity_label_info: The sensitivity label information for the reference. :vartype search_sensitivity_label_info: ~azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo + :ivar citation_url: A Search-owned URL that points at the backing document for this reference, + usable as a citation target. + :vartype citation_url: str """ type: Literal[KnowledgeBaseReferenceType.AZURE_BLOB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -1116,6 +1467,11 @@ class KnowledgeBaseAzureBlobReference(KnowledgeBaseReference, discriminator="azu name="searchSensitivityLabelInfo", visibility=["read", "create", "update", "delete", "query"] ) """The sensitivity label information for the reference.""" + citation_url: Optional[str] = rest_field( + name="citationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """A Search-owned URL that points at the backing document for this reference, usable as a citation + target.""" @overload def __init__( @@ -1127,6 +1483,7 @@ def __init__( reranker_score: Optional[float] = None, blob_url: Optional[str] = None, search_sensitivity_label_info: Optional["_models.PurviewSensitivityLabelInfo"] = None, + citation_url: Optional[str] = None, ) -> None: ... @overload @@ -1221,6 +1578,10 @@ class KnowledgeBaseFabricDataAgentActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -1273,6 +1634,8 @@ def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -1384,6 +1747,10 @@ class KnowledgeBaseFabricOntologyActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -1436,6 +1803,8 @@ def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -1545,6 +1914,10 @@ class KnowledgeBaseFileActivityRecord(KnowledgeBaseActivityRecord, discriminator :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -1568,6 +1941,10 @@ class KnowledgeBaseFileActivityRecord(KnowledgeBaseActivityRecord, discriminator :ivar file_arguments: The File arguments for the retrieval activity. :vartype file_arguments: ~azure.search.documents.knowledgebases.models.KnowledgeBaseFileActivityArguments + :ivar query_hint_processing: Details about the expressions generated from query hints for this + activity. + :vartype query_hint_processing: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing """ knowledge_source_name: Optional[str] = rest_field( @@ -1591,12 +1968,18 @@ class KnowledgeBaseFileActivityRecord(KnowledgeBaseActivityRecord, discriminator name="fileArguments", visibility=["read", "create", "update", "delete", "query"] ) """The File arguments for the retrieval activity.""" + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = rest_field( + name="queryHintProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the expressions generated from query hints for this activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -1605,6 +1988,7 @@ def __init__( count: Optional[int] = None, image_serving: Optional["_models.ImageServingStatistics"] = None, file_arguments: Optional["_models.KnowledgeBaseFileActivityArguments"] = None, + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = None, ) -> None: ... @overload @@ -1634,12 +2018,20 @@ class KnowledgeBaseFileReference(KnowledgeBaseReference, discriminator="file"): :vartype type: str or ~azure.search.documents.knowledgebases.models.FILE :ivar doc_name: The document name for the reference. :vartype doc_name: str + :ivar citation_url: A Search-owned URL that points at the backing document for this reference, + usable as a citation target. + :vartype citation_url: str """ type: Literal[KnowledgeBaseReferenceType.FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. File document reference.""" doc_name: Optional[str] = rest_field(name="docName", visibility=["read", "create", "update", "delete", "query"]) """The document name for the reference.""" + citation_url: Optional[str] = rest_field( + name="citationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """A Search-owned URL that points at the backing document for this reference, usable as a citation + target.""" @overload def __init__( @@ -1650,6 +2042,7 @@ def __init__( source_data: Optional[dict[str, Any]] = None, reranker_score: Optional[float] = None, doc_name: Optional[str] = None, + citation_url: Optional[str] = None, ) -> None: ... @overload @@ -1727,6 +2120,10 @@ class KnowledgeBaseIndexedOneLakeActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -1750,6 +2147,10 @@ class KnowledgeBaseIndexedOneLakeActivityRecord( :ivar indexed_one_lake_arguments: The indexed OneLake arguments for the retrieval activity. :vartype indexed_one_lake_arguments: ~azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeActivityArguments + :ivar query_hint_processing: Details about the expressions generated from query hints for this + activity. + :vartype query_hint_processing: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing """ knowledge_source_name: Optional[str] = rest_field( @@ -1773,12 +2174,18 @@ class KnowledgeBaseIndexedOneLakeActivityRecord( name="indexedOneLakeArguments", visibility=["read", "create", "update", "delete", "query"] ) """The indexed OneLake arguments for the retrieval activity.""" + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = rest_field( + name="queryHintProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the expressions generated from query hints for this activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -1787,6 +2194,7 @@ def __init__( count: Optional[int] = None, image_serving: Optional["_models.ImageServingStatistics"] = None, indexed_one_lake_arguments: Optional["_models.KnowledgeBaseIndexedOneLakeActivityArguments"] = None, + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = None, ) -> None: ... @overload @@ -1819,6 +2227,9 @@ class KnowledgeBaseIndexedOneLakeReference(KnowledgeBaseReference, discriminator :ivar search_sensitivity_label_info: The sensitivity label information for the reference. :vartype search_sensitivity_label_info: ~azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo + :ivar citation_url: A Search-owned URL that points at the backing document for this reference, + usable as a citation target. + :vartype citation_url: str """ type: Literal[KnowledgeBaseReferenceType.INDEXED_ONELAKE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -1829,6 +2240,11 @@ class KnowledgeBaseIndexedOneLakeReference(KnowledgeBaseReference, discriminator name="searchSensitivityLabelInfo", visibility=["read", "create", "update", "delete", "query"] ) """The sensitivity label information for the reference.""" + citation_url: Optional[str] = rest_field( + name="citationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """A Search-owned URL that points at the backing document for this reference, usable as a citation + target.""" @overload def __init__( @@ -1840,6 +2256,7 @@ def __init__( reranker_score: Optional[float] = None, doc_url: Optional[str] = None, search_sensitivity_label_info: Optional["_models.PurviewSensitivityLabelInfo"] = None, + citation_url: Optional[str] = None, ) -> None: ... @overload @@ -1889,6 +2306,10 @@ class KnowledgeBaseIndexedSharePointActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -1913,6 +2334,10 @@ class KnowledgeBaseIndexedSharePointActivityRecord( activity. :vartype indexed_share_point_arguments: ~azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointActivityArguments + :ivar query_hint_processing: Details about the expressions generated from query hints for this + activity. + :vartype query_hint_processing: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing """ knowledge_source_name: Optional[str] = rest_field( @@ -1936,12 +2361,18 @@ class KnowledgeBaseIndexedSharePointActivityRecord( name="indexedSharePointArguments", visibility=["read", "create", "update", "delete", "query"] ) """The indexed SharePoint arguments for the retrieval activity.""" + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = rest_field( + name="queryHintProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the expressions generated from query hints for this activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -1950,6 +2381,7 @@ def __init__( count: Optional[int] = None, image_serving: Optional["_models.ImageServingStatistics"] = None, indexed_share_point_arguments: Optional["_models.KnowledgeBaseIndexedSharePointActivityArguments"] = None, + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = None, ) -> None: ... @overload @@ -1982,6 +2414,9 @@ class KnowledgeBaseIndexedSharePointReference(KnowledgeBaseReference, discrimina :ivar search_sensitivity_label_info: The sensitivity label information for the reference. :vartype search_sensitivity_label_info: ~azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo + :ivar citation_url: A Search-owned URL that points at the backing document for this reference, + usable as a citation target. + :vartype citation_url: str """ type: Literal[KnowledgeBaseReferenceType.INDEXED_SHARE_POINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -1992,6 +2427,11 @@ class KnowledgeBaseIndexedSharePointReference(KnowledgeBaseReference, discrimina name="searchSensitivityLabelInfo", visibility=["read", "create", "update", "delete", "query"] ) """The sensitivity label information for the reference.""" + citation_url: Optional[str] = rest_field( + name="citationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """A Search-owned URL that points at the backing document for this reference, usable as a citation + target.""" @overload def __init__( @@ -2003,6 +2443,7 @@ def __init__( reranker_score: Optional[float] = None, doc_url: Optional[str] = None, search_sensitivity_label_info: Optional["_models.PurviewSensitivityLabelInfo"] = None, + citation_url: Optional[str] = None, ) -> None: ... @overload @@ -2050,6 +2491,10 @@ class KnowledgeBaseIndexedSqlActivityRecord(KnowledgeBaseActivityRecord, discrim :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -2073,6 +2518,10 @@ class KnowledgeBaseIndexedSqlActivityRecord(KnowledgeBaseActivityRecord, discrim :ivar indexed_sql_arguments: The indexed SQL arguments for the retrieval activity. :vartype indexed_sql_arguments: ~azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlActivityArguments + :ivar query_hint_processing: Details about the expressions generated from query hints for this + activity. + :vartype query_hint_processing: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing """ knowledge_source_name: Optional[str] = rest_field( @@ -2096,12 +2545,18 @@ class KnowledgeBaseIndexedSqlActivityRecord(KnowledgeBaseActivityRecord, discrim name="indexedSqlArguments", visibility=["read", "create", "update", "delete", "query"] ) """The indexed SQL arguments for the retrieval activity.""" + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = rest_field( + name="queryHintProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the expressions generated from query hints for this activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -2110,6 +2565,7 @@ def __init__( count: Optional[int] = None, image_serving: Optional["_models.ImageServingStatistics"] = None, indexed_sql_arguments: Optional["_models.KnowledgeBaseIndexedSqlActivityArguments"] = None, + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = None, ) -> None: ... @overload @@ -2139,12 +2595,20 @@ class KnowledgeBaseIndexedSqlReference(KnowledgeBaseReference, discriminator="in :vartype type: str or ~azure.search.documents.knowledgebases.models.INDEXED_SQL :ivar doc_url: The document URL for the reference. :vartype doc_url: str + :ivar citation_url: A Search-owned URL that points at the backing document for this reference, + usable as a citation target. + :vartype citation_url: str """ type: Literal[KnowledgeBaseReferenceType.INDEXED_SQL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. Indexed SQL document reference.""" doc_url: Optional[str] = rest_field(name="docUrl", visibility=["read", "create", "update", "delete", "query"]) """The document URL for the reference.""" + citation_url: Optional[str] = rest_field( + name="citationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """A Search-owned URL that points at the backing document for this reference, usable as a citation + target.""" @overload def __init__( @@ -2155,6 +2619,7 @@ def __init__( source_data: Optional[dict[str, Any]] = None, reranker_score: Optional[float] = None, doc_url: Optional[str] = None, + citation_url: Optional[str] = None, ) -> None: ... @overload @@ -2209,6 +2674,10 @@ class KnowledgeBaseMcpServerActivityRecord(KnowledgeBaseActivityRecord, discrimi :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -2261,6 +2730,8 @@ def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -2475,6 +2946,10 @@ class KnowledgeBaseModelAnswerSynthesisActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -2490,8 +2965,8 @@ class KnowledgeBaseModelAnswerSynthesisActivityRecord( :vartype input_tokens: int :ivar output_tokens: The number of output tokens for the LLM answer synthesis activity. :vartype output_tokens: int - :ivar model_name: The name of the model used for the LLM answer synthesis activity. - :vartype model_name: str + :ivar model: The model used for the LLM answer synthesis activity. + :vartype model: ~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel """ type: Literal[KnowledgeBaseActivityRecordType.MODEL_ANSWER_SYNTHESIS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -2504,20 +2979,24 @@ class KnowledgeBaseModelAnswerSynthesisActivityRecord( name="outputTokens", visibility=["read", "create", "update", "delete", "query"] ) """The number of output tokens for the LLM answer synthesis activity.""" - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the model used for the LLM answer synthesis activity.""" + model: Optional["_models.KnowledgeBaseActivityRecordModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The model used for the LLM answer synthesis activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, input_tokens: Optional[int] = None, output_tokens: Optional[int] = None, - model_name: Optional[str] = None, + model: Optional["_models.KnowledgeBaseActivityRecordModel"] = None, ) -> None: ... @overload @@ -2539,6 +3018,10 @@ class KnowledgeBaseModelQueryPlanningActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -2554,8 +3037,8 @@ class KnowledgeBaseModelQueryPlanningActivityRecord( :vartype input_tokens: int :ivar output_tokens: The number of output tokens for the LLM query planning activity. :vartype output_tokens: int - :ivar model_name: The name of the model used for the LLM query planning activity. - :vartype model_name: str + :ivar model: The model used for the LLM query planning activity. + :vartype model: ~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel """ type: Literal[KnowledgeBaseActivityRecordType.MODEL_QUERY_PLANNING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -2568,20 +3051,24 @@ class KnowledgeBaseModelQueryPlanningActivityRecord( name="outputTokens", visibility=["read", "create", "update", "delete", "query"] ) """The number of output tokens for the LLM query planning activity.""" - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the model used for the LLM query planning activity.""" + model: Optional["_models.KnowledgeBaseActivityRecordModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The model used for the LLM query planning activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, input_tokens: Optional[int] = None, output_tokens: Optional[int] = None, - model_name: Optional[str] = None, + model: Optional["_models.KnowledgeBaseActivityRecordModel"] = None, ) -> None: ... @overload @@ -2603,6 +3090,10 @@ class KnowledgeBaseModelWebSummarizationActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -2618,8 +3109,8 @@ class KnowledgeBaseModelWebSummarizationActivityRecord( :vartype input_tokens_count: int :ivar output_tokens_count: The number of output tokens for the LLM web summarization activity. :vartype output_tokens_count: int - :ivar model_name: The name of the model used for the LLM web summarization activity. - :vartype model_name: str + :ivar model: The model used for the LLM web summarization activity. + :vartype model: ~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel """ type: Literal[KnowledgeBaseActivityRecordType.MODEL_WEB_SUMMARIZATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -2632,20 +3123,24 @@ class KnowledgeBaseModelWebSummarizationActivityRecord( name="outputTokens", visibility=["read", "create", "update", "delete", "query"] ) """The number of output tokens for the LLM web summarization activity.""" - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the model used for the LLM web summarization activity.""" + model: Optional["_models.KnowledgeBaseActivityRecordModel"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The model used for the LLM web summarization activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, input_tokens_count: Optional[int] = None, output_tokens_count: Optional[int] = None, - model_name: Optional[str] = None, + model: Optional["_models.KnowledgeBaseActivityRecordModel"] = None, ) -> None: ... @overload @@ -2660,6 +3155,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.MODEL_WEB_SUMMARIZATION # type: ignore +class KnowledgeBaseQueryHintProcessing(_Model): + """Details about the expressions generated from query hints for a retrieval activity. + + :ivar generated_boost: The search clause generated from boost hints for this activity. + :vartype generated_boost: str + :ivar generated_filter: The filter expression generated from filter hints for this activity. + :vartype generated_filter: str + """ + + generated_boost: Optional[str] = rest_field( + name="generatedBoost", visibility=["read", "create", "update", "delete", "query"] + ) + """The search clause generated from boost hints for this activity.""" + generated_filter: Optional[str] = rest_field( + name="generatedFilter", visibility=["read", "create", "update", "delete", "query"] + ) + """The filter expression generated from filter hints for this activity.""" + + @overload + def __init__( + self, + *, + generated_boost: Optional[str] = None, + generated_filter: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeBaseRemoteSharePointActivityArguments(_Model): # pylint: disable=name-too-long """Represents the arguments the remote SharePoint retrieval activity was run with. @@ -2702,6 +3234,10 @@ class KnowledgeBaseRemoteSharePointActivityRecord( :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -2754,6 +3290,8 @@ def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -2829,6 +3367,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.REMOTE_SHARE_POINT # type: ignore +class KnowledgeBaseResponseCompletedEvent(_Model): + """Emitted after retrieval completes successfully. + + :ivar status_code: The semantic HTTP status of the completed retrieval. Required. Known values + are: 200 and 206. + :vartype status_code: int or + ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStatusCode + :ivar response: The authoritative completed retrieval response. Required. + :vartype response: ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResponse + """ + + status_code: Union[int, "_models.KnowledgeBaseRetrievalStatusCode"] = rest_field( + name="statusCode", visibility=["read", "create", "update", "delete", "query"] + ) + """The semantic HTTP status of the completed retrieval. Required. Known values are: 200 and 206.""" + response: "_models.KnowledgeBaseRetrievalResponse" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The authoritative completed retrieval response. Required.""" + + @overload + def __init__( + self, + *, + status_code: Union[int, "_models.KnowledgeBaseRetrievalStatusCode"], + response: "_models.KnowledgeBaseRetrievalResponse", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeBaseRetrievalRequest(_Model): """The input contract for the retrieval request. @@ -2981,6 +3558,60 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class KnowledgeBaseRetrievalStartedEvent(_Model): + """Emitted once retrieval preflight validation completes, before any activity begins. + + :ivar request_id: A service-generated identifier that correlates all events in this retrieval + stream. Required. + :vartype request_id: str + :ivar knowledge_base_name: The name of the knowledge base being queried. Required. + :vartype knowledge_base_name: str + :ivar output_mode: The effective output mode for this retrieval. Required. Known values are: + "extractiveData" and "answerSynthesis". + :vartype output_mode: str or + ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode + :ivar reasoning_effort: The effective reasoning effort for this retrieval. Required. + :vartype reasoning_effort: + ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort + """ + + request_id: str = rest_field(name="requestId", visibility=["read", "create", "update", "delete", "query"]) + """A service-generated identifier that correlates all events in this retrieval stream. Required.""" + knowledge_base_name: str = rest_field( + name="knowledgeBaseName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the knowledge base being queried. Required.""" + output_mode: Union[str, "_models.KnowledgeRetrievalOutputMode"] = rest_field( + name="outputMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The effective output mode for this retrieval. Required. Known values are: \"extractiveData\" + and \"answerSynthesis\".""" + reasoning_effort: "_models.KnowledgeRetrievalReasoningEffort" = rest_field( + name="reasoningEffort", visibility=["read", "create", "update", "delete", "query"] + ) + """The effective reasoning effort for this retrieval. Required.""" + + @overload + def __init__( + self, + *, + request_id: str, + knowledge_base_name: str, + output_mode: Union[str, "_models.KnowledgeRetrievalOutputMode"], + reasoning_effort: "_models.KnowledgeRetrievalReasoningEffort", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeBaseSearchIndexActivityArguments(_Model): # pylint: disable=name-too-long """Represents the arguments the search index retrieval activity was run with. @@ -2995,6 +3626,9 @@ class KnowledgeBaseSearchIndexActivityArguments(_Model): # pylint: disable=name :vartype search_fields: list[~azure.search.documents.indexes.models.SearchIndexFieldReference] :ivar semantic_configuration_name: What semantic configuration was used from the search index. :vartype semantic_configuration_name: str + :ivar query_type: The query syntax used to execute the search. Query hints can cause semantic + queries to use full query syntax. Known values are: "simple", "full", and "semantic". + :vartype query_type: str or ~azure.search.documents.models.QueryType """ search: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3013,6 +3647,11 @@ class KnowledgeBaseSearchIndexActivityArguments(_Model): # pylint: disable=name name="semanticConfigurationName", visibility=["read", "create", "update", "delete", "query"] ) """What semantic configuration was used from the search index.""" + query_type: Optional[Union[str, "_models2.QueryType"]] = rest_field( + name="queryType", visibility=["read", "create", "update", "delete", "query"] + ) + """The query syntax used to execute the search. Query hints can cause semantic queries to use full + query syntax. Known values are: \"simple\", \"full\", and \"semantic\".""" @overload def __init__( @@ -3023,6 +3662,7 @@ def __init__( source_data_fields: Optional[list["_indexes_models3.SearchIndexFieldReference"]] = None, search_fields: Optional[list["_indexes_models3.SearchIndexFieldReference"]] = None, semantic_configuration_name: Optional[str] = None, + query_type: Optional[Union[str, "_models2.QueryType"]] = None, ) -> None: ... @overload @@ -3041,6 +3681,10 @@ class KnowledgeBaseSearchIndexActivityRecord(KnowledgeBaseActivityRecord, discri :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -3064,6 +3708,10 @@ class KnowledgeBaseSearchIndexActivityRecord(KnowledgeBaseActivityRecord, discri :ivar search_index_arguments: The search index arguments for the retrieval activity. :vartype search_index_arguments: ~azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityArguments + :ivar query_hint_processing: Details about the expressions generated from query hints for this + activity. + :vartype query_hint_processing: + ~azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing """ knowledge_source_name: Optional[str] = rest_field( @@ -3087,12 +3735,18 @@ class KnowledgeBaseSearchIndexActivityRecord(KnowledgeBaseActivityRecord, discri name="searchIndexArguments", visibility=["read", "create", "update", "delete", "query"] ) """The search index arguments for the retrieval activity.""" + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = rest_field( + name="queryHintProcessing", visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the expressions generated from query hints for this activity.""" @overload def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -3101,6 +3755,7 @@ def __init__( count: Optional[int] = None, image_serving: Optional["_models.ImageServingStatistics"] = None, search_index_arguments: Optional["_models.KnowledgeBaseSearchIndexActivityArguments"] = None, + query_hint_processing: Optional["_models.KnowledgeBaseQueryHintProcessing"] = None, ) -> None: ... @overload @@ -3133,6 +3788,9 @@ class KnowledgeBaseSearchIndexReference(KnowledgeBaseReference, discriminator="s :ivar search_sensitivity_label_info: The sensitivity label information for the reference. :vartype search_sensitivity_label_info: ~azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo + :ivar citation_url: A Search-owned URL that points at the backing document for this reference, + usable as a citation target. + :vartype citation_url: str """ type: Literal[KnowledgeBaseReferenceType.SEARCH_INDEX] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -3143,6 +3801,11 @@ class KnowledgeBaseSearchIndexReference(KnowledgeBaseReference, discriminator="s name="searchSensitivityLabelInfo", visibility=["read", "create", "update", "delete", "query"] ) """The sensitivity label information for the reference.""" + citation_url: Optional[str] = rest_field( + name="citationUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """A Search-owned URL that points at the backing document for this reference, usable as a citation + target.""" @overload def __init__( @@ -3154,6 +3817,7 @@ def __init__( reranker_score: Optional[float] = None, doc_key: Optional[str] = None, search_sensitivity_label_info: Optional["_models.PurviewSensitivityLabelInfo"] = None, + citation_url: Optional[str] = None, ) -> None: ... @overload @@ -3168,6 +3832,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.SEARCH_INDEX # type: ignore +class KnowledgeBaseStreamErrorEvent(_Model): + """Emitted in place of ``response.completed`` if retrieval fails after the stream starts. + + :ivar error: The error detail explaining why the retrieval stream failed. + :vartype error: ~azure.search.documents.knowledgebases.models.KnowledgeBaseErrorDetail + :ivar activity: Activity records that completed before the retrieval failed. + :vartype activity: + list[~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord] + """ + + error: Optional["_models.KnowledgeBaseErrorDetail"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The error detail explaining why the retrieval stream failed.""" + activity: Optional[list["_models.KnowledgeBaseActivityRecord"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Activity records that completed before the retrieval failed.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.KnowledgeBaseErrorDetail"] = None, + activity: Optional[list["_models.KnowledgeBaseActivityRecord"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class KnowledgeBaseWebActivityArguments(_Model): """Represents the arguments the web retrieval activity was run with. @@ -3221,6 +3923,10 @@ class KnowledgeBaseWebActivityRecord(KnowledgeBaseActivityRecord, discriminator= :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -3273,6 +3979,8 @@ def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -3378,6 +4086,10 @@ class KnowledgeBaseWorkIQActivityRecord(KnowledgeBaseActivityRecord, discriminat :ivar id: The ID of the activity record. Required. :vartype id: int + :ivar started_at: The time at which the activity started. + :vartype started_at: ~datetime.datetime + :ivar completed_at: The time at which the activity completed. + :vartype completed_at: ~datetime.datetime :ivar elapsed_ms: The elapsed time in milliseconds for the retrieval activity. :vartype elapsed_ms: int :ivar error: The error detail explaining why the operation failed. This property is only @@ -3430,6 +4142,8 @@ def __init__( self, *, id: int, # pylint: disable=redefined-builtin + started_at: Optional[datetime.datetime] = None, + completed_at: Optional[datetime.datetime] = None, elapsed_ms: Optional[int] = None, error: Optional["_models.KnowledgeBaseErrorDetail"] = None, warning: Optional[str] = None, @@ -3465,16 +4179,17 @@ class KnowledgeBaseWorkIQReference(KnowledgeBaseReference, discriminator="workIQ :vartype reranker_score: float :ivar type: The discriminator value. Required. Work IQ document reference. :vartype type: str or ~azure.search.documents.knowledgebases.models.WORK_IQ - :ivar attributions: The attributions for the reference. - :vartype attributions: list[~azure.search.documents.knowledgebases.models.WorkIQAttribution] + :ivar search_sensitivity_label_info: The sensitivity label information for the reference. + :vartype search_sensitivity_label_info: + ~azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo """ type: Literal[KnowledgeBaseReferenceType.WORK_IQ] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The discriminator value. Required. Work IQ document reference.""" - attributions: Optional[list["_models.WorkIQAttribution"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + search_sensitivity_label_info: Optional["_models.PurviewSensitivityLabelInfo"] = rest_field( + name="searchSensitivityLabelInfo", visibility=["read", "create", "update", "delete", "query"] ) - """The attributions for the reference.""" + """The sensitivity label information for the reference.""" @overload def __init__( @@ -3484,7 +4199,7 @@ def __init__( activity_source: int, source_data: Optional[dict[str, Any]] = None, reranker_score: Optional[float] = None, - attributions: Optional[list["_models.WorkIQAttribution"]] = None, + search_sensitivity_label_info: Optional["_models.PurviewSensitivityLabelInfo"] = None, ) -> None: ... @overload @@ -3499,26 +4214,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.WORK_IQ # type: ignore -class KnowledgeRetrievalIntent(_Model): - """An intended query to execute without model query planning. +class KnowledgeRetrievalReasoningEffort(_Model): + """Base type for reasoning effort. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - KnowledgeRetrievalSemanticIntent + KnowledgeRetrievalAutoReasoningEffort, KnowledgeRetrievalLowReasoningEffort, + KnowledgeRetrievalMediumReasoningEffort, KnowledgeRetrievalMinimalReasoningEffort - :ivar type: The type of the intent. Required. "semantic" - :vartype type: str or - ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntentType + :ivar kind: The kind of reasoning effort. Required. Known values are: "minimal", "low", + "medium", and "auto". + :vartype kind: str or + ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind """ __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the intent. Required. \"semantic\"""" + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of reasoning effort. Required. Known values are: \"minimal\", \"low\", \"medium\", and + \"auto\".""" @overload def __init__( self, *, - type: str, + kind: str, ) -> None: ... @overload @@ -3532,28 +4250,57 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeRetrievalReasoningEffort(_Model): - """Base type for reasoning effort. +class KnowledgeRetrievalAutoReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator="auto"): + """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. + + :ivar kind: The discriminator value. Required. Automatically select the reasoning effort during + retrieval, escalating from the cheapest tier only as far as needed. + :vartype kind: str or ~azure.search.documents.knowledgebases.models.AUTO + """ + + kind: Literal[KnowledgeRetrievalReasoningEffortKind.AUTO] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The discriminator value. Required. Automatically select the reasoning effort during retrieval, + escalating from the cheapest tier only as far as needed.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = KnowledgeRetrievalReasoningEffortKind.AUTO # type: ignore + + +class KnowledgeRetrievalIntent(_Model): + """An intended query to execute without model query planning. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - KnowledgeRetrievalLowReasoningEffort, KnowledgeRetrievalMediumReasoningEffort, - KnowledgeRetrievalMinimalReasoningEffort + KnowledgeRetrievalSemanticIntent - :ivar kind: The kind of reasoning effort. Required. Known values are: "minimal", "low", and - "medium". - :vartype kind: str or - ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind + :ivar type: The type of the intent. Required. "semantic" + :vartype type: str or + ~azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntentType """ __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of reasoning effort. Required. Known values are: \"minimal\", \"low\", and \"medium\".""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of the intent. Required. \"semantic\"""" @overload def __init__( self, *, - kind: str, + type: str, ) -> None: ... @overload @@ -3790,6 +4537,12 @@ class KnowledgeSourceIngestionParameters(_Model): :vartype asset_store: ~azure.search.documents.knowledgebases.models.AssetStore :ivar freshness_policy: Optional freshness policy for biasing retrieval toward newer documents. :vartype freshness_policy: ~azure.search.documents.knowledgebases.models.FreshnessPolicy + :ivar network_access_mode: Optional network access mode for ingestion. Set to 'private' to run + ingestion in a private execution environment that can reach data sources and dependencies over + a private network. Default is 'public'. This is a create-time setting and cannot be changed + after the knowledge source is created. Known values are: "public" and "private". + :vartype network_access_mode: str or + ~azure.search.documents.knowledgebases.models.KnowledgeSourceNetworkAccessMode """ identity: Optional["_indexes_models3.SearchIndexerDataIdentity"] = rest_field( @@ -3834,6 +4587,13 @@ class KnowledgeSourceIngestionParameters(_Model): name="freshnessPolicy", visibility=["read", "create", "update", "delete", "query"] ) """Optional freshness policy for biasing retrieval toward newer documents.""" + network_access_mode: Optional[Union[str, "_models.KnowledgeSourceNetworkAccessMode"]] = rest_field( + name="networkAccessMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional network access mode for ingestion. Set to 'private' to run ingestion in a private + execution environment that can reach data sources and dependencies over a private network. + Default is 'public'. This is a create-time setting and cannot be changed after the knowledge + source is created. Known values are: \"public\" and \"private\".""" @overload def __init__( @@ -3851,6 +4611,7 @@ def __init__( ai_services: Optional["_models.AIServices"] = None, asset_store: Optional["_models.AssetStore"] = None, freshness_policy: Optional["_models.FreshnessPolicy"] = None, + network_access_mode: Optional[Union[str, "_models.KnowledgeSourceNetworkAccessMode"]] = None, ) -> None: ... @overload @@ -4063,12 +4824,22 @@ class McpServerKnowledgeSourceParams(KnowledgeSourceParams, discriminator="mcpSe :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -4093,8 +4864,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, ) -> None: ... @@ -4184,12 +4957,22 @@ class RemoteSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminator :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -4223,8 +5006,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, filter_expression_add_on: Optional[str] = None, @@ -4256,12 +5041,22 @@ class SearchIndexKnowledgeSourceParams(KnowledgeSourceParams, discriminator="sea :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -4274,6 +5069,11 @@ class SearchIndexKnowledgeSourceParams(KnowledgeSourceParams, discriminator="sea :vartype kind: str or ~azure.search.documents.indexes.models.SEARCH_INDEX :ivar filter_add_on: A filter condition applied to the index (e.g., 'State eq VA'). :vartype filter_add_on: str + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: + ~azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints """ kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -4282,6 +5082,11 @@ class SearchIndexKnowledgeSourceParams(KnowledgeSourceParams, discriminator="sea name="filterAddOn", visibility=["read", "create", "update", "delete", "query"] ) """A filter condition applied to the index (e.g., 'State eq VA').""" + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = rest_field( + name="queryHintOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" @overload def __init__( @@ -4291,11 +5096,14 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, filter_add_on: Optional[str] = None, + query_hint_overrides: Optional["_indexes_models3.SearchIndexKnowledgeSourceQueryHints"] = None, ) -> None: ... @overload @@ -4310,6 +5118,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.SEARCH_INDEX # type: ignore +class ServedImage(_Model): + """Describes a single image that the model selected to be served during a retrieval activity. + + :ivar image_id: The image label extracted from the source document by Content Understanding + enrichment. Corresponds to the figure numbering in the original document. + :vartype image_id: str + :ivar image_path: The relative path to the image within the asset store. + :vartype image_path: str + :ivar size_bytes: The size in bytes of this image as sent to the model. + :vartype size_bytes: int + """ + + image_id: Optional[str] = rest_field(name="imageId", visibility=["read", "create", "update", "delete", "query"]) + """The image label extracted from the source document by Content Understanding enrichment. + Corresponds to the figure numbering in the original document.""" + image_path: Optional[str] = rest_field(name="imagePath", visibility=["read", "create", "update", "delete", "query"]) + """The relative path to the image within the asset store.""" + size_bytes: Optional[int] = rest_field(name="sizeBytes", visibility=["read", "create", "update", "delete", "query"]) + """The size in bytes of this image as sent to the model.""" + + @overload + def __init__( + self, + *, + image_id: Optional[str] = None, + image_path: Optional[str] = None, + size_bytes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class SynchronizationState(_Model): """Represents the current state of an ongoing synchronization that spans multiple indexer runs. @@ -4385,12 +5233,22 @@ class WebKnowledgeSourceParams(KnowledgeSourceParams, discriminator="web"): :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -4429,8 +5287,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, language: Optional[str] = None, @@ -4451,36 +5311,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.WEB # type: ignore -class WorkIQAttribution(_Model): - """Attribution information for a WorkIQ reference. - - :ivar see_more_web_url: The URL for the attribution. - :vartype see_more_web_url: str - """ - - see_more_web_url: Optional[str] = rest_field( - name="seeMoreWebUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """The URL for the attribution.""" - - @overload - def __init__( - self, - *, - see_more_web_url: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class WorkIQKnowledgeSourceParams(KnowledgeSourceParams, discriminator="workIQ"): """Specifies runtime parameters for a WorkIQ knowledge source. @@ -4495,12 +5325,22 @@ class WorkIQKnowledgeSourceParams(KnowledgeSourceParams, discriminator="workIQ") :ivar always_query_source: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. :vartype fail_on_error: bool :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be included in the response. :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: str or + ~azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge source. :vartype max_output_documents: int @@ -4523,8 +5363,10 @@ def __init__( include_references: Optional[bool] = None, include_reference_source_data: Optional[bool] = None, always_query_source: Optional[bool] = None, + never_query_source: Optional[bool] = None, fail_on_error: Optional[bool] = None, reranker_threshold: Optional[float] = None, + results_processing: Optional[Union[str, "_indexes_models3.KnowledgeSourceResultsProcessing"]] = None, max_output_documents: Optional[int] = None, enable_image_serving: Optional[bool] = None, ) -> None: ... diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py new file mode 100644 index 000000000000..da05f523f8b7 --- /dev/null +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py @@ -0,0 +1,1455 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Literal, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from ..indexes.models._enums import KnowledgeSourceKind, VectorSearchVectorizerKind +from .models._enums import ( + KnowledgeBaseMessageContentType, + KnowledgeRetrievalIntentType, + KnowledgeRetrievalReasoningEffortKind, +) + +if TYPE_CHECKING: + from ..indexes.types import ( + AzureOpenAIVectorizerParameters, + IndexingSchedule, + KnowledgeBaseModel, + SearchIndexKnowledgeSourceQueryHints, + SearchIndexerDataIdentity, + ) + from ..indexesmodels import ( + KnowledgeSourceContentExtractionMode, + KnowledgeSourceIngestionPermissionOption, + KnowledgeSourceKind, + KnowledgeSourceResultsProcessing, + KnowledgeSourceSynchronizationStatus, + ) + from .models import KnowledgeRetrievalOutputMode, KnowledgeSourceNetworkAccessMode + + +class AIServices(TypedDict, total=False): + """Parameters for AI Services. + + :ivar uri: The URI of the AI Services endpoint. Required. + :vartype uri: str + :ivar api_key: The API key for accessing AI Services. + :vartype api_key: str + """ + + uri: Required[str] + """The URI of the AI Services endpoint. Required.""" + apiKey: str + """The API key for accessing AI Services.""" + + +class AssetStore(TypedDict, total=False): + """Configuration for an asset store used to store extracted assets such as images. + + :ivar connection_string: The connection string for the asset store. Required. + :vartype connection_string: str + :ivar container_name: The name of the blob container within the asset store where extracted + assets (for example, images) are stored. Required. + :vartype container_name: str + """ + + connectionString: Required[str] + """The connection string for the asset store. Required.""" + containerName: Required[str] + """The name of the blob container within the asset store where extracted assets (for example, + images) are stored. Required.""" + + +class AzureBlobKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a azure blob knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that read and ingest data + from Azure Blob Storage to a Search Index. + :vartype kind: Literal[KnowledgeSourceKind.AZURE_BLOB] + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] + """The discriminator value. Required. A knowledge source that read and ingest data from Azure Blob + Storage to a Search Index.""" + queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class CompletedSynchronizationState(TypedDict, total=False): + """Represents the completed state of the last synchronization. + + :ivar start_time: The start time of the last completed synchronization. Required. + :vartype start_time: str + :ivar end_time: The end time of the last completed synchronization. Required. + :vartype end_time: str + :ivar items_updates_processed: The number of item updates successfully processed in the last + synchronization. Required. + :vartype items_updates_processed: int + :ivar items_updates_failed: The number of item updates that failed in the last synchronization. + Required. + :vartype items_updates_failed: int + :ivar items_skipped: The number of items skipped in the last synchronization. Required. + :vartype items_skipped: int + """ + + startTime: Required[str] + """The start time of the last completed synchronization. Required.""" + endTime: Required[str] + """The end time of the last completed synchronization. Required.""" + itemsUpdatesProcessed: Required[int] + """The number of item updates successfully processed in the last synchronization. Required.""" + itemsUpdatesFailed: Required[int] + """The number of item updates that failed in the last synchronization. Required.""" + itemsSkipped: Required[int] + """The number of items skipped in the last synchronization. Required.""" + + +class FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a Fabric Data Agent knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that retrieves data from a + Fabric Data Agent. + :vartype kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] + """The discriminator value. Required. A knowledge source that retrieves data from a Fabric Data + Agent.""" + + +class FabricOntologyKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a Fabric Ontology knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that retrieves data from + Microsoft Fabric Ontology ontologies. + :vartype kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] + """The discriminator value. Required. A knowledge source that retrieves data from Microsoft Fabric + Ontology ontologies.""" + + +class FileKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a File knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that supports direct file + upload and indexing. + :vartype kind: Literal[KnowledgeSourceKind.FILE] + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.FILE]] + """The discriminator value. Required. A knowledge source that supports direct file upload and + indexing.""" + queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class FreshnessPolicy(TypedDict, total=False): + """Configuration for freshness-aware retrieval. When set, newer documents receive a ranking boost + during retrieval. + + :ivar boosting_duration: 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. + :vartype boosting_duration: str + """ + + boostingDuration: str + """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.""" + + +class IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a indexed OneLake knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that reads data from indexed + OneLake. + :vartype kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] + """The discriminator value. Required. A knowledge source that reads data from indexed OneLake.""" + queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class IndexedSharePointKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a indexed SharePoint knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that reads data from indexed + SharePoint. + :vartype kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] + """The discriminator value. Required. A knowledge source that reads data from indexed SharePoint.""" + queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class IndexedSqlKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for an indexed SQL knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that retrieves and ingests + data from Azure SQL Database or SQL Managed Instance to a Search Index. + :vartype kind: Literal[KnowledgeSourceKind.INDEXED_SQL] + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] + """The discriminator value. Required. A knowledge source that retrieves and ingests data from + Azure SQL Database or SQL Managed Instance to a Search Index.""" + queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class KnowledgeBaseImageContent(TypedDict, total=False): + """Image content. + + :ivar url: The url of the image. Required. + :vartype url: str + """ + + url: Required[str] + """The url of the image. Required.""" + + +class KnowledgeBaseMessage(TypedDict, total=False): + """The natural language message style object. + + :ivar role: The role of the tool response. + :vartype role: str + :ivar content: The content of the message. Required. + :vartype content: list["KnowledgeBaseMessageContent"] + """ + + role: str + """The role of the tool response.""" + content: Required[list["KnowledgeBaseMessageContent"]] + """The content of the message. Required.""" + + +class KnowledgeBaseMessageImageContent(TypedDict, total=False): + """Image message type. + + :ivar type: The discriminator value. Required. Image message content kind. + :vartype type: Literal[KnowledgeBaseMessageContentType.IMAGE] + :ivar image: The image content. Required. + :vartype image: "KnowledgeBaseImageContent" + """ + + type: Required[Literal[KnowledgeBaseMessageContentType.IMAGE]] + """The discriminator value. Required. Image message content kind.""" + image: Required["KnowledgeBaseImageContent"] + """The image content. Required.""" + + +class KnowledgeBaseMessageTextContent(TypedDict, total=False): + """Text message type. + + :ivar type: The discriminator value. Required. Text message content kind. + :vartype type: Literal[KnowledgeBaseMessageContentType.TEXT] + :ivar text: The text content. Required. + :vartype text: str + """ + + type: Required[Literal[KnowledgeBaseMessageContentType.TEXT]] + """The discriminator value. Required. Text message content kind.""" + text: Required[str] + """The text content. Required.""" + + +class KnowledgeBaseRetrievalRequest(TypedDict, total=False): + """The input contract for the retrieval request. + + :ivar messages: A list of chat message style input. + :vartype messages: list["KnowledgeBaseMessage"] + :ivar intents: A list of intended queries to execute without model query planning. + :vartype intents: list["KnowledgeRetrievalIntent"] + :ivar max_runtime_in_seconds: The maximum runtime in seconds. + :vartype max_runtime_in_seconds: int + :ivar max_output_size: Limits the maximum size of the content in the output. + :vartype max_output_size: int + :ivar max_output_documents: Limits the maximum number of documents in the output. + :vartype max_output_documents: int + :ivar max_output_size_in_tokens: Limits the maximum size of the content in the output. + :vartype max_output_size_in_tokens: int + :ivar retrieval_reasoning_effort: The retrieval reasoning effort configuration. + :vartype retrieval_reasoning_effort: "KnowledgeRetrievalReasoningEffort" + :ivar include_activity: Indicates retrieval results should include activity information. + :vartype include_activity: bool + :ivar output_mode: The output configuration for this retrieval. Known values are: + "extractiveData" and "answerSynthesis". + :vartype output_mode: Union[str, "KnowledgeRetrievalOutputMode"] + :ivar knowledge_source_params: A list of runtime parameters for the knowledge sources. + :vartype knowledge_source_params: list["KnowledgeSourceParams"] + """ + + messages: list["KnowledgeBaseMessage"] + """A list of chat message style input.""" + intents: list["KnowledgeRetrievalIntent"] + """A list of intended queries to execute without model query planning.""" + maxRuntimeInSeconds: int + """The maximum runtime in seconds.""" + maxOutputSize: int + """Limits the maximum size of the content in the output.""" + maxOutputDocuments: int + """Limits the maximum number of documents in the output.""" + maxOutputSizeInTokens: int + """Limits the maximum size of the content in the output.""" + retrievalReasoningEffort: "KnowledgeRetrievalReasoningEffort" + """The retrieval reasoning effort configuration.""" + includeActivity: bool + """Indicates retrieval results should include activity information.""" + outputMode: Union[str, "KnowledgeRetrievalOutputMode"] + """The output configuration for this retrieval. Known values are: \"extractiveData\" and + \"answerSynthesis\".""" + knowledgeSourceParams: list["KnowledgeSourceParams"] + """A list of runtime parameters for the knowledge sources.""" + + +class KnowledgeRetrievalAutoReasoningEffort(TypedDict, total=False): + """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. + + :ivar kind: The discriminator value. Required. Automatically select the reasoning effort during + retrieval, escalating from the cheapest tier only as far as needed. + :vartype kind: Literal[KnowledgeRetrievalReasoningEffortKind.AUTO] + """ + + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.AUTO]] + """The discriminator value. Required. Automatically select the reasoning effort during retrieval, + escalating from the cheapest tier only as far as needed.""" + + +class KnowledgeRetrievalLowReasoningEffort(TypedDict, total=False): + """Run knowledge retrieval with low reasoning effort. + + :ivar kind: The discriminator value. Required. Use low reasoning during retrieval. + :vartype kind: Literal[KnowledgeRetrievalReasoningEffortKind.LOW] + """ + + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.LOW]] + """The discriminator value. Required. Use low reasoning during retrieval.""" + + +class KnowledgeRetrievalMediumReasoningEffort(TypedDict, total=False): + """Run knowledge retrieval with medium reasoning effort. + + :ivar kind: The discriminator value. Required. Use a moderate amount of reasoning during + retrieval. + :vartype kind: Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM] + """ + + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM]] + """The discriminator value. Required. Use a moderate amount of reasoning during retrieval.""" + + +class KnowledgeRetrievalMinimalReasoningEffort(TypedDict, total=False): + """Run knowledge retrieval with minimal reasoning effort. + + :ivar kind: The discriminator value. Required. Does not perform any source selections, query + planning, or iterative search. + :vartype kind: Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL] + """ + + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL]] + """The discriminator value. Required. Does not perform any source selections, query planning, or + iterative search.""" + + +class KnowledgeRetrievalSemanticIntent(TypedDict, total=False): + """A semantic query intent. + + :ivar type: The discriminator value. Required. A natural language semantic query intent. + :vartype type: Literal[KnowledgeRetrievalIntentType.SEMANTIC] + :ivar search: The semantic query to execute. Required. + :vartype search: str + """ + + type: Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + """The discriminator value. Required. A natural language semantic query intent.""" + search: Required[str] + """The semantic query to execute. Required.""" + + +class KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): + """Specifies the Azure OpenAI resource used to vectorize a query string. + + :ivar kind: The discriminator value. Required. Generate embeddings using an Azure OpenAI + resource at query time. + :vartype kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] + :ivar azure_open_ai_parameters: Contains the parameters specific to Azure OpenAI embedding + vectorization. + :vartype azure_open_ai_parameters: "AzureOpenAIVectorizerParameters" + """ + + kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + """The discriminator value. Required. Generate embeddings using an Azure OpenAI resource at query + time.""" + azureOpenAIParameters: "AzureOpenAIVectorizerParameters" + """Contains the parameters specific to Azure OpenAI embedding vectorization.""" + + +class KnowledgeSourceIngestionParameters(TypedDict, total=False): + """Consolidates all general ingestion settings for knowledge sources. + + :ivar identity: An explicit identity to use for this knowledge source. + :vartype identity: "SearchIndexerDataIdentity" + :ivar embedding_model: Optional vectorizer configuration for vectorizing content. + :vartype embedding_model: "KnowledgeSourceVectorizer" + :ivar chat_completion_model: Optional chat completion model for image verbalization or context + extraction. + :vartype chat_completion_model: "KnowledgeBaseModel" + :ivar disable_image_verbalization: Indicates whether image verbalization should be disabled. + Default is false. + :vartype disable_image_verbalization: bool + :ivar ingestion_schedule: Optional schedule for data ingestion. + :vartype ingestion_schedule: "IndexingSchedule" + :ivar ingestion_permission_options: Optional list of permission types to ingest together with + document content. If specified, it will set the indexer permission options for the data source. + :vartype ingestion_permission_options: list[Union[str, + "KnowledgeSourceIngestionPermissionOption"]] + :ivar content_extraction_mode: Optional content extraction mode. Default is 'minimal'. Known + values are: "minimal" and "standard". + :vartype content_extraction_mode: Union[str, "KnowledgeSourceContentExtractionMode"] + :ivar ai_services: Optional AI Services configuration for content processing. + :vartype ai_services: "AIServices" + :ivar asset_store: Optional asset store configuration for storing extracted assets such as + images. + :vartype asset_store: "AssetStore" + :ivar freshness_policy: Optional freshness policy for biasing retrieval toward newer documents. + :vartype freshness_policy: "FreshnessPolicy" + :ivar network_access_mode: Optional network access mode for ingestion. Set to 'private' to run + ingestion in a private execution environment that can reach data sources and dependencies over + a private network. Default is 'public'. This is a create-time setting and cannot be changed + after the knowledge source is created. Known values are: "public" and "private". + :vartype network_access_mode: Union[str, "KnowledgeSourceNetworkAccessMode"] + """ + + identity: Optional["SearchIndexerDataIdentity"] + """An explicit identity to use for this knowledge source.""" + embeddingModel: Optional["KnowledgeSourceVectorizer"] + """Optional vectorizer configuration for vectorizing content.""" + chatCompletionModel: Optional["KnowledgeBaseModel"] + """Optional chat completion model for image verbalization or context extraction.""" + disableImageVerbalization: bool + """Indicates whether image verbalization should be disabled. Default is false.""" + ingestionSchedule: Optional["IndexingSchedule"] + """Optional schedule for data ingestion.""" + ingestionPermissionOptions: Optional[list[Union[str, "KnowledgeSourceIngestionPermissionOption"]]] + """Optional list of permission types to ingest together with document content. If specified, it + will set the indexer permission options for the data source.""" + contentExtractionMode: Optional[Union[str, "KnowledgeSourceContentExtractionMode"]] + """Optional content extraction mode. Default is 'minimal'. Known values are: \"minimal\" and + \"standard\".""" + aiServices: Optional["AIServices"] + """Optional AI Services configuration for content processing.""" + assetStore: "AssetStore" + """Optional asset store configuration for storing extracted assets such as images.""" + freshnessPolicy: "FreshnessPolicy" + """Optional freshness policy for biasing retrieval toward newer documents.""" + networkAccessMode: Union[str, "KnowledgeSourceNetworkAccessMode"] + """Optional network access mode for ingestion. Set to 'private' to run ingestion in a private + execution environment that can reach data sources and dependencies over a private network. + Default is 'public'. This is a create-time setting and cannot be changed after the knowledge + source is created. Known values are: \"public\" and \"private\".""" + + +class KnowledgeSourceStatistics(TypedDict, total=False): + """Statistical information about knowledge source synchronization history. + + :ivar total_synchronization: Total number of synchronizations. Required. + :vartype total_synchronization: int + :ivar average_synchronization_duration: Average synchronization duration in HH:MM:SS format. + Required. + :vartype average_synchronization_duration: str + :ivar average_items_processed_per_synchronization: Average items processed per synchronization. + Required. + :vartype average_items_processed_per_synchronization: int + """ + + totalSynchronization: Required[int] + """Total number of synchronizations. Required.""" + averageSynchronizationDuration: Required[str] + """Average synchronization duration in HH:MM:SS format. Required.""" + averageItemsProcessedPerSynchronization: Required[int] + """Average items processed per synchronization. Required.""" + + +class KnowledgeSourceStatus(TypedDict, total=False): + """Represents the status and synchronization history of a knowledge source. + + :ivar kind: Identifies the Knowledge Source kind directly from the Status response. Known + values are: "searchIndex", "azureBlob", "indexedSharePoint", "indexedOneLake", "indexedSql", + "web", "remoteSharePoint", "workIQ", "file", "mcpServer", "fabricDataAgent", and + "fabricOntology". + :vartype kind: Union[str, "KnowledgeSourceKind"] + :ivar synchronization_status: The current synchronization status. Required. Known values are: + "creating", "active", and "deleting". + :vartype synchronization_status: Union[str, "KnowledgeSourceSynchronizationStatus"] + :ivar synchronization_interval: The synchronization interval (e.g., '1d' for daily). Null if no + schedule is configured. + :vartype synchronization_interval: str + :ivar current_synchronization_state: Current synchronization state that spans multiple indexer + runs. + :vartype current_synchronization_state: "SynchronizationState" + :ivar last_synchronization_state: Details of the last completed synchronization. Null on first + sync. + :vartype last_synchronization_state: "CompletedSynchronizationState" + :ivar statistics: Statistical information about the knowledge source synchronization history. + Null on first sync. + :vartype statistics: "KnowledgeSourceStatistics" + """ + + kind: Union[str, "KnowledgeSourceKind"] + """Identifies the Knowledge Source kind directly from the Status response. Known values are: + \"searchIndex\", \"azureBlob\", \"indexedSharePoint\", \"indexedOneLake\", \"indexedSql\", + \"web\", \"remoteSharePoint\", \"workIQ\", \"file\", \"mcpServer\", \"fabricDataAgent\", and + \"fabricOntology\".""" + synchronizationStatus: Required[Union[str, "KnowledgeSourceSynchronizationStatus"]] + """The current synchronization status. Required. Known values are: \"creating\", \"active\", and + \"deleting\".""" + synchronizationInterval: Optional[str] + """The synchronization interval (e.g., '1d' for daily). Null if no schedule is configured.""" + currentSynchronizationState: Optional["SynchronizationState"] + """Current synchronization state that spans multiple indexer runs.""" + lastSynchronizationState: Optional["CompletedSynchronizationState"] + """Details of the last completed synchronization. Null on first sync.""" + statistics: Optional["KnowledgeSourceStatistics"] + """Statistical information about the knowledge source synchronization history. Null on first sync.""" + + +class KnowledgeSourceSynchronizationError(TypedDict, total=False): + """Represents a document-level indexing error encountered during a knowledge source + synchronization run. + + :ivar doc_id: The unique identifier for the failed document or item within the synchronization + run. + :vartype doc_id: str + :ivar status_code: HTTP-like status code representing the failure category (e.g., 400). + :vartype status_code: int + :ivar name: Name of the ingestion or processing component reporting the error. + :vartype name: str + :ivar error_message: Human-readable, customer-visible error message. Required. + :vartype error_message: str + :ivar details: Additional contextual information about the failure. + :vartype details: str + :ivar documentation_link: A link to relevant troubleshooting documentation. + :vartype documentation_link: str + """ + + docId: str + """The unique identifier for the failed document or item within the synchronization run.""" + statusCode: int + """HTTP-like status code representing the failure category (e.g., 400).""" + name: str + """Name of the ingestion or processing component reporting the error.""" + errorMessage: Required[str] + """Human-readable, customer-visible error message. Required.""" + details: str + """Additional contextual information about the failure.""" + documentationLink: str + """A link to relevant troubleshooting documentation.""" + + +class McpServerKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for an MCP server knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source backed by an MCP (Model + Context Protocol) server. + :vartype kind: Literal[KnowledgeSourceKind.MCP_SERVER] + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.MCP_SERVER]] + """The discriminator value. Required. A knowledge source backed by an MCP (Model Context Protocol) + server.""" + + +class RemoteSharePointKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a remote SharePoint knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that reads data from remote + SharePoint. + :vartype kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] + :ivar filter_expression_add_on: 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. + :vartype filter_expression_add_on: str + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] + """The discriminator value. Required. A knowledge source that reads data from remote SharePoint.""" + filterExpressionAddOn: str + """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.""" + + +class SearchIndexKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a search index knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that reads data from a Search + Index. + :vartype kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] + :ivar filter_add_on: A filter condition applied to the index (e.g., 'State eq VA'). + :vartype filter_add_on: str + :ivar query_hint_overrides: 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. + :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] + """The discriminator value. Required. A knowledge source that reads data from a Search Index.""" + filterAddOn: str + """A filter condition applied to the index (e.g., 'State eq VA').""" + queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" + """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.""" + + +class SynchronizationState(TypedDict, total=False): + """Represents the current state of an ongoing synchronization that spans multiple indexer runs. + + :ivar start_time: The start time of the current synchronization. Required. + :vartype start_time: str + :ivar items_updates_processed: The number of item updates successfully processed in the current + synchronization. Required. + :vartype items_updates_processed: int + :ivar items_updates_failed: The number of item updates that failed in the current + synchronization. Required. + :vartype items_updates_failed: int + :ivar items_skipped: The number of items skipped in the current synchronization. Required. + :vartype items_skipped: int + :ivar errors: Collection of document-level indexing errors encountered during the current + synchronization run. Returned only when errors are present. + :vartype errors: list["KnowledgeSourceSynchronizationError"] + """ + + startTime: Required[str] + """The start time of the current synchronization. Required.""" + itemsUpdatesProcessed: Required[int] + """The number of item updates successfully processed in the current synchronization. Required.""" + itemsUpdatesFailed: Required[int] + """The number of item updates that failed in the current synchronization. Required.""" + itemsSkipped: Required[int] + """The number of items skipped in the current synchronization. Required.""" + errors: list["KnowledgeSourceSynchronizationError"] + """Collection of document-level indexing errors encountered during the current synchronization + run. Returned only when errors are present.""" + + +class WebKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a web knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that reads data from the web. + :vartype kind: Literal[KnowledgeSourceKind.WEB] + :ivar language: The language of the web results. + :vartype language: str + :ivar market: The market of the web results. + :vartype market: str + :ivar count: The number of web results to return. + :vartype count: int + :ivar freshness: The freshness of web results. + :vartype freshness: str + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.WEB]] + """The discriminator value. Required. A knowledge source that reads data from the web.""" + language: str + """The language of the web results.""" + market: str + """The market of the web results.""" + count: int + """The number of web results to return.""" + freshness: str + """The freshness of web results.""" + + +class WorkIQKnowledgeSourceParams(TypedDict, total=False): + """Specifies runtime parameters for a WorkIQ knowledge source. + + :ivar knowledge_source_name: The name of the index the params apply to. Required. + :vartype knowledge_source_name: str + :ivar include_references: Indicates whether references should be included for data retrieved + from this source. + :vartype include_references: bool + :ivar include_reference_source_data: Indicates whether references should include the structured + data obtained during retrieval in their payload. + :vartype include_reference_source_data: bool + :ivar always_query_source: Indicates that this knowledge source should bypass source selection + and always be queried at retrieval time. + :vartype always_query_source: bool + :ivar never_query_source: 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. + :vartype never_query_source: bool + :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + this knowledge source encounters an error. Defaults to false. + :vartype fail_on_error: bool + :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + included in the response. + :vartype reranker_threshold: float + :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + retrieve call only. When omitted, the stored knowledge source value applies. Known values are: + "rerank" and "none". + :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + source. + :vartype max_output_documents: int + :ivar enable_image_serving: 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. + :vartype enable_image_serving: bool + :ivar kind: The discriminator value. Required. A knowledge source that reads data from work IQ. + :vartype kind: Literal[KnowledgeSourceKind.WORK_IQ] + """ + + knowledgeSourceName: Required[str] + """The name of the index the params apply to. Required.""" + includeReferences: bool + """Indicates whether references should be included for data retrieved from this source.""" + includeReferenceSourceData: bool + """Indicates whether references should include the structured data obtained during retrieval in + their payload.""" + alwaysQuerySource: bool + """Indicates that this knowledge source should bypass source selection and always be queried at + retrieval time.""" + neverQuerySource: bool + """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.""" + failOnError: bool + """Indicates that the entire retrieval request should fail if retrieval from this knowledge source + encounters an error. Defaults to false.""" + rerankerThreshold: float + """The reranker threshold all retrieved documents must meet to be included in the response.""" + resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + """Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When + omitted, the stored knowledge source value applies. Known values are: \"rerank\" and \"none\".""" + maxOutputDocuments: int + """Limits the maximum number of documents returned from this knowledge source.""" + enableImageServing: bool + """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.""" + kind: Required[Literal[KnowledgeSourceKind.WORK_IQ]] + """The discriminator value. Required. A knowledge source that reads data from work IQ.""" + + +KnowledgeSourceParams = Union[ + AzureBlobKnowledgeSourceParams, + FabricDataAgentKnowledgeSourceParams, + FabricOntologyKnowledgeSourceParams, + FileKnowledgeSourceParams, + IndexedOneLakeKnowledgeSourceParams, + IndexedSharePointKnowledgeSourceParams, + IndexedSqlKnowledgeSourceParams, + McpServerKnowledgeSourceParams, + RemoteSharePointKnowledgeSourceParams, + SearchIndexKnowledgeSourceParams, + WebKnowledgeSourceParams, + WorkIQKnowledgeSourceParams, +] +KnowledgeBaseMessageContent = Union[KnowledgeBaseMessageImageContent, KnowledgeBaseMessageTextContent] +KnowledgeRetrievalReasoningEffort = Union[ + KnowledgeRetrievalAutoReasoningEffort, + KnowledgeRetrievalLowReasoningEffort, + KnowledgeRetrievalMediumReasoningEffort, + KnowledgeRetrievalMinimalReasoningEffort, +] +KnowledgeRetrievalIntent = Union[KnowledgeRetrievalSemanticIntent] +KnowledgeSourceVectorizer = Union[KnowledgeSourceAzureOpenAIVectorizer] diff --git a/sdk/search/azure-search-documents/azure/search/documents/types.py b/sdk/search/azure-search-documents/azure/search/documents/types.py new file mode 100644 index 000000000000..c0a3d6b76127 --- /dev/null +++ b/sdk/search/azure-search-documents/azure/search/documents/types.py @@ -0,0 +1,1622 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Literal, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import VectorQueryKind, VectorThresholdKind + +if TYPE_CHECKING: + from .models import ( + AutocompleteMode, + HybridCountAndFacetMode, + IndexActionType, + QueryAnswerType, + QueryCaptionType, + QueryDebugMode, + QueryLanguage, + QueryRewritesType, + QuerySpellerType, + QueryType, + ScoringStatistics, + SearchMode, + SemanticErrorMode, + SemanticErrorReason, + SemanticFieldState, + SemanticQueryRewritesResultType, + SemanticSearchResultsType, + VectorFilterMode, + ) + + +class AutocompleteItem(TypedDict, total=False): + """The result of Autocomplete requests. + + :ivar text: The completed term. Required. + :vartype text: str + :ivar query_plus_text: The query along with the completed term. Required. + :vartype query_plus_text: str + """ + + text: Required[str] + """The completed term. Required.""" + queryPlusText: Required[str] + """The query along with the completed term. Required.""" + + +class DebugInfo(TypedDict, total=False): + """Contains debugging information that can be used to further explore your search results. + + :ivar query_rewrites: Contains debugging information specific to query rewrites. + :vartype query_rewrites: "QueryRewritesDebugInfo" + """ + + queryRewrites: "QueryRewritesDebugInfo" + """Contains debugging information specific to query rewrites.""" + + +class DocumentDebugInfo(TypedDict, total=False): + """Contains debugging information that can be used to further explore your search results. + + :ivar semantic: Contains debugging information specific to semantic ranking requests. + :vartype semantic: "SemanticDebugInfo" + :ivar vectors: Contains debugging information specific to vector and hybrid search. + :vartype vectors: "VectorsDebugInfo" + :ivar inner_hits: Contains debugging information specific to vectors matched within a + collection of complex types. + :vartype inner_hits: dict[str, list["QueryResultDocumentInnerHit"]] + """ + + semantic: "SemanticDebugInfo" + """Contains debugging information specific to semantic ranking requests.""" + vectors: "VectorsDebugInfo" + """Contains debugging information specific to vector and hybrid search.""" + innerHits: dict[str, list["QueryResultDocumentInnerHit"]] + """Contains debugging information specific to vectors matched within a collection of complex + types.""" + + +FacetResult = TypedDict( + "FacetResult", + { + "count": int, + "avg": float, + "min": float, + "max": float, + "sum": float, + "cardinality": int, + "@search.facets": dict[str, list["FacetResult"]], + }, + total=False, +) +FacetResult.__doc__ = """A single bucket of a facet query result. Reports the number of documents with a field value +falling within a particular range or having a particular value or interval. + +:ivar count: The approximate count of documents falling within the bucket described by this + facet. +:vartype count: int +:ivar avg: The resulting total avg for the facet when a avg metric is requested. +:vartype avg: float +:ivar min: The resulting total min for the facet when a min metric is requested. +:vartype min: float +:ivar max: The resulting total max for the facet when a max metric is requested. +:vartype max: float +:ivar sum: The resulting total sum for the facet when a sum metric is requested. +:vartype sum: float +:ivar cardinality: The resulting total cardinality for the facet when a cardinality metric is + requested. +:vartype cardinality: int +:ivar facets: 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. +:vartype facets: dict[str, list["FacetResult"]] +""" + + +class HybridSearch(TypedDict, total=False): + """The query parameters to configure hybrid search behaviors. + + :ivar max_text_recall_size: 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. + :vartype max_text_recall_size: int + :ivar count_and_facet_mode: 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. Known values are: "countRetrievableResults" and "countAllResults". + :vartype count_and_facet_mode: Union[str, "HybridCountAndFacetMode"] + """ + + maxTextRecallSize: int + """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.""" + countAndFacetMode: Union[str, "HybridCountAndFacetMode"] + """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. Known + values are: \"countRetrievableResults\" and \"countAllResults\".""" + + +IndexAction = TypedDict( + "IndexAction", + { + "@search.action": Union[str, "IndexActionType"], + }, + total=False, +) +IndexAction.__doc__ = """Represents an index action that operates on a document. + +:ivar action_type: The operation to perform on a document in an indexing batch. Known values + are: "upload", "merge", "mergeOrUpload", and "delete". +:vartype action_type: Union[str, "IndexActionType"] +""" + + +class IndexDocumentsBatch(TypedDict, total=False): + """Contains a batch of document write actions to send to the index. + + :ivar actions: The actions in the batch. Required. + :vartype actions: list["IndexAction"] + """ + + value: Required[list["IndexAction"]] + """The actions in the batch. Required.""" + + +class IndexingResult(TypedDict, total=False): + """Status of an indexing operation for a single document. + + :ivar key: The key of a document that was in the indexing request. Required. + :vartype key: str + :ivar error_message: The error message explaining why the indexing operation failed for the + document identified by the key; null if indexing succeeded. + :vartype error_message: str + :ivar succeeded: A value indicating whether the indexing operation succeeded for the document + identified by the key. Required. + :vartype succeeded: bool + :ivar status_code: The status code of the indexing operation. Possible values include: 200 for + a successful update or delete, 201 for successful document creation, 400 for a malformed input + document, 404 for document not found, 409 for a version conflict, 422 when the index is + temporarily unavailable, or 503 for when the service is too busy. Required. + :vartype status_code: int + """ + + key: Required[str] + """The key of a document that was in the indexing request. Required.""" + errorMessage: str + """The error message explaining why the indexing operation failed for the document identified by + the key; null if indexing succeeded.""" + status: Required[bool] + """A value indicating whether the indexing operation succeeded for the document identified by the + key. Required.""" + statusCode: Required[int] + """The status code of the indexing operation. Possible values include: 200 for a successful update + or delete, 201 for successful document creation, 400 for a malformed input document, 404 for + document not found, 409 for a version conflict, 422 when the index is temporarily unavailable, + or 503 for when the service is too busy. Required.""" + + +class QueryAnswerResult(TypedDict, total=False): + """An answer is a text passage extracted from the contents of the most relevant documents that + matched the query. Answers are extracted from the top search results. Answer candidates are + scored and the top answers are selected. + + :ivar score: The score value represents how relevant the answer is to the query relative to + other answers returned for the query. + :vartype score: float + :ivar key: The key of the document the answer was extracted from. + :vartype key: str + :ivar text: The text passage extracted from the document contents as the answer. + :vartype text: str + :ivar highlights: Same text passage as in the Text property with highlighted text phrases most + relevant to the query. + :vartype highlights: str + """ + + score: float + """The score value represents how relevant the answer is to the query relative to other answers + returned for the query.""" + key: str + """The key of the document the answer was extracted from.""" + text: str + """The text passage extracted from the document contents as the answer.""" + highlights: Optional[str] + """Same text passage as in the Text property with highlighted text phrases most relevant to the + query.""" + + +class QueryCaptionResult(TypedDict, total=False): + """Captions are the most representative passages from the document relatively to the search query. + They are often used as document summary. Captions are only returned for queries of type + ``semantic``. + + :ivar text: A representative text passage extracted from the document most relevant to the + search query. + :vartype text: str + :ivar highlights: Same text passage as in the Text property with highlighted phrases most + relevant to the query. + :vartype highlights: str + """ + + text: str + """A representative text passage extracted from the document most relevant to the search query.""" + highlights: Optional[str] + """Same text passage as in the Text property with highlighted phrases most relevant to the query.""" + + +class QueryResultDocumentInnerHit(TypedDict, total=False): + """Detailed scoring information for an individual element of a complex collection. + + :ivar ordinal: Position of this specific matching element within it's original collection. + Position starts at 0. + :vartype ordinal: int + :ivar vectors: Detailed scoring information for an individual element of a complex collection + that matched a vector query. + :vartype vectors: list[dict[str, "SingleVectorFieldResult"]] + """ + + ordinal: int + """Position of this specific matching element within it's original collection. Position starts at + 0.""" + vectors: list[dict[str, "SingleVectorFieldResult"]] + """Detailed scoring information for an individual element of a complex collection that matched a + vector query.""" + + +class QueryResultDocumentRerankerInput(TypedDict, total=False): + """The raw concatenated strings that were sent to the semantic enrichment process. + + :ivar title: The raw string for the title field that was used for semantic enrichment. + :vartype title: str + :ivar content: The raw concatenated strings for the content fields that were used for semantic + enrichment. + :vartype content: str + :ivar keywords: The raw concatenated strings for the keyword fields that were used for semantic + enrichment. + :vartype keywords: str + """ + + title: str + """The raw string for the title field that was used for semantic enrichment.""" + content: str + """The raw concatenated strings for the content fields that were used for semantic enrichment.""" + keywords: str + """The raw concatenated strings for the keyword fields that were used for semantic enrichment.""" + + +class QueryResultDocumentSemanticField(TypedDict, total=False): + """Description of fields that were sent to the semantic enrichment process, as well as how they + were used. + + :ivar name: The name of the field that was sent to the semantic enrichment process. + :vartype name: str + :ivar state: The way the field was used for the semantic enrichment process (fully used, + partially used, or unused). Known values are: "used", "unused", and "partial". + :vartype state: Union[str, "SemanticFieldState"] + """ + + name: str + """The name of the field that was sent to the semantic enrichment process.""" + state: Union[str, "SemanticFieldState"] + """The way the field was used for the semantic enrichment process (fully used, partially used, or + unused). Known values are: \"used\", \"unused\", and \"partial\".""" + + +class QueryResultDocumentSubscores(TypedDict, total=False): + """The breakdown of subscores between the text and vector query components of the search query for + this document. Each vector query is shown as a separate object in the same order they were + received. + + :ivar text: The BM25 or Classic score for the text portion of the query. + :vartype text: "TextResult" + :ivar vectors: The vector similarity and. + :vartype vectors: list[dict[str, "SingleVectorFieldResult"]] + :ivar document_boost: The BM25 or Classic score for the text portion of the query. + :vartype document_boost: float + """ + + text: "TextResult" + """The BM25 or Classic score for the text portion of the query.""" + vectors: list[dict[str, "SingleVectorFieldResult"]] + """The vector similarity and.""" + documentBoost: float + """The BM25 or Classic score for the text portion of the query.""" + + +class QueryRewritesDebugInfo(TypedDict, total=False): + """Contains debugging information specific to query rewrites. + + :ivar text: List of query rewrites generated for the text query. + :vartype text: "QueryRewritesValuesDebugInfo" + :ivar vectors: List of query rewrites generated for the vectorizable text queries. + :vartype vectors: list["QueryRewritesValuesDebugInfo"] + """ + + text: "QueryRewritesValuesDebugInfo" + """List of query rewrites generated for the text query.""" + vectors: list["QueryRewritesValuesDebugInfo"] + """List of query rewrites generated for the vectorizable text queries.""" + + +class QueryRewritesValuesDebugInfo(TypedDict, total=False): + """Contains debugging information specific to query rewrites. + + :ivar input_query: 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. + :vartype input_query: str + :ivar rewrites: List of query rewrites. + :vartype rewrites: list[str] + """ + + inputQuery: str + """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.""" + rewrites: list[str] + """List of query rewrites.""" + + +SearchDocumentsResult = TypedDict( + "SearchDocumentsResult", + { + "@odata.count": int, + "@search.coverage": float, + "@search.facets": dict[str, list["FacetResult"]], + "@search.answers": Optional[list["QueryAnswerResult"]], + "@search.debug": Optional["DebugInfo"], + "@search.nextPageParameters": "SearchRequest", + "value": Required[list["SearchResult"]], + "@odata.nextLink": str, + "@search.semanticPartialResponseReason": Union[str, "SemanticErrorReason"], + "@search.semanticPartialResponseType": Union[str, "SemanticSearchResultsType"], + "@search.semanticQueryRewritesResultType": Union[str, "_enums.SemanticQueryRewritesResultType"], + }, + total=False, +) +SearchDocumentsResult.__doc__ = """Response containing search results from an index. + +:ivar count: The total count of results found by the search operation, or null if the count was + not requested. If present, the count may be greater than the number of results in this + response. This can happen if you use the $top or $skip parameters, or if the query can't return + all the requested documents in a single response. +:vartype count: int +:ivar coverage: A value indicating the percentage of the index that was included in the query, + or null if minimumCoverage was not specified in the request. +:vartype coverage: float +:ivar facets: The facet query results for the search operation, organized as a collection of + buckets for each faceted field; null if the query did not include any facet expressions. +:vartype facets: dict[str, list["FacetResult"]] +:ivar answers: The answers query results for the search operation; null if the answers query + parameter was not specified or set to 'none'. +:vartype answers: list["QueryAnswerResult"] +:ivar debug_info: Debug information that applies to the search results as a whole. +:vartype debug_info: "DebugInfo" +:ivar next_page_parameters: Continuation JSON payload returned when the query can't return all + the requested results in a single response. You can use this JSON along with. +:vartype next_page_parameters: "SearchRequest" +:ivar results: The sequence of results returned by the query. Required. +:vartype results: list["SearchResult"] +:ivar next_link: Continuation URL returned when the query can't return all the requested + results in a single response. You can use this URL to formulate another GET or POST Search + request to get the next part of the search response. Make sure to use the same verb (GET or + POST) as the request that produced this response. +:vartype next_link: str +:ivar semantic_partial_response_reason: Reason that a partial response was returned for a + semantic ranking request. Known values are: "maxWaitExceeded", "capacityOverloaded", and + "transient". +:vartype semantic_partial_response_reason: Union[str, "SemanticErrorReason"] +:ivar semantic_partial_response_type: Type of partial response that was returned for a semantic + ranking request. Known values are: "baseResults" and "rerankedResults". +:vartype semantic_partial_response_type: Union[str, "SemanticSearchResultsType"] +:ivar semantic_query_rewrites_result_type: Type of query rewrite that was used to retrieve + documents. "originalQueryOnly" +:vartype semantic_query_rewrites_result_type: Union[str, + "_enums.SemanticQueryRewritesResultType"] +""" + + +class SearchRequest(TypedDict, total=False): + """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. + + :ivar include_total_count: A value that specifies whether to fetch the total count of results. + Default is false. Setting this value to true may have a performance impact. Note that the count + returned is an approximation. + :vartype include_total_count: bool + :ivar facets: The list of facet expressions to apply to the search query. Each facet expression + contains a field name, optionally followed by a comma-separated list of name:value pairs. + :vartype facets: list[str] + :ivar filter: The OData $filter expression to apply to the search query. + :vartype filter: str + :ivar highlight_fields: The comma-separated list of field names to use for hit highlights. Only + searchable fields can be used for hit highlighting. + :vartype highlight_fields: list[str] + :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + highlightPreTag. Default is </em>. + :vartype highlight_post_tag: str + :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + highlightPostTag. Default is <em>. + :vartype highlight_pre_tag: str + :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + must be covered by a search query in order for the query to be reported as a success. This + parameter can be useful for ensuring search availability even for services with only one + replica. The default is 100. + :vartype minimum_coverage: float + :ivar order_by: The comma-separated list of OData $orderby expressions by which to sort the + results. Each expression can be either a field name or a call to either the geo.distance() or + the search.score() functions. Each expression can be followed by asc to indicate ascending, or + desc to indicate descending. The default is ascending order. Ties will be broken by the match + scores of documents. If no $orderby is specified, the default sort order is descending by + document match score. There can be at most 32 $orderby clauses. + :vartype order_by: list[str] + :ivar query_type: A value that specifies the syntax of the search query. The default is + 'simple'. Use 'full' if your query uses the Lucene query syntax. Known values are: "simple", + "full", and "semantic". + :vartype query_type: Union[str, "QueryType"] + :ivar scoring_statistics: A value that specifies whether we want to calculate scoring + statistics (such as document frequency) globally for more consistent scoring, or locally, for + lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally + before scoring. Using global scoring statistics can increase latency of search queries. Known + values are: "local" and "global". + :vartype scoring_statistics: Union[str, "ScoringStatistics"] + :ivar session_id: A value to be used to create a sticky session, which can help getting more + consistent results. As long as the same sessionId is used, a best-effort attempt will be made + to target the same replica set. Be wary that reusing the same sessionID values repeatedly can + interfere with the load balancing of the requests across replicas and adversely affect the + performance of the search service. The value used as sessionId cannot start with a '_' + character. + :vartype session_id: str + :ivar scoring_parameters: The 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 + "mylocation--122.2,44.8" (without the quotes). + :vartype scoring_parameters: list[str] + :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching + documents in order to sort the results. + :vartype scoring_profile: str + :ivar debug: Enables a debugging tool that can be used to further explore your reranked + results. Known values are: "disabled", "semantic", "vector", "queryRewrites", "innerHits", and + "all". + :vartype debug: Union[str, "QueryDebugMode"] + :ivar search_text: A full-text search query expression; Use "*" or omit this parameter to match + all documents. + :vartype search_text: str + :ivar search_fields: The comma-separated list of field names to which to scope the full-text + search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the + field names of each fielded search expression take precedence over any field names listed in + this parameter. + :vartype search_fields: list[str] + :ivar search_mode: A value that specifies whether any or all of the search terms must be + matched in order to count the document as a match. Known values are: "any" and "all". + :vartype search_mode: Union[str, "SearchMode"] + :ivar query_language: A value that specifies the language of the search query. Known values + are: "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", and "ur-pk". + :vartype query_language: Union[str, "QueryLanguage"] + :ivar query_speller: A value that specifies the type of the speller to use to spell-correct + individual search query terms. Known values are: "none" and "lexicon". + :vartype query_speller: Union[str, "QuerySpellerType"] + :ivar select: The comma-separated list of fields to retrieve. If unspecified, all fields marked + as retrievable in the schema are included. + :vartype select: list[str] + :ivar skip: The number of search results to skip. This value cannot be greater than 100,000. If + you need to scan documents in sequence, but cannot use skip due to this limitation, consider + using orderby on a totally-ordered key and filter with a range query instead. + :vartype skip: int + :ivar top: The number of search results to retrieve. This can be used in conjunction with $skip + to implement client-side paging of search results. If results are truncated due to server-side + paging, the response will include a continuation token that can be used to issue another Search + request for the next page of results. + :vartype top: int + :ivar semantic_configuration_name: The name of a semantic configuration that will be used when + processing documents for queries of type semantic. + :vartype semantic_configuration_name: str + :ivar semantic_error_handling: Allows the user to choose whether a semantic call should fail + completely (default / current behavior), or to return partial results. Known values are: + "partial" and "fail". + :vartype semantic_error_handling: Union[str, "SemanticErrorMode"] + :ivar semantic_max_wait_in_milliseconds: Allows the user to set an upper bound on the amount of + time it takes for semantic enrichment to finish processing before the request fails. + :vartype semantic_max_wait_in_milliseconds: int + :ivar semantic_query: Allows setting a separate search query that will be solely used for + semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there + is a need to use different queries between the base retrieval and ranking phase, and the L2 + semantic phase. + :vartype semantic_query: str + :ivar answers: A value that specifies whether answers should be returned as part of the search + response. Known values are: "none" and "extractive". + :vartype answers: Union[str, "QueryAnswerType"] + :ivar captions: A value that specifies whether captions should be returned as part of the + search response. Known values are: "none" and "extractive". + :vartype captions: Union[str, "QueryCaptionType"] + :ivar query_rewrites: A value that specifies whether query rewrites should be generated to + augment the search query. Known values are: "none" and "generative". + :vartype query_rewrites: Union[str, "QueryRewritesType"] + :ivar semantic_fields: The comma-separated list of field names used for semantic ranking. + :vartype semantic_fields: list[str] + :ivar vector_queries: The query parameters for vector and hybrid search queries. + :vartype vector_queries: list["VectorQuery"] + :ivar vector_filter_mode: Determines whether or not filters are applied before or after the + vector search is performed. Default is 'preFilter' for new indexes. Known values are: + "postFilter", "preFilter", and "strictPostFilter". + :vartype vector_filter_mode: Union[str, "VectorFilterMode"] + :ivar hybrid_search: The query parameters to configure hybrid search behaviors. + :vartype hybrid_search: "HybridSearch" + """ + + count: bool + """A value that specifies whether to fetch the total count of results. Default is false. Setting + this value to true may have a performance impact. Note that the count returned is an + approximation.""" + facets: list[str] + """The list of facet expressions to apply to the search query. Each facet expression contains a + field name, optionally followed by a comma-separated list of name:value pairs.""" + filter: str + """The OData $filter expression to apply to the search query.""" + highlight: list[str] + """The comma-separated list of field names to use for hit highlights. Only searchable fields can + be used for hit highlighting.""" + highlightPostTag: str + """A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is + </em>.""" + highlightPreTag: str + """A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is + <em>.""" + minimumCoverage: float + """A number between 0 and 100 indicating the percentage of the index that must be covered by a + search query in order for the query to be reported as a success. This parameter can be useful + for ensuring search availability even for services with only one replica. The default is 100.""" + orderby: list[str] + """The comma-separated list of OData $orderby expressions by which to sort the results. Each + expression can be either a field name or a call to either the geo.distance() or the + search.score() functions. Each expression can be followed by asc to indicate ascending, or desc + to indicate descending. The default is ascending order. Ties will be broken by the match scores + of documents. If no $orderby is specified, the default sort order is descending by document + match score. There can be at most 32 $orderby clauses.""" + queryType: Union[str, "QueryType"] + """A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if + your query uses the Lucene query syntax. Known values are: \"simple\", \"full\", and + \"semantic\".""" + scoringStatistics: Union[str, "ScoringStatistics"] + """A value that specifies whether we want to calculate scoring statistics (such as document + frequency) globally for more consistent scoring, or locally, for lower latency. The default is + 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global + scoring statistics can increase latency of search queries. Known values are: \"local\" and + \"global\".""" + sessionId: str + """A value to be used to create a sticky session, which can help getting more consistent results. + As long as the same sessionId is used, a best-effort attempt will be made to target the same + replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the + load balancing of the requests across replicas and adversely affect the performance of the + search service. The value used as sessionId cannot start with a '_' character.""" + scoringParameters: list[str] + """The 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 + \"mylocation--122.2,44.8\" (without the quotes).""" + scoringProfile: str + """The name of a scoring profile to evaluate match scores for matching documents in order to sort + the results.""" + debug: Union[str, "QueryDebugMode"] + """Enables a debugging tool that can be used to further explore your reranked results. Known + values are: \"disabled\", \"semantic\", \"vector\", \"queryRewrites\", \"innerHits\", and + \"all\".""" + search: str + """A full-text search query expression; Use \"*\" or omit this parameter to match all documents.""" + searchFields: list[str] + """The comma-separated list of field names to which to scope the full-text search. When using + fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each + fielded search expression take precedence over any field names listed in this parameter.""" + searchMode: Union[str, "SearchMode"] + """A value that specifies whether any or all of the search terms must be matched in order to count + the document as a match. Known values are: \"any\" and \"all\".""" + queryLanguage: Union[str, "QueryLanguage"] + """A value that specifies the language of the search query. Known values are: \"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\", and \"ur-pk\".""" + speller: Union[str, "QuerySpellerType"] + """A value that specifies the type of the speller to use to spell-correct individual search query + terms. Known values are: \"none\" and \"lexicon\".""" + select: list[str] + """The comma-separated list of fields to retrieve. If unspecified, all fields marked as + retrievable in the schema are included.""" + skip: int + """The number of search results to skip. This value cannot be greater than 100,000. If you need to + scan documents in sequence, but cannot use skip due to this limitation, consider using orderby + on a totally-ordered key and filter with a range query instead.""" + top: int + """The number of search results to retrieve. This can be used in conjunction with $skip to + implement client-side paging of search results. If results are truncated due to server-side + paging, the response will include a continuation token that can be used to issue another Search + request for the next page of results.""" + semanticConfiguration: str + """The name of a semantic configuration that will be used when processing documents for queries of + type semantic.""" + semanticErrorHandling: Union[str, "SemanticErrorMode"] + """Allows the user to choose whether a semantic call should fail completely (default / current + behavior), or to return partial results. Known values are: \"partial\" and \"fail\".""" + semanticMaxWaitInMilliseconds: int + """Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to + finish processing before the request fails.""" + semanticQuery: str + """Allows setting a separate search query that will be solely used for semantic reranking, + semantic captions and semantic answers. Is useful for scenarios where there is a need to use + different queries between the base retrieval and ranking phase, and the L2 semantic phase.""" + answers: Union[str, "QueryAnswerType"] + """A value that specifies whether answers should be returned as part of the search response. Known + values are: \"none\" and \"extractive\".""" + captions: Union[str, "QueryCaptionType"] + """A value that specifies whether captions should be returned as part of the search response. + Known values are: \"none\" and \"extractive\".""" + queryRewrites: Union[str, "QueryRewritesType"] + """A value that specifies whether query rewrites should be generated to augment the search query. + Known values are: \"none\" and \"generative\".""" + semanticFields: list[str] + """The comma-separated list of field names used for semantic ranking.""" + vectorQueries: list["VectorQuery"] + """The query parameters for vector and hybrid search queries.""" + vectorFilterMode: Union[str, "VectorFilterMode"] + """Determines whether or not filters are applied before or after the vector search is performed. + Default is 'preFilter' for new indexes. Known values are: \"postFilter\", \"preFilter\", and + \"strictPostFilter\".""" + hybridSearch: "HybridSearch" + """The query parameters to configure hybrid search behaviors.""" + + +SearchResult = TypedDict( + "SearchResult", + { + "@search.score": Required[float], + "@search.rerankerScore": Optional[float], + "@search.rerankerBoostedScore": Optional[float], + "@search.highlights": dict[str, list[str]], + "@search.captions": Optional[list["QueryCaptionResult"]], + "@search.documentDebugInfo": Optional["DocumentDebugInfo"], + }, + total=False, +) +SearchResult.__doc__ = """Contains a document found by a search query, plus associated metadata. + +:ivar score: The relevance score of the document compared to other documents returned by the + query. Required. +:vartype score: float +:ivar reranker_score: The relevance score computed by the semantic ranker for the top search + results. Search results are sorted by the RerankerScore first and then by the Score. + RerankerScore is only returned for queries of type 'semantic'. +:vartype reranker_score: float +:ivar reranker_boosted_score: The relevance score computed by boosting the Reranker Score. + Search results are sorted by the RerankerScore/RerankerBoostedScore based on + useScoringProfileBoostedRanking in the Semantic Config. RerankerBoostedScore is only returned + for queries of type 'semantic'. +:vartype reranker_boosted_score: float +:ivar highlights: Text fragments from the document that indicate the matching search terms, + organized by each applicable field; null if hit highlighting was not enabled for the query. +:vartype highlights: dict[str, list[str]] +:ivar captions: Captions are the most representative passages from the document relatively to + the search query. They are often used as document summary. Captions are only returned for + queries of type 'semantic'. +:vartype captions: list["QueryCaptionResult"] +:ivar document_debug_info: Contains debugging information that can be used to further explore + your search results. +:vartype document_debug_info: "DocumentDebugInfo" +""" + + +class SearchScoreThreshold(TypedDict, total=False): + """The results of the vector query will filter based on the '. + + :ivar value: The threshold will filter based on the '. Required. + :vartype value: float + :ivar kind: The kind of threshold used to filter vector queries. Required. 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. + :vartype kind: Literal[VectorThresholdKind.SEARCH_SCORE] + """ + + value: Required[float] + """The threshold will filter based on the '. Required.""" + kind: Required[Literal[VectorThresholdKind.SEARCH_SCORE]] + """The kind of threshold used to filter vector queries. Required. 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.""" + + +class SemanticDebugInfo(TypedDict, total=False): + """Contains debugging information specific to semantic ranking requests. + + :ivar title_field: The title field that was sent to the semantic enrichment process, as well as + how it was used. + :vartype title_field: "QueryResultDocumentSemanticField" + :ivar content_fields: The content fields that were sent to the semantic enrichment process, as + well as how they were used. + :vartype content_fields: list["QueryResultDocumentSemanticField"] + :ivar keyword_fields: The keyword fields that were sent to the semantic enrichment process, as + well as how they were used. + :vartype keyword_fields: list["QueryResultDocumentSemanticField"] + :ivar reranker_input: The raw concatenated strings that were sent to the semantic enrichment + process. + :vartype reranker_input: "QueryResultDocumentRerankerInput" + """ + + titleField: "QueryResultDocumentSemanticField" + """The title field that was sent to the semantic enrichment process, as well as how it was used.""" + contentFields: list["QueryResultDocumentSemanticField"] + """The content fields that were sent to the semantic enrichment process, as well as how they were + used.""" + keywordFields: list["QueryResultDocumentSemanticField"] + """The keyword fields that were sent to the semantic enrichment process, as well as how they were + used.""" + rerankerInput: "QueryResultDocumentRerankerInput" + """The raw concatenated strings that were sent to the semantic enrichment process.""" + + +class SingleVectorFieldResult(TypedDict, total=False): + """A single vector field result. Both. + + :ivar search_score: The. + :vartype search_score: float + :ivar vector_similarity: The vector similarity score for this document. Note this is the + canonical definition of similarity metric, not the 'distance' version. For example, cosine + similarity instead of cosine distance. + :vartype vector_similarity: float + """ + + searchScore: float + """The.""" + vectorSimilarity: float + """The vector similarity score for this document. Note this is the canonical definition of + similarity metric, not the 'distance' version. For example, cosine similarity instead of cosine + distance.""" + + +SuggestResult = TypedDict( + "SuggestResult", + { + "@search.text": Required[str], + }, + total=False, +) +SuggestResult.__doc__ = """A result containing a document found by a suggestion query, plus associated metadata. + +:ivar text: The text of the suggestion result. Required. +:vartype text: str +""" + + +class TextResult(TypedDict, total=False): + """The BM25 or Classic score for the text portion of the query. + + :ivar search_score: The BM25 or Classic score for the text portion of the query. + :vartype search_score: float + """ + + searchScore: float + """The BM25 or Classic score for the text portion of the query.""" + + +class VectorizableImageBinaryQuery(TypedDict, total=False): + """The query parameters to use for vector search when a base 64 encoded binary of an image that + needs to be vectorized is provided. + + :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. + :vartype k_nearest_neighbors: int + :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector + searched. + :vartype fields: str + :ivar exhaustive: When true, triggers an exhaustive k-nearest neighbor search across all + vectors within the vector index. Useful for scenarios where exact matches are critical, such as + determining ground truth values. + :vartype exhaustive: bool + :ivar oversampling: Oversampling factor. Minimum value is 1. It overrides the + 'defaultOversampling' parameter configured in the index definition. It can be set only when + 'rerankWithOriginalVectors' is true. This parameter is only permitted when a compression method + is used on the underlying vector field. + :vartype oversampling: float + :ivar weight: Relative weight of the vector query when compared to other vector query and/or + the text query within the same search request. This value is used when combining the results of + multiple ranking lists produced by the different vector queries and/or the results retrieved + through the text query. The higher the weight, the higher the documents that matched that query + will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger + than zero. + :vartype weight: float + :ivar threshold: The threshold used for vector queries. Note this can only be set if all + 'fields' use the same similarity metric. + :vartype threshold: "VectorThreshold" + :ivar filter_override: 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. + :vartype filter_override: str + :ivar per_document_vector_limit: 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. + :vartype per_document_vector_limit: int + :ivar base64_image: The base 64 encoded binary of an image to be vectorized to perform a vector + search query. + :vartype base64_image: str + :ivar kind: The kind of vector query being performed. Required. Vector query where a base 64 + encoded binary of an image that needs to be vectorized is provided. + :vartype kind: Literal[VectorQueryKind.IMAGE_BINARY] + """ + + k: int + """Number of nearest neighbors to return as top hits.""" + fields: str + """Vector Fields of type Collection(Edm.Single) to be included in the vector searched.""" + exhaustive: bool + """When true, triggers an exhaustive k-nearest neighbor search across all vectors within the + vector index. Useful for scenarios where exact matches are critical, such as determining ground + truth values.""" + oversampling: float + """Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter + configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is + true. This parameter is only permitted when a compression method is used on the underlying + vector field.""" + weight: float + """Relative weight of the vector query when compared to other vector query and/or the text query + within the same search request. This value is used when combining the results of multiple + ranking lists produced by the different vector queries and/or the results retrieved through the + text query. The higher the weight, the higher the documents that matched that query will be in + the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero.""" + threshold: "VectorThreshold" + """The threshold used for vector queries. Note this can only be set if all 'fields' use the same + similarity metric.""" + filterOverride: str + """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.""" + perDocumentVectorLimit: int + """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.""" + base64Image: str + """The base 64 encoded binary of an image to be vectorized to perform a vector search query.""" + kind: Required[Literal[VectorQueryKind.IMAGE_BINARY]] + """The kind of vector query being performed. Required. Vector query where a base 64 encoded binary + of an image that needs to be vectorized is provided.""" + + +class VectorizableImageUrlQuery(TypedDict, total=False): + """The query parameters to use for vector search when an url that represents an image value that + needs to be vectorized is provided. + + :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. + :vartype k_nearest_neighbors: int + :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector + searched. + :vartype fields: str + :ivar exhaustive: When true, triggers an exhaustive k-nearest neighbor search across all + vectors within the vector index. Useful for scenarios where exact matches are critical, such as + determining ground truth values. + :vartype exhaustive: bool + :ivar oversampling: Oversampling factor. Minimum value is 1. It overrides the + 'defaultOversampling' parameter configured in the index definition. It can be set only when + 'rerankWithOriginalVectors' is true. This parameter is only permitted when a compression method + is used on the underlying vector field. + :vartype oversampling: float + :ivar weight: Relative weight of the vector query when compared to other vector query and/or + the text query within the same search request. This value is used when combining the results of + multiple ranking lists produced by the different vector queries and/or the results retrieved + through the text query. The higher the weight, the higher the documents that matched that query + will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger + than zero. + :vartype weight: float + :ivar threshold: The threshold used for vector queries. Note this can only be set if all + 'fields' use the same similarity metric. + :vartype threshold: "VectorThreshold" + :ivar filter_override: 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. + :vartype filter_override: str + :ivar per_document_vector_limit: 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. + :vartype per_document_vector_limit: int + :ivar url: The URL of an image to be vectorized to perform a vector search query. + :vartype url: str + :ivar kind: The kind of vector query being performed. Required. Vector query where an url that + represents an image value that needs to be vectorized is provided. + :vartype kind: Literal[VectorQueryKind.IMAGE_URL] + """ + + k: int + """Number of nearest neighbors to return as top hits.""" + fields: str + """Vector Fields of type Collection(Edm.Single) to be included in the vector searched.""" + exhaustive: bool + """When true, triggers an exhaustive k-nearest neighbor search across all vectors within the + vector index. Useful for scenarios where exact matches are critical, such as determining ground + truth values.""" + oversampling: float + """Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter + configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is + true. This parameter is only permitted when a compression method is used on the underlying + vector field.""" + weight: float + """Relative weight of the vector query when compared to other vector query and/or the text query + within the same search request. This value is used when combining the results of multiple + ranking lists produced by the different vector queries and/or the results retrieved through the + text query. The higher the weight, the higher the documents that matched that query will be in + the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero.""" + threshold: "VectorThreshold" + """The threshold used for vector queries. Note this can only be set if all 'fields' use the same + similarity metric.""" + filterOverride: str + """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.""" + perDocumentVectorLimit: int + """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.""" + url: str + """The URL of an image to be vectorized to perform a vector search query.""" + kind: Required[Literal[VectorQueryKind.IMAGE_URL]] + """The kind of vector query being performed. Required. Vector query where an url that represents + an image value that needs to be vectorized is provided.""" + + +class VectorizableTextQuery(TypedDict, total=False): + """The query parameters to use for vector search when a text value that needs to be vectorized is + provided. + + :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. + :vartype k_nearest_neighbors: int + :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector + searched. + :vartype fields: str + :ivar exhaustive: When true, triggers an exhaustive k-nearest neighbor search across all + vectors within the vector index. Useful for scenarios where exact matches are critical, such as + determining ground truth values. + :vartype exhaustive: bool + :ivar oversampling: Oversampling factor. Minimum value is 1. It overrides the + 'defaultOversampling' parameter configured in the index definition. It can be set only when + 'rerankWithOriginalVectors' is true. This parameter is only permitted when a compression method + is used on the underlying vector field. + :vartype oversampling: float + :ivar weight: Relative weight of the vector query when compared to other vector query and/or + the text query within the same search request. This value is used when combining the results of + multiple ranking lists produced by the different vector queries and/or the results retrieved + through the text query. The higher the weight, the higher the documents that matched that query + will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger + than zero. + :vartype weight: float + :ivar threshold: The threshold used for vector queries. Note this can only be set if all + 'fields' use the same similarity metric. + :vartype threshold: "VectorThreshold" + :ivar filter_override: 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. + :vartype filter_override: str + :ivar per_document_vector_limit: 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. + :vartype per_document_vector_limit: int + :ivar text: The text to be vectorized to perform a vector search query. Required. + :vartype text: str + :ivar query_rewrites: Can be configured to let a generative model rewrite the query before + sending it to be vectorized. Known values are: "none" and "generative". + :vartype query_rewrites: Union[str, "QueryRewritesType"] + :ivar kind: The kind of vector query being performed. Required. Vector query where a text value + that needs to be vectorized is provided. + :vartype kind: Literal[VectorQueryKind.TEXT] + """ + + k: int + """Number of nearest neighbors to return as top hits.""" + fields: str + """Vector Fields of type Collection(Edm.Single) to be included in the vector searched.""" + exhaustive: bool + """When true, triggers an exhaustive k-nearest neighbor search across all vectors within the + vector index. Useful for scenarios where exact matches are critical, such as determining ground + truth values.""" + oversampling: float + """Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter + configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is + true. This parameter is only permitted when a compression method is used on the underlying + vector field.""" + weight: float + """Relative weight of the vector query when compared to other vector query and/or the text query + within the same search request. This value is used when combining the results of multiple + ranking lists produced by the different vector queries and/or the results retrieved through the + text query. The higher the weight, the higher the documents that matched that query will be in + the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero.""" + threshold: "VectorThreshold" + """The threshold used for vector queries. Note this can only be set if all 'fields' use the same + similarity metric.""" + filterOverride: str + """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.""" + perDocumentVectorLimit: int + """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.""" + text: Required[str] + """The text to be vectorized to perform a vector search query. Required.""" + queryRewrites: Union[str, "QueryRewritesType"] + """Can be configured to let a generative model rewrite the query before sending it to be + vectorized. Known values are: \"none\" and \"generative\".""" + kind: Required[Literal[VectorQueryKind.TEXT]] + """The kind of vector query being performed. Required. Vector query where a text value that needs + to be vectorized is provided.""" + + +class VectorizedQuery(TypedDict, total=False): + """The query parameters to use for vector search when a raw vector value is provided. + + :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. + :vartype k_nearest_neighbors: int + :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector + searched. + :vartype fields: str + :ivar exhaustive: When true, triggers an exhaustive k-nearest neighbor search across all + vectors within the vector index. Useful for scenarios where exact matches are critical, such as + determining ground truth values. + :vartype exhaustive: bool + :ivar oversampling: Oversampling factor. Minimum value is 1. It overrides the + 'defaultOversampling' parameter configured in the index definition. It can be set only when + 'rerankWithOriginalVectors' is true. This parameter is only permitted when a compression method + is used on the underlying vector field. + :vartype oversampling: float + :ivar weight: Relative weight of the vector query when compared to other vector query and/or + the text query within the same search request. This value is used when combining the results of + multiple ranking lists produced by the different vector queries and/or the results retrieved + through the text query. The higher the weight, the higher the documents that matched that query + will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger + than zero. + :vartype weight: float + :ivar threshold: The threshold used for vector queries. Note this can only be set if all + 'fields' use the same similarity metric. + :vartype threshold: "VectorThreshold" + :ivar filter_override: 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. + :vartype filter_override: str + :ivar per_document_vector_limit: 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. + :vartype per_document_vector_limit: int + :ivar vector: The vector representation of a search query. Required. + :vartype vector: list[float] + :ivar kind: The kind of vector query being performed. Required. Vector query where a raw vector + value is provided. + :vartype kind: Literal[VectorQueryKind.VECTOR] + """ + + k: int + """Number of nearest neighbors to return as top hits.""" + fields: str + """Vector Fields of type Collection(Edm.Single) to be included in the vector searched.""" + exhaustive: bool + """When true, triggers an exhaustive k-nearest neighbor search across all vectors within the + vector index. Useful for scenarios where exact matches are critical, such as determining ground + truth values.""" + oversampling: float + """Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter + configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is + true. This parameter is only permitted when a compression method is used on the underlying + vector field.""" + weight: float + """Relative weight of the vector query when compared to other vector query and/or the text query + within the same search request. This value is used when combining the results of multiple + ranking lists produced by the different vector queries and/or the results retrieved through the + text query. The higher the weight, the higher the documents that matched that query will be in + the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero.""" + threshold: "VectorThreshold" + """The threshold used for vector queries. Note this can only be set if all 'fields' use the same + similarity metric.""" + filterOverride: str + """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.""" + perDocumentVectorLimit: int + """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.""" + vector: Required[list[float]] + """The vector representation of a search query. Required.""" + kind: Required[Literal[VectorQueryKind.VECTOR]] + """The kind of vector query being performed. Required. Vector query where a raw vector value is + provided.""" + + +class VectorsDebugInfo(TypedDict, total=False): + """ "Contains debugging information specific to vector and hybrid search."). + + :ivar subscores: The breakdown of subscores of the document prior to the chosen result set + fusion/combination method such as RRF. + :vartype subscores: "QueryResultDocumentSubscores" + """ + + subscores: "QueryResultDocumentSubscores" + """The breakdown of subscores of the document prior to the chosen result set fusion/combination + method such as RRF.""" + + +class VectorSimilarityThreshold(TypedDict, total=False): + """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. + + :ivar value: 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. + Required. + :vartype value: float + :ivar kind: The kind of threshold used to filter vector queries. Required. 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. + :vartype kind: Literal[VectorThresholdKind.VECTOR_SIMILARITY] + """ + + value: Required[float] + """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. Required.""" + kind: Required[Literal[VectorThresholdKind.VECTOR_SIMILARITY]] + """The kind of threshold used to filter vector queries. Required. 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.""" + + +class SearchPostRequest(TypedDict, total=False): + """SearchPostRequest. + + :ivar include_total_count: A value that specifies whether to fetch the total count of results. + Default is false. Setting this value to true may have a performance impact. Note that the count + returned is an approximation. + :vartype include_total_count: bool + :ivar facets: The list of facet expressions to apply to the search query. Each facet expression + contains a field name, optionally followed by a comma-separated list of name:value pairs. + :vartype facets: list[str] + :ivar filter: The OData $filter expression to apply to the search query. + :vartype filter: str + :ivar highlight_fields: The comma-separated list of field names to use for hit highlights. Only + searchable fields can be used for hit highlighting. + :vartype highlight_fields: list[str] + :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + highlightPreTag. Default is </em>. + :vartype highlight_post_tag: str + :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + highlightPostTag. Default is <em>. + :vartype highlight_pre_tag: str + :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + must be covered by a search query in order for the query to be reported as a success. This + parameter can be useful for ensuring search availability even for services with only one + replica. The default is 100. + :vartype minimum_coverage: float + :ivar order_by: The comma-separated list of OData $orderby expressions by which to sort the + results. Each expression can be either a field name or a call to either the geo.distance() or + the search.score() functions. Each expression can be followed by asc to indicate ascending, or + desc to indicate descending. The default is ascending order. Ties will be broken by the match + scores of documents. If no $orderby is specified, the default sort order is descending by + document match score. There can be at most 32 $orderby clauses. + :vartype order_by: list[str] + :ivar query_type: A value that specifies the syntax of the search query. The default is + 'simple'. Use 'full' if your query uses the Lucene query syntax. Known values are: "simple", + "full", and "semantic". + :vartype query_type: Union[str, "QueryType"] + :ivar scoring_statistics: A value that specifies whether we want to calculate scoring + statistics (such as document frequency) globally for more consistent scoring, or locally, for + lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally + before scoring. Using global scoring statistics can increase latency of search queries. Known + values are: "local" and "global". + :vartype scoring_statistics: Union[str, "ScoringStatistics"] + :ivar session_id: A value to be used to create a sticky session, which can help getting more + consistent results. As long as the same sessionId is used, a best-effort attempt will be made + to target the same replica set. Be wary that reusing the same sessionID values repeatedly can + interfere with the load balancing of the requests across replicas and adversely affect the + performance of the search service. The value used as sessionId cannot start with a '_' + character. + :vartype session_id: str + :ivar scoring_parameters: The 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 + "mylocation--122.2,44.8" (without the quotes). + :vartype scoring_parameters: list[str] + :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching + documents in order to sort the results. + :vartype scoring_profile: str + :ivar debug: Enables a debugging tool that can be used to further explore your reranked + results. Known values are: "disabled", "semantic", "vector", "queryRewrites", "innerHits", and + "all". + :vartype debug: Union[str, "QueryDebugMode"] + :ivar search_text: A full-text search query expression; Use "*" or omit this parameter to match + all documents. + :vartype search_text: str + :ivar search_fields: The comma-separated list of field names to which to scope the full-text + search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the + field names of each fielded search expression take precedence over any field names listed in + this parameter. + :vartype search_fields: list[str] + :ivar search_mode: A value that specifies whether any or all of the search terms must be + matched in order to count the document as a match. Known values are: "any" and "all". + :vartype search_mode: Union[str, "SearchMode"] + :ivar query_language: A value that specifies the language of the search query. Known values + are: "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", and "ur-pk". + :vartype query_language: Union[str, "QueryLanguage"] + :ivar query_speller: A value that specifies the type of the speller to use to spell-correct + individual search query terms. Known values are: "none" and "lexicon". + :vartype query_speller: Union[str, "QuerySpellerType"] + :ivar select: The comma-separated list of fields to retrieve. If unspecified, all fields marked + as retrievable in the schema are included. + :vartype select: list[str] + :ivar skip: The number of search results to skip. This value cannot be greater than 100,000. If + you need to scan documents in sequence, but cannot use skip due to this limitation, consider + using orderby on a totally-ordered key and filter with a range query instead. + :vartype skip: int + :ivar top: The number of search results to retrieve. This can be used in conjunction with $skip + to implement client-side paging of search results. If results are truncated due to server-side + paging, the response will include a continuation token that can be used to issue another Search + request for the next page of results. + :vartype top: int + :ivar semantic_configuration_name: The name of a semantic configuration that will be used when + processing documents for queries of type semantic. + :vartype semantic_configuration_name: str + :ivar semantic_error_handling: Allows the user to choose whether a semantic call should fail + completely (default / current behavior), or to return partial results. Known values are: + "partial" and "fail". + :vartype semantic_error_handling: Union[str, "SemanticErrorMode"] + :ivar semantic_max_wait_in_milliseconds: Allows the user to set an upper bound on the amount of + time it takes for semantic enrichment to finish processing before the request fails. + :vartype semantic_max_wait_in_milliseconds: int + :ivar semantic_query: Allows setting a separate search query that will be solely used for + semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there + is a need to use different queries between the base retrieval and ranking phase, and the L2 + semantic phase. + :vartype semantic_query: str + :ivar answers: A value that specifies whether answers should be returned as part of the search + response. Known values are: "none" and "extractive". + :vartype answers: Union[str, "QueryAnswerType"] + :ivar captions: A value that specifies whether captions should be returned as part of the + search response. Known values are: "none" and "extractive". + :vartype captions: Union[str, "QueryCaptionType"] + :ivar query_rewrites: A value that specifies whether query rewrites should be generated to + augment the search query. Known values are: "none" and "generative". + :vartype query_rewrites: Union[str, "QueryRewritesType"] + :ivar semantic_fields: The comma-separated list of field names used for semantic ranking. + :vartype semantic_fields: list[str] + :ivar vector_queries: The query parameters for vector and hybrid search queries. + :vartype vector_queries: list["VectorQuery"] + :ivar vector_filter_mode: Determines whether or not filters are applied before or after the + vector search is performed. Default is 'preFilter' for new indexes. Known values are: + "postFilter", "preFilter", and "strictPostFilter". + :vartype vector_filter_mode: Union[str, "VectorFilterMode"] + :ivar hybrid_search: The query parameters to configure hybrid search behaviors. + :vartype hybrid_search: "HybridSearch" + """ + + count: bool + """A value that specifies whether to fetch the total count of results. Default is false. Setting + this value to true may have a performance impact. Note that the count returned is an + approximation.""" + facets: list[str] + """The list of facet expressions to apply to the search query. Each facet expression contains a + field name, optionally followed by a comma-separated list of name:value pairs.""" + filter: str + """The OData $filter expression to apply to the search query.""" + highlight: list[str] + """The comma-separated list of field names to use for hit highlights. Only searchable fields can + be used for hit highlighting.""" + highlightPostTag: str + """A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is + </em>.""" + highlightPreTag: str + """A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is + <em>.""" + minimumCoverage: float + """A number between 0 and 100 indicating the percentage of the index that must be covered by a + search query in order for the query to be reported as a success. This parameter can be useful + for ensuring search availability even for services with only one replica. The default is 100.""" + orderby: list[str] + """The comma-separated list of OData $orderby expressions by which to sort the results. Each + expression can be either a field name or a call to either the geo.distance() or the + search.score() functions. Each expression can be followed by asc to indicate ascending, or desc + to indicate descending. The default is ascending order. Ties will be broken by the match scores + of documents. If no $orderby is specified, the default sort order is descending by document + match score. There can be at most 32 $orderby clauses.""" + queryType: Union[str, "QueryType"] + """A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if + your query uses the Lucene query syntax. Known values are: \"simple\", \"full\", and + \"semantic\".""" + scoringStatistics: Union[str, "ScoringStatistics"] + """A value that specifies whether we want to calculate scoring statistics (such as document + frequency) globally for more consistent scoring, or locally, for lower latency. The default is + 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global + scoring statistics can increase latency of search queries. Known values are: \"local\" and + \"global\".""" + sessionId: str + """A value to be used to create a sticky session, which can help getting more consistent results. + As long as the same sessionId is used, a best-effort attempt will be made to target the same + replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the + load balancing of the requests across replicas and adversely affect the performance of the + search service. The value used as sessionId cannot start with a '_' character.""" + scoringParameters: list[str] + """The 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 + \"mylocation--122.2,44.8\" (without the quotes).""" + scoringProfile: str + """The name of a scoring profile to evaluate match scores for matching documents in order to sort + the results.""" + debug: Union[str, "QueryDebugMode"] + """Enables a debugging tool that can be used to further explore your reranked results. Known + values are: \"disabled\", \"semantic\", \"vector\", \"queryRewrites\", \"innerHits\", and + \"all\".""" + search: str + """A full-text search query expression; Use \"*\" or omit this parameter to match all documents.""" + searchFields: list[str] + """The comma-separated list of field names to which to scope the full-text search. When using + fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each + fielded search expression take precedence over any field names listed in this parameter.""" + searchMode: Union[str, "SearchMode"] + """A value that specifies whether any or all of the search terms must be matched in order to count + the document as a match. Known values are: \"any\" and \"all\".""" + queryLanguage: Union[str, "QueryLanguage"] + """A value that specifies the language of the search query. Known values are: \"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\", and \"ur-pk\".""" + speller: Union[str, "QuerySpellerType"] + """A value that specifies the type of the speller to use to spell-correct individual search query + terms. Known values are: \"none\" and \"lexicon\".""" + select: list[str] + """The comma-separated list of fields to retrieve. If unspecified, all fields marked as + retrievable in the schema are included.""" + skip: int + """The number of search results to skip. This value cannot be greater than 100,000. If you need to + scan documents in sequence, but cannot use skip due to this limitation, consider using orderby + on a totally-ordered key and filter with a range query instead.""" + top: int + """The number of search results to retrieve. This can be used in conjunction with $skip to + implement client-side paging of search results. If results are truncated due to server-side + paging, the response will include a continuation token that can be used to issue another Search + request for the next page of results.""" + semanticConfiguration: str + """The name of a semantic configuration that will be used when processing documents for queries of + type semantic.""" + semanticErrorHandling: Union[str, "SemanticErrorMode"] + """Allows the user to choose whether a semantic call should fail completely (default / current + behavior), or to return partial results. Known values are: \"partial\" and \"fail\".""" + semanticMaxWaitInMilliseconds: int + """Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to + finish processing before the request fails.""" + semanticQuery: str + """Allows setting a separate search query that will be solely used for semantic reranking, + semantic captions and semantic answers. Is useful for scenarios where there is a need to use + different queries between the base retrieval and ranking phase, and the L2 semantic phase.""" + answers: Union[str, "QueryAnswerType"] + """A value that specifies whether answers should be returned as part of the search response. Known + values are: \"none\" and \"extractive\".""" + captions: Union[str, "QueryCaptionType"] + """A value that specifies whether captions should be returned as part of the search response. + Known values are: \"none\" and \"extractive\".""" + queryRewrites: Union[str, "QueryRewritesType"] + """A value that specifies whether query rewrites should be generated to augment the search query. + Known values are: \"none\" and \"generative\".""" + semanticFields: list[str] + """The comma-separated list of field names used for semantic ranking.""" + vectorQueries: list["VectorQuery"] + """The query parameters for vector and hybrid search queries.""" + vectorFilterMode: Union[str, "VectorFilterMode"] + """Determines whether or not filters are applied before or after the vector search is performed. + Default is 'preFilter' for new indexes. Known values are: \"postFilter\", \"preFilter\", and + \"strictPostFilter\".""" + hybridSearch: "HybridSearch" + """The query parameters to configure hybrid search behaviors.""" + + +class SuggestPostRequest(TypedDict, total=False): + """SuggestPostRequest. + + :ivar filter: An OData expression that filters the documents considered for suggestions. + :vartype filter: str + :ivar use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestion + query. Default is false. When set to true, the query will find suggestions even if there's a + substituted or missing character in the search text. While this provides a better experience in + some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and + consume more resources. + :vartype use_fuzzy_matching: bool + :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + highlightPreTag. If omitted, hit highlighting of suggestions is disabled. + :vartype highlight_post_tag: str + :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + highlightPostTag. If omitted, hit highlighting of suggestions is disabled. + :vartype highlight_pre_tag: str + :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + must be covered by a suggestion query in order for the query to be reported as a success. This + parameter can be useful for ensuring search availability even for services with only one + replica. The default is 80. + :vartype minimum_coverage: float + :ivar order_by: The comma-separated list of OData $orderby expressions by which to sort the + results. Each expression can be either a field name or a call to either the geo.distance() or + the search.score() functions. Each expression can be followed by asc to indicate ascending, or + desc to indicate descending. The default is ascending order. Ties will be broken by the match + scores of documents. If no $orderby is specified, the default sort order is descending by + document match score. There can be at most 32 $orderby clauses. + :vartype order_by: list[str] + :ivar search_text: The search text to use to suggest documents. Must be at least 1 character, + and no more than 100 characters. Required. + :vartype search_text: str + :ivar search_fields: The comma-separated list of field names to search for the specified search + text. Target fields must be included in the specified suggester. + :vartype search_fields: list[str] + :ivar select: The comma-separated list of fields to retrieve. If unspecified, only the key + field will be included in the results. + :vartype select: list[str] + :ivar suggester_name: The name of the suggester as specified in the suggesters collection + that's part of the index definition. Required. + :vartype suggester_name: str + :ivar top: The number of suggestions to retrieve. This must be a value between 1 and 100. The + default is 5. + :vartype top: int + """ + + filter: str + """An OData expression that filters the documents considered for suggestions.""" + fuzzy: bool + """A value indicating whether to use fuzzy matching for the suggestion query. Default is false. + When set to true, the query will find suggestions even if there's a substituted or missing + character in the search text. While this provides a better experience in some scenarios, it + comes at a performance cost as fuzzy suggestion searches are slower and consume more resources.""" + highlightPostTag: str + """A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, + hit highlighting of suggestions is disabled.""" + highlightPreTag: str + """A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If + omitted, hit highlighting of suggestions is disabled.""" + minimumCoverage: float + """A number between 0 and 100 indicating the percentage of the index that must be covered by a + suggestion query in order for the query to be reported as a success. This parameter can be + useful for ensuring search availability even for services with only one replica. The default is + 80.""" + orderby: list[str] + """The comma-separated list of OData $orderby expressions by which to sort the results. Each + expression can be either a field name or a call to either the geo.distance() or the + search.score() functions. Each expression can be followed by asc to indicate ascending, or desc + to indicate descending. The default is ascending order. Ties will be broken by the match scores + of documents. If no $orderby is specified, the default sort order is descending by document + match score. There can be at most 32 $orderby clauses.""" + search: Required[str] + """The search text to use to suggest documents. Must be at least 1 character, and no more than 100 + characters. Required.""" + searchFields: list[str] + """The comma-separated list of field names to search for the specified search text. Target fields + must be included in the specified suggester.""" + select: list[str] + """The comma-separated list of fields to retrieve. If unspecified, only the key field will be + included in the results.""" + suggesterName: Required[str] + """The name of the suggester as specified in the suggesters collection that's part of the index + definition. Required.""" + top: int + """The number of suggestions to retrieve. This must be a value between 1 and 100. The default is + 5.""" + + +class AutocompletePostRequest(TypedDict, total=False): + """AutocompletePostRequest. + + :ivar search_text: The search text on which to base autocomplete results. Required. + :vartype search_text: str + :ivar autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing + auto-completed terms. Known values are: "oneTerm", "twoTerms", and "oneTermWithContext". + :vartype autocomplete_mode: Union[str, "AutocompleteMode"] + :ivar filter: An OData expression that filters the documents used to produce completed terms + for the Autocomplete result. + :vartype filter: str + :ivar use_fuzzy_matching: A value indicating whether to use fuzzy matching for the autocomplete + query. Default is false. When set to true, the query will autocomplete terms even if there's a + substituted or missing character in the search text. While this provides a better experience in + some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and + consume more resources. + :vartype use_fuzzy_matching: bool + :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + highlightPreTag. If omitted, hit highlighting is disabled. + :vartype highlight_post_tag: str + :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + highlightPostTag. If omitted, hit highlighting is disabled. + :vartype highlight_pre_tag: str + :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + must be covered by an autocomplete query in order for the query to be reported as a success. + This parameter can be useful for ensuring search availability even for services with only one + replica. The default is 80. + :vartype minimum_coverage: float + :ivar search_fields: The comma-separated list of field names to consider when querying for + auto-completed terms. Target fields must be included in the specified suggester. + :vartype search_fields: list[str] + :ivar suggester_name: The name of the suggester as specified in the suggesters collection + that's part of the index definition. Required. + :vartype suggester_name: str + :ivar top: The number of auto-completed terms to retrieve. This must be a value between 1 and + 100. The default is 5. + :vartype top: int + """ + + search: Required[str] + """The search text on which to base autocomplete results. Required.""" + autocompleteMode: Union[str, "AutocompleteMode"] + """Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles + and 'oneTermWithContext' to use the current context while producing auto-completed terms. Known + values are: \"oneTerm\", \"twoTerms\", and \"oneTermWithContext\".""" + filter: str + """An OData expression that filters the documents used to produce completed terms for the + Autocomplete result.""" + fuzzy: bool + """A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. + When set to true, the query will autocomplete terms even if there's a substituted or missing + character in the search text. While this provides a better experience in some scenarios, it + comes at a performance cost as fuzzy autocomplete queries are slower and consume more + resources.""" + highlightPostTag: str + """A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, + hit highlighting is disabled.""" + highlightPreTag: str + """A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If + omitted, hit highlighting is disabled.""" + minimumCoverage: float + """A number between 0 and 100 indicating the percentage of the index that must be covered by an + autocomplete query in order for the query to be reported as a success. This parameter can be + useful for ensuring search availability even for services with only one replica. The default is + 80.""" + searchFields: list[str] + """The comma-separated list of field names to consider when querying for auto-completed terms. + Target fields must be included in the specified suggester.""" + suggesterName: Required[str] + """The name of the suggester as specified in the suggesters collection that's part of the index + definition. Required.""" + top: int + """The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The + default is 5.""" + + +VectorThreshold = Union[SearchScoreThreshold, VectorSimilarityThreshold] +VectorQuery = Union[VectorizableImageBinaryQuery, VectorizableImageUrlQuery, VectorizableTextQuery, VectorizedQuery] diff --git a/sdk/search/azure-search-documents/pyproject.toml b/sdk/search/azure-search-documents/pyproject.toml index 3bf87af09a10..17c12b7e0389 100644 --- a/sdk/search/azure-search-documents/pyproject.toml +++ b/sdk/search/azure-search-documents/pyproject.toml @@ -21,13 +21,13 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = ["azure", "azure sdk"] dependencies = [ diff --git a/sdk/search/azure-search-documents/tsp-location.yaml b/sdk/search/azure-search-documents/tsp-location.yaml index a8e0ccbf25df..aabc59c494f9 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: f05186bb638cd3e72b8b63a51b04c909ad26ae54 +commit: 84400eeb46c48ffe88d81e126449725508c17547 repo: Azure/azure-rest-api-specs From 59ef7ac7534c6c83bdf5da6be9985ce6f017e3a5 Mon Sep 17 00:00:00 2001 From: Efrain Retana Date: Mon, 10 Aug 2026 18:34:26 -0500 Subject: [PATCH 06/17] Update tests and changelog --- .../azure-search-documents/CHANGELOG.md | 63 +++- sdk/search/azure-search-documents/README.md | 9 +- .../azure-search-documents/TROUBLESHOOTING.md | 23 +- sdk/search/azure-search-documents/assets.json | 2 +- .../documents/indexes/_operations/_patch.py | 61 ++-- .../indexes/aio/_operations/_patch.py | 61 ++-- .../search/documents/knowledgebases/_patch.py | 56 +++- .../documents/knowledgebases/_stream.py | 314 ++++++++++++++++++ .../documents/knowledgebases/aio/_patch.py | 56 +++- .../azure-search-documents/samples/README.md | 12 +- .../samples/sample_index_crud.py | 9 +- .../samples/sample_index_crud_async.py | 19 ++ ...le_knowledge_base_configuration_preview.py | 32 +- ...wledge_base_configuration_preview_async.py | 32 +- ...le_knowledge_retrieval_response_preview.py | 12 + ...wledge_retrieval_response_preview_async.py | 13 + .../sample_knowledge_source_file_preview.py | 56 +++- ...ple_knowledge_source_file_preview_async.py | 57 +++- .../sample_knowledge_source_workiq_preview.py | 24 +- ...e_knowledge_source_workiq_preview_async.py | 24 +- .../tests/_capabilities.py | 38 ++- .../test_knowledge_base_retrieval_client.py | 203 +++++++++++ ...t_knowledge_base_retrieval_client_async.py | 162 +++++++++ ...dge_base_retrieval_client_retrieve_live.py | 52 +++ ...se_retrieval_client_retrieve_live_async.py | 53 +++ .../tests/test_search_index_client.py | 46 +-- .../tests/test_search_index_client_async.py | 46 +-- 27 files changed, 1373 insertions(+), 162 deletions(-) create mode 100644 sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 84251fff4589..d6ed43c73cb0 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -6,15 +6,76 @@ - Added `ApiVersion.V2026_08_01_PREVIEW` so the `2026-08-01-preview` Search API version can be selected via the `api_version` keyword on the clients. +- Added filtered and paged resource listing with `search`, `page_size`, and `search_type` parameters. + File listings also support `prefix`. +- Added multipart File knowledge source operations and models: + - `azure.search.documents.indexes.SearchIndexClient.update_knowledge_source_file` + - `azure.search.documents.indexes.SearchIndexClient.upload_knowledge_source_file_multipart` + - `azure.search.documents.indexes.models.FileUploadMetadata` + - `azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest` + - `azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest` +- Added knowledge source query-hint and result-processing models: + - `azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing` + - `azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoost` + - `azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoostKind` + - `azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFieldValueBoost` + - `azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint` + - `azure.search.documents.indexes.models.SearchIndexKnowledgeSourceMultiWordExpressionBoost` + - `azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints` + - `azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing` +- Added knowledge base retrieval streaming through + `azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieve_stream` and its + asynchronous equivalent. The methods return closeable streams of typed + `KnowledgeBaseRetrievalEvent` instances. New stream payload models include: + - `azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedEvent` + - `azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedEvent` + - `azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent` + - `azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent` + - `azure.search.documents.knowledgebases.models.KnowledgeBaseStreamErrorEvent` +- Added knowledge base configuration and retrieval features: + - Knowledge base `tags` and persisted `retrieve_defaults`. + - Per-source `never_query_source`, `results_processing`, and `query_hint_overrides`. + - `KnowledgeRetrievalAutoReasoningEffort` for automatic reasoning-effort selection. + - Activity start/completion timestamps, model metadata, logical reasoning effort, query-hint + processing details, and served-image metadata. + - Citation URLs on index-backed knowledge base references. + - Private ingestion networking through `KnowledgeSourceNetworkAccessMode`. +- Added Work IQ configuration through `EntraAppAuthentication` and + `WorkIQKnowledgeSourceParameters`, plus the `query_work_iq_source_authorization` retrieval + parameter. +- Added File knowledge source CORS, metadata, prefix, parsing-mode, and extraction-mode support. +- Added GPT-5.5, GPT-5.6 Luna, GPT-5.6 Sol, and GPT-5.6 Terra model names. +- Added `SearchServiceLimits.max_vector_index_size_per_index_in_bytes`. ### Breaking Changes +> These changes do not impact the API of stable versions such as 11.6.0. +> Only code written against a beta version such as 12.1.0b1 may be affected. + +- Replaced `ApiVersion.V2026_05_01_PREVIEW` with `ApiVersion.V2026_08_01_PREVIEW` and made the new + version the default. +- Replaced `top`, `skip`, and `count` with `search`, `page_size`, and `search_type` on + `SearchIndexClient.list_indexes`, `SearchIndexClient.list_index_names`, and their asynchronous + equivalents. `list_index_stats_summary` uses the same new parameters. +- Replaced `McpServerTool.inclusion_mode` and `McpServerToolInclusionMode` with + `McpServerTool.results_processing` and `KnowledgeSourceResultsProcessing`. +- Replaced `model_name` with `model` on model query-planning, answer-synthesis, and web-summarization + activity records. The new value is a `KnowledgeBaseActivityRecordModel`. +- Replaced `KnowledgeBaseWorkIQReference.attributions` and `WorkIQAttribution` with + `search_sensitivity_label_info`. +- Renamed the Python enum members `GPT_5_MINI`, `GPT_5_NANO`, `GPT_5_4_MINI`, and `GPT_5_4_NANO` + to `GPT5_MINI`, `GPT5_NANO`, `GPT5_4_MINI`, and `GPT5_4_NANO`, respectively. Wire values are + unchanged. +- Dropped Python 3.9 support. Python 3.10 or later is now required. + ### Bugs Fixed ### Other Changes - Updated `tsp-location.yaml` to target spec commit - `33f88d027ee9721b5ca912c59d531884309f15d3` (`2026-08-01-preview`). + `84400eeb46c48ffe88d81e126449725508c17547` (`2026-08-01-preview`). +- Added Python 3.14 support. + ## 12.1.0b1 (2026-05-28) ### Features Added diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index b8419b4b4546..4d9b49bd461f 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -48,7 +48,7 @@ pip install azure-search-documents ### Prerequisites -* Python 3.8 or later is required to use this package. +* Python 3.10 or later is required to use this package. * You need an [Azure subscription][azure_sub] and an [Azure AI Search service][search_resource] to use this package. @@ -63,7 +63,7 @@ See [choosing a pricing tier](https://learn.microsoft.com/azure/search/search-sk ### Authenticate the client -To interact with the search service, you'll need to create an instance of the appropriate client class: `SearchClient` for searching indexed documents, `SearchIndexClient` for managing indexes, or `SearchIndexerClient` for crawling data sources and loading search documents into an index. To instantiate a client object, you'll need an **endpoint** and **Azure roles** or an **API key**. You can refer to the documentation for more information on [supported authenticating approaches](https://learn.microsoft.com/azure/search/search-security-overview#authentication) with the search service. +To interact with the search service, create an instance of the appropriate client class: `SearchClient` for searching indexed documents, `SearchIndexClient` for managing indexes and knowledge resources, `SearchIndexerClient` for crawling data sources and loading search documents into an index, or `KnowledgeBaseRetrievalClient` for retrieving from a knowledge base. To instantiate a client object, you'll need an **endpoint** and **Azure roles** or an **API key**. You can refer to the documentation for more information on [supported authenticating approaches](https://learn.microsoft.com/azure/search/search-security-overview#authentication) with the search service. #### Get an API Key @@ -153,12 +153,17 @@ exposes operations on these resources through three main client types. * `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) + * Create and manage knowledge bases and knowledge sources * `SearchIndexerClient` allows you to: * [Start indexers to automatically crawl data sources](https://learn.microsoft.com/rest/api/searchservice/indexer-operations) * [Define AI powered Skillsets to transform and enrich your data](https://learn.microsoft.com/rest/api/searchservice/skillset-operations) +* `KnowledgeBaseRetrievalClient` allows you to: + * Retrieve relevant content and synthesized answers from a knowledge base + * Stream typed retrieval progress and results as server-sent events + Azure AI Search provides two powerful features: **semantic ranking** and **vector search**. **Semantic ranking** enhances the quality of search results for text-based queries. By enabling semantic ranking on your search service, you can improve the relevance of search results in two ways: diff --git a/sdk/search/azure-search-documents/TROUBLESHOOTING.md b/sdk/search/azure-search-documents/TROUBLESHOOTING.md index 16a20314f535..d4c6f7670874 100644 --- a/sdk/search/azure-search-documents/TROUBLESHOOTING.md +++ b/sdk/search/azure-search-documents/TROUBLESHOOTING.md @@ -1,18 +1,21 @@ -# Troubleshooting Azure Cognitive Search SDK Issues +# Troubleshooting Azure AI Search SDK Issues -The `azure-search-documents` package provides APIs for operations on the [Azure Cognitive Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search) cloud service. +The `azure-search-documents` package provides APIs for operations on the [Azure AI Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search) cloud service. ## Table of Contents -* [Identifying and Troubleshooting Issues by Response Code](#troubleshooting-issues-by-response-code) - * [HTTP 207 Errors](#207-multi-status) - * [HTTP 404 Errors](#404-not-found) - * [HTTP 429 Errors](#429-too-many-requests) -* [Unexpected search query results](#unexpected-search-query-results) +- [Troubleshooting Azure AI Search SDK Issues](#troubleshooting-azure-ai-search-sdk-issues) + - [Table of Contents](#table-of-contents) + - [Troubleshooting Issues By Response Code](#troubleshooting-issues-by-response-code) + - [207 Multi-Status](#207-multi-status) + - [403 Forbidden](#403-forbidden) + - [404 Not Found](#404-not-found) + - [429 too many requests](#429-too-many-requests) + - [Unexpected Search Query Results](#unexpected-search-query-results) ## Troubleshooting Issues By Response Code -See [this page](https://learn.microsoft.com/rest/api/searchservice/http-status-codes) for the common response status codes sent by the Azure Cognitive Search service. +See [this page](https://learn.microsoft.com/rest/api/searchservice/http-status-codes) for the common response status codes sent by the Azure AI Search service. ### 207 Multi-Status @@ -22,7 +25,7 @@ This response status indicates a partial success for an indexing operation. Some Returned when you pass an invalid api-key. Search service uses two types of keys to control access: admin (read-write) and query (read-only). The **admin key** grants full rights to all operations, including the ability to manage the service, create and delete indexes, indexers, and data sources. The **query key** grants read-only access to indexes and documents. Ensure that the key used for an API call provides sufficient privileges for the operation. See [here](https://learn.microsoft.com/azure/search/search-security-api-keys) for details about managing API keys. -If you are using the `azure-identity` package to authenticate requests to Azure Cognitive Search, please see our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/TROUBLESHOOTING.md). +If you are using the `azure-identity` package to authenticate requests to Azure AI Search, please see our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/TROUBLESHOOTING.md). ### 404 Not Found @@ -30,7 +33,7 @@ Returned when a resource does not exist on the server. If you are managing or qu ### 429 too many requests -If this error occurs while you are trying to create an index, it means you already have the maximum number of indexes allowed for your pricing tier. A count of the indexes stored in Azure Cognitive Search is visible in the search service dashboard on the [Azure portal](https://portal.azure.com/). To view the indexes by name, click the Index tile. +If this error occurs while you are trying to create an index, it means you already have the maximum number of indexes allowed for your pricing tier. A count of the indexes stored in Azure AI Search is visible in the search service dashboard on the [Azure portal](https://portal.azure.com/). To view the indexes by name, click the Index tile. Alternatively, you can also get a list of the indexes by name using the [list_index_names() method](https://learn.microsoft.com/python/api/azure-search-documents/azure.search.documents.indexes.searchindexclient?view=azure-python#azure-search-documents-indexes-searchindexclient-list-index-names). If this error occurs during document upload, it indicates that you've exceeded your [quota](https://learn.microsoft.com/azure/search/search-limits-quotas-capacity) on the number of documents per index. You must either create a new index or upgrade for higher capacity limits. diff --git a/sdk/search/azure-search-documents/assets.json b/sdk/search/azure-search-documents/assets.json index 7cda7e51d5b0..fcbf45b2376c 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": "python", "TagPrefix": "python/search/azure-search-documents", - "Tag": "python/search/azure-search-documents_199a6c97e6" + "Tag": "python/search/azure-search-documents_766e6de99d" } diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py index 4ca6b5addaba..6f83c1652f13 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py @@ -437,9 +437,9 @@ def list_indexes( self, *, select: Optional[List[str]] = None, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, **kwargs: Any, ) -> ItemPaged[_models.SearchIndex]: """Lists all indexes available for a search service. @@ -448,14 +448,13 @@ def list_indexes( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of SearchIndex :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchIndex] :raises ~azure.core.exceptions.HttpResponseError: @@ -465,39 +464,47 @@ def list_indexes( ItemPaged[_models.SearchIndex], self._list_indexes_with_selected_properties( select=select, - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, cls=lambda objs: [_convert_index_response(x) for x in objs], **kwargs, ), ) - return cast(ItemPaged[_models.SearchIndex], self._list_indexes(top=top, skip=skip, count=count, **kwargs)) + return cast( + ItemPaged[_models.SearchIndex], + self._list_indexes(search=search, page_size=page_size, search_type=search_type, **kwargs), + ) @distributed_trace def list_index_names( self, *, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, **kwargs: Any, ) -> ItemPaged[str]: """Lists the names of all indexes available for a search service. - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An iterator like instance of index names :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: """ - names = self._list_indexes(top=top, skip=skip, count=count, cls=lambda objs: [x.name for x in objs], **kwargs) + names = self._list_indexes( + search=search, + page_size=page_size, + search_type=search_type, + cls=lambda objs: [x.name for x in objs], + **kwargs, + ) return cast(ItemPaged[str], names) @distributed_trace diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py index 7c884fe76970..4aa74a8b0881 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py @@ -417,9 +417,9 @@ def list_indexes( self, *, select: Optional[List[str]] = None, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, **kwargs: Any, ) -> AsyncItemPaged[_models.SearchIndex]: """Lists all indexes available for a search service. @@ -428,14 +428,13 @@ def list_indexes( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An async iterator like instance of SearchIndex :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SearchIndex] :raises ~azure.core.exceptions.HttpResponseError: @@ -445,39 +444,47 @@ def list_indexes( AsyncItemPaged[_models.SearchIndex], self._list_indexes_with_selected_properties( select=select, - top=top, - skip=skip, - count=count, + search=search, + page_size=page_size, + search_type=search_type, cls=lambda objs: [_convert_index_response(x) for x in objs], **kwargs, ), ) - return cast(AsyncItemPaged[_models.SearchIndex], self._list_indexes(top=top, skip=skip, count=count, **kwargs)) + return cast( + AsyncItemPaged[_models.SearchIndex], + self._list_indexes(search=search, page_size=page_size, search_type=search_type, **kwargs), + ) @distributed_trace def list_index_names( self, *, - top: Optional[int] = None, - skip: Optional[int] = None, - count: Optional[bool] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, **kwargs: Any, ) -> AsyncItemPaged[str]: """Lists the names of all indexes available for a search service. - :keyword top: The number of items to retrieve. Default is 50, maximum is 1000. Default value is - None. - :paramtype top: int - :keyword skip: The number of items to skip. Default value is None. - :paramtype skip: int - :keyword count: A value that specifies whether to fetch the total count of items. Default is - false. Default value is None. - :paramtype count: bool + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: An async iterator like instance of index names :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: """ - names = self._list_indexes(top=top, skip=skip, count=count, cls=lambda objs: [x.name for x in objs], **kwargs) + names = self._list_indexes( + search=search, + page_size=page_size, + search_type=search_type, + cls=lambda objs: [x.name for x in objs], + **kwargs, + ) return cast(AsyncItemPaged[str], names) @distributed_trace_async diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py index ef0d4dfa8b0b..4c2004352cee 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py @@ -7,11 +7,13 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Union +from typing import Any, IO, Optional, Union from azure.core.credentials import AzureKeyCredential, TokenCredential from ._client import KnowledgeBaseRetrievalClient as _KnowledgeBaseRetrievalClient +from . import models +from ._stream import KnowledgeBaseRetrievalEvent, KnowledgeBaseRetrievalEventData, KnowledgeBaseRetrievalStream class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): @@ -41,9 +43,61 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre kwargs.setdefault("credential_scopes", [audience.rstrip("/") + "/.default"]) super().__init__(endpoint=endpoint, credential=credential, **kwargs) + def retrieve_stream( + self, + retrieval_request: Union[models.KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + **kwargs: Any, + ) -> KnowledgeBaseRetrievalStream: + """Retrieve relevant data and stream typed server-sent events. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest + or dict or IO[bytes] + :keyword query_source_authorization: Token identifying the user for which the query is + executed. Default value is None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: User assertion token for a customer-owned Entra + app registration configured on a Work IQ knowledge source. Default value is None. + :paramtype query_work_iq_source_authorization: str + :return: A stream of typed knowledge base retrieval events. + :rtype: ~azure.search.documents.knowledgebases.KnowledgeBaseRetrievalStream + :raises ~azure.core.exceptions.HttpResponseError: + """ + custom_cls = kwargs.pop("cls", None) + callback_context: dict[str, Any] = {} + + def _wrap_stream(pipeline_response, raw_stream, response_headers): + stream = KnowledgeBaseRetrievalStream( + response=pipeline_response.http_response, + raw_stream=raw_stream, + ) + callback_context.update(pipeline_response=pipeline_response, response_headers=response_headers) + return stream + + stream = super().retrieve_stream( + retrieval_request, + query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, + cls=_wrap_stream, + **kwargs, + ) # type: ignore[return-value] + if not custom_cls: + return stream + try: + return custom_cls(callback_context["pipeline_response"], stream, callback_context["response_headers"]) + except Exception: + stream.close() + raise + __all__: list[str] = [ "KnowledgeBaseRetrievalClient", + "KnowledgeBaseRetrievalEvent", + "KnowledgeBaseRetrievalEventData", + "KnowledgeBaseRetrievalStream", ] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py new file mode 100644 index 000000000000..d023fe60c818 --- /dev/null +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py @@ -0,0 +1,314 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- + +from __future__ import annotations + +import codecs +import json +import sys +from types import TracebackType +from typing import Any, AsyncGenerator, AsyncIterator, Generator, Iterator, Optional, Tuple, Type, Union + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +from . import models +from ._utils.model_base import _deserialize + + +_TERMINAL_EVENTS = {"error", "response.completed"} + +KnowledgeBaseRetrievalEventData = Union[ + models.KnowledgeBaseRetrievalStartedEvent, + models.KnowledgeBaseActivityStartedEvent, + models.KnowledgeBaseActivityRecord, + models.KnowledgeBaseAnswerCompletedEvent, + list[models.KnowledgeBaseReference], + models.KnowledgeBaseStreamErrorEvent, + models.KnowledgeBaseResponseCompletedEvent, + dict[str, Any], + list[Any], + str, + int, + float, + bool, + None, +] + + +class KnowledgeBaseRetrievalEvent: + """A typed event emitted by a knowledge base retrieval stream. + + :ivar event_type: The server-sent event name. + :vartype event_type: str + :ivar data: The deserialized event payload. + :vartype data: object + """ + + event_type: str + data: KnowledgeBaseRetrievalEventData + + def __init__(self, event_type: str, data: KnowledgeBaseRetrievalEventData) -> None: + self.event_type = event_type + self.data = data + + def __repr__(self) -> str: + return f"KnowledgeBaseRetrievalEvent(event_type={self.event_type!r}, data={self.data!r})" + + +def _split_sse_lines(buffer: str) -> Tuple[list[str], str]: + lines: list[str] = [] + start = 0 + index = 0 + while index < len(buffer): + char = buffer[index] + if char == "\n": + lines.append(buffer[start:index]) + index += 1 + start = index + elif char == "\r": + if index + 1 == len(buffer): + break + lines.append(buffer[start:index]) + index += 2 if buffer[index + 1] == "\n" else 1 + start = index + else: + index += 1 + return lines, buffer[start:] + + +def _iter_sse_lines(raw_stream: Iterator[bytes]) -> Iterator[str]: + decoder = codecs.getincrementaldecoder("utf-8-sig")(errors="replace") + buffer = "" + for chunk in raw_stream: + buffer += decoder.decode(chunk) + lines, buffer = _split_sse_lines(buffer) + yield from lines + buffer += decoder.decode(b"", final=True) + lines, remainder = _split_sse_lines(buffer) + yield from lines + if remainder: + yield remainder[:-1] if remainder.endswith("\r") else remainder + + +async def _aiter_sse_lines(raw_stream: AsyncIterator[bytes]) -> AsyncIterator[str]: + decoder = codecs.getincrementaldecoder("utf-8-sig")(errors="replace") + buffer = "" + async for chunk in raw_stream: + buffer += decoder.decode(chunk) + lines, buffer = _split_sse_lines(buffer) + for line in lines: + yield line + buffer += decoder.decode(b"", final=True) + lines, remainder = _split_sse_lines(buffer) + for line in lines: + yield line + if remainder: + yield remainder[:-1] if remainder.endswith("\r") else remainder + + +class _SSEEventBuilder: + def __init__(self) -> None: + self._event_type = "" + self._data: list[str] = [] + + def add_line(self, line: str) -> Optional[Tuple[str, str]]: + if line == "": + return self._dispatch() + if line.startswith(":"): + return None + + field, _, value = line.partition(":") + if value.startswith(" "): + value = value[1:] + if field == "event": + self._event_type = value + elif field == "data": + self._data.append(value) + return None + + def _dispatch(self) -> Optional[Tuple[str, str]]: + if not self._data: + self._event_type = "" + return None + event = (self._event_type or "message", "\n".join(self._data)) + self._event_type = "" + self._data = [] + return event + + +def _iter_sse_events(raw_stream: Iterator[bytes]) -> Iterator[Tuple[str, str]]: + builder = _SSEEventBuilder() + for line in _iter_sse_lines(raw_stream): + event = builder.add_line(line) + if event is not None: + yield event + + +async def _aiter_sse_events(raw_stream: AsyncIterator[bytes]) -> AsyncIterator[Tuple[str, str]]: + builder = _SSEEventBuilder() + async for line in _aiter_sse_lines(raw_stream): + event = builder.add_line(line) + if event is not None: + yield event + + +def _deserialize_event(event_type: str, data: str) -> KnowledgeBaseRetrievalEvent: + payload = json.loads(data) + if event_type == "activity.completed": + event_data = models.KnowledgeBaseActivityRecord._deserialize(payload, []) # pylint: disable=protected-access + return KnowledgeBaseRetrievalEvent(event_type, event_data) + if event_type == "references.completed": + references = [ + models.KnowledgeBaseReference._deserialize(item, []) # pylint: disable=protected-access + for item in payload + ] + return KnowledgeBaseRetrievalEvent(event_type, references) + deserializer = { + "retrieval.started": models.KnowledgeBaseRetrievalStartedEvent, + "activity.started": models.KnowledgeBaseActivityStartedEvent, + "answer.completed": models.KnowledgeBaseAnswerCompletedEvent, + "error": models.KnowledgeBaseStreamErrorEvent, + "response.completed": models.KnowledgeBaseResponseCompletedEvent, + }.get(event_type) + event_data = _deserialize(deserializer, payload) if deserializer is not None else payload + return KnowledgeBaseRetrievalEvent(event_type, event_data) + + +class KnowledgeBaseRetrievalStream(Iterator[KnowledgeBaseRetrievalEvent]): + """A synchronous stream of typed knowledge base retrieval events.""" + + def __init__(self, *, response: Any, raw_stream: Iterator[bytes]) -> None: + self._response = response + self._raw_stream = raw_stream + self._closed = False + self._resources_closed = False + self._iterator = self._iterate() + + def __iter__(self) -> Self: + return self + + def __next__(self) -> KnowledgeBaseRetrievalEvent: + return next(self._iterator) + + def _iterate(self) -> Generator[KnowledgeBaseRetrievalEvent, None, None]: + try: + for event_type, data in _iter_sse_events(self._raw_stream): + event = _deserialize_event(event_type, data) + if event_type in _TERMINAL_EVENTS: + self._close_resources() + yield event + if event_type in _TERMINAL_EVENTS: + return + finally: + self._close_resources() + self._closed = True + + def _close_resources(self) -> None: + if self._resources_closed: + return + self._resources_closed = True + close = getattr(self._raw_stream, "close", None) + try: + if close is not None: + close() + finally: + self._response.close() + + def close(self) -> None: + """Close the stream and its underlying HTTP response.""" + + if self._closed: + return + self._closed = True + try: + self._iterator.close() + finally: + self._close_resources() + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]] = None, + exc_value: Optional[BaseException] = None, + traceback: Optional[TracebackType] = None, + ) -> None: + self.close() + + +class AsyncKnowledgeBaseRetrievalStream(AsyncIterator[KnowledgeBaseRetrievalEvent]): + """An asynchronous stream of typed knowledge base retrieval events.""" + + def __init__(self, *, response: Any, raw_stream: AsyncIterator[bytes]) -> None: + self._response = response + self._raw_stream = raw_stream + self._closed = False + self._resources_closed = False + self._iterator = self._iterate() + + def __aiter__(self) -> Self: + return self + + async def __anext__(self) -> KnowledgeBaseRetrievalEvent: + return await self._iterator.__anext__() + + async def _iterate(self) -> AsyncGenerator[KnowledgeBaseRetrievalEvent, None]: + try: + async for event_type, data in _aiter_sse_events(self._raw_stream): + event = _deserialize_event(event_type, data) + if event_type in _TERMINAL_EVENTS: + await self._close_resources() + yield event + if event_type in _TERMINAL_EVENTS: + return + finally: + await self._close_resources() + self._closed = True + + async def _close_resources(self) -> None: + if self._resources_closed: + return + self._resources_closed = True + aclose = getattr(self._raw_stream, "aclose", None) + try: + if aclose is not None: + await aclose() + finally: + await self._response.close() + + async def close(self) -> None: + """Close the stream and its underlying HTTP response.""" + + if self._closed: + return + self._closed = True + try: + await self._iterator.aclose() + finally: + await self._close_resources() + + async def __aenter__(self) -> Self: + return self + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]] = None, + exc_value: Optional[BaseException] = None, + traceback: Optional[TracebackType] = None, + ) -> None: + await self.close() + + +__all__ = [ + "AsyncKnowledgeBaseRetrievalStream", + "KnowledgeBaseRetrievalEvent", + "KnowledgeBaseRetrievalEventData", + "KnowledgeBaseRetrievalStream", +] \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py index 21ca59a0335c..ba065a5bc517 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py @@ -7,12 +7,14 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Union +from typing import Any, IO, Optional, Union from azure.core.credentials import AzureKeyCredential from azure.core.credentials_async import AsyncTokenCredential from ._client import KnowledgeBaseRetrievalClient as _KnowledgeBaseRetrievalClient +from .. import models +from .._stream import AsyncKnowledgeBaseRetrievalStream, KnowledgeBaseRetrievalEvent, KnowledgeBaseRetrievalEventData class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): @@ -44,9 +46,61 @@ def __init__( kwargs.setdefault("credential_scopes", [audience.rstrip("/") + "/.default"]) super().__init__(endpoint=endpoint, credential=credential, **kwargs) + async def retrieve_stream( + self, + retrieval_request: Union[models.KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], + *, + query_source_authorization: Optional[str] = None, + query_work_iq_source_authorization: Optional[str] = None, + **kwargs: Any, + ) -> AsyncKnowledgeBaseRetrievalStream: + """Retrieve relevant data and asynchronously stream typed server-sent events. + + :param retrieval_request: The retrieval request to process. Required. + :type retrieval_request: ~azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest + or dict or IO[bytes] + :keyword query_source_authorization: Token identifying the user for which the query is + executed. Default value is None. + :paramtype query_source_authorization: str + :keyword query_work_iq_source_authorization: User assertion token for a customer-owned Entra + app registration configured on a Work IQ knowledge source. Default value is None. + :paramtype query_work_iq_source_authorization: str + :return: An asynchronous stream of typed knowledge base retrieval events. + :rtype: ~azure.search.documents.knowledgebases.aio.AsyncKnowledgeBaseRetrievalStream + :raises ~azure.core.exceptions.HttpResponseError: + """ + custom_cls = kwargs.pop("cls", None) + callback_context: dict[str, Any] = {} + + def _wrap_stream(pipeline_response, raw_stream, response_headers): + stream = AsyncKnowledgeBaseRetrievalStream( + response=pipeline_response.http_response, + raw_stream=raw_stream, + ) + callback_context.update(pipeline_response=pipeline_response, response_headers=response_headers) + return stream + + stream = await super().retrieve_stream( + retrieval_request, + query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, + cls=_wrap_stream, + **kwargs, + ) # type: ignore[return-value] + if not custom_cls: + return stream + try: + return custom_cls(callback_context["pipeline_response"], stream, callback_context["response_headers"]) + except Exception: + await stream.close() + raise + __all__: list[str] = [ + "AsyncKnowledgeBaseRetrievalStream", "KnowledgeBaseRetrievalClient", + "KnowledgeBaseRetrievalEvent", + "KnowledgeBaseRetrievalEventData", ] diff --git a/sdk/search/azure-search-documents/samples/README.md b/sdk/search/azure-search-documents/samples/README.md index 1a5880fb4f59..65f1b69a088a 100644 --- a/sdk/search/azure-search-documents/samples/README.md +++ b/sdk/search/azure-search-documents/samples/README.md @@ -65,22 +65,22 @@ pip install azure-search-documents * Custom HTTP requests (SearchIndexClient): [sample_index_client_custom_request.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_index_client_custom_request.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_index_client_custom_request_async.py)) * Knowledge base agentic retrieval: [sample_agentic_retrieval.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_agentic_retrieval.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_agentic_retrieval_async.py)) -### Preview samples (2026-05-01-preview) +### Preview samples (2026-08-01-preview) -The following samples target an `azure-search-documents` build whose default API version is `2026-05-01-preview`. Behavior of preview APIs may change before GA. +The following samples target an `azure-search-documents` build whose default API version is `2026-08-01-preview`. Behavior of preview APIs may change before GA. Knowledge base and retrieval: -* Knowledge base preview configuration (CORS, model, retrieval defaults): [sample_knowledge_base_configuration_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py)) -* Retrieve response (activity model_name, Purview labels, output modes): [sample_knowledge_retrieval_response_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py)) +* Knowledge base preview configuration (CORS, tags, retrieval defaults, and query hints): [sample_knowledge_base_configuration_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py)) +* Retrieve responses and typed server-sent events: [sample_knowledge_retrieval_response_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py)) * Service stats with knowledge base / source counters: [sample_knowledge_service_stats_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py)) * Source attach-time defaults (`enable_freshness`, `enable_image_serving`): [sample_knowledge_source_freshness_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview_async.py)) Knowledge source kinds: -* File knowledge source: [sample_knowledge_source_file_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py)) +* File knowledge source with multipart upload and update: [sample_knowledge_source_file_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py)) * MCP server knowledge source: [sample_knowledge_source_mcp_server_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview_async.py)) -* WorkIQ knowledge source: [sample_knowledge_source_workiq_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py)) +* Work IQ knowledge source with customer-owned Entra app authentication: [sample_knowledge_source_workiq_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py)) * Fabric ontology knowledge source: [sample_knowledge_source_fabric_ontology_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview_async.py)) * Fabric data agent knowledge source: [sample_knowledge_source_fabric_data_agent_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview_async.py)) diff --git a/sdk/search/azure-search-documents/samples/sample_index_crud.py b/sdk/search/azure-search-documents/samples/sample_index_crud.py index f918dd4771bd..185825439f64 100644 --- a/sdk/search/azure-search-documents/samples/sample_index_crud.py +++ b/sdk/search/azure-search-documents/samples/sample_index_crud.py @@ -131,11 +131,16 @@ def list_index_names(): # [START list_index_names] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient + from azure.search.documents.indexes.models import ListingSearchType index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - print("Listing all index names:") - for name in index_client.list_index_names(): + print("Listing matching index names:") + for name in index_client.list_index_names( + search="hotels-sample", + page_size=10, + search_type=ListingSearchType.PREFIX, + ): print(f" - {name}") # [END list_index_names] diff --git a/sdk/search/azure-search-documents/samples/sample_index_crud_async.py b/sdk/search/azure-search-documents/samples/sample_index_crud_async.py index f01c2f21bf02..7680852f2abf 100644 --- a/sdk/search/azure-search-documents/samples/sample_index_crud_async.py +++ b/sdk/search/azure-search-documents/samples/sample_index_crud_async.py @@ -133,6 +133,24 @@ async def update_index_async(): # [END update_index_async] +async def list_index_names_async(): + # [START list_index_names_async] + from azure.core.credentials import AzureKeyCredential + from azure.search.documents.indexes.aio import SearchIndexClient + from azure.search.documents.indexes.models import ListingSearchType + + index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) + print("Listing matching index names:") + async with index_client: + async for name in index_client.list_index_names( + search="hotels-sample", + page_size=10, + search_type=ListingSearchType.PREFIX, + ): + print(f" - {name}") + # [END list_index_names_async] + + async def delete_index_async(): # [START delete_index_async] from azure.core.credentials import AzureKeyCredential @@ -149,4 +167,5 @@ async def delete_index_async(): asyncio.run(create_index_async()) asyncio.run(get_index_async()) asyncio.run(update_index_async()) + asyncio.run(list_index_names_async()) asyncio.run(delete_index_async()) diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py index aea4d8bbf1d3..b120635543c1 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py @@ -51,25 +51,47 @@ def main(): CorsOptions, KnowledgeBase, KnowledgeBaseAzureOpenAIModel, + KnowledgeBaseRetrieveDefaults, KnowledgeSourceReference, SearchIndexKnowledgeSource, + SearchIndexKnowledgeSourceFieldValueBoost, + SearchIndexKnowledgeSourceFilterHint, SearchIndexKnowledgeSourceParameters, + SearchIndexKnowledgeSourceQueryHints, ) from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalClient from azure.search.documents.knowledgebases.models import ( KnowledgeBaseMessage, KnowledgeBaseMessageTextContent, KnowledgeBaseRetrievalRequest, - KnowledgeRetrievalLowReasoningEffort, + KnowledgeRetrievalAutoReasoningEffort, ) index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) knowledge_source = SearchIndexKnowledgeSource( name=knowledge_source_name, description="Hotel knowledge source with default parking filter", + results_processing="rerank", search_index_parameters=SearchIndexKnowledgeSourceParameters( search_index_name=index_name, base_filter="ParkingIncluded eq true and IsDeleted eq false", + query_hints=SearchIndexKnowledgeSourceQueryHints( + filters=[ + SearchIndexKnowledgeSourceFilterHint( + field="Category", + field_values=["Luxury", "Boutique"], + filter_instructions="Use this field when the user asks for a hotel category.", + ) + ], + boosts=[ + SearchIndexKnowledgeSourceFieldValueBoost( + field="Rating", + field_values=["4", "5"], + boost=2.0, + boost_instructions="Prefer highly rated hotels.", + ) + ], + ), ), ) index_client.create_or_update_knowledge_source(knowledge_source) @@ -79,6 +101,7 @@ def main(): knowledge_base = KnowledgeBase( name=knowledge_base_name, description="Hotel knowledge base with preview configuration", + tags={"scenario": "hotel-search", "environment": "sample"}, knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], cors_options=CorsOptions(allowed_origins=["https://app.contoso.com"], max_age_in_seconds=300), models=[ @@ -91,8 +114,13 @@ def main(): ) ) ], - retrieval_reasoning_effort=KnowledgeRetrievalLowReasoningEffort(), + retrieval_reasoning_effort=KnowledgeRetrievalAutoReasoningEffort(), output_mode="answerSynthesis", + retrieve_defaults=KnowledgeBaseRetrieveDefaults( + max_runtime_in_seconds=60, + max_output_documents=20, + max_output_size_in_tokens=4000, + ), ) created_knowledge_base = index_client.create_or_update_knowledge_base(knowledge_base) print(f"Created: knowledge base '{created_knowledge_base.name}'") diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py index 023dde0ffb88..e2f0aa8eef57 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py @@ -50,16 +50,20 @@ async def main(): CorsOptions, KnowledgeBase, KnowledgeBaseAzureOpenAIModel, + KnowledgeBaseRetrieveDefaults, KnowledgeSourceReference, SearchIndexKnowledgeSource, + SearchIndexKnowledgeSourceFieldValueBoost, + SearchIndexKnowledgeSourceFilterHint, SearchIndexKnowledgeSourceParameters, + SearchIndexKnowledgeSourceQueryHints, ) from azure.search.documents.knowledgebases.aio import KnowledgeBaseRetrievalClient from azure.search.documents.knowledgebases.models import ( KnowledgeBaseMessage, KnowledgeBaseMessageTextContent, KnowledgeBaseRetrievalRequest, - KnowledgeRetrievalLowReasoningEffort, + KnowledgeRetrievalAutoReasoningEffort, ) index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) @@ -68,9 +72,27 @@ async def main(): knowledge_source = SearchIndexKnowledgeSource( name=knowledge_source_name, description="Hotel knowledge source with default parking filter", + results_processing="rerank", search_index_parameters=SearchIndexKnowledgeSourceParameters( search_index_name=index_name, base_filter="ParkingIncluded eq true and IsDeleted eq false", + query_hints=SearchIndexKnowledgeSourceQueryHints( + filters=[ + SearchIndexKnowledgeSourceFilterHint( + field="Category", + field_values=["Luxury", "Boutique"], + filter_instructions="Use this field when the user asks for a hotel category.", + ) + ], + boosts=[ + SearchIndexKnowledgeSourceFieldValueBoost( + field="Rating", + field_values=["4", "5"], + boost=2.0, + boost_instructions="Prefer highly rated hotels.", + ) + ], + ), ), ) await index_client.create_or_update_knowledge_source(knowledge_source) @@ -80,6 +102,7 @@ async def main(): knowledge_base = KnowledgeBase( name=knowledge_base_name, description="Hotel knowledge base with preview configuration", + tags={"scenario": "hotel-search", "environment": "sample"}, knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], cors_options=CorsOptions(allowed_origins=["https://app.contoso.com"], max_age_in_seconds=300), models=[ @@ -92,8 +115,13 @@ async def main(): ) ) ], - retrieval_reasoning_effort=KnowledgeRetrievalLowReasoningEffort(), + retrieval_reasoning_effort=KnowledgeRetrievalAutoReasoningEffort(), output_mode="answerSynthesis", + retrieve_defaults=KnowledgeBaseRetrieveDefaults( + max_runtime_in_seconds=60, + max_output_documents=20, + max_output_size_in_tokens=4000, + ), ) created_knowledge_base = await index_client.create_or_update_knowledge_base(knowledge_base) print(f"Created: knowledge base '{created_knowledge_base.name}'") diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py index 39d0a784dbea..293f522754a0 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py @@ -59,7 +59,9 @@ def main(): from azure.search.documents.knowledgebases.models import ( KnowledgeBaseMessage, KnowledgeBaseMessageTextContent, + KnowledgeBaseResponseCompletedEvent, KnowledgeBaseRetrievalRequest, + KnowledgeBaseStreamErrorEvent, KnowledgeRetrievalLowReasoningEffort, KnowledgeRetrievalSemanticIntent, SearchIndexKnowledgeSourceParams, @@ -118,6 +120,16 @@ def main(): semantic_result = retrieval_client.retrieve(semantic_request) print_retrieval_summary(semantic_result) + with retrieval_client.retrieve_stream(semantic_request) as stream: + for event in stream: + if event.event_type == "response.completed" and isinstance( + event.data, KnowledgeBaseResponseCompletedEvent + ): + print_retrieval_summary(event.data.response) + elif event.event_type == "error" and isinstance(event.data, KnowledgeBaseStreamErrorEvent): + error_message = event.data.error.message if event.data.error else "Retrieval failed" + print(f"Streaming retrieval error: {error_message}") + message_request = KnowledgeBaseRetrievalRequest( include_activity=True, messages=[ diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py index d0fd5ef6ae11..57986c3a05eb 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py @@ -58,7 +58,9 @@ async def main(): from azure.search.documents.knowledgebases.models import ( KnowledgeBaseMessage, KnowledgeBaseMessageTextContent, + KnowledgeBaseResponseCompletedEvent, KnowledgeBaseRetrievalRequest, + KnowledgeBaseStreamErrorEvent, KnowledgeRetrievalLowReasoningEffort, KnowledgeRetrievalSemanticIntent, SearchIndexKnowledgeSourceParams, @@ -119,6 +121,17 @@ async def main(): semantic_result = await retrieval_client.retrieve(semantic_request) print_retrieval_summary(semantic_result) + stream = await retrieval_client.retrieve_stream(semantic_request) + async with stream: + async for event in stream: + if event.event_type == "response.completed" and isinstance( + event.data, KnowledgeBaseResponseCompletedEvent + ): + print_retrieval_summary(event.data.response) + elif event.event_type == "error" and isinstance(event.data, KnowledgeBaseStreamErrorEvent): + error_message = event.data.error.message if event.data.error else "Retrieval failed" + print(f"Streaming retrieval error: {error_message}") + message_request = KnowledgeBaseRetrievalRequest( include_activity=True, messages=[ diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py index f624240acb54..7b4fcd1f50fb 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py @@ -43,10 +43,13 @@ def main(): from azure.search.documents.indexes import SearchIndexClient from azure.search.documents.indexes.models import ( AzureOpenAIVectorizerParameters, + FileUploadMetadata, FileKnowledgeSource, FileKnowledgeSourceParameters, KnowledgeBase, KnowledgeSourceReference, + UpdateKnowledgeSourceFileRequest, + UploadKnowledgeSourceFileMultipartRequest, ) from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalClient from azure.search.documents.knowledgebases.models import ( @@ -66,6 +69,7 @@ def main(): file_parameters=FileKnowledgeSourceParameters( ingestion_parameters=KnowledgeSourceIngestionParameters( content_extraction_mode="minimal", + network_access_mode="public", embedding_model=KnowledgeSourceAzureOpenAIVectorizer( azure_open_ai_parameters=AzureOpenAIVectorizerParameters( resource_url=os.environ["AZURE_OPENAI_ENDPOINT"], @@ -91,6 +95,46 @@ def main(): ) index_client.create_or_update_knowledge_base(knowledge_base) + file_content = b"Historic Harbor Hotel has free parking and a rooftop restaurant." + file_metadata = FileUploadMetadata( + file_name=f"hotels/{upload_file_name}", + metadata={"category": "hotel", "city": "Seattle"}, + ) + uploaded_file = index_client.upload_knowledge_source_file_multipart( + name=knowledge_source_name, + body=UploadKnowledgeSourceFileMultipartRequest( + metadata=file_metadata, + content=(upload_file_name, file_content, "text/plain"), + ), + ) + print(f"Uploaded: file '{uploaded_file.file_name}'") + assert uploaded_file.file_id is not None + + updated_file = index_client.update_knowledge_source_file( + file_id=uploaded_file.file_id, + name=knowledge_source_name, + body=UpdateKnowledgeSourceFileRequest( + metadata=file_metadata, + content=( + upload_file_name, + b"Historic Harbor Hotel has free parking, free Wi-Fi, and a rooftop restaurant.", + "text/plain", + ), + ), + ) + print(f"Updated: file '{updated_file.file_name}'") + + files = list( + index_client.list_knowledge_source_files( + knowledge_source_name, + prefix="hotels/", + search="hotels", + page_size=10, + search_type="prefix", + ) + ) + print(f"Files: {len(files)}") + retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name ) @@ -110,18 +154,6 @@ def main(): print_retrieval_summary(retrieval_result) finally: retrieval_client.close() - - file_content = b"Historic Harbor Hotel has free parking and a rooftop restaurant." - uploaded_file = index_client.upload_knowledge_source_file( - knowledge_source_name, - file_content, - filename=upload_file_name, - content_type="application/octet-stream", - ) - print(f"Uploaded: file '{uploaded_file.file_name}'") - - files = list(index_client.list_knowledge_source_files(knowledge_source_name)) - print(f"Files: {len(files)}") # [END sample_knowledge_source_file_preview] finally: cleanup_resources( diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py index 4b80f069f772..8f5331cd9105 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py @@ -44,10 +44,13 @@ async def main(): from azure.search.documents.indexes.aio import SearchIndexClient from azure.search.documents.indexes.models import ( AzureOpenAIVectorizerParameters, + FileUploadMetadata, FileKnowledgeSource, FileKnowledgeSourceParameters, KnowledgeBase, KnowledgeSourceReference, + UpdateKnowledgeSourceFileRequest, + UploadKnowledgeSourceFileMultipartRequest, ) from azure.search.documents.knowledgebases.aio import KnowledgeBaseRetrievalClient from azure.search.documents.knowledgebases.models import ( @@ -68,6 +71,7 @@ async def main(): file_parameters=FileKnowledgeSourceParameters( ingestion_parameters=KnowledgeSourceIngestionParameters( content_extraction_mode="minimal", + network_access_mode="public", embedding_model=KnowledgeSourceAzureOpenAIVectorizer( azure_open_ai_parameters=AzureOpenAIVectorizerParameters( resource_url=os.environ["AZURE_OPENAI_ENDPOINT"], @@ -93,6 +97,47 @@ async def main(): ) await index_client.create_or_update_knowledge_base(knowledge_base) + file_content = b"Historic Harbor Hotel has free parking and a rooftop restaurant." + file_metadata = FileUploadMetadata( + file_name=f"hotels/{upload_file_name}", + metadata={"category": "hotel", "city": "Seattle"}, + ) + uploaded_file = await index_client.upload_knowledge_source_file_multipart( + name=knowledge_source_name, + body=UploadKnowledgeSourceFileMultipartRequest( + metadata=file_metadata, + content=(upload_file_name, file_content, "text/plain"), + ), + ) + print(f"Uploaded: file '{uploaded_file.file_name}'") + assert uploaded_file.file_id is not None + + updated_file = await index_client.update_knowledge_source_file( + file_id=uploaded_file.file_id, + name=knowledge_source_name, + body=UpdateKnowledgeSourceFileRequest( + metadata=file_metadata, + content=( + upload_file_name, + b"Historic Harbor Hotel has free parking, free Wi-Fi, and a rooftop restaurant.", + "text/plain", + ), + ), + ) + print(f"Updated: file '{updated_file.file_name}'") + + files = [ + file + async for file in index_client.list_knowledge_source_files( + knowledge_source_name, + prefix="hotels/", + search="hotels", + page_size=10, + search_type="prefix", + ) + ] + print(f"Files: {len(files)}") + retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name ) @@ -112,18 +157,6 @@ async def main(): print_retrieval_summary(retrieval_result) finally: await retrieval_client.close() - - file_content = b"Historic Harbor Hotel has free parking and a rooftop restaurant." - uploaded_file = await index_client.upload_knowledge_source_file( - knowledge_source_name, - file_content, - filename=upload_file_name, - content_type="application/octet-stream", - ) - print(f"Uploaded: file '{uploaded_file.file_name}'") - - files = [file async for file in index_client.list_knowledge_source_files(knowledge_source_name)] - print(f"Files: {len(files)}") # [END sample_knowledge_source_file_preview_async] finally: await cleanup_resources_async( diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py index 69ef63f6db0a..4f5cd0f247c8 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py @@ -15,7 +15,10 @@ Set the following environment variables before running the sample: 1) AZURE_SEARCH_SERVICE_ENDPOINT - base URL of your Azure AI Search service 2) AZURE_SEARCH_API_KEY - the admin key for your search service - 3) AZURE_SEARCH_QUERY_SOURCE_AUTHORIZATION - raw bearer token for query source access + 3) AZURE_WORKIQ_APPLICATION_ID - application ID of the customer-owned Entra app + 4) AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID - federated credential ID configured on the app + 5) AZURE_WORKIQ_TENANT_ID - tenant ID of the app registration (optional for same-tenant apps) + 6) AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION - user assertion token for Work IQ access """ import os @@ -38,7 +41,13 @@ def main(): # [START sample_knowledge_source_workiq_preview] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient - from azure.search.documents.indexes.models import KnowledgeBase, KnowledgeSourceReference, WorkIQKnowledgeSource + from azure.search.documents.indexes.models import ( + EntraAppAuthentication, + KnowledgeBase, + KnowledgeSourceReference, + WorkIQKnowledgeSource, + WorkIQKnowledgeSourceParameters, + ) from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalClient from azure.search.documents.knowledgebases.models import ( KnowledgeBaseRetrievalRequest, @@ -52,6 +61,13 @@ def main(): knowledge_source = WorkIQKnowledgeSource( name=knowledge_source_name, description="Hotel Work IQ knowledge source", + work_iq_parameters=WorkIQKnowledgeSourceParameters( + entra_app_authentication=EntraAppAuthentication( + application_id=os.environ["AZURE_WORKIQ_APPLICATION_ID"], + federated_credential_id=os.environ["AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID"], + tenant_id=os.getenv("AZURE_WORKIQ_TENANT_ID"), + ) + ), ) created_knowledge_source = index_client.create_or_update_knowledge_source(knowledge_source) print(f"Created: knowledge source '{created_knowledge_source.name}'") @@ -86,7 +102,9 @@ def main(): ) retrieval_result = retrieval_client.retrieve( request, - query_source_authorization=os.environ["AZURE_SEARCH_QUERY_SOURCE_AUTHORIZATION"], + query_work_iq_source_authorization=os.environ[ + "AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION" + ], ) finally: retrieval_client.close() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py index 50f9bf465f4e..f3c1fafe8b43 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py @@ -15,7 +15,10 @@ Set the following environment variables before running the sample: 1) AZURE_SEARCH_SERVICE_ENDPOINT - base URL of your Azure AI Search service 2) AZURE_SEARCH_API_KEY - the admin key for your search service - 3) AZURE_SEARCH_QUERY_SOURCE_AUTHORIZATION - raw bearer token for query source access + 3) AZURE_WORKIQ_APPLICATION_ID - application ID of the customer-owned Entra app + 4) AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID - federated credential ID configured on the app + 5) AZURE_WORKIQ_TENANT_ID - tenant ID of the app registration (optional for same-tenant apps) + 6) AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION - user assertion token for Work IQ access """ import asyncio @@ -39,7 +42,13 @@ async def main(): # [START sample_knowledge_source_workiq_preview_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient - from azure.search.documents.indexes.models import KnowledgeBase, KnowledgeSourceReference, WorkIQKnowledgeSource + from azure.search.documents.indexes.models import ( + EntraAppAuthentication, + KnowledgeBase, + KnowledgeSourceReference, + WorkIQKnowledgeSource, + WorkIQKnowledgeSourceParameters, + ) from azure.search.documents.knowledgebases.aio import KnowledgeBaseRetrievalClient from azure.search.documents.knowledgebases.models import ( KnowledgeBaseRetrievalRequest, @@ -54,6 +63,13 @@ async def main(): knowledge_source = WorkIQKnowledgeSource( name=knowledge_source_name, description="Hotel Work IQ knowledge source", + work_iq_parameters=WorkIQKnowledgeSourceParameters( + entra_app_authentication=EntraAppAuthentication( + application_id=os.environ["AZURE_WORKIQ_APPLICATION_ID"], + federated_credential_id=os.environ["AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID"], + tenant_id=os.getenv("AZURE_WORKIQ_TENANT_ID"), + ) + ), ) created_knowledge_source = await index_client.create_or_update_knowledge_source(knowledge_source) print(f"Created: knowledge source '{created_knowledge_source.name}'") @@ -88,7 +104,9 @@ async def main(): ) retrieval_result = await retrieval_client.retrieve( request, - query_source_authorization=os.environ["AZURE_SEARCH_QUERY_SOURCE_AUTHORIZATION"], + query_work_iq_source_authorization=os.environ[ + "AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION" + ], ) finally: await retrieval_client.close() diff --git a/sdk/search/azure-search-documents/tests/_capabilities.py b/sdk/search/azure-search-documents/tests/_capabilities.py index 88862c6b9be3..14e08b209eab 100644 --- a/sdk/search/azure-search-documents/tests/_capabilities.py +++ b/sdk/search/azure-search-documents/tests/_capabilities.py @@ -17,6 +17,7 @@ import pytest PREVIEW = "2026-05-01-preview" +PREVIEW_2026_08_01 = "2026-08-01-preview" def _surface(owner: str, kwargs: tuple = (), available_from: str = PREVIEW) -> Mapping[str, Any]: @@ -128,6 +129,15 @@ def _model_capabilities() -> Mapping[str, Mapping[str, Any]]: for dotted in new_classes: entries[dotted] = _surface(dotted) + for dotted in [ + f"{_KBM}.KnowledgeBaseRetrievalStartedEvent", + f"{_KBM}.KnowledgeBaseActivityStartedEvent", + f"{_KBM}.KnowledgeBaseAnswerCompletedEvent", + f"{_KBM}.KnowledgeBaseResponseCompletedEvent", + f"{_KBM}.KnowledgeBaseStreamErrorEvent", + ]: + entries[dotted] = _surface(dotted, available_from=PREVIEW_2026_08_01) + # New fields on existing models. Key = ".", owner = dotted-class, kwargs = (field,). field_additions = [ (f"{_IM}.SearchIndex", "cors_options"), @@ -305,6 +315,12 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: for dotted in method_existence: entries[dotted] = _surface(dotted) + for dotted in [ + f"{_KB}.KnowledgeBaseRetrievalClient.retrieve_stream", + f"{_KB}.aio.KnowledgeBaseRetrievalClient.retrieve_stream", + ]: + entries[dotted] = _surface(dotted, available_from=PREVIEW_2026_08_01) + method_kwargs = [ ( f"{_IDX}.SearchIndexerClient.create_or_update_data_source_connection", @@ -318,8 +334,8 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: f"{_IDX}.SearchIndexerClient.create_or_update_skillset", ("skip_indexer_reset_requirement_for_cache", "disable_cache_reprocessing_change_detection"), ), - (f"{_IDX}.SearchIndexClient.list_indexes", ("top", "skip", "count")), - (f"{_IDX}.SearchIndexClient.list_index_names", ("top", "skip", "count")), + (f"{_IDX}.SearchIndexClient.list_indexes", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexClient.list_index_names", ("search", "page_size", "search_type")), ( f"{_IDX}.aio.SearchIndexerClient.create_or_update_data_source_connection", ("skip_indexer_reset_requirement_for_cache",), @@ -332,8 +348,8 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: f"{_IDX}.aio.SearchIndexerClient.create_or_update_skillset", ("skip_indexer_reset_requirement_for_cache", "disable_cache_reprocessing_change_detection"), ), - (f"{_IDX}.aio.SearchIndexClient.list_indexes", ("top", "skip", "count")), - (f"{_IDX}.aio.SearchIndexClient.list_index_names", ("top", "skip", "count")), + (f"{_IDX}.aio.SearchIndexClient.list_indexes", ("search", "page_size", "search_type")), + (f"{_IDX}.aio.SearchIndexClient.list_index_names", ("search", "page_size", "search_type")), ] for dotted, kwargs in method_kwargs: for kw in kwargs: @@ -378,6 +394,18 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: "KnowledgeBaseRetrievalClient.aio": _surface( "azure.search.documents.knowledgebases.aio.KnowledgeBaseRetrievalClient" ), + "KnowledgeBaseRetrievalEvent": _surface( + "azure.search.documents.knowledgebases.KnowledgeBaseRetrievalEvent", + available_from=PREVIEW_2026_08_01, + ), + "KnowledgeBaseRetrievalStream": _surface( + "azure.search.documents.knowledgebases.KnowledgeBaseRetrievalStream", + available_from=PREVIEW_2026_08_01, + ), + "AsyncKnowledgeBaseRetrievalStream": _surface( + "azure.search.documents.knowledgebases.aio.AsyncKnowledgeBaseRetrievalStream", + available_from=PREVIEW_2026_08_01, + ), } _CAPS.update(_model_capabilities()) _CAPS.update(_client_capabilities()) @@ -423,6 +451,7 @@ def _has_capability_attr(owner: Any, name: str) -> bool: def require_capability(*names: str) -> None: for name in names: + owner: Any = None try: cap = CAPABILITIES[name] except KeyError: # pragma: no cover - misuse @@ -431,6 +460,7 @@ def require_capability(*names: str) -> None: owner = _resolve(cap["owner"]) except (ImportError, AttributeError) as exc: pytest.skip(f"{name} unavailable: owner {cap['owner']!r} cannot be resolved ({exc})") + assert owner is not None if not cap["kwargs"]: # Existence of owner is the capability. continue diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py index 8b04832ceaee..dcdee2654274 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py @@ -4,6 +4,11 @@ # ------------------------------------ """Unit tests for ``KnowledgeBaseRetrievalClient`` patched public behavior.""" +import json +from types import SimpleNamespace +from unittest import mock + +import pytest from azure.core.credentials import AzureKeyCredential from _capabilities import require_capability @@ -14,6 +19,33 @@ AUDIENCE = "https://search.azure.com/" +class _Response: + def __init__(self): + self.closed = False + + def close(self): + self.closed = True + + +class _RawStream: + def __init__(self, chunks): + self._chunks = iter(chunks) + self.closed = False + + def __iter__(self): + return self + + def __next__(self): + return next(self._chunks) + + def close(self): + self.closed = True + + +def _frame(event_type, payload): + return f"event: {event_type}\ndata: {json.dumps(payload)}\n\n".encode() + + class TestKnowledgeBaseRetrievalClientConstructor: def test_constructor_translates_audience_to_credential_scope(self): require_capability("KnowledgeBaseRetrievalClient") @@ -29,3 +61,174 @@ def test_constructor_translates_audience_to_credential_scope(self): assert client._config.endpoint == ENDPOINT assert client._config.knowledge_base_name == KNOWLEDGE_BASE_NAME assert client._config.credential_scopes == ["https://search.azure.com/.default"] + + +class TestKnowledgeBaseRetrievalStream: + def test_stream_deserializes_all_known_event_types(self): + require_capability("KnowledgeBaseRetrievalEvent", "KnowledgeBaseRetrievalStream") + from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalStream + from azure.search.documents.knowledgebases.models import ( + KnowledgeBaseActivityStartedEvent, + KnowledgeBaseAnswerCompletedEvent, + KnowledgeBaseResponseCompletedEvent, + KnowledgeBaseRetrievalStartedEvent, + KnowledgeBaseSearchIndexActivityRecord, + KnowledgeBaseSearchIndexReference, + KnowledgeBaseStreamErrorEvent, + ) + + chunks = [ + _frame( + "retrieval.started", + { + "requestId": "request-id", + "knowledgeBaseName": KNOWLEDGE_BASE_NAME, + "outputMode": "extractiveData", + "reasoningEffort": {"kind": "minimal"}, + }, + ), + _frame( + "activity.started", + {"id": 1, "type": "searchIndex", "startedAt": "2026-08-10T00:00:00Z"}, + ), + _frame("activity.completed", {"id": 1, "type": "searchIndex"}), + _frame("answer.completed", {"messageIndex": 0, "message": {"role": "assistant", "content": []}}), + _frame("references.completed", [{"type": "searchIndex", "id": "doc-1", "activitySource": 1}]), + _frame("error", {"error": {"code": "Failed", "message": "retrieval failed"}}), + _frame("response.completed", {"statusCode": 200, "response": {}}), + ] + response = _Response() + raw_stream = _RawStream(chunks) + stream = KnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream) + + events = list(stream) + + assert [event.event_type for event in events] == [ + "retrieval.started", + "activity.started", + "activity.completed", + "answer.completed", + "references.completed", + "error", + ] + assert isinstance(events[0].data, KnowledgeBaseRetrievalStartedEvent) + assert isinstance(events[1].data, KnowledgeBaseActivityStartedEvent) + assert isinstance(events[2].data, KnowledgeBaseSearchIndexActivityRecord) + assert isinstance(events[3].data, KnowledgeBaseAnswerCompletedEvent) + assert isinstance(events[4].data[0], KnowledgeBaseSearchIndexReference) + assert isinstance(events[5].data, KnowledgeBaseStreamErrorEvent) + assert response.closed + assert raw_stream.closed + + success_stream = KnowledgeBaseRetrievalStream( + response=_Response(), + raw_stream=_RawStream([_frame("response.completed", {"statusCode": 200, "response": {}})]), + ) + assert isinstance(next(success_stream).data, KnowledgeBaseResponseCompletedEvent) + + @pytest.mark.parametrize("chunk_size", [1, 2, 5, 512]) + def test_stream_handles_fragmented_utf8_line_endings_comments_and_unknown_events(self, chunk_size): + from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalStream + + payload = ( + b"\xef\xbb\xbf: keep-alive\r\n" + b"event: future.event\r" + b"data: {\"message\":\r\n" + b"data: \"caf\xc3\xa9\"}\r\n\r\n" + ) + chunks = [payload[index : index + chunk_size] for index in range(0, len(payload), chunk_size)] + response = _Response() + + with KnowledgeBaseRetrievalStream(response=response, raw_stream=_RawStream(chunks)) as stream: + event = next(stream) + + assert event.event_type == "future.event" + assert event.data == {"message": "caf\u00e9"} + assert response.closed + + def test_stream_closes_on_malformed_json_and_explicit_close(self): + from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalStream + + response = _Response() + raw_stream = _RawStream([b"event: retrieval.started\ndata: {invalid}\n\n"]) + stream = KnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream) + + with pytest.raises(json.JSONDecodeError): + next(stream) + assert response.closed + assert raw_stream.closed + + response = _Response() + raw_stream = _RawStream([]) + stream = KnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream) + stream.close() + stream.close() + assert response.closed + assert raw_stream.closed + + def test_client_wraps_generated_stream_and_composes_cls(self): + require_capability( + "azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieve_stream", + "KnowledgeBaseRetrievalStream", + ) + from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalClient, KnowledgeBaseRetrievalStream + from azure.search.documents.knowledgebases.models import KnowledgeBaseRetrievalRequest + + response = _Response() + raw_stream = _RawStream([_frame("response.completed", {"statusCode": 200, "response": {}})]) + pipeline_response = SimpleNamespace(http_response=response) + generated_kwargs = {} + + def generated_retrieve_stream(_self, _request, **kwargs): + generated_kwargs.update(kwargs) + return kwargs["cls"](pipeline_response, raw_stream, {"content-type": "text/event-stream"}) + + client = KnowledgeBaseRetrievalClient( + ENDPOINT, AzureKeyCredential(KEY), knowledge_base_name=KNOWLEDGE_BASE_NAME + ) + with mock.patch( + "azure.search.documents.knowledgebases._patch._KnowledgeBaseRetrievalClient.retrieve_stream", + new=generated_retrieve_stream, + ): + stream = client.retrieve_stream( + KnowledgeBaseRetrievalRequest(), + query_source_authorization="query-token", + ) + assert isinstance(stream, KnowledgeBaseRetrievalStream) + assert generated_kwargs["query_source_authorization"] == "query-token" + stream.close() + + observed = {} + + def custom_cls(received_pipeline_response, typed_stream, headers): + observed.update(pipeline_response=received_pipeline_response, stream=typed_stream, headers=headers) + return "custom-result" + + response = _Response() + raw_stream = _RawStream([]) + pipeline_response = SimpleNamespace(http_response=response) + with mock.patch( + "azure.search.documents.knowledgebases._patch._KnowledgeBaseRetrievalClient.retrieve_stream", + new=generated_retrieve_stream, + ): + result = client.retrieve_stream(KnowledgeBaseRetrievalRequest(), cls=custom_cls) + assert result == "custom-result" + assert isinstance(observed["stream"], KnowledgeBaseRetrievalStream) + observed["stream"].close() + + response = _Response() + raw_stream = _RawStream([]) + pipeline_response = SimpleNamespace(http_response=response) + + def raising_cls(_pipeline_response, _typed_stream, _headers): + raise RuntimeError("custom callback failed") + + with mock.patch( + "azure.search.documents.knowledgebases._patch._KnowledgeBaseRetrievalClient.retrieve_stream", + new=generated_retrieve_stream, + ): + with pytest.raises(RuntimeError, match="custom callback failed"): + client.retrieve_stream(KnowledgeBaseRetrievalRequest(), cls=raising_cls) + assert response.closed + assert raw_stream.closed + client.close() \ No newline at end of file diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py index cfe44a6c9af5..bc698d255278 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py @@ -4,6 +4,11 @@ # ------------------------------------ """Async unit tests for ``KnowledgeBaseRetrievalClient`` patched public behavior.""" +import asyncio +import json +from types import SimpleNamespace +from unittest import mock + import pytest from azure.core.credentials import AzureKeyCredential @@ -15,6 +20,41 @@ AUDIENCE = "https://search.azure.com/" +class _AsyncResponse: + def __init__(self): + self.closed = False + + async def close(self): + self.closed = True + + +class _AsyncRawStream: + def __init__(self, chunks, error=None): + self._chunks = iter(chunks) + self._error = error + self.closed = False + + def __aiter__(self): + return self + + async def __anext__(self): + if self._error is not None: + error = self._error + self._error = None + raise error + try: + return next(self._chunks) + except StopIteration as exc: + raise StopAsyncIteration from exc + + async def aclose(self): + self.closed = True + + +def _frame(event_type, payload): + return f"event: {event_type}\ndata: {json.dumps(payload)}\n\n".encode() + + @pytest.mark.asyncio class TestKnowledgeBaseRetrievalClientConstructorAsync: async def test_constructor_translates_audience_to_credential_scope(self): @@ -32,3 +72,125 @@ async def test_constructor_translates_audience_to_credential_scope(self): assert client._config.knowledge_base_name == KNOWLEDGE_BASE_NAME assert client._config.credential_scopes == ["https://search.azure.com/.default"] await client.close() + + +@pytest.mark.asyncio +class TestKnowledgeBaseRetrievalStreamAsync: + async def test_stream_handles_fragmented_events_and_terminal_cleanup(self): + require_capability("AsyncKnowledgeBaseRetrievalStream", "KnowledgeBaseRetrievalEvent") + from azure.search.documents.knowledgebases.aio import AsyncKnowledgeBaseRetrievalStream + from azure.search.documents.knowledgebases.models import KnowledgeBaseResponseCompletedEvent + + payload = ( + b": keep-alive\r\n" + b"event: response.completed\r\n" + b'data: {"statusCode":200,"response":{}}\r\n\r\nignored' + ) + raw_stream = _AsyncRawStream([payload[index : index + 2] for index in range(0, len(payload), 2)]) + response = _AsyncResponse() + stream = AsyncKnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream) + + event = await stream.__anext__() + + assert event.event_type == "response.completed" + assert isinstance(event.data, KnowledgeBaseResponseCompletedEvent) + assert response.closed + assert raw_stream.closed + with pytest.raises(StopAsyncIteration): + await stream.__anext__() + + async def test_stream_closes_on_cancellation_malformed_json_and_context_exit(self): + from azure.search.documents.knowledgebases.aio import AsyncKnowledgeBaseRetrievalStream + + response = _AsyncResponse() + raw_stream = _AsyncRawStream([], error=asyncio.CancelledError()) + stream = AsyncKnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream) + with pytest.raises(asyncio.CancelledError): + await stream.__anext__() + assert response.closed + assert raw_stream.closed + + response = _AsyncResponse() + raw_stream = _AsyncRawStream([b"event: error\ndata: {invalid}\n\n"]) + stream = AsyncKnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream) + with pytest.raises(json.JSONDecodeError): + await stream.__anext__() + assert response.closed + assert raw_stream.closed + + response = _AsyncResponse() + raw_stream = _AsyncRawStream([]) + async with AsyncKnowledgeBaseRetrievalStream(response=response, raw_stream=raw_stream): + pass + assert response.closed + assert raw_stream.closed + + async def test_client_wraps_generated_stream_and_composes_cls(self): + require_capability( + "azure.search.documents.knowledgebases.aio.KnowledgeBaseRetrievalClient.retrieve_stream", + "AsyncKnowledgeBaseRetrievalStream", + ) + from azure.search.documents.knowledgebases.aio import ( + AsyncKnowledgeBaseRetrievalStream, + KnowledgeBaseRetrievalClient, + ) + from azure.search.documents.knowledgebases.models import KnowledgeBaseRetrievalRequest + + response = _AsyncResponse() + raw_stream = _AsyncRawStream([_frame("response.completed", {"statusCode": 200, "response": {}})]) + pipeline_response = SimpleNamespace(http_response=response) + generated_kwargs = {} + + async def generated_retrieve_stream(_self, _request, **kwargs): + generated_kwargs.update(kwargs) + return kwargs["cls"](pipeline_response, raw_stream, {"content-type": "text/event-stream"}) + + client = KnowledgeBaseRetrievalClient( + ENDPOINT, AzureKeyCredential(KEY), knowledge_base_name=KNOWLEDGE_BASE_NAME + ) + with mock.patch( + "azure.search.documents.knowledgebases.aio._patch._KnowledgeBaseRetrievalClient.retrieve_stream", + new=generated_retrieve_stream, + ): + stream = await client.retrieve_stream( + KnowledgeBaseRetrievalRequest(), + query_work_iq_source_authorization="work-iq-token", + ) + assert isinstance(stream, AsyncKnowledgeBaseRetrievalStream) + assert generated_kwargs["query_work_iq_source_authorization"] == "work-iq-token" + await stream.close() + + observed = {} + + def custom_cls(received_pipeline_response, typed_stream, headers): + observed.update(pipeline_response=received_pipeline_response, stream=typed_stream, headers=headers) + return "custom-result" + + response = _AsyncResponse() + raw_stream = _AsyncRawStream([]) + pipeline_response = SimpleNamespace(http_response=response) + with mock.patch( + "azure.search.documents.knowledgebases.aio._patch._KnowledgeBaseRetrievalClient.retrieve_stream", + new=generated_retrieve_stream, + ): + result = await client.retrieve_stream(KnowledgeBaseRetrievalRequest(), cls=custom_cls) + assert result == "custom-result" + assert isinstance(observed["stream"], AsyncKnowledgeBaseRetrievalStream) + await observed["stream"].close() + + response = _AsyncResponse() + raw_stream = _AsyncRawStream([]) + pipeline_response = SimpleNamespace(http_response=response) + + def raising_cls(_pipeline_response, _typed_stream, _headers): + raise RuntimeError("custom callback failed") + + with mock.patch( + "azure.search.documents.knowledgebases.aio._patch._KnowledgeBaseRetrievalClient.retrieve_stream", + new=generated_retrieve_stream, + ): + with pytest.raises(RuntimeError, match="custom callback failed"): + await client.retrieve_stream(KnowledgeBaseRetrievalRequest(), cls=raising_cls) + assert response.closed + assert raw_stream.closed + await client.close() diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live.py index 850b09fc6944..a502835b66bc 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live.py @@ -33,6 +33,13 @@ "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResponse", "azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent", ) +_STREAM_CAPABILITIES = ( + "azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient.retrieve_stream", + "KnowledgeBaseRetrievalEvent", + "KnowledgeBaseRetrievalStream", + "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent", + "azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent", +) class TestKnowledgeBaseRetrievalClient(AzureRecordedTestCase): @@ -71,3 +78,48 @@ def test_retrieve_returns_knowledge_base_response(self, endpoint: str) -> None: assert isinstance(result, KnowledgeBaseRetrievalResponse) assert hasattr(result, "response") assert hasattr(result, "references") + + @live_test() + def test_retrieve_stream_returns_typed_lifecycle_events(self, endpoint: str) -> None: + require_capability( + *_KNOWLEDGE_BASE_RESOURCE_CAPABILITIES, + *_RETRIEVAL_CAPABILITIES, + *_STREAM_CAPABILITIES, + ) + from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalClient + from azure.search.documents.knowledgebases.models import ( + KnowledgeBaseResponseCompletedEvent, + KnowledgeBaseRetrievalRequest, + KnowledgeBaseRetrievalResponse, + KnowledgeBaseRetrievalStartedEvent, + KnowledgeRetrievalMinimalReasoningEffort, + KnowledgeRetrievalSemanticIntent, + ) + + with knowledge_base_resources( + self, + endpoint, + prefix="knowledge-base-retrieve-stream", + wait_for_active=True, + description=KNOWLEDGE_BASE_RETRIEVAL_DESCRIPTION, + source_description=KNOWLEDGE_SOURCE_RETRIEVAL_DESCRIPTION, + ) as context: + retrieval_request = KnowledgeBaseRetrievalRequest( + intents=[KnowledgeRetrievalSemanticIntent(search=RETRIEVAL_QUERY)], + retrieval_reasoning_effort=KnowledgeRetrievalMinimalReasoningEffort(), + ) + + with KnowledgeBaseRetrievalClient( + endpoint, + credential=context.credential, + knowledge_base_name=context.knowledge_base_name, + ) as client: + with client.retrieve_stream(retrieval_request) as stream: + events = list(stream) + + assert events[0].event_type == "retrieval.started" + assert isinstance(events[0].data, KnowledgeBaseRetrievalStartedEvent) + assert events[-1].event_type == "response.completed" + assert isinstance(events[-1].data, KnowledgeBaseResponseCompletedEvent) + assert isinstance(events[-1].data.response, KnowledgeBaseRetrievalResponse) + assert sum(event.event_type in ("response.completed", "error") for event in events) == 1 diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live_async.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live_async.py index ec1f4890f028..d94afbe04d38 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live_async.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_retrieve_live_async.py @@ -33,6 +33,13 @@ "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalResponse", "azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent", ) +_STREAM_CAPABILITIES = ( + "azure.search.documents.knowledgebases.aio.KnowledgeBaseRetrievalClient.retrieve_stream", + "KnowledgeBaseRetrievalEvent", + "AsyncKnowledgeBaseRetrievalStream", + "azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent", + "azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent", +) class TestKnowledgeBaseRetrievalClientAsync(AzureRecordedTestCase): @@ -71,3 +78,49 @@ async def test_retrieve_returns_knowledge_base_response(self, endpoint: str) -> assert isinstance(result, KnowledgeBaseRetrievalResponse) assert hasattr(result, "response") assert hasattr(result, "references") + + @live_test() + async def test_retrieve_stream_returns_typed_lifecycle_events(self, endpoint: str) -> None: + require_capability( + *_KNOWLEDGE_BASE_RESOURCE_CAPABILITIES, + *_RETRIEVAL_CAPABILITIES, + *_STREAM_CAPABILITIES, + ) + from azure.search.documents.knowledgebases.aio import KnowledgeBaseRetrievalClient + from azure.search.documents.knowledgebases.models import ( + KnowledgeBaseResponseCompletedEvent, + KnowledgeBaseRetrievalRequest, + KnowledgeBaseRetrievalResponse, + KnowledgeBaseRetrievalStartedEvent, + KnowledgeRetrievalMinimalReasoningEffort, + KnowledgeRetrievalSemanticIntent, + ) + + async with knowledge_base_resources( + self, + endpoint, + prefix="knowledge-base-retrieve-stream", + wait_for_active=True, + description=KNOWLEDGE_BASE_RETRIEVAL_DESCRIPTION, + source_description=KNOWLEDGE_SOURCE_RETRIEVAL_DESCRIPTION, + ) as context: + retrieval_request = KnowledgeBaseRetrievalRequest( + intents=[KnowledgeRetrievalSemanticIntent(search=RETRIEVAL_QUERY)], + retrieval_reasoning_effort=KnowledgeRetrievalMinimalReasoningEffort(), + ) + + async with KnowledgeBaseRetrievalClient( + endpoint, + credential=context.credential, + knowledge_base_name=context.knowledge_base_name, + ) as client: + stream = await client.retrieve_stream(retrieval_request) + async with stream: + events = [event async for event in stream] + + assert events[0].event_type == "retrieval.started" + assert isinstance(events[0].data, KnowledgeBaseRetrievalStartedEvent) + assert events[-1].event_type == "response.completed" + assert isinstance(events[-1].data, KnowledgeBaseResponseCompletedEvent) + assert isinstance(events[-1].data.response, KnowledgeBaseRetrievalResponse) + assert sum(event.event_type in ("response.completed", "error") for event in events) == 1 diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client.py b/sdk/search/azure-search-documents/tests/test_search_index_client.py index 08c95aad08f9..cf51d3842cc3 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client.py @@ -61,20 +61,20 @@ class TestListIndexes: "azure.search.documents.indexes._operations._operations._SearchIndexClientOperationsMixin._list_indexes", side_effect=_empty_pager, ) - def test_list_indexes_forwards_top_skip_count(self, mock_list): + def test_list_indexes_forwards_search_paging(self, mock_list): require_capability( - "azure.search.documents.indexes.SearchIndexClient.list_indexes.top", - "azure.search.documents.indexes.SearchIndexClient.list_indexes.skip", - "azure.search.documents.indexes.SearchIndexClient.list_indexes.count", + "azure.search.documents.indexes.SearchIndexClient.list_indexes.search", + "azure.search.documents.indexes.SearchIndexClient.list_indexes.page_size", + "azure.search.documents.indexes.SearchIndexClient.list_indexes.search_type", ) - list(_client().list_indexes(top=10, skip=5, count=True)) + list(_client().list_indexes(search="hot", page_size=10, search_type="prefix")) mock_list.assert_called_once() kwargs = mock_list.call_args.kwargs - assert kwargs["top"] == 10 - assert kwargs["skip"] == 5 - assert kwargs["count"] is True + assert kwargs["search"] == "hot" + assert kwargs["page_size"] == 10 + assert kwargs["search_type"] == "prefix" @mock.patch( "azure.search.documents.indexes._operations._operations." @@ -83,22 +83,22 @@ def test_list_indexes_forwards_top_skip_count(self, mock_list): ) def test_list_indexes_with_select_forwards_paging_kwargs(self, mock_list_select): require_capability( - "azure.search.documents.indexes.SearchIndexClient.list_indexes.top", - "azure.search.documents.indexes.SearchIndexClient.list_indexes.skip", - "azure.search.documents.indexes.SearchIndexClient.list_indexes.count", + "azure.search.documents.indexes.SearchIndexClient.list_indexes.search", + "azure.search.documents.indexes.SearchIndexClient.list_indexes.page_size", + "azure.search.documents.indexes.SearchIndexClient.list_indexes.search_type", "azure.search.documents.indexes.models.SearchIndex.cors_options", "azure.search.documents.indexes.models.SearchIndex.permission_filter_option", "azure.search.documents.indexes.models.SearchIndex.purview_enabled", ) - list(_client().list_indexes(select=["name"], top=3, skip=1, count=False)) + list(_client().list_indexes(select=["name"], search="hot", page_size=3, search_type="prefix")) mock_list_select.assert_called_once() kwargs = mock_list_select.call_args.kwargs assert kwargs["select"] == ["name"] - assert kwargs["top"] == 3 - assert kwargs["skip"] == 1 - assert kwargs["count"] is False + assert kwargs["search"] == "hot" + assert kwargs["page_size"] == 3 + assert kwargs["search_type"] == "prefix" converted = kwargs["cls"]([_index_response_stub()]) assert isinstance(converted[0], SearchIndex) assert converted[0].name == "hotels" @@ -109,20 +109,20 @@ class TestListIndexNames: "azure.search.documents.indexes._operations._operations._SearchIndexClientOperationsMixin._list_indexes", side_effect=_empty_pager, ) - def test_list_index_names_forwards_top_skip_count(self, mock_list): + def test_list_index_names_forwards_search_paging(self, mock_list): require_capability( - "azure.search.documents.indexes.SearchIndexClient.list_index_names.top", - "azure.search.documents.indexes.SearchIndexClient.list_index_names.skip", - "azure.search.documents.indexes.SearchIndexClient.list_index_names.count", + "azure.search.documents.indexes.SearchIndexClient.list_index_names.search", + "azure.search.documents.indexes.SearchIndexClient.list_index_names.page_size", + "azure.search.documents.indexes.SearchIndexClient.list_index_names.search_type", ) - list(_client().list_index_names(top=20, skip=0, count=True)) + list(_client().list_index_names(search="hot", page_size=20, search_type="prefix")) mock_list.assert_called_once() kwargs = mock_list.call_args.kwargs - assert kwargs["top"] == 20 - assert kwargs["skip"] == 0 - assert kwargs["count"] is True + assert kwargs["search"] == "hot" + assert kwargs["page_size"] == 20 + assert kwargs["search_type"] == "prefix" # The names projection passes a `cls` callback that maps to .name strings. assert callable(kwargs["cls"]) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_async.py index 5666e59edfc0..dc583e6e9b4b 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_async.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_async.py @@ -62,11 +62,11 @@ def _index_response_stub(name="hotels"): @pytest.mark.asyncio class TestListIndexesAsync: - async def test_list_indexes_forwards_top_skip_count(self): + async def test_list_indexes_forwards_search_paging(self): require_capability( - "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.top", - "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.skip", - "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.count", + "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.search", + "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.page_size", + "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.search_type", ) with mock.patch( @@ -74,21 +74,21 @@ async def test_list_indexes_forwards_top_skip_count(self): "_SearchIndexClientOperationsMixin._list_indexes", side_effect=_empty_async_pager, ) as mock_list: - pager = _client().list_indexes(top=10, skip=5, count=True) + pager = _client().list_indexes(search="hot", page_size=10, search_type="prefix") async for _ in pager: pass mock_list.assert_called_once() kwargs = mock_list.call_args.kwargs - assert kwargs["top"] == 10 - assert kwargs["skip"] == 5 - assert kwargs["count"] is True + assert kwargs["search"] == "hot" + assert kwargs["page_size"] == 10 + assert kwargs["search_type"] == "prefix" async def test_list_indexes_with_select_forwards_paging_kwargs(self): require_capability( - "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.top", - "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.skip", - "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.count", + "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.search", + "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.page_size", + "azure.search.documents.indexes.aio.SearchIndexClient.list_indexes.search_type", "azure.search.documents.indexes.models.SearchIndex.cors_options", "azure.search.documents.indexes.models.SearchIndex.permission_filter_option", "azure.search.documents.indexes.models.SearchIndex.purview_enabled", @@ -99,16 +99,16 @@ async def test_list_indexes_with_select_forwards_paging_kwargs(self): "_SearchIndexClientOperationsMixin._list_indexes_with_selected_properties", side_effect=_empty_async_pager, ) as mock_list_select: - pager = _client().list_indexes(select=["name"], top=3, skip=1, count=False) + pager = _client().list_indexes(select=["name"], search="hot", page_size=3, search_type="prefix") async for _ in pager: pass mock_list_select.assert_called_once() kwargs = mock_list_select.call_args.kwargs assert kwargs["select"] == ["name"] - assert kwargs["top"] == 3 - assert kwargs["skip"] == 1 - assert kwargs["count"] is False + assert kwargs["search"] == "hot" + assert kwargs["page_size"] == 3 + assert kwargs["search_type"] == "prefix" converted = kwargs["cls"]([_index_response_stub()]) assert isinstance(converted[0], SearchIndex) assert converted[0].name == "hotels" @@ -116,11 +116,11 @@ async def test_list_indexes_with_select_forwards_paging_kwargs(self): @pytest.mark.asyncio class TestListIndexNamesAsync: - async def test_list_index_names_forwards_top_skip_count(self): + async def test_list_index_names_forwards_search_paging(self): require_capability( - "azure.search.documents.indexes.aio.SearchIndexClient.list_index_names.top", - "azure.search.documents.indexes.aio.SearchIndexClient.list_index_names.skip", - "azure.search.documents.indexes.aio.SearchIndexClient.list_index_names.count", + "azure.search.documents.indexes.aio.SearchIndexClient.list_index_names.search", + "azure.search.documents.indexes.aio.SearchIndexClient.list_index_names.page_size", + "azure.search.documents.indexes.aio.SearchIndexClient.list_index_names.search_type", ) with mock.patch( @@ -128,15 +128,15 @@ async def test_list_index_names_forwards_top_skip_count(self): "_SearchIndexClientOperationsMixin._list_indexes", side_effect=_empty_async_pager, ) as mock_list: - pager = _client().list_index_names(top=20, skip=0, count=True) + pager = _client().list_index_names(search="hot", page_size=20, search_type="prefix") async for _ in pager: pass mock_list.assert_called_once() kwargs = mock_list.call_args.kwargs - assert kwargs["top"] == 20 - assert kwargs["skip"] == 0 - assert kwargs["count"] is True + assert kwargs["search"] == "hot" + assert kwargs["page_size"] == 20 + assert kwargs["search_type"] == "prefix" assert callable(kwargs["cls"]) From dd513aae28a7373ce1cd009016d1c318336d7498 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Aug 2026 00:03:09 +0000 Subject: [PATCH 07/17] [Search] Refresh api.md and api.metadata.yml via azpysdk apistub Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com> --- sdk/search/azure-search-documents/api.md | 5590 +++++++++++++++-- .../azure-search-documents/api.metadata.yml | 6 +- 2 files changed, 4958 insertions(+), 638 deletions(-) diff --git a/sdk/search/azure-search-documents/api.md b/sdk/search/azure-search-documents/api.md index 13f9dde66b56..52067fe067fc 100644 --- a/sdk/search/azure-search-documents/api.md +++ b/sdk/search/azure-search-documents/api.md @@ -7,7 +7,7 @@ namespace azure.search.documents V2024_07_01 = "2024-07-01" V2025_09_01 = "2025-09-01" V2026_04_01 = "2026-04-01" - V2026_05_01_PREVIEW = "2026-05-01-preview" + V2026_08_01_PREVIEW = "2026-08-01-preview" class azure.search.documents.IndexDocumentsBatch(MutableMapping[str, Any]): @@ -96,7 +96,7 @@ namespace azure.search.documents ) -> List[IndexingResult]: ... @distributed_trace - @api_version_validation(params_added_on={'2026-05-01-preview': ['query_source_authorization', 'enable_elevated_read']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview']) + @api_version_validation(params_added_on={'2026-05-01-preview': ['query_source_authorization', 'enable_elevated_read']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) def get_document( self, key: str, @@ -360,7 +360,7 @@ namespace azure.search.documents.aio ) -> List[IndexingResult]: ... @distributed_trace_async - @api_version_validation(params_added_on={'2026-05-01-preview': ['query_source_authorization', 'enable_elevated_read']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview']) + @api_version_validation(params_added_on={'2026-05-01-preview': ['query_source_authorization', 'enable_elevated_read']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) async def get_document( self, key: str, @@ -577,7 +577,7 @@ namespace azure.search.documents.indexes @overload def create_alias( self, - alias: JSON, + alias: SearchAlias, *, content_type: str = "application/json", **kwargs: Any @@ -604,7 +604,7 @@ namespace azure.search.documents.indexes @overload def create_index( self, - index: JSON, + index: SearchIndex, *, content_type: str = "application/json", **kwargs: Any @@ -631,7 +631,7 @@ namespace azure.search.documents.indexes @overload def create_knowledge_base( self, - knowledge_base: JSON, + knowledge_base: KnowledgeBase, *, content_type: str = "application/json", **kwargs: Any @@ -658,7 +658,7 @@ namespace azure.search.documents.indexes @overload def create_knowledge_source( self, - knowledge_source: JSON, + knowledge_source: KnowledgeSource, *, content_type: str = "application/json", **kwargs: Any @@ -731,7 +731,7 @@ namespace azure.search.documents.indexes @overload def create_synonym_map( self, - synonym_map: JSON, + synonym_map: SynonymMap, *, content_type: str = "application/json", **kwargs: Any @@ -872,26 +872,34 @@ namespace azure.search.documents.indexes def list_alias_names(self, **kwargs: Any) -> ItemPaged[str]: ... @distributed_trace - def list_aliases(self, **kwargs: Any) -> ItemPaged[SearchAlias]: ... + @api_version_validation(params_added_on={'2026-08-01-preview': ['search', 'page_size', 'search_type']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) + def list_aliases( + self, + *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., + **kwargs: Any + ) -> ItemPaged[SearchAlias]: ... @distributed_trace def list_index_names( self, *, - count: Optional[bool] = ..., - skip: Optional[int] = ..., - top: Optional[int] = ..., + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., **kwargs: Any ) -> ItemPaged[str]: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'accept', 'top', 'skip', 'count', 'client_request_id']}, api_versions_list=['2026-05-01-preview']) + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'accept', 'search', 'page_size', 'search_type', 'client_request_id']}, api_versions_list=['2026-08-01-preview']) def list_index_stats_summary( self, *, - count: Optional[bool] = ..., - skip: Optional[int] = ..., - top: Optional[int] = ..., + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., **kwargs: Any ) -> ItemPaged[IndexStatisticsSummary]: ... @@ -899,26 +907,47 @@ namespace azure.search.documents.indexes def list_indexes( self, *, - count: Optional[bool] = ..., + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., - skip: Optional[int] = ..., - top: Optional[int] = ..., **kwargs: Any ) -> ItemPaged[SearchIndex]: ... @distributed_trace - def list_knowledge_bases(self, **kwargs: Any) -> ItemPaged[KnowledgeBase]: ... + @api_version_validation(params_added_on={'2026-08-01-preview': ['search', 'page_size', 'search_type']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) + def list_knowledge_bases( + self, + *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., + **kwargs: Any + ) -> ItemPaged[KnowledgeBase]: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'accept', 'client_request_id', 'name']}, api_versions_list=['2026-05-01-preview']) + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'accept', 'client_request_id', 'name'], '2026-08-01-preview': ['prefix', 'search', 'page_size', 'search_type']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) def list_knowledge_source_files( self, name: str, + *, + page_size: Optional[int] = ..., + prefix: Optional[str] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., **kwargs: Any ) -> ItemPaged[KnowledgeSourceFile]: ... @distributed_trace - def list_knowledge_sources(self, **kwargs: Any) -> ItemPaged[KnowledgeSource]: ... + @api_version_validation(params_added_on={'2026-08-01-preview': ['search', 'page_size', 'search_type']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) + def list_knowledge_sources( + self, + *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., + **kwargs: Any + ) -> ItemPaged[KnowledgeSource]: ... def send_request( self, @@ -928,6 +957,24 @@ namespace azure.search.documents.indexes **kwargs: Any ) -> HttpResponse: ... + @overload + def update_knowledge_source_file( + self, + file_id: str, + name: str, + body: UpdateKnowledgeSourceFileRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + + @overload + def update_knowledge_source_file( + self, + file_id: str, + name: str, + body: UpdateKnowledgeSourceFileRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + @distributed_trace def upload_knowledge_source_file( self, @@ -939,6 +986,22 @@ namespace azure.search.documents.indexes **kwargs: Any ) -> KnowledgeSourceFile: ... + @overload + def upload_knowledge_source_file_multipart( + self, + name: str, + body: UploadKnowledgeSourceFileMultipartRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + + @overload + def upload_knowledge_source_file_multipart( + self, + name: str, + body: UploadKnowledgeSourceFileMultipartRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + class azure.search.documents.indexes.SearchIndexerClient(_SearchIndexerClient): implements ContextManager @@ -966,7 +1029,7 @@ namespace azure.search.documents.indexes @overload def create_data_source_connection( self, - data_source_connection: JSON, + data_source_connection: SearchIndexerDataSourceConnection, *, content_type: str = "application/json", **kwargs: Any @@ -993,7 +1056,7 @@ namespace azure.search.documents.indexes @overload def create_indexer( self, - indexer: JSON, + indexer: SearchIndexer, *, content_type: str = "application/json", **kwargs: Any @@ -1052,7 +1115,7 @@ namespace azure.search.documents.indexes @overload def create_skillset( self, - skillset: JSON, + skillset: SearchIndexerSkillset, *, content_type: str = "application/json", **kwargs: Any @@ -1240,7 +1303,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_alias( self, - alias: JSON, + alias: SearchAlias, *, content_type: str = "application/json", **kwargs: Any @@ -1267,7 +1330,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_index( self, - index: JSON, + index: SearchIndex, *, content_type: str = "application/json", **kwargs: Any @@ -1294,7 +1357,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_knowledge_base( self, - knowledge_base: JSON, + knowledge_base: KnowledgeBase, *, content_type: str = "application/json", **kwargs: Any @@ -1321,7 +1384,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_knowledge_source( self, - knowledge_source: JSON, + knowledge_source: KnowledgeSource, *, content_type: str = "application/json", **kwargs: Any @@ -1394,7 +1457,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_synonym_map( self, - synonym_map: JSON, + synonym_map: SynonymMap, *, content_type: str = "application/json", **kwargs: Any @@ -1535,26 +1598,34 @@ namespace azure.search.documents.indexes.aio def list_alias_names(self, **kwargs) -> AsyncItemPaged[str]: ... @distributed_trace - def list_aliases(self, **kwargs: Any) -> AsyncItemPaged[SearchAlias]: ... + @api_version_validation(params_added_on={'2026-08-01-preview': ['search', 'page_size', 'search_type']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) + def list_aliases( + self, + *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[SearchAlias]: ... @distributed_trace def list_index_names( self, *, - count: Optional[bool] = ..., - skip: Optional[int] = ..., - top: Optional[int] = ..., + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., **kwargs: Any ) -> AsyncItemPaged[str]: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'accept', 'top', 'skip', 'count', 'client_request_id']}, api_versions_list=['2026-05-01-preview']) + @api_version_validation(method_added_on='2026-08-01-preview', params_added_on={'2026-08-01-preview': ['api_version', 'accept', 'search', 'page_size', 'search_type', 'client_request_id']}, api_versions_list=['2026-08-01-preview']) def list_index_stats_summary( self, *, - count: Optional[bool] = ..., - skip: Optional[int] = ..., - top: Optional[int] = ..., + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., **kwargs: Any ) -> AsyncItemPaged[IndexStatisticsSummary]: ... @@ -1562,26 +1633,47 @@ namespace azure.search.documents.indexes.aio def list_indexes( self, *, - count: Optional[bool] = ..., + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., - skip: Optional[int] = ..., - top: Optional[int] = ..., **kwargs: Any ) -> AsyncItemPaged[SearchIndex]: ... @distributed_trace - def list_knowledge_bases(self, **kwargs: Any) -> AsyncItemPaged[KnowledgeBase]: ... + @api_version_validation(params_added_on={'2026-08-01-preview': ['search', 'page_size', 'search_type']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) + def list_knowledge_bases( + self, + *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[KnowledgeBase]: ... @distributed_trace - @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'accept', 'client_request_id', 'name']}, api_versions_list=['2026-05-01-preview']) + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'accept', 'client_request_id', 'name'], '2026-08-01-preview': ['prefix', 'search', 'page_size', 'search_type']}, api_versions_list=['2026-05-01-preview', '2026-08-01-preview']) def list_knowledge_source_files( self, name: str, + *, + page_size: Optional[int] = ..., + prefix: Optional[str] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., **kwargs: Any ) -> AsyncItemPaged[KnowledgeSourceFile]: ... @distributed_trace - def list_knowledge_sources(self, **kwargs: Any) -> AsyncItemPaged[KnowledgeSource]: ... + @api_version_validation(params_added_on={'2026-08-01-preview': ['search', 'page_size', 'search_type']}, api_versions_list=['2025-11-01-preview', '2026-04-01', '2026-05-01-preview', '2026-08-01-preview']) + def list_knowledge_sources( + self, + *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., + **kwargs: Any + ) -> AsyncItemPaged[KnowledgeSource]: ... def send_request( self, @@ -1591,6 +1683,24 @@ namespace azure.search.documents.indexes.aio **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: ... + @overload + async def update_knowledge_source_file( + self, + file_id: str, + name: str, + body: UpdateKnowledgeSourceFileRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + + @overload + async def update_knowledge_source_file( + self, + file_id: str, + name: str, + body: UpdateKnowledgeSourceFileRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + @distributed_trace_async async def upload_knowledge_source_file( self, @@ -1602,6 +1712,22 @@ namespace azure.search.documents.indexes.aio **kwargs: Any ) -> KnowledgeSourceFile: ... + @overload + async def upload_knowledge_source_file_multipart( + self, + name: str, + body: UploadKnowledgeSourceFileMultipartRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + + @overload + async def upload_knowledge_source_file_multipart( + self, + name: str, + body: UploadKnowledgeSourceFileMultipartRequest, + **kwargs: Any + ) -> KnowledgeSourceFile: ... + class azure.search.documents.indexes.aio.SearchIndexerClient(_SearchIndexerClient): implements AsyncContextManager @@ -1629,7 +1755,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_data_source_connection( self, - data_source_connection: JSON, + data_source_connection: SearchIndexerDataSourceConnection, *, content_type: str = "application/json", **kwargs: Any @@ -1656,7 +1782,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_indexer( self, - indexer: JSON, + indexer: SearchIndexer, *, content_type: str = "application/json", **kwargs: Any @@ -1715,7 +1841,7 @@ namespace azure.search.documents.indexes.aio @overload async def create_skillset( self, - skillset: JSON, + skillset: SearchIndexerSkillset, *, content_type: str = "application/json", **kwargs: Any @@ -2079,6 +2205,7 @@ namespace azure.search.documents.indexes.models encryption_key: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.AZURE_BLOB] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -2088,7 +2215,8 @@ namespace azure.search.documents.indexes.models description: Optional[str] = ..., e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -2102,6 +2230,7 @@ namespace azure.search.documents.indexes.models folder_path: Optional[str] ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] is_adls_gen2: Optional[bool] + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] @overload def __init__( @@ -2111,7 +2240,8 @@ namespace azure.search.documents.indexes.models container_name: str, folder_path: Optional[str] = ..., ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] = ..., - is_adls_gen2: Optional[bool] = ... + is_adls_gen2: Optional[bool] = ..., + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] = ... ) -> None: ... @overload @@ -2239,10 +2369,14 @@ namespace azure.search.documents.indexes.models GPT51 = "gpt-5.1" GPT52 = "gpt-5.2" GPT54 = "gpt-5.4" - GPT_5_4_MINI = "gpt-5.4-mini" - GPT_5_4_NANO = "gpt-5.4-nano" - GPT_5_MINI = "gpt-5-mini" - GPT_5_NANO = "gpt-5-nano" + GPT55 = "gpt-5.5" + GPT56_LUNA = "gpt-5.6-luna" + GPT56_SOL = "gpt-5.6-sol" + GPT56_TERRA = "gpt-5.6-terra" + GPT5_4_MINI = "gpt-5.4-mini" + GPT5_4_NANO = "gpt-5.4-nano" + GPT5_MINI = "gpt-5-mini" + GPT5_NANO = "gpt-5-nano" TEXT_EMBEDDING3_LARGE = "text-embedding-3-large" TEXT_EMBEDDING3_SMALL = "text-embedding-3-small" TEXT_EMBEDDING_ADA002 = "text-embedding-ada-002" @@ -3328,6 +3462,24 @@ namespace azure.search.documents.indexes.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.EntraAppAuthentication(_Model): + application_id: str + federated_credential_id: str + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + application_id: str, + federated_credential_id: str, + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.indexes.models.ExhaustiveKnnAlgorithmConfiguration(VectorSearchAlgorithmConfiguration, discriminator='exhaustiveKnn'): kind: Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN] name: str @@ -3366,6 +3518,7 @@ namespace azure.search.documents.indexes.models fabric_data_agent_parameters: FabricDataAgentKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -3375,7 +3528,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., fabric_data_agent_parameters: FabricDataAgentKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -3405,6 +3559,7 @@ namespace azure.search.documents.indexes.models fabric_ontology_parameters: FabricOntologyKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -3414,7 +3569,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., fabric_ontology_parameters: FabricOntologyKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -3472,37 +3628,64 @@ namespace azure.search.documents.indexes.models class azure.search.documents.indexes.models.FileKnowledgeSource(KnowledgeSource, discriminator='file'): + cors_options: Optional[CorsOptions] description: str e_tag: str encryption_key: SearchResourceEncryptionKey file_parameters: FileKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.FILE] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( self, *, + cors_options: Optional[CorsOptions] = ..., description: Optional[str] = ..., e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., file_parameters: FileKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.FileKnowledgeSourceExtractionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MINIMAL = "minimal" + STANDARD = "standard" + + class azure.search.documents.indexes.models.FileKnowledgeSourceParameters(_Model): created_resources: Optional[CreatedResources] ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] + + @overload + def __init__( + self, + *, + ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] = ..., + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.indexes.models.FileUploadMetadata(_Model): + file_name: Optional[str] + metadata: Optional[dict[str, str]] @overload def __init__( self, *, - ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] = ... + file_name: Optional[str] = ..., + metadata: Optional[dict[str, str]] = ... ) -> None: ... @overload @@ -3720,6 +3903,7 @@ namespace azure.search.documents.indexes.models indexed_one_lake_parameters: IndexedOneLakeKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -3729,7 +3913,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., indexed_one_lake_parameters: IndexedOneLakeKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -3741,6 +3926,7 @@ namespace azure.search.documents.indexes.models fabric_workspace_id: str ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] lakehouse_id: str + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] target_path: Optional[str] @overload @@ -3750,6 +3936,7 @@ namespace azure.search.documents.indexes.models fabric_workspace_id: str, ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] = ..., lakehouse_id: str, + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., target_path: Optional[str] = ... ) -> None: ... @@ -3770,6 +3957,7 @@ namespace azure.search.documents.indexes.models indexed_share_point_parameters: IndexedSharePointKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -3779,7 +3967,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., indexed_share_point_parameters: IndexedSharePointKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -3792,6 +3981,7 @@ namespace azure.search.documents.indexes.models created_resources: Optional[CreatedResources] ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] query: Optional[str] + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] @overload def __init__( @@ -3800,7 +3990,8 @@ namespace azure.search.documents.indexes.models connection_string: str, container_name: Union[str, IndexedSharePointContainerName], ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] = ..., - query: Optional[str] = ... + query: Optional[str] = ..., + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] = ... ) -> None: ... @overload @@ -3814,6 +4005,7 @@ namespace azure.search.documents.indexes.models indexed_sql_parameters: IndexedSqlKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.INDEXED_SQL] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -3823,7 +4015,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., indexed_sql_parameters: IndexedSqlKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -3837,6 +4030,7 @@ namespace azure.search.documents.indexes.models embedding_columns: Optional[list[EmbeddingColumnMapping]] high_water_mark_column_name: Optional[str] ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] table_or_view: str @overload @@ -3848,6 +4042,7 @@ namespace azure.search.documents.indexes.models embedding_columns: Optional[list[EmbeddingColumnMapping]] = ..., high_water_mark_column_name: Optional[str] = ..., ingestion_parameters: Optional[KnowledgeSourceIngestionParameters] = ..., + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., table_or_view: str ) -> None: ... @@ -4221,12 +4416,31 @@ namespace azure.search.documents.indexes.models AZURE_OPEN_AI = "azureOpenAI" + class azure.search.documents.indexes.models.KnowledgeBaseRetrieveDefaults(_Model): + max_output_documents: Optional[int] + max_output_size_in_tokens: Optional[int] + max_runtime_in_seconds: Optional[int] + + @overload + def __init__( + self, + *, + max_output_documents: Optional[int] = ..., + max_output_size_in_tokens: Optional[int] = ..., + max_runtime_in_seconds: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.indexes.models.KnowledgeSource(_Model): description: Optional[str] e_tag: Optional[str] encryption_key: Optional[SearchResourceEncryptionKey] kind: str name: str + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] @overload def __init__( @@ -4236,7 +4450,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., kind: str, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -4251,10 +4466,14 @@ namespace azure.search.documents.indexes.models class azure.search.documents.indexes.models.KnowledgeSourceFile(_Model): created_at: Optional[datetime] error_message: Optional[str] + extraction_mode: Optional[Union[str, FileKnowledgeSourceExtractionMode]] file_id: Optional[str] file_name: Optional[str] file_size_bytes: Optional[int] last_updated_at: Optional[datetime] + metadata: Optional[dict[str, str]] + parsing_mode: Optional[Union[str, BlobIndexerParsingMode]] + prefix: Optional[str] class azure.search.documents.indexes.models.KnowledgeSourceIngestionPermissionOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -4297,6 +4516,11 @@ namespace azure.search.documents.indexes.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.KnowledgeSourceResultsProcessing(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "none" + RERANK = "rerank" + + class azure.search.documents.indexes.models.KnowledgeSourceSynchronizationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): ACTIVE = "active" CREATING = "creating" @@ -4536,6 +4760,10 @@ namespace azure.search.documents.indexes.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.ListingSearchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PREFIX = "prefix" + + class azure.search.documents.indexes.models.LuceneStandardAnalyzer(LexicalAnalyzer, discriminator='#Microsoft.Azure.Search.StandardAnalyzer'): max_token_length: Optional[int] name: str @@ -4742,6 +4970,7 @@ namespace azure.search.documents.indexes.models kind: Literal[KnowledgeSourceKind.MCP_SERVER] mcp_server_parameters: McpServerKnowledgeSourceParameters name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -4751,7 +4980,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., mcp_server_parameters: McpServerKnowledgeSourceParameters, - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -4890,30 +5120,25 @@ namespace azure.search.documents.indexes.models class azure.search.documents.indexes.models.McpServerTool(_Model): - inclusion_mode: Optional[Union[str, McpServerToolInclusionMode]] max_output_tokens: Optional[int] name: Optional[str] output_parsing: Optional[McpServerOutputParsing] + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] @overload def __init__( self, *, - inclusion_mode: Optional[Union[str, McpServerToolInclusionMode]] = ..., max_output_tokens: Optional[int] = ..., name: Optional[str] = ..., - output_parsing: Optional[McpServerOutputParsing] = ... + output_parsing: Optional[McpServerOutputParsing] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.indexes.models.McpServerToolInclusionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALWAYS = "always" - RERANKED = "reranked" - - class azure.search.documents.indexes.models.MergeSkill(SearchIndexerSkill, discriminator='#Microsoft.Skills.Text.MergeSkill'): context: str description: str @@ -5600,6 +5825,7 @@ namespace azure.search.documents.indexes.models kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] name: str remote_share_point_parameters: Optional[RemoteSharePointKnowledgeSourceParameters] + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -5609,7 +5835,8 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., name: str, - remote_share_point_parameters: Optional[RemoteSharePointKnowledgeSourceParameters] = ... + remote_share_point_parameters: Optional[RemoteSharePointKnowledgeSourceParameters] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -5875,6 +6102,7 @@ namespace azure.search.documents.indexes.models encryption_key: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] search_index_parameters: SearchIndexKnowledgeSourceParameters @overload @@ -5885,6 +6113,7 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ..., search_index_parameters: SearchIndexKnowledgeSourceParameters ) -> None: ... @@ -5892,8 +6121,88 @@ namespace azure.search.documents.indexes.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoost(_Model): + boost_instructions: Optional[str] + kind: str + + @overload + def __init__( + self, + *, + boost_instructions: Optional[str] = ..., + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceBoostKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIELD_VALUE = "fieldValue" + MULTI_WORD_EXPRESSION = "multiWordExpression" + + + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFieldValueBoost(SearchIndexKnowledgeSourceBoost, discriminator='fieldValue'): + boost: float + boost_instructions: str + field: str + field_values: Optional[list[str]] + kind: Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE] + + @overload + def __init__( + self, + *, + boost: float, + boost_instructions: Optional[str] = ..., + field: str, + field_values: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceFilterHint(_Model): + field: str + field_values: list[str] + filter_instructions: Optional[str] + + @overload + def __init__( + self, + *, + field: str, + field_values: list[str], + filter_instructions: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceMultiWordExpressionBoost(SearchIndexKnowledgeSourceBoost, discriminator='multiWordExpression'): + boost: float + boost_instructions: str + field_values: Optional[list[str]] + kind: Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION] + + @overload + def __init__( + self, + *, + boost: float, + boost_instructions: Optional[str] = ..., + field_values: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceParameters(_Model): base_filter: Optional[str] + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] search_fields: Optional[list[SearchIndexFieldReference]] search_index_name: str semantic_configuration_name: Optional[str] @@ -5904,6 +6213,7 @@ namespace azure.search.documents.indexes.models self, *, base_filter: Optional[str] = ..., + query_hints: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., search_fields: Optional[list[SearchIndexFieldReference]] = ..., search_index_name: str, semantic_configuration_name: Optional[str] = ..., @@ -5914,6 +6224,22 @@ namespace azure.search.documents.indexes.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.SearchIndexKnowledgeSourceQueryHints(_Model): + boosts: Optional[list[SearchIndexKnowledgeSourceBoost]] + filters: Optional[list[SearchIndexKnowledgeSourceFilterHint]] + + @overload + def __init__( + self, + *, + boosts: Optional[list[SearchIndexKnowledgeSourceBoost]] = ..., + filters: Optional[list[SearchIndexKnowledgeSourceFilterHint]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.indexes.models.SearchIndexPermissionFilterOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "disabled" ENABLED = "enabled" @@ -6463,6 +6789,7 @@ namespace azure.search.documents.indexes.models max_field_nesting_depth_per_index: Optional[int] max_fields_per_index: Optional[int] max_storage_per_index_in_bytes: Optional[int] + max_vector_index_size_per_index_in_bytes: Optional[int] @overload def __init__( @@ -6473,7 +6800,8 @@ namespace azure.search.documents.indexes.models max_cumulative_indexer_runtime_seconds: Optional[int] = ..., max_field_nesting_depth_per_index: Optional[int] = ..., max_fields_per_index: Optional[int] = ..., - max_storage_per_index_in_bytes: Optional[int] = ... + max_storage_per_index_in_bytes: Optional[int] = ..., + max_vector_index_size_per_index_in_bytes: Optional[int] = ... ) -> None: ... @overload @@ -7377,6 +7705,38 @@ namespace azure.search.documents.indexes.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest(_Model): + content: Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]] + metadata: FileUploadMetadata + + @overload + def __init__( + self, + *, + content: FileType, + metadata: FileUploadMetadata + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest(_Model): + content: Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]] + metadata: FileUploadMetadata + + @overload + def __init__( + self, + *, + content: FileType, + metadata: FileUploadMetadata + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.indexes.models.VectorEncodingFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): PACKED_BIT = "packedBit" @@ -7630,6 +7990,7 @@ namespace azure.search.documents.indexes.models encryption_key: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.WEB] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] web_parameters: Optional[WebKnowledgeSourceParameters] @overload @@ -7640,6 +8001,7 @@ namespace azure.search.documents.indexes.models e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ..., web_parameters: Optional[WebKnowledgeSourceParameters] = ... ) -> None: ... @@ -7742,6 +8104,8 @@ namespace azure.search.documents.indexes.models encryption_key: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.WORK_IQ] name: str + results_processing: Union[str, KnowledgeSourceResultsProcessing] + work_iq_parameters: WorkIQKnowledgeSourceParameters @overload def __init__( @@ -7750,260 +8114,2881 @@ namespace azure.search.documents.indexes.models description: Optional[str] = ..., e_tag: Optional[str] = ..., encryption_key: Optional[SearchResourceEncryptionKey] = ..., - name: str + name: str, + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ..., + work_iq_parameters: WorkIQKnowledgeSourceParameters ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... -namespace azure.search.documents.knowledgebases - - class azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): implements ContextManager + class azure.search.documents.indexes.models.WorkIQKnowledgeSourceParameters(_Model): + entra_app_authentication: EntraAppAuthentication + @overload def __init__( self, - endpoint: str, - credential: Union[AzureKeyCredential, TokenCredential], *, - api_version: Union[str, ApiVersion] = ..., - audience: Optional[str] = ..., - **kwargs: Any + entra_app_authentication: EntraAppAuthentication ) -> None: ... - def close(self) -> None: ... - @overload - def retrieve( - self, - retrieval_request: KnowledgeBaseRetrievalRequest, - *, - content_type: str = "application/json", - query_source_authorization: Optional[str] = ..., - **kwargs: Any - ) -> KnowledgeBaseRetrievalResponse: ... + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - @overload - def retrieve( - self, - retrieval_request: JSON, - *, - content_type: str = "application/json", - query_source_authorization: Optional[str] = ..., - **kwargs: Any - ) -> KnowledgeBaseRetrievalResponse: ... - @overload - def retrieve( - self, - retrieval_request: IO[bytes], - *, - content_type: str = "application/json", - query_source_authorization: Optional[str] = ..., - **kwargs: Any - ) -> KnowledgeBaseRetrievalResponse: ... +namespace azure.search.documents.indexes.types - def send_request( - self, - request: HttpRequest, - *, - stream: bool = False, - **kwargs: Any - ) -> HttpResponse: ... + class azure.search.documents.indexes.types.AIServicesAccountIdentity(TypedDict): + key "description": str + key "identity": Optional[SearchIndexerDataIdentity] + @odata.type: Required[Literal["#AIServicesByIdentity"]] + description: str + identity: SearchIndexerDataIdentity + odata_type: Literal[#AIServicesByIdentity] + subdomainUrl: Required[str] + subdomain_url: str -namespace azure.search.documents.knowledgebases.aio + class azure.search.documents.indexes.types.AIServicesAccountKey(TypedDict): + key "description": str + @odata.type: Required[Literal["#AIServicesByKey"]] + description: str + key: Required[str] + odata_type: Literal[#AIServicesByKey] + subdomainUrl: Required[str] + subdomain_url: str - class azure.search.documents.knowledgebases.aio.KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): implements AsyncContextManager - def __init__( - self, - endpoint: str, - credential: Union[AzureKeyCredential, AsyncTokenCredential], - *, - api_version: Union[str, ApiVersion] = ..., - audience: Optional[str] = ..., - **kwargs: Any - ) -> None: ... + class azure.search.documents.indexes.types.AIServicesVisionParameters(TypedDict, total=False): + key "apiKey": str + key "authIdentity": Optional[SearchIndexerDataIdentity] + api_key: str + auth_identity: SearchIndexerDataIdentity + modelVersion: Required[Optional[str]] + model_version: str + resourceUri: Required[str] + resource_uri: str - async def close(self) -> None: ... - @overload - async def retrieve( - self, - retrieval_request: KnowledgeBaseRetrievalRequest, - *, - content_type: str = "application/json", - query_source_authorization: Optional[str] = ..., - **kwargs: Any - ) -> KnowledgeBaseRetrievalResponse: ... + class azure.search.documents.indexes.types.AIServicesVisionVectorizer(TypedDict, total=False): + key "aiServicesVisionParameters": ForwardRef('AIServicesVisionParameters') + ai_services_vision_parameters: AIServicesVisionParameters + kind: Required[Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION]] + name: Required[str] + vectorizer_name: str - @overload - async def retrieve( - self, - retrieval_request: JSON, - *, - content_type: str = "application/json", - query_source_authorization: Optional[str] = ..., - **kwargs: Any - ) -> KnowledgeBaseRetrievalResponse: ... - @overload - async def retrieve( - self, - retrieval_request: IO[bytes], - *, - content_type: str = "application/json", - query_source_authorization: Optional[str] = ..., - **kwargs: Any - ) -> KnowledgeBaseRetrievalResponse: ... + class azure.search.documents.indexes.types.AnalyzeResult(TypedDict, total=False): + tokens: Required[list[AnalyzedTokenInfo]] - def send_request( - self, - request: HttpRequest, - *, - stream: bool = False, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: ... + class azure.search.documents.indexes.types.AnalyzeTextOptions(TypedDict, total=False): + key "analyzer": Union[str, LexicalAnalyzerName] + key "charFilters": list[Union[str, CharFilterName]] + key "normalizer": Union[str, LexicalNormalizerName] + key "tokenFilters": list[Union[str, TokenFilterName]] + key "tokenizer": Union[str, LexicalTokenizerName] + analyzer_name: Union[str, LexicalAnalyzerName] + char_filters: list[Union[str, CharFilterName]] + normalizer_name: Union[str, LexicalNormalizerName] + text: Required[str] + token_filters: list[Union[str, TokenFilterName]] + tokenizer_name: Union[str, LexicalTokenizerName] -namespace azure.search.documents.knowledgebases.models - class azure.search.documents.knowledgebases.models.AIServices(_Model): - api_key: Optional[str] - uri: str + class azure.search.documents.indexes.types.AnalyzedTokenInfo(TypedDict, total=False): + endOffset: Required[int] + end_offset: int + position: Required[int] + startOffset: Required[int] + start_offset: int + token: Required[str] - @overload - def __init__( - self, - *, - api_key: Optional[str] = ..., - uri: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.types.AsciiFoldingTokenFilter(TypedDict): + key "preserveOriginal": bool + @odata.type: Required[Literal["#AsciiFoldingTokenFilter"]] + name: Required[str] + odata_type: Literal[#AsciiFoldingTokenFilter] + preserve_original: bool - class azure.search.documents.knowledgebases.models.AssetStore(_Model): + class azure.search.documents.indexes.types.AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): + key "applicationSecret": str + applicationId: Required[str] + application_id: str + application_secret: str + + + class azure.search.documents.indexes.types.AzureBlobKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + azureBlobParameters: Required[AzureBlobKnowledgeSourceParameters] + azure_blob_parameters: AzureBlobKnowledgeSourceParameters + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + kind: Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.AzureBlobKnowledgeSourceParameters(TypedDict, total=False): + key "createdResources": ForwardRef('CreatedResources') + key "folderPath": Optional[str] + key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] + key "isADLSGen2": bool + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + connectionString: Required[str] connection_string: str + containerName: Required[str] container_name: str + created_resources: CreatedResources + folder_path: str + ingestion_parameters: KnowledgeSourceIngestionParameters + is_adls_gen2: bool + query_hints: SearchIndexKnowledgeSourceQueryHints + + + class azure.search.documents.indexes.types.AzureMachineLearningParameters(TypedDict, total=False): + key "key": Optional[str] + key "modelName": Union[str, AIFoundryModelCatalogName] + key "region": Optional[str] + key "resourceId": Optional[str] + key "timeout": Optional[str] + authentication_key: str + model_name: Union[str, AIFoundryModelCatalogName] + region: str + resource_id: str + scoring_uri: str + timeout: str + uri: Required[Optional[str]] + + + class azure.search.documents.indexes.types.AzureMachineLearningSkill(TypedDict): + key "context": str + key "degreeOfParallelism": Optional[int] + key "description": str + key "key": Optional[str] + key "name": str + key "region": Optional[str] + key "resourceId": Optional[str] + key "timeout": Optional[str] + key "uri": Optional[str] + @odata.type: Required[Literal["#AmlSkill"]] + authentication_key: str + context: str + degree_of_parallelism: int + description: str + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#AmlSkill] + outputs: Required[list[OutputFieldMappingEntry]] + region: str + resource_id: str + scoring_uri: str + timeout: str - @overload - def __init__( - self, - *, - connection_string: str, - container_name: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.types.AzureMachineLearningVectorizer(TypedDict, total=False): + key "amlParameters": ForwardRef('AzureMachineLearningParameters') + aml_parameters: AzureMachineLearningParameters + kind: Required[Literal[VectorSearchVectorizerKind.AML]] + name: Required[str] + vectorizer_name: str - class azure.search.documents.knowledgebases.models.AzureBlobKnowledgeSourceParams(KnowledgeSourceParams, discriminator='azureBlob'): - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool - kind: Literal[KnowledgeSourceKind.AZURE_BLOB] - knowledge_source_name: str - max_output_documents: int - reranker_threshold: float + class azure.search.documents.indexes.types.AzureOpenAIEmbeddingSkill(TypedDict): + key "apiKey": str + key "authIdentity": ForwardRef('SearchIndexerDataIdentity') + key "context": str + key "deploymentId": str + key "description": str + key "dimensions": Optional[int] + key "modelName": Union[str, AzureOpenAIModelName] + key "name": str + key "resourceUri": str + @odata.type: Required[Literal["#AzureOpenAIEmbeddingSkill"]] + api_key: str + auth_identity: SearchIndexerDataIdentity + context: str + deployment_name: str + description: str + dimensions: int + inputs: Required[list[InputFieldMappingEntry]] + model_name: Union[str, AzureOpenAIModelName] + name: str + odata_type: Literal[#AzureOpenAIEmbeddingSkill] + outputs: Required[list[OutputFieldMappingEntry]] + resource_url: str - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.types.AzureOpenAITokenizerParameters(TypedDict, total=False): + key "allowedSpecialTokens": list[str] + key "encoderModelName": Optional[Union[str, SplitSkillEncoderModelName]] + allowed_special_tokens: list[str] + encoder_model_name: Union[str, SplitSkillEncoderModelName] - class azure.search.documents.knowledgebases.models.CompletedSynchronizationState(_Model): - end_time: datetime - items_skipped: int - items_updates_failed: int - items_updates_processed: int - start_time: datetime + class azure.search.documents.indexes.types.AzureOpenAIVectorizer(TypedDict, total=False): + key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters') + kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + name: Required[str] + parameters: AzureOpenAIVectorizerParameters + vectorizer_name: str - @overload - def __init__( - self, - *, - end_time: datetime, - items_skipped: int, - items_updates_failed: int, - items_updates_processed: int, - start_time: datetime - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.types.AzureOpenAIVectorizerParameters(TypedDict, total=False): + key "apiKey": str + key "authIdentity": ForwardRef('SearchIndexerDataIdentity') + key "deploymentId": str + key "modelName": Union[str, AzureOpenAIModelName] + key "resourceUri": str + api_key: str + auth_identity: SearchIndexerDataIdentity + deployment_name: str + model_name: Union[str, AzureOpenAIModelName] + resource_url: str - class azure.search.documents.knowledgebases.models.FabricDataAgentKnowledgeSourceParams(KnowledgeSourceParams, discriminator='fabricDataAgent'): - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool - kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] - knowledge_source_name: str - max_output_documents: int - reranker_threshold: float + class azure.search.documents.indexes.types.BM25SimilarityAlgorithm(TypedDict): + key "b": Optional[float] + key "k1": Optional[float] + @odata.type: Required[Literal["#BM25Similarity"]] + b: float + k1: float + odata_type: Literal[#BM25Similarity] - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.indexes.types.BinaryQuantizationCompression(TypedDict, total=False): + key "rescoringOptions": Optional[RescoringOptions] + key "truncationDimension": Optional[int] + compression_name: str + kind: Required[Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION]] + name: Required[str] + rescoring_options: RescoringOptions + truncation_dimension: int - class azure.search.documents.knowledgebases.models.FabricOntologyKnowledgeSourceParams(KnowledgeSourceParams, discriminator='fabricOntology'): - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool - kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] - knowledge_source_name: str - max_output_documents: int - reranker_threshold: float + class azure.search.documents.indexes.types.ChatCompletionCommonModelParameters(TypedDict, total=False): + key "frequencyPenalty": Optional[float] + key "maxTokens": Optional[int] + key "model": Optional[str] + key "presencePenalty": Optional[float] + key "seed": Optional[int] + key "stop": Optional[list[str]] + key "temperature": Optional[float] + frequency_penalty: float + max_tokens: int + model_name: str + presence_penalty: float + seed: int + stop: list[str] + temperature: float + + + class azure.search.documents.indexes.types.ChatCompletionResponseFormat(TypedDict, total=False): + key "jsonSchemaProperties": Optional[ChatCompletionSchemaProperties] + key "type": Union[str, ChatCompletionResponseFormatType] + json_schema_properties: ChatCompletionSchemaProperties + type: Union[str, ChatCompletionResponseFormatType] + + + class azure.search.documents.indexes.types.ChatCompletionSchema(TypedDict, total=False): + key "additionalProperties": bool + key "properties": str + key "required": list[str] + key "type": str + additional_properties: bool + properties: str + required: list[str] + type: str - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... + + class azure.search.documents.indexes.types.ChatCompletionSchemaProperties(TypedDict, total=False): + key "description": Optional[str] + key "name": Optional[str] + key "schema": ForwardRef('ChatCompletionSchema') + key "strict": bool + description: str + name: str + schema: ChatCompletionSchema + strict: bool + + + class azure.search.documents.indexes.types.ChatCompletionSkill(TypedDict): + key "apiKey": str + key "authIdentity": Optional[SearchIndexerDataIdentity] + key "commonModelParameters": ForwardRef('ChatCompletionCommonModelParameters') + key "context": str + key "description": str + key "extraParameters": Optional[dict[str, Any]] + key "extraParametersBehavior": Union[str, ChatCompletionExtraParametersBehavior] + key "name": str + key "responseFormat": ForwardRef('ChatCompletionResponseFormat') + @odata.type: Required[Literal["#ChatCompletionSkill"]] + api_key: str + auth_identity: SearchIndexerDataIdentity + common_model_parameters: ChatCompletionCommonModelParameters + context: str + description: str + extra_parameters: dict[str, Any] + extra_parameters_behavior: Union[str, ChatCompletionExtraParametersBehavior] + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#ChatCompletionSkill] + outputs: Required[list[OutputFieldMappingEntry]] + response_format: ChatCompletionResponseFormat + uri: Required[str] + + + class azure.search.documents.indexes.types.CjkBigramTokenFilter(TypedDict): + key "ignoreScripts": list[Union[str, CjkBigramTokenFilterScripts]] + key "outputUnigrams": bool + @odata.type: Required[Literal["#CjkBigramTokenFilter"]] + ignore_scripts: list[Union[str, CjkBigramTokenFilterScripts]] + name: Required[str] + odata_type: Literal[#CjkBigramTokenFilter] + output_unigrams: bool + + + class azure.search.documents.indexes.types.ClassicSimilarityAlgorithm(TypedDict): + @odata.type: Required[Literal["#ClassicSimilarity"]] + odata_type: Literal[#ClassicSimilarity] + + + class azure.search.documents.indexes.types.ClassicTokenizer(TypedDict): + key "maxTokenLength": int + @odata.type: Required[Literal["#ClassicTokenizer"]] + max_token_length: int + name: Required[str] + odata_type: Literal[#ClassicTokenizer] + + + class azure.search.documents.indexes.types.CognitiveServicesAccountKey(TypedDict): + key "description": str + @odata.type: Required[Literal["#CognitiveServicesByKey"]] + description: str + key: Required[str] + odata_type: Literal[#CognitiveServicesByKey] + + + class azure.search.documents.indexes.types.CommonGramTokenFilter(TypedDict): + key "ignoreCase": bool + key "queryMode": bool + @odata.type: Required[Literal["#CommonGramTokenFilter"]] + commonWords: Required[list[str]] + common_words: list[str] + ignore_case: bool + name: Required[str] + odata_type: Literal[#CommonGramTokenFilter] + use_query_mode: bool + + + class azure.search.documents.indexes.types.ConditionalSkill(TypedDict): + key "context": str + key "description": str + key "name": str + @odata.type: Required[Literal["#ConditionalSkill"]] + context: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#ConditionalSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.ContentColumnMapping(TypedDict, total=False): + name: Required[str] + searchFieldType: Required[str] + search_field_type: str + sourceField: Required[str] + source_field: str + + + class azure.search.documents.indexes.types.ContentUnderstandingSkill(TypedDict): + key "chunkingProperties": Optional[ContentUnderstandingSkillChunkingProperties] + key "context": str + key "description": str + key "extractionOptions": Optional[list[Union[str, ContentUnderstandingSkillExtractionOptions]]] + key "name": str + @odata.type: Required[Literal["#ContentUnderstandingSkill"]] + chunking_properties: ContentUnderstandingSkillChunkingProperties + context: str + description: str + extraction_options: list[Union[str, ContentUnderstandingSkillExtractionOptions]] + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#ContentUnderstandingSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.ContentUnderstandingSkillChunkingProperties(TypedDict, total=False): + key "maximumLength": Optional[int] + key "method": Union[str, ContentUnderstandingSkillChunkingMethod] + key "overlapLength": Optional[int] + key "unit": Optional[Union[str, ContentUnderstandingSkillChunkingUnit]] + maximum_length: int + method: Union[str, ContentUnderstandingSkillChunkingMethod] + overlap_length: int + unit: Union[str, ContentUnderstandingSkillChunkingUnit] + + + class azure.search.documents.indexes.types.CorsOptions(TypedDict, total=False): + key "maxAgeInSeconds": Optional[int] + allowedOrigins: Required[list[str]] + allowed_origins: list[str] + max_age_in_seconds: int + + + class azure.search.documents.indexes.types.CreatedResources(TypedDict, total=False): + + + class azure.search.documents.indexes.types.CustomAnalyzer(TypedDict): + key "charFilters": list[Union[str, CharFilterName]] + key "tokenFilters": list[Union[str, TokenFilterName]] + @odata.type: Required[Literal["#CustomAnalyzer"]] + char_filters: list[Union[str, CharFilterName]] + name: Required[str] + odata_type: Literal[#CustomAnalyzer] + token_filters: list[Union[str, TokenFilterName]] + tokenizer: Required[Union[str, LexicalTokenizerName]] + tokenizer_name: Union[str, LexicalTokenizerName] + + + class azure.search.documents.indexes.types.CustomEntity(TypedDict, total=False): + key "accentSensitive": Optional[bool] + key "aliases": Optional[list[CustomEntityAlias]] + key "caseSensitive": Optional[bool] + key "defaultAccentSensitive": Optional[bool] + key "defaultCaseSensitive": Optional[bool] + key "defaultFuzzyEditDistance": Optional[int] + key "description": Optional[str] + key "fuzzyEditDistance": Optional[int] + key "id": Optional[str] + key "subtype": Optional[str] + key "type": Optional[str] + accent_sensitive: bool + aliases: list[CustomEntityAlias] + case_sensitive: bool + default_accent_sensitive: bool + default_case_sensitive: bool + default_fuzzy_edit_distance: int + description: str + fuzzy_edit_distance: int + id: str + name: Required[str] + subtype: str + type: str + + + class azure.search.documents.indexes.types.CustomEntityAlias(TypedDict, total=False): + key "accentSensitive": Optional[bool] + key "caseSensitive": Optional[bool] + key "fuzzyEditDistance": Optional[int] + accent_sensitive: bool + case_sensitive: bool + fuzzy_edit_distance: int + text: Required[str] + + + class azure.search.documents.indexes.types.CustomEntityLookupSkill(TypedDict): + key "context": str + key "defaultLanguageCode": Optional[Union[str, CustomEntityLookupSkillLanguage]] + key "description": str + key "entitiesDefinitionUri": Optional[str] + key "globalDefaultAccentSensitive": Optional[bool] + key "globalDefaultCaseSensitive": Optional[bool] + key "globalDefaultFuzzyEditDistance": Optional[int] + key "inlineEntitiesDefinition": Optional[list[CustomEntity]] + key "name": str + @odata.type: Required[Literal["#CustomEntityLookupSkill"]] + context: str + default_language_code: Union[str, CustomEntityLookupSkillLanguage] + description: str + entities_definition_uri: str + global_default_accent_sensitive: bool + global_default_case_sensitive: bool + global_default_fuzzy_edit_distance: int + inline_entities_definition: list[CustomEntity] + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#CustomEntityLookupSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.CustomNormalizer(TypedDict): + key "charFilters": list[Union[str, CharFilterName]] + key "tokenFilters": list[Union[str, TokenFilterName]] + @odata.type: Required[Literal["#CustomNormalizer"]] + char_filters: list[Union[str, CharFilterName]] + name: Required[str] + odata_type: Literal[#CustomNormalizer] + token_filters: list[Union[str, TokenFilterName]] + + + class azure.search.documents.indexes.types.DataSourceCredentials(TypedDict, total=False): + key "connectionString": str + connection_string: str + + + class azure.search.documents.indexes.types.DefaultCognitiveServicesAccount(TypedDict): + key "description": str + @odata.type: Required[Literal["#DefaultCognitiveServices"]] + description: str + odata_type: Literal[#DefaultCognitiveServices] + + + class azure.search.documents.indexes.types.DictionaryDecompounderTokenFilter(TypedDict): + key "maxSubwordSize": int + key "minSubwordSize": int + key "minWordSize": int + key "onlyLongestMatch": bool + @odata.type: Required[Literal["#DictionaryDecompounderTokenFilter"]] + max_subword_size: int + min_subword_size: int + min_word_size: int + name: Required[str] + odata_type: Literal[#DictionaryDecompounderTokenFilter] + only_longest_match: bool + wordList: Required[list[str]] + word_list: list[str] + + + class azure.search.documents.indexes.types.DistanceScoringFunction(TypedDict, total=False): + key "interpolation": Union[str, ScoringFunctionInterpolation] + boost: Required[float] + distance: Required[DistanceScoringParameters] + fieldName: Required[str] + field_name: str + interpolation: Union[str, ScoringFunctionInterpolation] + parameters: DistanceScoringParameters + type: Required[Literal["distance"]] + + + class azure.search.documents.indexes.types.DistanceScoringParameters(TypedDict, total=False): + boostingDistance: Required[float] + boosting_distance: float + referencePointParameter: Required[str] + reference_point_parameter: str + + + class azure.search.documents.indexes.types.DocumentExtractionSkill(TypedDict): + key "configuration": Optional[dict[str, Any]] + key "context": str + key "dataToExtract": Optional[str] + key "description": str + key "name": str + key "parsingMode": Optional[str] + @odata.type: Required[Literal["#DocumentExtractionSkill"]] + configuration: dict[str, Any] + context: str + data_to_extract: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#DocumentExtractionSkill] + outputs: Required[list[OutputFieldMappingEntry]] + parsing_mode: str + + + class azure.search.documents.indexes.types.DocumentIntelligenceLayoutSkill(TypedDict): + key "chunkingProperties": Optional[DocumentIntelligenceLayoutSkillChunkingProperties] + key "context": str + key "description": str + key "extractionOptions": Optional[list[Union[str, DocumentIntelligenceLayoutSkillExtractionOptions]]] + key "markdownHeaderDepth": Optional[Union[str, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth]] + key "name": str + key "outputFormat": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputFormat]] + key "outputMode": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputMode]] + @odata.type: Required[Literal["#DocumentIntelligenceLayoutSkill"]] + chunking_properties: DocumentIntelligenceLayoutSkillChunkingProperties + context: str + description: str + extraction_options: list[Union[str, DocumentIntelligenceLayoutSkillExtractionOptions]] + inputs: Required[list[InputFieldMappingEntry]] + markdown_header_depth: Union[str, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth] + name: str + odata_type: Literal[#DocumentIntelligenceLayoutSkill] + output_format: Union[str, DocumentIntelligenceLayoutSkillOutputFormat] + output_mode: Union[str, DocumentIntelligenceLayoutSkillOutputMode] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.DocumentIntelligenceLayoutSkillChunkingProperties(TypedDict, total=False): + key "maximumLength": Optional[int] + key "overlapLength": Optional[int] + key "unit": Optional[Union[str, DocumentIntelligenceLayoutSkillChunkingUnit]] + maximum_length: int + overlap_length: int + unit: Union[str, DocumentIntelligenceLayoutSkillChunkingUnit] + + + class azure.search.documents.indexes.types.DocumentKeysOrIds(TypedDict, total=False): + key "datasourceDocumentIds": list[str] + key "documentKeys": list[str] + datasource_document_ids: list[str] + document_keys: list[str] + + + class azure.search.documents.indexes.types.EdgeNGramTokenFilter(TypedDict): + key "maxGram": int + key "minGram": int + key "side": Union[str, EdgeNGramTokenFilterSide] + @odata.type: Required[Literal["#EdgeNGramTokenFilter"]] + max_gram: int + min_gram: int + name: Required[str] + odata_type: Literal[#EdgeNGramTokenFilter] + side: Union[str, EdgeNGramTokenFilterSide] + + + class azure.search.documents.indexes.types.EdgeNGramTokenFilterV2(TypedDict): + key "maxGram": int + key "minGram": int + key "side": Union[str, EdgeNGramTokenFilterSide] + @odata.type: Required[Literal["#EdgeNGramTokenFilterV2"]] + max_gram: int + min_gram: int + name: Required[str] + odata_type: Literal[#EdgeNGramTokenFilterV2] + side: Union[str, EdgeNGramTokenFilterSide] + + + class azure.search.documents.indexes.types.EdgeNGramTokenizer(TypedDict): + key "maxGram": int + key "minGram": int + key "tokenChars": list[Union[str, TokenCharacterKind]] + @odata.type: Required[Literal["#EdgeNGramTokenizer"]] + max_gram: int + min_gram: int + name: Required[str] + odata_type: Literal[#EdgeNGramTokenizer] + token_chars: list[Union[str, TokenCharacterKind]] + + + class azure.search.documents.indexes.types.ElisionTokenFilter(TypedDict): + key "articles": list[str] + @odata.type: Required[Literal["#ElisionTokenFilter"]] + articles: list[str] + name: Required[str] + odata_type: Literal[#ElisionTokenFilter] + + + class azure.search.documents.indexes.types.EmbeddingColumnMapping(TypedDict, total=False): + name: Required[str] + sourceField: Required[str] + source_field: str + + + class azure.search.documents.indexes.types.EntityLinkingSkill(TypedDict): + key "context": str + key "defaultLanguageCode": Optional[str] + key "description": str + key "minimumPrecision": float + key "modelVersion": Optional[str] + key "name": str + @odata.type: Required[Literal["#EntityLinkingSkill"]] + context: str + default_language_code: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + minimum_precision: float + model_version: str + name: str + odata_type: Literal[#EntityLinkingSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.EntityRecognitionSkillV3(TypedDict): + key "categories": list[Union[str, EntityCategory]] + key "context": str + key "defaultLanguageCode": Optional[Union[str, EntityRecognitionSkillLanguage]] + key "description": str + key "minimumPrecision": float + key "modelVersion": Optional[str] + key "name": str + @odata.type: Required[Literal["#EntityRecognitionSkill"]] + categories: list[Union[str, EntityCategory]] + context: str + default_language_code: Union[str, EntityRecognitionSkillLanguage] + description: str + inputs: Required[list[InputFieldMappingEntry]] + minimum_precision: float + model_version: str + name: str + odata_type: Literal[#EntityRecognitionSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.EntraAppAuthentication(TypedDict, total=False): + key "tenantId": str + applicationId: Required[str] + application_id: str + federatedCredentialId: Required[str] + federated_credential_id: str + tenant_id: str + + + class azure.search.documents.indexes.types.ExhaustiveKnnAlgorithmConfiguration(TypedDict, total=False): + key "exhaustiveKnnParameters": ForwardRef('ExhaustiveKnnParameters') + kind: Required[Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN]] + name: Required[str] + parameters: ExhaustiveKnnParameters + + + class azure.search.documents.indexes.types.ExhaustiveKnnParameters(TypedDict, total=False): + key "metric": Optional[Union[str, VectorSearchAlgorithmMetric]] + metric: Union[str, VectorSearchAlgorithmMetric] + + + class azure.search.documents.indexes.types.FabricDataAgentKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + fabricDataAgentParameters: Required[FabricDataAgentKnowledgeSourceParameters] + fabric_data_agent_parameters: FabricDataAgentKnowledgeSourceParameters + kind: Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): + dataAgentId: Required[str] + data_agent_id: str + workspaceId: Required[str] + workspace_id: str + + + class azure.search.documents.indexes.types.FabricOntologyKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + fabricOntologyParameters: Required[FabricOntologyKnowledgeSourceParameters] + fabric_ontology_parameters: FabricOntologyKnowledgeSourceParameters + kind: Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.FabricOntologyKnowledgeSourceParameters(TypedDict, total=False): + ontologyId: Required[str] + ontology_id: str + workspaceId: Required[str] + workspace_id: str + + + class azure.search.documents.indexes.types.FieldMapping(TypedDict, total=False): + key "mappingFunction": Optional[FieldMappingFunction] + key "targetFieldName": str + mapping_function: FieldMappingFunction + sourceFieldName: Required[str] + source_field_name: str + target_field_name: str + + + class azure.search.documents.indexes.types.FieldMappingFunction(TypedDict, total=False): + key "parameters": Optional[dict[str, Any]] + name: Required[str] + parameters: dict[str, Any] + + + class azure.search.documents.indexes.types.FileKnowledgeSource(TypedDict): + key "@odata.etag": str + key "corsOptions": ForwardRef('CorsOptions') + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + cors_options: CorsOptions + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + fileParameters: Required[FileKnowledgeSourceParameters] + file_parameters: FileKnowledgeSourceParameters + kind: Required[Literal[KnowledgeSourceKind.FILE]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.FileKnowledgeSourceParameters(TypedDict, total=False): + key "createdResources": ForwardRef('CreatedResources') + key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters') + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + created_resources: CreatedResources + ingestion_parameters: KnowledgeSourceIngestionParameters + query_hints: SearchIndexKnowledgeSourceQueryHints + + + class azure.search.documents.indexes.types.FileUploadMetadata(TypedDict, total=False): + key "fileName": str + key "metadata": dict[str, str] + file_name: str + metadata: dict[str, str] + + + class azure.search.documents.indexes.types.FreshnessScoringFunction(TypedDict, total=False): + key "interpolation": Union[str, ScoringFunctionInterpolation] + boost: Required[float] + fieldName: Required[str] + field_name: str + freshness: Required[FreshnessScoringParameters] + interpolation: Union[str, ScoringFunctionInterpolation] + parameters: FreshnessScoringParameters + type: Required[Literal["freshness"]] + + + class azure.search.documents.indexes.types.FreshnessScoringParameters(TypedDict, total=False): + boostingDuration: Required[str] + boosting_duration: str + + + class azure.search.documents.indexes.types.GetIndexStatisticsResult(TypedDict, total=False): + documentCount: Required[int] + document_count: int + storageSize: Required[int] + storage_size: int + vectorIndexSize: Required[int] + vector_index_size: int + + + class azure.search.documents.indexes.types.HighWaterMarkChangeDetectionPolicy(TypedDict): + @odata.type: Required[Literal["#HighWaterMarkChangeDetectionPolicy"]] + highWaterMarkColumnName: Required[str] + high_water_mark_column_name: str + odata_type: Literal[#HighWaterMarkChangeDetectionPolicy] + + + class azure.search.documents.indexes.types.HnswAlgorithmConfiguration(TypedDict, total=False): + key "hnswParameters": ForwardRef('HnswParameters') + kind: Required[Literal[VectorSearchAlgorithmKind.HNSW]] + name: Required[str] + parameters: HnswParameters + + + class azure.search.documents.indexes.types.HnswParameters(TypedDict, total=False): + key "efConstruction": int + key "efSearch": int + key "m": int + key "metric": Optional[Union[str, VectorSearchAlgorithmMetric]] + ef_construction: int + ef_search: int + m: int + metric: Union[str, VectorSearchAlgorithmMetric] + + + class azure.search.documents.indexes.types.ImageAnalysisSkill(TypedDict): + key "context": str + key "defaultLanguageCode": Union[str, ImageAnalysisSkillLanguage] + key "description": str + key "details": list[Union[str, ImageDetail]] + key "name": str + key "visualFeatures": list[Union[str, VisualFeature]] + @odata.type: Required[Literal["#ImageAnalysisSkill"]] + context: str + default_language_code: Union[str, ImageAnalysisSkillLanguage] + description: str + details: list[Union[str, ImageDetail]] + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#ImageAnalysisSkill] + outputs: Required[list[OutputFieldMappingEntry]] + visual_features: list[Union[str, VisualFeature]] + + + class azure.search.documents.indexes.types.IndexedOneLakeKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + indexedOneLakeParameters: Required[IndexedOneLakeKnowledgeSourceParameters] + indexed_one_lake_parameters: IndexedOneLakeKnowledgeSourceParameters + kind: Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): + key "createdResources": ForwardRef('CreatedResources') + key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters') + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "targetPath": Optional[str] + created_resources: CreatedResources + fabricWorkspaceId: Required[str] + fabric_workspace_id: str + ingestion_parameters: KnowledgeSourceIngestionParameters + lakehouseId: Required[str] + lakehouse_id: str + query_hints: SearchIndexKnowledgeSourceQueryHints + target_path: str + + + class azure.search.documents.indexes.types.IndexedSharePointKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + indexedSharePointParameters: Required[IndexedSharePointKnowledgeSourceParameters] + indexed_share_point_parameters: IndexedSharePointKnowledgeSourceParameters + kind: Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): + key "createdResources": ForwardRef('CreatedResources') + key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] + key "query": Optional[str] + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + connectionString: Required[str] + connection_string: str + containerName: Required[Union[str, IndexedSharePointContainerName]] + container_name: Union[str, IndexedSharePointContainerName] + created_resources: CreatedResources + ingestion_parameters: KnowledgeSourceIngestionParameters + query: str + query_hints: SearchIndexKnowledgeSourceQueryHints + + + class azure.search.documents.indexes.types.IndexedSqlKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + indexedSqlParameters: Required[IndexedSqlKnowledgeSourceParameters] + indexed_sql_parameters: IndexedSqlKnowledgeSourceParameters + kind: Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.IndexedSqlKnowledgeSourceParameters(TypedDict, total=False): + key "contentColumns": list[ContentColumnMapping] + key "createdResources": ForwardRef('CreatedResources') + key "embeddingColumns": list[EmbeddingColumnMapping] + key "highWaterMarkColumnName": str + key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters') + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + connectionString: Required[str] + connection_string: str + content_columns: list[ContentColumnMapping] + created_resources: CreatedResources + embedding_columns: list[EmbeddingColumnMapping] + high_water_mark_column_name: str + ingestion_parameters: KnowledgeSourceIngestionParameters + query_hints: SearchIndexKnowledgeSourceQueryHints + tableOrView: Required[str] + table_or_view: str + + + class azure.search.documents.indexes.types.IndexerResyncBody(TypedDict, total=False): + key "options": Optional[list[Union[str, IndexerResyncOption]]] + options: list[Union[str, IndexerResyncOption]] + + + class azure.search.documents.indexes.types.IndexingParameters(TypedDict, total=False): + key "batchSize": Optional[int] + key "configuration": ForwardRef('IndexingParametersConfiguration') + key "maxFailedItems": Optional[int] + key "maxFailedItemsPerBatch": Optional[int] + batch_size: int + configuration: IndexingParametersConfiguration + max_failed_items: int + max_failed_items_per_batch: int + + + class azure.search.documents.indexes.types.IndexingParametersConfiguration(TypedDict, total=False): + key "allowSkillsetToReadFileData": bool + key "dataToExtract": Union[str, BlobIndexerDataToExtract] + key "delimitedTextDelimiter": str + key "delimitedTextHeaders": str + key "documentRoot": str + key "excludedFileNameExtensions": str + key "executionEnvironment": Union[str, IndexerExecutionEnvironment] + key "failOnUnprocessableDocument": bool + key "failOnUnsupportedContentType": bool + key "firstLineContainsHeaders": bool + key "imageAction": Union[str, BlobIndexerImageAction] + key "indexStorageMetadataOnlyForOversizedDocuments": bool + key "indexedFileNameExtensions": str + key "markdownHeaderDepth": Optional[Union[str, MarkdownHeaderDepth]] + key "markdownParsingSubmode": Optional[Union[str, MarkdownParsingSubmode]] + key "parsingMode": Union[str, BlobIndexerParsingMode] + key "pdfTextRotationAlgorithm": Union[str, BlobIndexerPDFTextRotationAlgorithm] + key "queryTimeout": str + allow_skillset_to_read_file_data: bool + data_to_extract: Union[str, BlobIndexerDataToExtract] + delimited_text_delimiter: str + delimited_text_headers: str + document_root: str + excluded_file_name_extensions: str + execution_environment: Union[str, IndexerExecutionEnvironment] + fail_on_unprocessable_document: bool + fail_on_unsupported_content_type: bool + first_line_contains_headers: bool + image_action: Union[str, BlobIndexerImageAction] + index_storage_metadata_only_for_oversized_documents: bool + indexed_file_name_extensions: str + markdown_header_depth: Union[str, MarkdownHeaderDepth] + markdown_parsing_submode: Union[str, MarkdownParsingSubmode] + parsing_mode: Union[str, BlobIndexerParsingMode] + pdf_text_rotation_algorithm: Union[str, BlobIndexerPDFTextRotationAlgorithm] + query_timeout: str + + + class azure.search.documents.indexes.types.IndexingSchedule(TypedDict, total=False): + key "startTime": str + interval: Required[str] + start_time: str + + + class azure.search.documents.indexes.types.InputFieldMappingEntry(TypedDict, total=False): + key "inputs": list[InputFieldMappingEntry] + key "source": str + key "sourceContext": str + inputs: list[InputFieldMappingEntry] + name: Required[str] + source: str + source_context: str + + + class azure.search.documents.indexes.types.KeepTokenFilter(TypedDict): + key "keepWordsCase": bool + @odata.type: Required[Literal["#KeepTokenFilter"]] + keepWords: Required[list[str]] + keep_words: list[str] + lower_case_keep_words: bool + name: Required[str] + odata_type: Literal[#KeepTokenFilter] + + + class azure.search.documents.indexes.types.KeyPhraseExtractionSkill(TypedDict): + key "context": str + key "defaultLanguageCode": Union[str, KeyPhraseExtractionSkillLanguage] + key "description": str + key "maxKeyPhraseCount": Optional[int] + key "modelVersion": Optional[str] + key "name": str + @odata.type: Required[Literal["#KeyPhraseExtractionSkill"]] + context: str + default_language_code: Union[str, KeyPhraseExtractionSkillLanguage] + description: str + inputs: Required[list[InputFieldMappingEntry]] + max_key_phrase_count: int + model_version: str + name: str + odata_type: Literal[#KeyPhraseExtractionSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.KeywordMarkerTokenFilter(TypedDict): + key "ignoreCase": bool + @odata.type: Required[Literal["#KeywordMarkerTokenFilter"]] + ignore_case: bool + keywords: Required[list[str]] + name: Required[str] + odata_type: Literal[#KeywordMarkerTokenFilter] + + + class azure.search.documents.indexes.types.KeywordTokenizer(TypedDict): + key "bufferSize": int + @odata.type: Required[Literal["#KeywordTokenizer"]] + buffer_size: int + name: Required[str] + odata_type: Literal[#KeywordTokenizer] + + + class azure.search.documents.indexes.types.KeywordTokenizerV2(TypedDict): + key "maxTokenLength": int + @odata.type: Required[Literal["#KeywordTokenizerV2"]] + max_token_length: int + name: Required[str] + odata_type: Literal[#KeywordTokenizerV2] + + + class azure.search.documents.indexes.types.KnowledgeBase(TypedDict): + key "@odata.etag": str + key "answerInstructions": str + key "corsOptions": ForwardRef('CorsOptions') + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "models": list[KnowledgeBaseModel] + key "outputMode": Union[str, KnowledgeRetrievalOutputMode] + key "retrievalInstructions": str + key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort') + key "retrieveDefaults": ForwardRef('KnowledgeBaseRetrieveDefaults') + key "tags": dict[str, str] + answer_instructions: str + cors_options: CorsOptions + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + knowledgeSources: Required[list[KnowledgeSourceReference]] + knowledge_sources: list[KnowledgeSourceReference] + models: list[KnowledgeBaseModel] + name: Required[str] + output_mode: Union[str, KnowledgeRetrievalOutputMode] + retrieval_instructions: str + retrieval_reasoning_effort: KnowledgeRetrievalReasoningEffort + retrieve_defaults: KnowledgeBaseRetrieveDefaults + tags: dict[str, str] + + + class azure.search.documents.indexes.types.KnowledgeBaseAzureOpenAIModel(TypedDict, total=False): + azureOpenAIParameters: Required[AzureOpenAIVectorizerParameters] + azure_open_ai_parameters: AzureOpenAIVectorizerParameters + kind: Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] + + + class azure.search.documents.indexes.types.KnowledgeBaseModel(TypedDict, total=False): + azureOpenAIParameters: Required[AzureOpenAIVectorizerParameters] + azure_open_ai_parameters: AzureOpenAIVectorizerParameters + kind: Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] + + + class azure.search.documents.indexes.types.KnowledgeBaseModelKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_OPEN_AI = "azureOpenAI" + + + class azure.search.documents.indexes.types.KnowledgeBaseRetrieveDefaults(TypedDict, total=False): + key "maxOutputDocuments": int + key "maxOutputSizeInTokens": int + key "maxRuntimeInSeconds": int + max_output_documents: int + max_output_size_in_tokens: int + max_runtime_in_seconds: int + + + class azure.search.documents.indexes.types.KnowledgeSourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_BLOB = "azureBlob" + FABRIC_DATA_AGENT = "fabricDataAgent" + FABRIC_ONTOLOGY = "fabricOntology" + FILE = "file" + INDEXED_ONELAKE = "indexedOneLake" + INDEXED_SHARE_POINT = "indexedSharePoint" + INDEXED_SQL = "indexedSql" + MCP_SERVER = "mcpServer" + REMOTE_SHARE_POINT = "remoteSharePoint" + SEARCH_INDEX = "searchIndex" + WEB = "web" + WORK_IQ = "workIQ" + + + class azure.search.documents.indexes.types.KnowledgeSourceReference(TypedDict, total=False): + key "enableFreshness": bool + key "enableImageServing": bool + enable_freshness: bool + enable_image_serving: bool + name: Required[str] + + + class azure.search.documents.indexes.types.LanguageDetectionSkill(TypedDict): + key "context": str + key "defaultCountryHint": Optional[str] + key "description": str + key "modelVersion": Optional[str] + key "name": str + @odata.type: Required[Literal["#LanguageDetectionSkill"]] + context: str + default_country_hint: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + model_version: str + name: str + odata_type: Literal[#LanguageDetectionSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.LengthTokenFilter(TypedDict): + key "max": int + key "min": int + @odata.type: Required[Literal["#LengthTokenFilter"]] + max_length: int + min_length: int + name: Required[str] + odata_type: Literal[#LengthTokenFilter] + + + class azure.search.documents.indexes.types.LexicalNormalizer(TypedDict): + key "charFilters": list[Union[str, CharFilterName]] + key "tokenFilters": list[Union[str, TokenFilterName]] + @odata.type: Required[Literal["#CustomNormalizer"]] + char_filters: list[Union[str, CharFilterName]] + name: Required[str] + odata_type: Literal[#CustomNormalizer] + token_filters: list[Union[str, TokenFilterName]] + + + class azure.search.documents.indexes.types.LimitTokenFilter(TypedDict): + key "consumeAllTokens": bool + key "maxTokenCount": int + @odata.type: Required[Literal["#LimitTokenFilter"]] + consume_all_tokens: bool + max_token_count: int + name: Required[str] + odata_type: Literal[#LimitTokenFilter] + + + class azure.search.documents.indexes.types.LuceneStandardAnalyzer(TypedDict): + key "maxTokenLength": int + key "stopwords": list[str] + @odata.type: Required[Literal["#StandardAnalyzer"]] + max_token_length: int + name: Required[str] + odata_type: Literal[#StandardAnalyzer] + stopwords: list[str] + + + class azure.search.documents.indexes.types.LuceneStandardTokenizer(TypedDict): + key "maxTokenLength": int + @odata.type: Required[Literal["#StandardTokenizer"]] + max_token_length: int + name: Required[str] + odata_type: Literal[#StandardTokenizer] + + + class azure.search.documents.indexes.types.LuceneStandardTokenizerV2(TypedDict): + key "maxTokenLength": int + @odata.type: Required[Literal["#StandardTokenizerV2"]] + max_token_length: int + name: Required[str] + odata_type: Literal[#StandardTokenizerV2] + + + class azure.search.documents.indexes.types.MagnitudeScoringFunction(TypedDict, total=False): + key "interpolation": Union[str, ScoringFunctionInterpolation] + boost: Required[float] + fieldName: Required[str] + field_name: str + interpolation: Union[str, ScoringFunctionInterpolation] + magnitude: Required[MagnitudeScoringParameters] + parameters: MagnitudeScoringParameters + type: Required[Literal["magnitude"]] + + + class azure.search.documents.indexes.types.MagnitudeScoringParameters(TypedDict, total=False): + key "constantBoostBeyondRange": bool + boostingRangeEnd: Required[float] + boostingRangeStart: Required[float] + boosting_range_end: float + boosting_range_start: float + should_boost_beyond_range_by_constant: bool + + + class azure.search.documents.indexes.types.MappingCharFilter(TypedDict): + @odata.type: Required[Literal["#MappingCharFilter"]] + mappings: Required[list[str]] + name: Required[str] + odata_type: Literal[#MappingCharFilter] + + + class azure.search.documents.indexes.types.McpServerAuthenticationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FOUNDRY_CONNECTION = "foundryConnection" + STORED_HEADERS = "storedHeaders" + + + class azure.search.documents.indexes.types.McpServerAutoOutputParsing(TypedDict, total=False): + kind: Required[Literal[McpServerOutputParsingKind.AUTO]] + + + class azure.search.documents.indexes.types.McpServerFoundryConnectionAuthentication(TypedDict, total=False): + foundryConnectionParameters: Required[McpServerFoundryConnectionParameters] + foundry_connection_parameters: McpServerFoundryConnectionParameters + kind: Required[Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION]] + + + class azure.search.documents.indexes.types.McpServerFoundryConnectionParameters(TypedDict, total=False): + key "connectionId": str + connection_id: str + + + class azure.search.documents.indexes.types.McpServerHeaders(TypedDict, total=False): + + + class azure.search.documents.indexes.types.McpServerJsonOutputParsing(TypedDict, total=False): + jsonParameters: Required[McpServerOutputParsingJsonParameters] + json_parameters: McpServerOutputParsingJsonParameters + kind: Required[Literal[McpServerOutputParsingKind.JSON]] + + + class azure.search.documents.indexes.types.McpServerKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + kind: Required[Literal[KnowledgeSourceKind.MCP_SERVER]] + mcpServerParameters: Required[McpServerKnowledgeSourceParameters] + mcp_server_parameters: McpServerKnowledgeSourceParameters + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.McpServerKnowledgeSourceParameters(TypedDict, total=False): + key "authentication": ForwardRef('McpServerAuthentication') + authentication: McpServerAuthentication + serverURL: Required[str] + server_url: str + tools: Required[list[McpServerTool]] + + + class azure.search.documents.indexes.types.McpServerNoneOutputParsing(TypedDict, total=False): + kind: Required[Literal[McpServerOutputParsingKind.NONE]] + + + class azure.search.documents.indexes.types.McpServerOutputParsingJsonParameters(TypedDict, total=False): + key "includeContext": bool + documentsPath: Required[str] + documents_path: str + include_context: bool + + + class azure.search.documents.indexes.types.McpServerOutputParsingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + JSON = "json" + NONE = "none" + SPLIT = "split" + + + class azure.search.documents.indexes.types.McpServerOutputParsingSplitParameters(TypedDict, total=False): + key "defaultLanguageCode": Union[str, SplitSkillLanguage] + key "maximumPageLength": int + key "maximumPagesToTake": int + key "pageOverlapLength": int + key "textSplitMode": Union[str, TextSplitMode] + default_language_code: Union[str, SplitSkillLanguage] + maximum_page_length: int + maximum_pages_to_take: int + page_overlap_length: int + text_split_mode: Union[str, TextSplitMode] + + + class azure.search.documents.indexes.types.McpServerSplitOutputParsing(TypedDict, total=False): + key "splitParameters": ForwardRef('McpServerOutputParsingSplitParameters') + kind: Required[Literal[McpServerOutputParsingKind.SPLIT]] + split_parameters: McpServerOutputParsingSplitParameters + + + class azure.search.documents.indexes.types.McpServerStoredHeadersAuthentication(TypedDict, total=False): + kind: Required[Literal[McpServerAuthenticationKind.STORED_HEADERS]] + storedHeadersParameters: Required[McpServerStoredHeadersParameters] + stored_headers_parameters: McpServerStoredHeadersParameters + + + class azure.search.documents.indexes.types.McpServerStoredHeadersParameters(TypedDict, total=False): + key "headers": ForwardRef('McpServerHeaders') + headers: McpServerHeaders + + + class azure.search.documents.indexes.types.McpServerTool(TypedDict, total=False): + key "maxOutputTokens": int + key "name": str + key "outputParsing": ForwardRef('McpServerOutputParsing') + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + max_output_tokens: int + name: str + output_parsing: McpServerOutputParsing + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.MergeSkill(TypedDict): + key "context": str + key "description": str + key "insertPostTag": str + key "insertPreTag": str + key "name": str + @odata.type: Required[Literal["#MergeSkill"]] + context: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + insert_post_tag: str + insert_pre_tag: str + name: str + odata_type: Literal[#MergeSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.MicrosoftLanguageStemmingTokenizer(TypedDict): + key "isSearchTokenizer": bool + key "language": Union[str, MicrosoftStemmingTokenizerLanguage] + key "maxTokenLength": int + @odata.type: Required[Literal["#MicrosoftLanguageStemmingTokenizer"]] + is_search_tokenizer: bool + language: Union[str, MicrosoftStemmingTokenizerLanguage] + max_token_length: int + name: Required[str] + odata_type: Literal[#MicrosoftLanguageStemmingTokenizer] + + + class azure.search.documents.indexes.types.MicrosoftLanguageTokenizer(TypedDict): + key "isSearchTokenizer": bool + key "language": Union[str, MicrosoftTokenizerLanguage] + key "maxTokenLength": int + @odata.type: Required[Literal["#MicrosoftLanguageTokenizer"]] + is_search_tokenizer: bool + language: Union[str, MicrosoftTokenizerLanguage] + max_token_length: int + name: Required[str] + odata_type: Literal[#MicrosoftLanguageTokenizer] + + + class azure.search.documents.indexes.types.NGramTokenFilter(TypedDict): + key "maxGram": int + key "minGram": int + @odata.type: Required[Literal["#NGramTokenFilter"]] + max_gram: int + min_gram: int + name: Required[str] + odata_type: Literal[#NGramTokenFilter] + + + class azure.search.documents.indexes.types.NGramTokenFilterV2(TypedDict): + key "maxGram": int + key "minGram": int + @odata.type: Required[Literal["#NGramTokenFilterV2"]] + max_gram: int + min_gram: int + name: Required[str] + odata_type: Literal[#NGramTokenFilterV2] + + + class azure.search.documents.indexes.types.NGramTokenizer(TypedDict): + key "maxGram": int + key "minGram": int + key "tokenChars": list[Union[str, TokenCharacterKind]] + @odata.type: Required[Literal["#NGramTokenizer"]] + max_gram: int + min_gram: int + name: Required[str] + odata_type: Literal[#NGramTokenizer] + token_chars: list[Union[str, TokenCharacterKind]] + + + class azure.search.documents.indexes.types.NativeBlobSoftDeleteDeletionDetectionPolicy(TypedDict): + @odata.type: Required[Literal["#NativeBlobSoftDeleteDeletionDetectionPolicy"]] + odata_type: Literal[#NativeBlobSoftDeleteDeletionDetectionPolicy] + + + class azure.search.documents.indexes.types.OcrSkill(TypedDict): + key "context": str + key "defaultLanguageCode": Union[str, OcrSkillLanguage] + key "description": str + key "detectOrientation": bool + key "lineEnding": Union[str, OcrLineEnding] + key "name": str + @odata.type: Required[Literal["#OcrSkill"]] + context: str + default_language_code: Union[str, OcrSkillLanguage] + description: str + inputs: Required[list[InputFieldMappingEntry]] + line_ending: Union[str, OcrLineEnding] + name: str + odata_type: Literal[#OcrSkill] + outputs: Required[list[OutputFieldMappingEntry]] + should_detect_orientation: bool + + + class azure.search.documents.indexes.types.OutputFieldMappingEntry(TypedDict, total=False): + key "targetName": str + name: Required[str] + target_name: str + + + class azure.search.documents.indexes.types.PIIDetectionSkill(TypedDict): + key "context": str + key "defaultLanguageCode": Optional[str] + key "description": str + key "domain": Optional[str] + key "maskingCharacter": str + key "maskingMode": Union[str, PIIDetectionSkillMaskingMode] + key "minimumPrecision": float + key "modelVersion": Optional[str] + key "name": str + key "piiCategories": list[str] + @odata.type: Required[Literal["#PIIDetectionSkill"]] + context: str + default_language_code: str + description: str + domain: str + inputs: Required[list[InputFieldMappingEntry]] + mask: str + masking_mode: Union[str, PIIDetectionSkillMaskingMode] + minimum_precision: float + model_version: str + name: str + odata_type: Literal[#PIIDetectionSkill] + outputs: Required[list[OutputFieldMappingEntry]] + pii_categories: list[str] + + + class azure.search.documents.indexes.types.PathHierarchyTokenizerV2(TypedDict): + key "delimiter": str + key "maxTokenLength": int + key "replacement": str + key "reverse": bool + key "skip": int + @odata.type: Required[Literal["#PathHierarchyTokenizerV2"]] + delimiter: str + max_token_length: int + name: Required[str] + number_of_tokens_to_skip: int + odata_type: Literal[#PathHierarchyTokenizerV2] + replacement: str + reverse_token_order: bool + + + class azure.search.documents.indexes.types.PatternAnalyzer(TypedDict): + key "flags": list[Union[str, RegexFlags]] + key "lowercase": bool + key "pattern": str + key "stopwords": list[str] + @odata.type: Required[Literal["#PatternAnalyzer"]] + flags: list[Union[str, RegexFlags]] + lower_case_terms: bool + name: Required[str] + odata_type: Literal[#PatternAnalyzer] + pattern: str + stopwords: list[str] + + + class azure.search.documents.indexes.types.PatternCaptureTokenFilter(TypedDict): + key "preserveOriginal": bool + @odata.type: Required[Literal["#PatternCaptureTokenFilter"]] + name: Required[str] + odata_type: Literal[#PatternCaptureTokenFilter] + patterns: Required[list[str]] + preserve_original: bool + + + class azure.search.documents.indexes.types.PatternReplaceCharFilter(TypedDict): + @odata.type: Required[Literal["#PatternReplaceCharFilter"]] + name: Required[str] + odata_type: Literal[#PatternReplaceCharFilter] + pattern: Required[str] + replacement: Required[str] + + + class azure.search.documents.indexes.types.PatternReplaceTokenFilter(TypedDict): + @odata.type: Required[Literal["#PatternReplaceTokenFilter"]] + name: Required[str] + odata_type: Literal[#PatternReplaceTokenFilter] + pattern: Required[str] + replacement: Required[str] + + + class azure.search.documents.indexes.types.PatternTokenizer(TypedDict): + key "flags": list[Union[str, RegexFlags]] + key "group": int + key "pattern": str + @odata.type: Required[Literal["#PatternTokenizer"]] + flags: list[Union[str, RegexFlags]] + group: int + name: Required[str] + odata_type: Literal[#PatternTokenizer] + pattern: str + + + class azure.search.documents.indexes.types.PhoneticTokenFilter(TypedDict): + key "encoder": Union[str, PhoneticEncoder] + key "replace": bool + @odata.type: Required[Literal["#PhoneticTokenFilter"]] + encoder: Union[str, PhoneticEncoder] + name: Required[str] + odata_type: Literal[#PhoneticTokenFilter] + replace_original_tokens: bool + + + class azure.search.documents.indexes.types.RemoteSharePointKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "remoteSharePointParameters": ForwardRef('RemoteSharePointKnowledgeSourceParameters') + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + kind: Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] + name: Required[str] + remote_share_point_parameters: RemoteSharePointKnowledgeSourceParameters + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.indexes.types.RemoteSharePointKnowledgeSourceParameters(TypedDict, total=False): + key "containerTypeId": str + key "filterExpression": str + key "resourceMetadata": list[str] + container_type_id: str + filter_expression: str + resource_metadata: list[str] + + + class azure.search.documents.indexes.types.RescoringOptions(TypedDict, total=False): + key "defaultOversampling": Optional[float] + key "enableRescoring": Optional[bool] + key "rescoreStorageMethod": Optional[Union[str, VectorSearchCompressionRescoreStorageMethod]] + default_oversampling: float + enable_rescoring: bool + rescore_storage_method: Union[str, VectorSearchCompressionRescoreStorageMethod] + + + class azure.search.documents.indexes.types.ScalarQuantizationCompression(TypedDict, total=False): + key "rescoringOptions": Optional[RescoringOptions] + key "scalarQuantizationParameters": ForwardRef('ScalarQuantizationParameters') + key "truncationDimension": Optional[int] + compression_name: str + kind: Required[Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION]] + name: Required[str] + parameters: ScalarQuantizationParameters + rescoring_options: RescoringOptions + truncation_dimension: int + + + class azure.search.documents.indexes.types.ScalarQuantizationParameters(TypedDict, total=False): + key "quantizedDataType": Optional[Union[str, VectorSearchCompressionTarget]] + quantized_data_type: Union[str, VectorSearchCompressionTarget] + + + class azure.search.documents.indexes.types.ScoringProfile(TypedDict, total=False): + key "functionAggregation": Union[str, ScoringFunctionAggregation] + key "functions": list[ScoringFunction] + key "text": Optional[TextWeights] + function_aggregation: Union[str, ScoringFunctionAggregation] + functions: list[ScoringFunction] + name: Required[str] + text_weights: TextWeights + + + class azure.search.documents.indexes.types.SearchAlias(TypedDict): + key "@odata.etag": str + e_tag: str + indexes: Required[list[str]] + name: Required[str] + + + class azure.search.documents.indexes.types.SearchField(TypedDict, total=False): + key "analyzer": Optional[Union[str, LexicalAnalyzerName]] + key "dimensions": int + key "facetable": bool + key "fields": list[SearchField] + key "filterable": bool + key "indexAnalyzer": Optional[Union[str, LexicalAnalyzerName]] + key "key": bool + key "normalizer": Optional[Union[str, LexicalNormalizerName]] + key "permissionFilter": Optional[Union[str, PermissionFilter]] + key "retrievable": bool + key "searchAnalyzer": Optional[Union[str, LexicalAnalyzerName]] + key "searchable": bool + key "sensitivityLabelId": bool + key "sensitivityLabelName": bool + key "sharepointSiteUrl": bool + key "sortable": bool + key "sourceDocumentId": bool + key "stored": bool + key "synonymMaps": list[str] + key "vectorEncoding": Optional[Union[str, VectorEncodingFormat]] + key "vectorSearchProfile": Optional[str] + analyzer_name: Union[str, LexicalAnalyzerName] + facetable: bool + fields: list[SearchField] + filterable: bool + index_analyzer_name: Union[str, LexicalAnalyzerName] + key: bool + name: Required[str] + normalizer_name: Union[str, LexicalNormalizerName] + permission_filter: Union[str, PermissionFilter] + retrievable: bool + search_analyzer_name: Union[str, LexicalAnalyzerName] + searchable: bool + sensitivity_label_id: bool + sensitivity_label_name: bool + sharepoint_site_url: bool + sortable: bool + source_document_id: bool + stored: bool + synonym_map_names: list[str] + type: Required[Union[str, SearchFieldDataType]] + vector_encoding_format: Union[str, VectorEncodingFormat] + vector_search_dimensions: int + vector_search_profile_name: str + + + class azure.search.documents.indexes.types.SearchIndex(TypedDict): + key "@odata.etag": str + key "analyzers": list[LexicalAnalyzer] + key "charFilters": list[CharFilter] + key "corsOptions": Optional[CorsOptions] + key "defaultScoringProfile": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "normalizers": list[LexicalNormalizer] + key "permissionFilterOption": Optional[Union[str, SearchIndexPermissionFilterOption]] + key "purviewEnabled": Optional[bool] + key "scoringProfiles": list[ScoringProfile] + key "semantic": Optional[SemanticSearch] + key "sharePointConnectorAppRegistration": ForwardRef('SharePointConnectorAppRegistration') + key "similarity": ForwardRef('SimilarityAlgorithm') + key "suggesters": list[SearchSuggester] + key "tokenFilters": list[TokenFilter] + key "tokenizers": list[LexicalTokenizer] + key "vectorSearch": Optional[VectorSearch] + analyzers: list[LexicalAnalyzer] + char_filters: list[CharFilter] + cors_options: CorsOptions + default_scoring_profile: str + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + fields: Required[list[SearchField]] + name: Required[str] + normalizers: list[LexicalNormalizer] + permission_filter_option: Union[str, SearchIndexPermissionFilterOption] + purview_enabled: bool + scoring_profiles: list[ScoringProfile] + semantic_search: SemanticSearch + share_point_connector_app_registration: SharePointConnectorAppRegistration + similarity: SimilarityAlgorithm + suggesters: list[SearchSuggester] + token_filters: list[TokenFilter] + tokenizers: list[LexicalTokenizer] + vector_search: VectorSearch + + + class azure.search.documents.indexes.types.SearchIndexFieldReference(TypedDict, total=False): + name: Required[str] + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + kind: Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + searchIndexParameters: Required[SearchIndexKnowledgeSourceParameters] + search_index_parameters: SearchIndexKnowledgeSourceParameters + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceBoostKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FIELD_VALUE = "fieldValue" + MULTI_WORD_EXPRESSION = "multiWordExpression" + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceFieldValueBoost(TypedDict, total=False): + key "boostInstructions": str + key "fieldValues": list[str] + boost: Required[float] + boost_instructions: str + field: Required[str] + field_values: list[str] + kind: Required[Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE]] + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceFilterHint(TypedDict, total=False): + key "filterInstructions": str + field: Required[str] + fieldValues: Required[list[str]] + field_values: list[str] + filter_instructions: str + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceMultiWordExpressionBoost(TypedDict, total=False): + key "boostInstructions": str + key "fieldValues": list[str] + boost: Required[float] + boost_instructions: str + field_values: list[str] + kind: Required[Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION]] + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceParameters(TypedDict, total=False): + key "baseFilter": str + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "searchFields": list[SearchIndexFieldReference] + key "semanticConfigurationName": str + key "sourceDataFields": list[SearchIndexFieldReference] + base_filter: str + query_hints: SearchIndexKnowledgeSourceQueryHints + searchIndexName: Required[str] + search_fields: list[SearchIndexFieldReference] + search_index_name: str + semantic_configuration_name: str + source_data_fields: list[SearchIndexFieldReference] + + + class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceQueryHints(TypedDict, total=False): + key "boosts": list[SearchIndexKnowledgeSourceBoost] + key "filters": list[SearchIndexKnowledgeSourceFilterHint] + boosts: list[SearchIndexKnowledgeSourceBoost] + filters: list[SearchIndexKnowledgeSourceFilterHint] + + + class azure.search.documents.indexes.types.SearchIndexer(TypedDict): + key "@odata.etag": str + key "cache": Optional[SearchIndexerCache] + key "description": str + key "disabled": Optional[bool] + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "fieldMappings": list[FieldMapping] + key "outputFieldMappings": list[FieldMapping] + key "parameters": Optional[IndexingParameters] + key "schedule": Optional[IndexingSchedule] + key "skillsetName": str + cache: SearchIndexerCache + dataSourceName: Required[str] + data_source_name: str + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + field_mappings: list[FieldMapping] + is_disabled: bool + name: Required[str] + output_field_mappings: list[FieldMapping] + parameters: IndexingParameters + schedule: IndexingSchedule + skillset_name: str + targetIndexName: Required[str] + target_index_name: str + + + class azure.search.documents.indexes.types.SearchIndexerCache(TypedDict, total=False): + key "enableReprocessing": Optional[bool] + key "id": str + key "identity": Optional[SearchIndexerDataIdentity] + key "storageConnectionString": str + enable_reprocessing: bool + id: str + identity: SearchIndexerDataIdentity + storage_connection_string: str + + + class azure.search.documents.indexes.types.SearchIndexerDataContainer(TypedDict, total=False): + key "query": str + name: Required[str] + query: str + + + class azure.search.documents.indexes.types.SearchIndexerDataNoneIdentity(TypedDict): + @odata.type: Required[Literal["#DataNoneIdentity"]] + odata_type: Literal[#DataNoneIdentity] + + + class azure.search.documents.indexes.types.SearchIndexerDataSourceConnection(TypedDict): + key "@odata.etag": str + key "dataChangeDetectionPolicy": Optional[DataChangeDetectionPolicy] + key "dataDeletionDetectionPolicy": Optional[DataDeletionDetectionPolicy] + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "identity": Optional[SearchIndexerDataIdentity] + key "indexerPermissionOptions": Optional[list[Union[str, IndexerPermissionOption]]] + key "subType": str + container: Required[SearchIndexerDataContainer] + credentials: Required[DataSourceCredentials] + data_change_detection_policy: DataChangeDetectionPolicy + data_deletion_detection_policy: DataDeletionDetectionPolicy + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + identity: SearchIndexerDataIdentity + indexer_permission_options: list[Union[str, IndexerPermissionOption]] + name: Required[str] + sub_type: str + type: Required[Union[str, SearchIndexerDataSourceType]] + + + class azure.search.documents.indexes.types.SearchIndexerDataUserAssignedIdentity(TypedDict): + key "federatedIdentityClientId": str + @odata.type: Required[Literal["#DataUserAssignedIdentity"]] + federated_identity_client_id: str + odata_type: Literal[#DataUserAssignedIdentity] + resource_id: str + userAssignedIdentity: Required[str] + + + class azure.search.documents.indexes.types.SearchIndexerIndexProjection(TypedDict, total=False): + key "parameters": ForwardRef('SearchIndexerIndexProjectionsParameters') + parameters: SearchIndexerIndexProjectionsParameters + selectors: Required[list[SearchIndexerIndexProjectionSelector]] + + + class azure.search.documents.indexes.types.SearchIndexerIndexProjectionSelector(TypedDict, total=False): + mappings: Required[list[InputFieldMappingEntry]] + parentKeyFieldName: Required[str] + parent_key_field_name: str + sourceContext: Required[str] + source_context: str + targetIndexName: Required[str] + target_index_name: str + + + class azure.search.documents.indexes.types.SearchIndexerIndexProjectionsParameters(TypedDict, total=False): + key "projectionMode": Union[str, IndexProjectionMode] + projection_mode: Union[str, IndexProjectionMode] + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStore(TypedDict, total=False): + key "identity": Optional[SearchIndexerDataIdentity] + key "parameters": ForwardRef('SearchIndexerKnowledgeStoreParameters') + identity: SearchIndexerDataIdentity + parameters: SearchIndexerKnowledgeStoreParameters + projections: Required[list[SearchIndexerKnowledgeStoreProjection]] + storageConnectionString: Required[str] + storage_connection_string: str + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreBlobProjectionSelector(SearchIndexerKnowledgeStoreProjectionSelector): + key "generatedKeyName": str + key "inputs": list[InputFieldMappingEntry] + key "referenceKeyName": str + key "source": str + key "sourceContext": str + generated_key_name: str + inputs: list[InputFieldMappingEntry] + reference_key_name: str + source: str + source_context: str + storageContainer: Required[str] + storage_container: str + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreFileProjectionSelector(SearchIndexerKnowledgeStoreBlobProjectionSelector): + key "generatedKeyName": str + key "inputs": list[InputFieldMappingEntry] + key "referenceKeyName": str + key "source": str + key "sourceContext": str + generated_key_name: str + inputs: list[InputFieldMappingEntry] + reference_key_name: str + source: str + source_context: str + storageContainer: Required[str] + storage_container: str + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreObjectProjectionSelector(SearchIndexerKnowledgeStoreBlobProjectionSelector): + key "generatedKeyName": str + key "inputs": list[InputFieldMappingEntry] + key "referenceKeyName": str + key "source": str + key "sourceContext": str + generated_key_name: str + inputs: list[InputFieldMappingEntry] + reference_key_name: str + source: str + source_context: str + storageContainer: Required[str] + storage_container: str + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreParameters(TypedDict, total=False): + key "synthesizeGeneratedKeyName": bool + synthesize_generated_key_name: bool + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): + key "files": list[SearchIndexerKnowledgeStoreFileProjectionSelector] + key "objects": list[SearchIndexerKnowledgeStoreObjectProjectionSelector] + key "tables": list[SearchIndexerKnowledgeStoreTableProjectionSelector] + files: list[SearchIndexerKnowledgeStoreFileProjectionSelector] + objects: list[SearchIndexerKnowledgeStoreObjectProjectionSelector] + tables: list[SearchIndexerKnowledgeStoreTableProjectionSelector] + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreProjectionSelector(TypedDict, total=False): + key "generatedKeyName": str + key "inputs": list[InputFieldMappingEntry] + key "referenceKeyName": str + key "source": str + key "sourceContext": str + generated_key_name: str + inputs: list[InputFieldMappingEntry] + reference_key_name: str + source: str + source_context: str + + + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreTableProjectionSelector(SearchIndexerKnowledgeStoreProjectionSelector): + key "inputs": list[InputFieldMappingEntry] + key "referenceKeyName": str + key "source": str + key "sourceContext": str + generatedKeyName: Required[str] + generated_key_name: str + inputs: list[InputFieldMappingEntry] + reference_key_name: str + source: str + source_context: str + tableName: Required[str] + table_name: str + + + class azure.search.documents.indexes.types.SearchIndexerSkillset(TypedDict): + key "@odata.etag": str + key "cognitiveServices": ForwardRef('CognitiveServicesAccount') + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "indexProjections": ForwardRef('SearchIndexerIndexProjection') + key "knowledgeStore": ForwardRef('SearchIndexerKnowledgeStore') + cognitive_services_account: CognitiveServicesAccount + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + index_projection: SearchIndexerIndexProjection + knowledge_store: SearchIndexerKnowledgeStore + name: Required[str] + skills: Required[list[SearchIndexerSkill]] + + + class azure.search.documents.indexes.types.SearchResourceEncryptionKey(TypedDict, total=False): + key "accessCredentials": ForwardRef('AzureActiveDirectoryApplicationCredentials') + key "identity": Optional[SearchIndexerDataIdentity] + key "isServiceLevelKey": bool + key "keyVaultKeyVersion": str + access_credentials: AzureActiveDirectoryApplicationCredentials + identity: SearchIndexerDataIdentity + is_service_level_key: bool + keyVaultKeyName: Required[str] + keyVaultUri: Required[str] + key_name: str + key_version: str + vault_uri: str + + + class azure.search.documents.indexes.types.SearchSuggester(TypedDict, total=False): + name: Required[str] + searchMode: Required[Literal["analyzingInfixMatching"]] + search_mode: Literal[analyzingInfixMatching] + sourceFields: Required[list[str]] + source_fields: list[str] + + + class azure.search.documents.indexes.types.SemanticConfiguration(TypedDict, total=False): + key "flightingOptIn": bool + key "rankingOrder": Optional[Union[str, RankingOrder]] + flighting_opt_in: bool + name: Required[str] + prioritizedFields: Required[SemanticPrioritizedFields] + prioritized_fields: SemanticPrioritizedFields + ranking_order: Union[str, RankingOrder] + + + class azure.search.documents.indexes.types.SemanticField(TypedDict, total=False): + fieldName: Required[str] + field_name: str + + + class azure.search.documents.indexes.types.SemanticPrioritizedFields(TypedDict, total=False): + key "prioritizedContentFields": list[SemanticField] + key "prioritizedKeywordsFields": list[SemanticField] + key "titleField": ForwardRef('SemanticField') + content_fields: list[SemanticField] + keywords_fields: list[SemanticField] + title_field: SemanticField + + + class azure.search.documents.indexes.types.SemanticSearch(TypedDict, total=False): + key "configurations": list[SemanticConfiguration] + key "defaultConfiguration": str + configurations: list[SemanticConfiguration] + default_configuration_name: str + + + class azure.search.documents.indexes.types.SentimentSkillV3(TypedDict): + key "context": str + key "defaultLanguageCode": Optional[Union[str, SentimentSkillLanguage]] + key "description": str + key "includeOpinionMining": bool + key "modelVersion": Optional[str] + key "name": str + @odata.type: Required[Literal["#SentimentSkill"]] + context: str + default_language_code: Union[str, SentimentSkillLanguage] + description: str + include_opinion_mining: bool + inputs: Required[list[InputFieldMappingEntry]] + model_version: str + name: str + odata_type: Literal[#SentimentSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.ShaperSkill(TypedDict): + key "context": str + key "description": str + key "name": str + @odata.type: Required[Literal["#ShaperSkill"]] + context: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#ShaperSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.SharePointConnectorAppRegistration(TypedDict, total=False): + key "tenantId": str + applicationId: Required[str] + application_id: str + federatedCredentialId: Required[str] + federated_credential_id: str + tenant_id: str + + + class azure.search.documents.indexes.types.ShingleTokenFilter(TypedDict): + key "filterToken": str + key "maxShingleSize": int + key "minShingleSize": int + key "outputUnigrams": bool + key "outputUnigramsIfNoShingles": bool + key "tokenSeparator": str + @odata.type: Required[Literal["#ShingleTokenFilter"]] + filter_token: str + max_shingle_size: int + min_shingle_size: int + name: Required[str] + odata_type: Literal[#ShingleTokenFilter] + output_unigrams: bool + output_unigrams_if_no_shingles: bool + token_separator: str + + + class azure.search.documents.indexes.types.SkillNames(TypedDict, total=False): + key "skillNames": list[str] + skill_names: list[str] + + + class azure.search.documents.indexes.types.SnowballTokenFilter(TypedDict): + @odata.type: Required[Literal["#SnowballTokenFilter"]] + language: Required[Union[str, SnowballTokenFilterLanguage]] + name: Required[str] + odata_type: Literal[#SnowballTokenFilter] + + + class azure.search.documents.indexes.types.SoftDeleteColumnDeletionDetectionPolicy(TypedDict): + key "softDeleteColumnName": str + key "softDeleteMarkerValue": str + @odata.type: Required[Literal["#SoftDeleteColumnDeletionDetectionPolicy"]] + odata_type: Literal[#SoftDeleteColumnDeletionDetectionPolicy] + soft_delete_column_name: str + soft_delete_marker_value: str + + + class azure.search.documents.indexes.types.SplitSkill(TypedDict): + key "azureOpenAITokenizerParameters": Optional[AzureOpenAITokenizerParameters] + key "context": str + key "defaultLanguageCode": Union[str, SplitSkillLanguage] + key "description": str + key "maximumPageLength": Optional[int] + key "maximumPagesToTake": Optional[int] + key "name": str + key "pageOverlapLength": Optional[int] + key "textSplitMode": Union[str, TextSplitMode] + key "unit": Optional[Union[str, SplitSkillUnit]] + @odata.type: Required[Literal["#SplitSkill"]] + azure_open_ai_tokenizer_parameters: AzureOpenAITokenizerParameters + context: str + default_language_code: Union[str, SplitSkillLanguage] + description: str + inputs: Required[list[InputFieldMappingEntry]] + maximum_page_length: int + maximum_pages_to_take: int + name: str + odata_type: Literal[#SplitSkill] + outputs: Required[list[OutputFieldMappingEntry]] + page_overlap_length: int + text_split_mode: Union[str, TextSplitMode] + unit: Union[str, SplitSkillUnit] + + + class azure.search.documents.indexes.types.SqlIntegratedChangeTrackingPolicy(TypedDict): + @odata.type: Required[Literal["#SqlIntegratedChangeTrackingPolicy"]] + odata_type: Literal[#SqlIntegratedChangeTrackingPolicy] + + + class azure.search.documents.indexes.types.StemmerOverrideTokenFilter(TypedDict): + @odata.type: Required[Literal["#StemmerOverrideTokenFilter"]] + name: Required[str] + odata_type: Literal[#StemmerOverrideTokenFilter] + rules: Required[list[str]] + + + class azure.search.documents.indexes.types.StemmerTokenFilter(TypedDict): + @odata.type: Required[Literal["#StemmerTokenFilter"]] + language: Required[Union[str, StemmerTokenFilterLanguage]] + name: Required[str] + odata_type: Literal[#StemmerTokenFilter] + + + class azure.search.documents.indexes.types.StopAnalyzer(TypedDict): + key "stopwords": list[str] + @odata.type: Required[Literal["#StopAnalyzer"]] + name: Required[str] + odata_type: Literal[#StopAnalyzer] + stopwords: list[str] + + + class azure.search.documents.indexes.types.StopwordsTokenFilter(TypedDict): + key "ignoreCase": bool + key "removeTrailing": bool + key "stopwords": list[str] + key "stopwordsList": Union[str, StopwordsList] + @odata.type: Required[Literal["#StopwordsTokenFilter"]] + ignore_case: bool + name: Required[str] + odata_type: Literal[#StopwordsTokenFilter] + remove_trailing_stop_words: bool + stopwords: list[str] + stopwords_list: Union[str, StopwordsList] + + + class azure.search.documents.indexes.types.SynonymMap(TypedDict): + key "@odata.etag": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + e_tag: str + encryption_key: SearchResourceEncryptionKey + format: Required[Literal["solr"]] + name: Required[str] + synonyms: Required[list[str]] + + + class azure.search.documents.indexes.types.SynonymTokenFilter(TypedDict): + key "expand": bool + key "ignoreCase": bool + @odata.type: Required[Literal["#SynonymTokenFilter"]] + expand: bool + ignore_case: bool + name: Required[str] + odata_type: Literal[#SynonymTokenFilter] + synonyms: Required[list[str]] + + + class azure.search.documents.indexes.types.TagScoringFunction(TypedDict, total=False): + key "interpolation": Union[str, ScoringFunctionInterpolation] + boost: Required[float] + fieldName: Required[str] + field_name: str + interpolation: Union[str, ScoringFunctionInterpolation] + parameters: TagScoringParameters + tag: Required[TagScoringParameters] + type: Required[Literal["tag"]] + + + class azure.search.documents.indexes.types.TagScoringParameters(TypedDict, total=False): + tagsParameter: Required[str] + tags_parameter: str + + + class azure.search.documents.indexes.types.TextTranslationSkill(TypedDict): + key "context": str + key "defaultFromLanguageCode": Union[str, TextTranslationSkillLanguage] + key "description": str + key "name": str + key "suggestedFrom": Optional[Union[str, TextTranslationSkillLanguage]] + @odata.type: Required[Literal["#TranslationSkill"]] + context: str + defaultToLanguageCode: Required[Union[str, TextTranslationSkillLanguage]] + default_from_language_code: Union[str, TextTranslationSkillLanguage] + default_to_language_code: Union[str, TextTranslationSkillLanguage] + description: str + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#TranslationSkill] + outputs: Required[list[OutputFieldMappingEntry]] + suggested_from: Union[str, TextTranslationSkillLanguage] + + + class azure.search.documents.indexes.types.TextWeights(TypedDict, total=False): + weights: Required[dict[str, float]] + + + class azure.search.documents.indexes.types.TruncateTokenFilter(TypedDict): + key "length": int + @odata.type: Required[Literal["#TruncateTokenFilter"]] + length: int + name: Required[str] + odata_type: Literal[#TruncateTokenFilter] + + + class azure.search.documents.indexes.types.UaxUrlEmailTokenizer(TypedDict): + key "maxTokenLength": int + @odata.type: Required[Literal["#UaxUrlEmailTokenizer"]] + max_token_length: int + name: Required[str] + odata_type: Literal[#UaxUrlEmailTokenizer] + + + class azure.search.documents.indexes.types.UniqueTokenFilter(TypedDict): + key "onlyOnSamePosition": bool + @odata.type: Required[Literal["#UniqueTokenFilter"]] + name: Required[str] + odata_type: Literal[#UniqueTokenFilter] + only_on_same_position: bool + + + class azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest(TypedDict, total=False): + content: Required[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + metadata: Required[FileUploadMetadata] + + + class azure.search.documents.indexes.types.UploadKnowledgeSourceFileMultipartRequest(TypedDict, total=False): + content: Required[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + metadata: Required[FileUploadMetadata] + + + class azure.search.documents.indexes.types.VectorSearch(TypedDict, total=False): + key "algorithms": list[VectorSearchAlgorithmConfiguration] + key "compressions": list[VectorSearchCompression] + key "profiles": list[VectorSearchProfile] + key "vectorizers": list[VectorSearchVectorizer] + algorithms: list[VectorSearchAlgorithmConfiguration] + compressions: list[VectorSearchCompression] + profiles: list[VectorSearchProfile] + vectorizers: list[VectorSearchVectorizer] + + + class azure.search.documents.indexes.types.VectorSearchAlgorithmKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXHAUSTIVE_KNN = "exhaustiveKnn" + HNSW = "hnsw" + + + class azure.search.documents.indexes.types.VectorSearchCompressionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BINARY_QUANTIZATION = "binaryQuantization" + SCALAR_QUANTIZATION = "scalarQuantization" + + + class azure.search.documents.indexes.types.VectorSearchProfile(TypedDict, total=False): + key "compression": str + key "vectorizer": str + algorithm: Required[str] + algorithm_configuration_name: str + compression_name: str + name: Required[str] + vectorizer_name: str + + + class azure.search.documents.indexes.types.VectorSearchVectorizerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AI_SERVICES_VISION = "aiServicesVision" + AML = "aml" + AZURE_OPEN_AI = "azureOpenAI" + CUSTOM_WEB_API = "customWebApi" + + + class azure.search.documents.indexes.types.VisionVectorizeSkill(TypedDict): + key "context": str + key "description": str + key "name": str + @odata.type: Required[Literal["#VectorizeSkill"]] + context: str + description: str + inputs: Required[list[InputFieldMappingEntry]] + modelVersion: Required[Optional[str]] + model_version: str + name: str + odata_type: Literal[#VectorizeSkill] + outputs: Required[list[OutputFieldMappingEntry]] + + + class azure.search.documents.indexes.types.WebApiHttpHeaders(TypedDict, total=False): + + + class azure.search.documents.indexes.types.WebApiSkill(TypedDict): + key "authIdentity": Optional[SearchIndexerDataIdentity] + key "authResourceId": Optional[str] + key "batchSize": Optional[int] + key "context": str + key "degreeOfParallelism": Optional[int] + key "description": str + key "httpHeaders": ForwardRef('WebApiHttpHeaders') + key "httpMethod": str + key "name": str + key "timeout": str + @odata.type: Required[Literal["#WebApiSkill"]] + auth_identity: SearchIndexerDataIdentity + auth_resource_id: str + batch_size: int + context: str + degree_of_parallelism: int + description: str + http_headers: WebApiHttpHeaders + http_method: str + inputs: Required[list[InputFieldMappingEntry]] + name: str + odata_type: Literal[#WebApiSkill] + outputs: Required[list[OutputFieldMappingEntry]] + timeout: str + uri: Required[str] + + + class azure.search.documents.indexes.types.WebApiVectorizer(TypedDict, total=False): + key "customWebApiParameters": ForwardRef('WebApiVectorizerParameters') + kind: Required[Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API]] + name: Required[str] + vectorizer_name: str + web_api_parameters: WebApiVectorizerParameters + + + class azure.search.documents.indexes.types.WebApiVectorizerParameters(TypedDict, total=False): + key "authIdentity": Optional[SearchIndexerDataIdentity] + key "authResourceId": Optional[str] + key "httpHeaders": dict[str, str] + key "httpMethod": str + key "timeout": str + key "uri": str + auth_identity: SearchIndexerDataIdentity + auth_resource_id: str + http_headers: dict[str, str] + http_method: str + timeout: str + url: str + + + class azure.search.documents.indexes.types.WebKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + key "webParameters": ForwardRef('WebKnowledgeSourceParameters') + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + kind: Required[Literal[KnowledgeSourceKind.WEB]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + web_parameters: WebKnowledgeSourceParameters + + + class azure.search.documents.indexes.types.WebKnowledgeSourceDomain(TypedDict, total=False): + key "includeSubpages": bool + address: Required[str] + include_subpages: bool + + + class azure.search.documents.indexes.types.WebKnowledgeSourceDomains(TypedDict, total=False): + key "allowedDomains": list[WebKnowledgeSourceDomain] + key "blockedDomains": list[WebKnowledgeSourceDomain] + allowed_domains: list[WebKnowledgeSourceDomain] + blocked_domains: list[WebKnowledgeSourceDomain] + + + class azure.search.documents.indexes.types.WebKnowledgeSourceParameters(TypedDict, total=False): + key "count": int + key "domains": ForwardRef('WebKnowledgeSourceDomains') + key "freshness": str + key "language": str + key "market": str + count: int + domains: WebKnowledgeSourceDomains + freshness: str + language: str + market: str + + + class azure.search.documents.indexes.types.WordDelimiterTokenFilter(TypedDict): + key "catenateAll": bool + key "catenateNumbers": bool + key "catenateWords": bool + key "generateNumberParts": bool + key "generateWordParts": bool + key "preserveOriginal": bool + key "protectedWords": list[str] + key "splitOnCaseChange": bool + key "splitOnNumerics": bool + key "stemEnglishPossessive": bool + @odata.type: Required[Literal["#WordDelimiterTokenFilter"]] + catenate_all: bool + catenate_numbers: bool + catenate_words: bool + generate_number_parts: bool + generate_word_parts: bool + name: Required[str] + odata_type: Literal[#WordDelimiterTokenFilter] + preserve_original: bool + protected_words: list[str] + split_on_case_change: bool + split_on_numerics: bool + stem_english_possessive: bool + + + class azure.search.documents.indexes.types.WorkIQKnowledgeSource(TypedDict): + key "@odata.etag": str + key "description": str + key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + description: str + e_tag: str + encryption_key: SearchResourceEncryptionKey + kind: Required[Literal[KnowledgeSourceKind.WORK_IQ]] + name: Required[str] + results_processing: Union[str, KnowledgeSourceResultsProcessing] + workIQParameters: Required[WorkIQKnowledgeSourceParameters] + work_iq_parameters: WorkIQKnowledgeSourceParameters + + + class azure.search.documents.indexes.types.WorkIQKnowledgeSourceParameters(TypedDict, total=False): + entraAppAuthentication: Required[EntraAppAuthentication] + entra_app_authentication: EntraAppAuthentication + + +namespace azure.search.documents.knowledgebases + + class azure.search.documents.knowledgebases.KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): implements ContextManager + + def __init__( + self, + endpoint: str, + credential: Union[AzureKeyCredential, TokenCredential], + *, + api_version: Union[str, ApiVersion] = ..., + audience: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + @overload + def retrieve( + self, + retrieval_request: KnowledgeBaseRetrievalRequest, + *, + content_type: str = "application/json", + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalResponse: ... + + @overload + def retrieve( + self, + retrieval_request: KnowledgeBaseRetrievalRequest, + *, + content_type: str = "application/json", + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalResponse: ... + + @overload + def retrieve( + self, + retrieval_request: IO[bytes], + *, + content_type: str = "application/json", + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalResponse: ... + + def retrieve_stream( + self, + retrieval_request: Union[KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], + *, + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalStream: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + + class azure.search.documents.knowledgebases.KnowledgeBaseRetrievalEvent: + data: Optional[Union[KnowledgeBaseRetrievalStartedEvent, KnowledgeBaseActivityStartedEvent, KnowledgeBaseActivityRecord, KnowledgeBaseAnswerCompletedEvent, list[KnowledgeBaseReference], KnowledgeBaseStreamErrorEvent, KnowledgeBaseResponseCompletedEvent, dict[str, Any], list[Any], str, int, float, bool]] + event_type: str + + def __init__( + self, + event_type: str, + data: KnowledgeBaseRetrievalEventData + ) -> None: ... + + def __repr__(self) -> str: ... + + + class azure.search.documents.knowledgebases.KnowledgeBaseRetrievalStream(Iterator[KnowledgeBaseRetrievalEvent]): implements ContextManager , Iterator + + def __init__( + self, + *, + raw_stream: Iterator[bytes], + response: Any + ) -> None: ... + + def close(self) -> None: ... + + +namespace azure.search.documents.knowledgebases.aio + + class azure.search.documents.knowledgebases.aio.AsyncKnowledgeBaseRetrievalStream(AsyncIterator[KnowledgeBaseRetrievalEvent]): implements AsyncContextManager , AsyncIterable , AsyncIterator + + def __init__( + self, + *, + raw_stream: AsyncIterator[bytes], + response: Any + ) -> None: ... + + async def close(self) -> None: ... + + + class azure.search.documents.knowledgebases.aio.KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): implements AsyncContextManager + + def __init__( + self, + endpoint: str, + credential: Union[AzureKeyCredential, AsyncTokenCredential], + *, + api_version: Union[str, ApiVersion] = ..., + audience: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + @overload + async def retrieve( + self, + retrieval_request: KnowledgeBaseRetrievalRequest, + *, + content_type: str = "application/json", + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalResponse: ... + + @overload + async def retrieve( + self, + retrieval_request: KnowledgeBaseRetrievalRequest, + *, + content_type: str = "application/json", + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalResponse: ... + + @overload + async def retrieve( + self, + retrieval_request: IO[bytes], + *, + content_type: str = "application/json", + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> KnowledgeBaseRetrievalResponse: ... + + async def retrieve_stream( + self, + retrieval_request: Union[KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], + *, + query_source_authorization: Optional[str] = ..., + query_work_iq_source_authorization: Optional[str] = ..., + **kwargs: Any + ) -> AsyncKnowledgeBaseRetrievalStream: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + + class azure.search.documents.knowledgebases.aio.KnowledgeBaseRetrievalEvent: + data: Optional[Union[KnowledgeBaseRetrievalStartedEvent, KnowledgeBaseActivityStartedEvent, KnowledgeBaseActivityRecord, KnowledgeBaseAnswerCompletedEvent, list[KnowledgeBaseReference], KnowledgeBaseStreamErrorEvent, KnowledgeBaseResponseCompletedEvent, dict[str, Any], list[Any], str, int, float, bool]] + event_type: str + + def __init__( + self, + event_type: str, + data: KnowledgeBaseRetrievalEventData + ) -> None: ... + + def __repr__(self) -> str: ... + + +namespace azure.search.documents.knowledgebases.models + + class azure.search.documents.knowledgebases.models.AIServices(_Model): + api_key: Optional[str] + uri: str + + @overload + def __init__( + self, + *, + api_key: Optional[str] = ..., + uri: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.AssetStore(_Model): + connection_string: str + container_name: str + + @overload + def __init__( + self, + *, + connection_string: str, + container_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.AzureBlobKnowledgeSourceParams(KnowledgeSourceParams, discriminator='azureBlob'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.AZURE_BLOB] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + @overload + def __init__( + self, + *, + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.CompletedSynchronizationState(_Model): + end_time: datetime + items_skipped: int + items_updates_failed: int + items_updates_processed: int + start_time: datetime + + @overload + def __init__( + self, + *, + end_time: datetime, + items_skipped: int, + items_updates_failed: int, + items_updates_processed: int, + start_time: datetime + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.FabricDataAgentKnowledgeSourceParams(KnowledgeSourceParams, discriminator='fabricDataAgent'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + @overload + def __init__( + self, + *, + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.FabricOntologyKnowledgeSourceParams(KnowledgeSourceParams, discriminator='fabricOntology'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + @overload + def __init__( + self, + *, + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -8019,7 +11004,10 @@ namespace azure.search.documents.knowledgebases.models kind: Literal[KnowledgeSourceKind.FILE] knowledge_source_name: str max_output_documents: int + never_query_source: bool + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -8032,7 +11020,10 @@ namespace azure.search.documents.knowledgebases.models include_references: Optional[bool] = ..., knowledge_source_name: str, max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... + never_query_source: Optional[bool] = ..., + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -8056,6 +11047,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.ImageServingStatistics(_Model): images_retrieved: Optional[int] images_sent_to_model: Optional[int] + served_images: Optional[list[ServedImage]] total_image_size_bytes: Optional[int] verbalization_used: Optional[bool] @@ -8065,6 +11057,7 @@ namespace azure.search.documents.knowledgebases.models *, images_retrieved: Optional[int] = ..., images_sent_to_model: Optional[int] = ..., + served_images: Optional[list[ServedImage]] = ..., total_image_size_bytes: Optional[int] = ..., verbalization_used: Optional[bool] = ... ) -> None: ... @@ -8082,7 +11075,10 @@ namespace azure.search.documents.knowledgebases.models kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] knowledge_source_name: str max_output_documents: int + never_query_source: bool + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -8095,7 +11091,10 @@ namespace azure.search.documents.knowledgebases.models include_references: Optional[bool] = ..., knowledge_source_name: str, max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... + never_query_source: Optional[bool] = ..., + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -8111,7 +11110,10 @@ namespace azure.search.documents.knowledgebases.models kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] knowledge_source_name: str max_output_documents: int + never_query_source: bool + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -8124,7 +11126,10 @@ namespace azure.search.documents.knowledgebases.models include_references: Optional[bool] = ..., knowledge_source_name: str, max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... + never_query_source: Optional[bool] = ..., + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -8140,7 +11145,10 @@ namespace azure.search.documents.knowledgebases.models kind: Literal[KnowledgeSourceKind.INDEXED_SQL] knowledge_source_name: str max_output_documents: int + never_query_source: bool + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( @@ -8153,7 +11161,10 @@ namespace azure.search.documents.knowledgebases.models include_references: Optional[bool] = ..., knowledge_source_name: str, max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... + never_query_source: Optional[bool] = ..., + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload @@ -8161,9 +11172,11 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord(_Model): + completed_at: Optional[datetime] elapsed_ms: Optional[int] error: Optional[KnowledgeBaseErrorDetail] id: int + started_at: Optional[datetime] type: str warning: Optional[str] @@ -8171,9 +11184,11 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, + started_at: Optional[datetime] = ..., type: str, warning: Optional[str] = ... ) -> None: ... @@ -8182,6 +11197,22 @@ namespace azure.search.documents.knowledgebases.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel(_Model): + deployment_id: Optional[str] + model_name: Optional[str] + + @overload + def __init__( + self, + *, + deployment_id: Optional[str] = ..., + model_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AGENTIC_REASONING = "agenticReasoning" AZURE_BLOB = "azureBlob" @@ -8201,12 +11232,35 @@ namespace azure.search.documents.knowledgebases.models WORK_IQ = "workIQ" + class azure.search.documents.knowledgebases.models.KnowledgeBaseActivityStartedEvent(_Model): + id: int + knowledge_source_name: Optional[str] + started_at: datetime + type: Union[str, KnowledgeBaseActivityRecordType] + + @overload + def __init__( + self, + *, + id: int, + knowledge_source_name: Optional[str] = ..., + started_at: datetime, + type: Union[str, KnowledgeBaseActivityRecordType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.models.KnowledgeBaseAgenticReasoningActivityRecord(KnowledgeBaseActivityRecord, discriminator='agenticReasoning'): + completed_at: datetime elapsed_ms: int error: KnowledgeBaseErrorDetail id: int + logical_reasoning_effort: Optional[KnowledgeRetrievalReasoningEffort] reasoning_tokens: Optional[int] retrieval_reasoning_effort: Optional[KnowledgeRetrievalReasoningEffort] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.AGENTIC_REASONING] warning: str @@ -8214,11 +11268,14 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, + logical_reasoning_effort: Optional[KnowledgeRetrievalReasoningEffort] = ..., reasoning_tokens: Optional[int] = ..., retrieval_reasoning_effort: Optional[KnowledgeRetrievalReasoningEffort] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8226,6 +11283,22 @@ namespace azure.search.documents.knowledgebases.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.models.KnowledgeBaseAnswerCompletedEvent(_Model): + message: KnowledgeBaseMessage + message_index: int + + @overload + def __init__( + self, + *, + message: KnowledgeBaseMessage, + message_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityArguments(_Model): search: Optional[str] @@ -8242,13 +11315,16 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobActivityRecord(KnowledgeBaseActivityRecord, discriminator='azureBlob'): azure_blob_arguments: Optional[KnowledgeBaseAzureBlobActivityArguments] + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail id: int image_serving: Optional[ImageServingStatistics] knowledge_source_name: Optional[str] + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.AZURE_BLOB] warning: str @@ -8257,13 +11333,16 @@ namespace azure.search.documents.knowledgebases.models self, *, azure_blob_arguments: Optional[KnowledgeBaseAzureBlobActivityArguments] = ..., + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, image_serving: Optional[ImageServingStatistics] = ..., knowledge_source_name: Optional[str] = ..., + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8274,6 +11353,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseAzureBlobReference(KnowledgeBaseReference, discriminator='azureBlob'): activity_source: int blob_url: Optional[str] + citation_url: Optional[str] id: str reranker_score: float search_sensitivity_label_info: Optional[PurviewSensitivityLabelInfo] @@ -8286,6 +11366,7 @@ namespace azure.search.documents.knowledgebases.models *, activity_source: int, blob_url: Optional[str] = ..., + citation_url: Optional[str] = ..., id: str, reranker_score: Optional[float] = ..., search_sensitivity_label_info: Optional[PurviewSensitivityLabelInfo] = ..., @@ -8324,6 +11405,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseFabricDataAgentActivityRecord(KnowledgeBaseActivityRecord, discriminator='fabricDataAgent'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8332,6 +11414,7 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] knowledge_source_name: Optional[str] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.FABRIC_DATA_AGENT] warning: str @@ -8339,6 +11422,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8347,6 +11431,7 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] = ..., knowledge_source_name: Optional[str] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8394,6 +11479,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseFabricOntologyActivityRecord(KnowledgeBaseActivityRecord, discriminator='fabricOntology'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8402,6 +11488,7 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] knowledge_source_name: Optional[str] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.FABRIC_ONTOLOGY] warning: str @@ -8409,6 +11496,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8417,6 +11505,7 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] = ..., knowledge_source_name: Optional[str] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8464,6 +11553,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseFileActivityRecord(KnowledgeBaseActivityRecord, discriminator='file'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8471,7 +11561,9 @@ namespace azure.search.documents.knowledgebases.models id: int image_serving: Optional[ImageServingStatistics] knowledge_source_name: Optional[str] + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.FILE] warning: str @@ -8479,6 +11571,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8486,7 +11579,9 @@ namespace azure.search.documents.knowledgebases.models id: int, image_serving: Optional[ImageServingStatistics] = ..., knowledge_source_name: Optional[str] = ..., + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8496,6 +11591,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseFileReference(KnowledgeBaseReference, discriminator='file'): activity_source: int + citation_url: Optional[str] doc_name: Optional[str] id: str reranker_score: float @@ -8507,6 +11603,7 @@ namespace azure.search.documents.knowledgebases.models self, *, activity_source: int, + citation_url: Optional[str] = ..., doc_name: Optional[str] = ..., id: str, reranker_score: Optional[float] = ..., @@ -8546,6 +11643,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeActivityRecord(KnowledgeBaseActivityRecord, discriminator='indexedOneLake'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8553,7 +11651,9 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] indexed_one_lake_arguments: Optional[KnowledgeBaseIndexedOneLakeActivityArguments] knowledge_source_name: Optional[str] + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.INDEXED_ONELAKE] warning: str @@ -8561,6 +11661,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8568,7 +11669,9 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] = ..., indexed_one_lake_arguments: Optional[KnowledgeBaseIndexedOneLakeActivityArguments] = ..., knowledge_source_name: Optional[str] = ..., + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8578,6 +11681,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedOneLakeReference(KnowledgeBaseReference, discriminator='indexedOneLake'): activity_source: int + citation_url: Optional[str] doc_url: Optional[str] id: str reranker_score: float @@ -8590,6 +11694,7 @@ namespace azure.search.documents.knowledgebases.models self, *, activity_source: int, + citation_url: Optional[str] = ..., doc_url: Optional[str] = ..., id: str, reranker_score: Optional[float] = ..., @@ -8616,6 +11721,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointActivityRecord(KnowledgeBaseActivityRecord, discriminator='indexedSharePoint'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8623,7 +11729,9 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] indexed_share_point_arguments: Optional[KnowledgeBaseIndexedSharePointActivityArguments] knowledge_source_name: Optional[str] + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.INDEXED_SHARE_POINT] warning: str @@ -8631,6 +11739,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8638,7 +11747,9 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] = ..., indexed_share_point_arguments: Optional[KnowledgeBaseIndexedSharePointActivityArguments] = ..., knowledge_source_name: Optional[str] = ..., + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8648,6 +11759,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSharePointReference(KnowledgeBaseReference, discriminator='indexedSharePoint'): activity_source: int + citation_url: Optional[str] doc_url: Optional[str] id: str reranker_score: float @@ -8660,6 +11772,7 @@ namespace azure.search.documents.knowledgebases.models self, *, activity_source: int, + citation_url: Optional[str] = ..., doc_url: Optional[str] = ..., id: str, reranker_score: Optional[float] = ..., @@ -8686,6 +11799,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlActivityRecord(KnowledgeBaseActivityRecord, discriminator='indexedSql'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8693,7 +11807,9 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] indexed_sql_arguments: Optional[KnowledgeBaseIndexedSqlActivityArguments] knowledge_source_name: Optional[str] + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.INDEXED_SQL] warning: str @@ -8701,6 +11817,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8708,7 +11825,9 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] = ..., indexed_sql_arguments: Optional[KnowledgeBaseIndexedSqlActivityArguments] = ..., knowledge_source_name: Optional[str] = ..., + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8718,6 +11837,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseIndexedSqlReference(KnowledgeBaseReference, discriminator='indexedSql'): activity_source: int + citation_url: Optional[str] doc_url: Optional[str] id: str reranker_score: float @@ -8729,6 +11849,7 @@ namespace azure.search.documents.knowledgebases.models self, *, activity_source: int, + citation_url: Optional[str] = ..., doc_url: Optional[str] = ..., id: str, reranker_score: Optional[float] = ..., @@ -8756,6 +11877,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseMcpServerActivityRecord(KnowledgeBaseActivityRecord, discriminator='mcpServer'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -8764,6 +11886,7 @@ namespace azure.search.documents.knowledgebases.models knowledge_source_name: Optional[str] mcp_server_arguments: Optional[KnowledgeBaseMcpServerActivityArguments] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.MCP_SERVER] warning: str @@ -8771,6 +11894,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -8779,6 +11903,7 @@ namespace azure.search.documents.knowledgebases.models knowledge_source_name: Optional[str] = ..., mcp_server_arguments: Optional[KnowledgeBaseMcpServerActivityArguments] = ..., query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8877,12 +12002,14 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseModelAnswerSynthesisActivityRecord(KnowledgeBaseActivityRecord, discriminator='modelAnswerSynthesis'): + completed_at: datetime elapsed_ms: int error: KnowledgeBaseErrorDetail id: int input_tokens: Optional[int] - model_name: Optional[str] + model: Optional[KnowledgeBaseActivityRecordModel] output_tokens: Optional[int] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.MODEL_ANSWER_SYNTHESIS] warning: str @@ -8890,12 +12017,14 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, input_tokens: Optional[int] = ..., - model_name: Optional[str] = ..., + model: Optional[KnowledgeBaseActivityRecordModel] = ..., output_tokens: Optional[int] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8904,12 +12033,14 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseModelQueryPlanningActivityRecord(KnowledgeBaseActivityRecord, discriminator='modelQueryPlanning'): + completed_at: datetime elapsed_ms: int error: KnowledgeBaseErrorDetail id: int input_tokens: Optional[int] - model_name: Optional[str] + model: Optional[KnowledgeBaseActivityRecordModel] output_tokens: Optional[int] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.MODEL_QUERY_PLANNING] warning: str @@ -8917,12 +12048,14 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, input_tokens: Optional[int] = ..., - model_name: Optional[str] = ..., + model: Optional[KnowledgeBaseActivityRecordModel] = ..., output_tokens: Optional[int] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8931,12 +12064,14 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseModelWebSummarizationActivityRecord(KnowledgeBaseActivityRecord, discriminator='modelWebSummarization'): + completed_at: datetime elapsed_ms: int error: KnowledgeBaseErrorDetail id: int input_tokens_count: Optional[int] - model_name: Optional[str] + model: Optional[KnowledgeBaseActivityRecordModel] output_tokens_count: Optional[int] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.MODEL_WEB_SUMMARIZATION] warning: str @@ -8944,12 +12079,14 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, input_tokens_count: Optional[int] = ..., - model_name: Optional[str] = ..., + model: Optional[KnowledgeBaseActivityRecordModel] = ..., output_tokens_count: Optional[int] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -8957,6 +12094,22 @@ namespace azure.search.documents.knowledgebases.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.models.KnowledgeBaseQueryHintProcessing(_Model): + generated_boost: Optional[str] + generated_filter: Optional[str] + + @overload + def __init__( + self, + *, + generated_boost: Optional[str] = ..., + generated_filter: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.models.KnowledgeBaseReference(_Model): activity_source: int id: str @@ -9011,6 +12164,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseRemoteSharePointActivityRecord(KnowledgeBaseActivityRecord, discriminator='remoteSharePoint'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -9019,6 +12173,7 @@ namespace azure.search.documents.knowledgebases.models knowledge_source_name: Optional[str] query_time: Optional[datetime] remote_share_point_arguments: Optional[KnowledgeBaseRemoteSharePointActivityArguments] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.REMOTE_SHARE_POINT] warning: str @@ -9026,6 +12181,7 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., @@ -9034,6 +12190,7 @@ namespace azure.search.documents.knowledgebases.models knowledge_source_name: Optional[str] = ..., query_time: Optional[datetime] = ..., remote_share_point_arguments: Optional[KnowledgeBaseRemoteSharePointActivityArguments] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -9066,6 +12223,22 @@ namespace azure.search.documents.knowledgebases.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.models.KnowledgeBaseResponseCompletedEvent(_Model): + response: KnowledgeBaseRetrievalResponse + status_code: Union[int, KnowledgeBaseRetrievalStatusCode] + + @overload + def __init__( + self, + *, + response: KnowledgeBaseRetrievalResponse, + status_code: Union[int, KnowledgeBaseRetrievalStatusCode] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalRequest(_Model): include_activity: Optional[bool] intents: Optional[list[KnowledgeRetrievalIntent]] @@ -9118,8 +12291,34 @@ namespace azure.search.documents.knowledgebases.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStartedEvent(_Model): + knowledge_base_name: str + output_mode: Union[str, KnowledgeRetrievalOutputMode] + reasoning_effort: KnowledgeRetrievalReasoningEffort + request_id: str + + @overload + def __init__( + self, + *, + knowledge_base_name: str, + output_mode: Union[str, KnowledgeRetrievalOutputMode], + reasoning_effort: KnowledgeRetrievalReasoningEffort, + request_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeBaseRetrievalStatusCode(int, Enum, metaclass=CaseInsensitiveEnumMeta): + OK = 200 + PARTIAL_CONTENT = 206 + + class azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityArguments(_Model): filter: Optional[str] + query_type: Optional[Union[str, QueryType]] search: Optional[str] search_fields: Optional[list[SearchIndexFieldReference]] semantic_configuration_name: Optional[str] @@ -9130,6 +12329,7 @@ namespace azure.search.documents.knowledgebases.models self, *, filter: Optional[str] = ..., + query_type: Optional[Union[str, QueryType]] = ..., search: Optional[str] = ..., search_fields: Optional[list[SearchIndexFieldReference]] = ..., semantic_configuration_name: Optional[str] = ..., @@ -9141,14 +12341,17 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexActivityRecord(KnowledgeBaseActivityRecord, discriminator='searchIndex'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail id: int image_serving: Optional[ImageServingStatistics] knowledge_source_name: Optional[str] + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] query_time: Optional[datetime] search_index_arguments: Optional[KnowledgeBaseSearchIndexActivityArguments] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.SEARCH_INDEX] warning: str @@ -9156,14 +12359,17 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, + completed_at: Optional[datetime] = ..., count: Optional[int] = ..., elapsed_ms: Optional[int] = ..., error: Optional[KnowledgeBaseErrorDetail] = ..., id: int, image_serving: Optional[ImageServingStatistics] = ..., knowledge_source_name: Optional[str] = ..., + query_hint_processing: Optional[KnowledgeBaseQueryHintProcessing] = ..., query_time: Optional[datetime] = ..., search_index_arguments: Optional[KnowledgeBaseSearchIndexActivityArguments] = ..., + started_at: Optional[datetime] = ..., warning: Optional[str] = ... ) -> None: ... @@ -9173,6 +12379,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseSearchIndexReference(KnowledgeBaseReference, discriminator='searchIndex'): activity_source: int + citation_url: Optional[str] doc_key: Optional[str] id: str reranker_score: float @@ -9185,6 +12392,7 @@ namespace azure.search.documents.knowledgebases.models self, *, activity_source: int, + citation_url: Optional[str] = ..., doc_key: Optional[str] = ..., id: str, reranker_score: Optional[float] = ..., @@ -9196,6 +12404,22 @@ namespace azure.search.documents.knowledgebases.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.models.KnowledgeBaseStreamErrorEvent(_Model): + activity: Optional[list[KnowledgeBaseActivityRecord]] + error: Optional[KnowledgeBaseErrorDetail] + + @overload + def __init__( + self, + *, + activity: Optional[list[KnowledgeBaseActivityRecord]] = ..., + error: Optional[KnowledgeBaseErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityArguments(_Model): count: Optional[int] freshness: Optional[str] @@ -9219,6 +12443,7 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseWebActivityRecord(KnowledgeBaseActivityRecord, discriminator='web'): + completed_at: datetime count: Optional[int] elapsed_ms: int error: KnowledgeBaseErrorDetail @@ -9226,6 +12451,7 @@ namespace azure.search.documents.knowledgebases.models image_serving: Optional[ImageServingStatistics] knowledge_source_name: Optional[str] query_time: Optional[datetime] + started_at: datetime type: Literal[KnowledgeBaseActivityRecordType.WEB] warning: str web_arguments: Optional[KnowledgeBaseWebActivityArguments] @@ -9234,574 +12460,1169 @@ namespace azure.search.documents.knowledgebases.models def __init__( self, *, - count: Optional[int] = ..., - elapsed_ms: Optional[int] = ..., - error: Optional[KnowledgeBaseErrorDetail] = ..., - id: int, - image_serving: Optional[ImageServingStatistics] = ..., - knowledge_source_name: Optional[str] = ..., - query_time: Optional[datetime] = ..., - warning: Optional[str] = ..., - web_arguments: Optional[KnowledgeBaseWebActivityArguments] = ... + completed_at: Optional[datetime] = ..., + count: Optional[int] = ..., + elapsed_ms: Optional[int] = ..., + error: Optional[KnowledgeBaseErrorDetail] = ..., + id: int, + image_serving: Optional[ImageServingStatistics] = ..., + knowledge_source_name: Optional[str] = ..., + query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., + warning: Optional[str] = ..., + web_arguments: Optional[KnowledgeBaseWebActivityArguments] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeBaseWebReference(KnowledgeBaseReference, discriminator='web'): + activity_source: int + id: str + reranker_score: float + source_data: dict[str, any] + title: Optional[str] + type: Literal[KnowledgeBaseReferenceType.WEB] + url: Optional[str] + + @overload + def __init__( + self, + *, + activity_source: int, + id: str, + reranker_score: Optional[float] = ..., + source_data: Optional[dict[str, Any]] = ..., + title: Optional[str] = ..., + url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityArguments(_Model): + search: Optional[str] + + @overload + def __init__( + self, + *, + search: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityRecord(KnowledgeBaseActivityRecord, discriminator='workIQ'): + completed_at: datetime + count: Optional[int] + elapsed_ms: int + error: KnowledgeBaseErrorDetail + id: int + image_serving: Optional[ImageServingStatistics] + knowledge_source_name: Optional[str] + query_time: Optional[datetime] + started_at: datetime + type: Literal[KnowledgeBaseActivityRecordType.WORK_IQ] + warning: str + work_iq_arguments: Optional[KnowledgeBaseWorkIQActivityArguments] + + @overload + def __init__( + self, + *, + completed_at: Optional[datetime] = ..., + count: Optional[int] = ..., + elapsed_ms: Optional[int] = ..., + error: Optional[KnowledgeBaseErrorDetail] = ..., + id: int, + image_serving: Optional[ImageServingStatistics] = ..., + knowledge_source_name: Optional[str] = ..., + query_time: Optional[datetime] = ..., + started_at: Optional[datetime] = ..., + warning: Optional[str] = ..., + work_iq_arguments: Optional[KnowledgeBaseWorkIQActivityArguments] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQReference(KnowledgeBaseReference, discriminator='workIQ'): + activity_source: int + id: str + reranker_score: float + search_sensitivity_label_info: Optional[PurviewSensitivityLabelInfo] + source_data: dict[str, any] + type: Literal[KnowledgeBaseReferenceType.WORK_IQ] + + @overload + def __init__( + self, + *, + activity_source: int, + id: str, + reranker_score: Optional[float] = ..., + search_sensitivity_label_info: Optional[PurviewSensitivityLabelInfo] = ..., + source_data: Optional[dict[str, Any]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalAutoReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='auto'): + kind: Literal[KnowledgeRetrievalReasoningEffortKind.AUTO] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntent(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC = "semantic" + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='low'): + kind: Literal[KnowledgeRetrievalReasoningEffortKind.LOW] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalMediumReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='medium'): + kind: Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='minimal'): + kind: Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANSWER_SYNTHESIS = "answerSynthesis" + EXTRACTIVE_DATA = "extractiveData" + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort(_Model): + kind: str + + @overload + def __init__( + self, + *, + kind: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + + + class azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent(KnowledgeRetrievalIntent, discriminator='semantic'): + search: str + type: Literal[KnowledgeRetrievalIntentType.SEMANTIC] + + @overload + def __init__( + self, + *, + search: str ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeBaseWebReference(KnowledgeBaseReference, discriminator='web'): - activity_source: int - id: str - reranker_score: float - source_data: dict[str, any] - title: Optional[str] - type: Literal[KnowledgeBaseReferenceType.WEB] - url: Optional[str] + class azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer(KnowledgeSourceVectorizer, discriminator='azureOpenAI'): + azure_open_ai_parameters: Optional[AzureOpenAIVectorizerParameters] + kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] @overload def __init__( self, *, - activity_source: int, - id: str, - reranker_score: Optional[float] = ..., - source_data: Optional[dict[str, Any]] = ..., - title: Optional[str] = ..., - url: Optional[str] = ... + azure_open_ai_parameters: Optional[AzureOpenAIVectorizerParameters] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityArguments(_Model): - search: Optional[str] + class azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters(_Model): + ai_services: Optional[AIServices] + asset_store: Optional[AssetStore] + chat_completion_model: Optional[KnowledgeBaseModel] + content_extraction_mode: Optional[Union[str, KnowledgeSourceContentExtractionMode]] + disable_image_verbalization: Optional[bool] + embedding_model: Optional[KnowledgeSourceVectorizer] + freshness_policy: Optional[FreshnessPolicy] + identity: Optional[SearchIndexerDataIdentity] + ingestion_permission_options: Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] + ingestion_schedule: Optional[IndexingSchedule] + network_access_mode: Optional[Union[str, KnowledgeSourceNetworkAccessMode]] @overload def __init__( self, *, - search: Optional[str] = ... + ai_services: Optional[AIServices] = ..., + asset_store: Optional[AssetStore] = ..., + chat_completion_model: Optional[KnowledgeBaseModel] = ..., + content_extraction_mode: Optional[Union[str, KnowledgeSourceContentExtractionMode]] = ..., + disable_image_verbalization: Optional[bool] = ..., + embedding_model: Optional[KnowledgeSourceVectorizer] = ..., + freshness_policy: Optional[FreshnessPolicy] = ..., + identity: Optional[SearchIndexerDataIdentity] = ..., + ingestion_permission_options: Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] = ..., + ingestion_schedule: Optional[IndexingSchedule] = ..., + network_access_mode: Optional[Union[str, KnowledgeSourceNetworkAccessMode]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQActivityRecord(KnowledgeBaseActivityRecord, discriminator='workIQ'): - count: Optional[int] - elapsed_ms: int - error: KnowledgeBaseErrorDetail - id: int - image_serving: Optional[ImageServingStatistics] - knowledge_source_name: Optional[str] - query_time: Optional[datetime] - type: Literal[KnowledgeBaseActivityRecordType.WORK_IQ] - warning: str - work_iq_arguments: Optional[KnowledgeBaseWorkIQActivityArguments] + class azure.search.documents.knowledgebases.models.KnowledgeSourceNetworkAccessMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRIVATE = "private" + PUBLIC = "public" + + + class azure.search.documents.knowledgebases.models.KnowledgeSourceParams(_Model): + always_query_source: Optional[bool] + enable_image_serving: Optional[bool] + fail_on_error: Optional[bool] + include_reference_source_data: Optional[bool] + include_references: Optional[bool] + kind: str + knowledge_source_name: str + max_output_documents: Optional[int] + never_query_source: Optional[bool] + reranker_threshold: Optional[float] + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] @overload def __init__( self, *, - count: Optional[int] = ..., - elapsed_ms: Optional[int] = ..., - error: Optional[KnowledgeBaseErrorDetail] = ..., - id: int, - image_serving: Optional[ImageServingStatistics] = ..., - knowledge_source_name: Optional[str] = ..., - query_time: Optional[datetime] = ..., - warning: Optional[str] = ..., - work_iq_arguments: Optional[KnowledgeBaseWorkIQActivityArguments] = ... + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + kind: str, + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeBaseWorkIQReference(KnowledgeBaseReference, discriminator='workIQ'): - activity_source: int - attributions: Optional[list[WorkIQAttribution]] - id: str - reranker_score: float - source_data: dict[str, any] - type: Literal[KnowledgeBaseReferenceType.WORK_IQ] + class azure.search.documents.knowledgebases.models.KnowledgeSourceStatistics(_Model): + average_items_processed_per_synchronization: int + average_synchronization_duration: str + total_synchronization: int @overload def __init__( self, *, - activity_source: int, - attributions: Optional[list[WorkIQAttribution]] = ..., - id: str, - reranker_score: Optional[float] = ..., - source_data: Optional[dict[str, Any]] = ... + average_items_processed_per_synchronization: int, + average_synchronization_duration: str, + total_synchronization: int ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntent(_Model): - type: str + class azure.search.documents.knowledgebases.models.KnowledgeSourceStatus(_Model): + current_synchronization_state: Optional[SynchronizationState] + kind: Optional[Union[str, KnowledgeSourceKind]] + last_synchronization_state: Optional[CompletedSynchronizationState] + statistics: Optional[KnowledgeSourceStatistics] + synchronization_interval: Optional[str] + synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] @overload def __init__( self, *, - type: str + current_synchronization_state: Optional[SynchronizationState] = ..., + kind: Optional[Union[str, KnowledgeSourceKind]] = ..., + last_synchronization_state: Optional[CompletedSynchronizationState] = ..., + statistics: Optional[KnowledgeSourceStatistics] = ..., + synchronization_interval: Optional[str] = ..., + synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalIntentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SEMANTIC = "semantic" - - - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalLowReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='low'): - kind: Literal[KnowledgeRetrievalReasoningEffortKind.LOW] + class azure.search.documents.knowledgebases.models.KnowledgeSourceSynchronizationError(_Model): + details: Optional[str] + doc_id: Optional[str] + documentation_link: Optional[str] + error_message: str + name: Optional[str] + status_code: Optional[int] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + details: Optional[str] = ..., + doc_id: Optional[str] = ..., + documentation_link: Optional[str] = ..., + error_message: str, + name: Optional[str] = ..., + status_code: Optional[int] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalMediumReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='medium'): - kind: Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM] + class azure.search.documents.knowledgebases.models.KnowledgeSourceVectorizer(_Model): + kind: str @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + kind: str + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalMinimalReasoningEffort(KnowledgeRetrievalReasoningEffort, discriminator='minimal'): - kind: Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL] + class azure.search.documents.knowledgebases.models.McpServerKnowledgeSourceParams(KnowledgeSourceParams, discriminator='mcpServer'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.MCP_SERVER] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload - def __init__(self) -> None: ... + def __init__( + self, + *, + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... + ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalOutputMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANSWER_SYNTHESIS = "answerSynthesis" - EXTRACTIVE_DATA = "extractiveData" - - - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffort(_Model): - kind: str + class azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo(_Model): + color: Optional[str] + display_name: Optional[str] + is_encrypted: Optional[bool] + priority: Optional[int] + sensitivity_label_id: Optional[str] + tool_tip: Optional[str] @overload def __init__( self, *, - kind: str + color: Optional[str] = ..., + display_name: Optional[str] = ..., + is_encrypted: Optional[bool] = ..., + priority: Optional[int] = ..., + sensitivity_label_id: Optional[str] = ..., + tool_tip: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalReasoningEffortKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - LOW = "low" - MEDIUM = "medium" - MINIMAL = "minimal" + class azure.search.documents.knowledgebases.models.RemoteSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminator='remoteSharePoint'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + filter_expression_add_on: Optional[str] + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + @overload + def __init__( + self, + *, + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + filter_expression_add_on: Optional[str] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... + ) -> None: ... + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeRetrievalSemanticIntent(KnowledgeRetrievalIntent, discriminator='semantic'): - search: str - type: Literal[KnowledgeRetrievalIntentType.SEMANTIC] + + class azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams(KnowledgeSourceParams, discriminator='searchIndex'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + filter_add_on: Optional[str] + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( self, *, - search: str + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + filter_add_on: Optional[str] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + query_hint_overrides: Optional[SearchIndexKnowledgeSourceQueryHints] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer(KnowledgeSourceVectorizer, discriminator='azureOpenAI'): - azure_open_ai_parameters: Optional[AzureOpenAIVectorizerParameters] - kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] + class azure.search.documents.knowledgebases.models.ServedImage(_Model): + image_id: Optional[str] + image_path: Optional[str] + size_bytes: Optional[int] @overload def __init__( self, *, - azure_open_ai_parameters: Optional[AzureOpenAIVectorizerParameters] = ... + image_id: Optional[str] = ..., + image_path: Optional[str] = ..., + size_bytes: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters(_Model): - ai_services: Optional[AIServices] - asset_store: Optional[AssetStore] - chat_completion_model: Optional[KnowledgeBaseModel] - content_extraction_mode: Optional[Union[str, KnowledgeSourceContentExtractionMode]] - disable_image_verbalization: Optional[bool] - embedding_model: Optional[KnowledgeSourceVectorizer] - freshness_policy: Optional[FreshnessPolicy] - identity: Optional[SearchIndexerDataIdentity] - ingestion_permission_options: Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] - ingestion_schedule: Optional[IndexingSchedule] + class azure.search.documents.knowledgebases.models.SynchronizationState(_Model): + errors: Optional[list[KnowledgeSourceSynchronizationError]] + items_skipped: int + items_updates_failed: int + items_updates_processed: int + start_time: datetime @overload def __init__( self, *, - ai_services: Optional[AIServices] = ..., - asset_store: Optional[AssetStore] = ..., - chat_completion_model: Optional[KnowledgeBaseModel] = ..., - content_extraction_mode: Optional[Union[str, KnowledgeSourceContentExtractionMode]] = ..., - disable_image_verbalization: Optional[bool] = ..., - embedding_model: Optional[KnowledgeSourceVectorizer] = ..., - freshness_policy: Optional[FreshnessPolicy] = ..., - identity: Optional[SearchIndexerDataIdentity] = ..., - ingestion_permission_options: Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] = ..., - ingestion_schedule: Optional[IndexingSchedule] = ... + errors: Optional[list[KnowledgeSourceSynchronizationError]] = ..., + items_skipped: int, + items_updates_failed: int, + items_updates_processed: int, + start_time: datetime ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeSourceParams(_Model): - always_query_source: Optional[bool] - enable_image_serving: Optional[bool] - fail_on_error: Optional[bool] - include_reference_source_data: Optional[bool] - include_references: Optional[bool] - kind: str + class azure.search.documents.knowledgebases.models.WebKnowledgeSourceParams(KnowledgeSourceParams, discriminator='web'): + always_query_source: bool + count: Optional[int] + enable_image_serving: bool + fail_on_error: bool + freshness: Optional[str] + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.WEB] knowledge_source_name: str - max_output_documents: Optional[int] - reranker_threshold: Optional[float] + language: Optional[str] + market: Optional[str] + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( self, *, always_query_source: Optional[bool] = ..., + count: Optional[int] = ..., enable_image_serving: Optional[bool] = ..., fail_on_error: Optional[bool] = ..., + freshness: Optional[str] = ..., include_reference_source_data: Optional[bool] = ..., include_references: Optional[bool] = ..., - kind: str, knowledge_source_name: str, + language: Optional[str] = ..., + market: Optional[str] = ..., max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeSourceStatistics(_Model): - average_items_processed_per_synchronization: int - average_synchronization_duration: str - total_synchronization: int + class azure.search.documents.knowledgebases.models.WorkIQKnowledgeSourceParams(KnowledgeSourceParams, discriminator='workIQ'): + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Literal[KnowledgeSourceKind.WORK_IQ] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] @overload def __init__( self, *, - average_items_processed_per_synchronization: int, - average_synchronization_duration: str, - total_synchronization: int + always_query_source: Optional[bool] = ..., + enable_image_serving: Optional[bool] = ..., + fail_on_error: Optional[bool] = ..., + include_reference_source_data: Optional[bool] = ..., + include_references: Optional[bool] = ..., + knowledge_source_name: str, + max_output_documents: Optional[int] = ..., + never_query_source: Optional[bool] = ..., + reranker_threshold: Optional[float] = ..., + results_processing: Optional[Union[str, KnowledgeSourceResultsProcessing]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.search.documents.knowledgebases.models.KnowledgeSourceStatus(_Model): - current_synchronization_state: Optional[SynchronizationState] - kind: Optional[Union[str, KnowledgeSourceKind]] - last_synchronization_state: Optional[CompletedSynchronizationState] - statistics: Optional[KnowledgeSourceStatistics] - synchronization_interval: Optional[str] - synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] +namespace azure.search.documents.knowledgebases.types - @overload - def __init__( - self, - *, - current_synchronization_state: Optional[SynchronizationState] = ..., - kind: Optional[Union[str, KnowledgeSourceKind]] = ..., - last_synchronization_state: Optional[CompletedSynchronizationState] = ..., - statistics: Optional[KnowledgeSourceStatistics] = ..., - synchronization_interval: Optional[str] = ..., - synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] - ) -> None: ... + class azure.search.documents.knowledgebases.types.AIServices(TypedDict, total=False): + key "apiKey": str + api_key: str + uri: Required[str] - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.types.AssetStore(TypedDict, total=False): + connectionString: Required[str] + connection_string: str + containerName: Required[str] + container_name: str - class azure.search.documents.knowledgebases.models.KnowledgeSourceSynchronizationError(_Model): - details: Optional[str] - doc_id: Optional[str] - documentation_link: Optional[str] - error_message: str - name: Optional[str] - status_code: Optional[int] - @overload - def __init__( - self, - *, - details: Optional[str] = ..., - doc_id: Optional[str] = ..., - documentation_link: Optional[str] = ..., - error_message: str, - name: Optional[str] = ..., - status_code: Optional[int] = ... - ) -> None: ... + class azure.search.documents.knowledgebases.types.AzureBlobKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: SearchIndexKnowledgeSourceQueryHints + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.search.documents.knowledgebases.types.CompletedSynchronizationState(TypedDict, total=False): + endTime: Required[str] + end_time: str + itemsSkipped: Required[int] + itemsUpdatesFailed: Required[int] + itemsUpdatesProcessed: Required[int] + items_skipped: int + items_updates_failed: int + items_updates_processed: int + startTime: Required[str] + start_time: str + + + class azure.search.documents.knowledgebases.types.FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.FabricOntologyKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.FileKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.FILE]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: SearchIndexKnowledgeSourceQueryHints + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] - class azure.search.documents.knowledgebases.models.KnowledgeSourceVectorizer(_Model): - kind: str + class azure.search.documents.knowledgebases.types.FreshnessPolicy(TypedDict, total=False): + key "boostingDuration": str + boosting_duration: str - @overload - def __init__( - self, - *, - kind: str - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.types.IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: SearchIndexKnowledgeSourceQueryHints + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.IndexedSharePointKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: SearchIndexKnowledgeSourceQueryHints + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.IndexedSqlKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + always_query_source: bool + enable_image_serving: bool + fail_on_error: bool + include_reference_source_data: bool + include_references: bool + kind: Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] + knowledgeSourceName: Required[str] + knowledge_source_name: str + max_output_documents: int + never_query_source: bool + query_hint_overrides: SearchIndexKnowledgeSourceQueryHints + reranker_threshold: float + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.KnowledgeBaseImageContent(TypedDict, total=False): + url: Required[str] + + + class azure.search.documents.knowledgebases.types.KnowledgeBaseMessage(TypedDict, total=False): + key "role": str + content: Required[list[KnowledgeBaseMessageContent]] + role: str + + + class azure.search.documents.knowledgebases.types.KnowledgeBaseMessageContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE = "image" + TEXT = "text" + + + class azure.search.documents.knowledgebases.types.KnowledgeBaseMessageImageContent(TypedDict, total=False): + image: Required[KnowledgeBaseImageContent] + type: Required[Literal[KnowledgeBaseMessageContentType.IMAGE]] + + + class azure.search.documents.knowledgebases.types.KnowledgeBaseMessageTextContent(TypedDict, total=False): + text: Required[str] + type: Required[Literal[KnowledgeBaseMessageContentType.TEXT]] + + + class azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest(TypedDict, total=False): + key "includeActivity": bool + key "intents": list[KnowledgeRetrievalIntent] + key "knowledgeSourceParams": list[KnowledgeSourceParams] + key "maxOutputDocuments": int + key "maxOutputSize": int + key "maxOutputSizeInTokens": int + key "maxRuntimeInSeconds": int + key "messages": list[KnowledgeBaseMessage] + key "outputMode": Union[str, KnowledgeRetrievalOutputMode] + key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort') + include_activity: bool + intents: list[KnowledgeRetrievalIntent] + knowledge_source_params: list[KnowledgeSourceParams] + max_output_documents: int + max_output_size: int + max_output_size_in_tokens: int + max_runtime_in_seconds: int + messages: list[KnowledgeBaseMessage] + output_mode: Union[str, KnowledgeRetrievalOutputMode] + retrieval_reasoning_effort: KnowledgeRetrievalReasoningEffort + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalAutoReasoningEffort(TypedDict, total=False): + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.AUTO]] + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalIntent(TypedDict, total=False): + search: Required[str] + type: Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalIntentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEMANTIC = "semantic" + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalLowReasoningEffort(TypedDict, total=False): + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.LOW]] + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalMediumReasoningEffort(TypedDict, total=False): + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM]] + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalMinimalReasoningEffort(TypedDict, total=False): + kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL]] + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalReasoningEffortKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + + + class azure.search.documents.knowledgebases.types.KnowledgeRetrievalSemanticIntent(TypedDict, total=False): + search: Required[str] + type: Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + + + class azure.search.documents.knowledgebases.types.KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): + key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters') + azure_open_ai_parameters: AzureOpenAIVectorizerParameters + kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + + + class azure.search.documents.knowledgebases.types.KnowledgeSourceIngestionParameters(TypedDict, total=False): + key "aiServices": Optional[AIServices] + key "assetStore": ForwardRef('AssetStore') + key "chatCompletionModel": Optional[KnowledgeBaseModel] + key "contentExtractionMode": Optional[Union[str, KnowledgeSourceContentExtractionMode]] + key "disableImageVerbalization": bool + key "embeddingModel": Optional[KnowledgeSourceVectorizer] + key "freshnessPolicy": ForwardRef('FreshnessPolicy') + key "identity": Optional[SearchIndexerDataIdentity] + key "ingestionPermissionOptions": Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] + key "ingestionSchedule": Optional[IndexingSchedule] + key "networkAccessMode": Union[str, KnowledgeSourceNetworkAccessMode] + ai_services: AIServices + asset_store: AssetStore + chat_completion_model: KnowledgeBaseModel + content_extraction_mode: Union[str, KnowledgeSourceContentExtractionMode] + disable_image_verbalization: bool + embedding_model: KnowledgeSourceVectorizer + freshness_policy: FreshnessPolicy + identity: SearchIndexerDataIdentity + ingestion_permission_options: list[Union[str, KnowledgeSourceIngestionPermissionOption]] + ingestion_schedule: IndexingSchedule + network_access_mode: Union[str, KnowledgeSourceNetworkAccessMode] + + + class azure.search.documents.knowledgebases.types.KnowledgeSourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_BLOB = "azureBlob" + FABRIC_DATA_AGENT = "fabricDataAgent" + FABRIC_ONTOLOGY = "fabricOntology" + FILE = "file" + INDEXED_ONELAKE = "indexedOneLake" + INDEXED_SHARE_POINT = "indexedSharePoint" + INDEXED_SQL = "indexedSql" + MCP_SERVER = "mcpServer" + REMOTE_SHARE_POINT = "remoteSharePoint" + SEARCH_INDEX = "searchIndex" + WEB = "web" + WORK_IQ = "workIQ" + + + class azure.search.documents.knowledgebases.types.KnowledgeSourceStatistics(TypedDict, total=False): + averageItemsProcessedPerSynchronization: Required[int] + averageSynchronizationDuration: Required[str] + average_items_processed_per_synchronization: int + average_synchronization_duration: str + totalSynchronization: Required[int] + total_synchronization: int + + class azure.search.documents.knowledgebases.types.KnowledgeSourceStatus(TypedDict, total=False): + key "currentSynchronizationState": Optional[SynchronizationState] + key "kind": Union[str, KnowledgeSourceKind] + key "lastSynchronizationState": Optional[CompletedSynchronizationState] + key "statistics": Optional[KnowledgeSourceStatistics] + key "synchronizationInterval": Optional[str] + current_synchronization_state: SynchronizationState + kind: Union[str, KnowledgeSourceKind] + last_synchronization_state: CompletedSynchronizationState + statistics: KnowledgeSourceStatistics + synchronizationStatus: Required[Union[str, KnowledgeSourceSynchronizationStatus]] + synchronization_interval: str + synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] - class azure.search.documents.knowledgebases.models.McpServerKnowledgeSourceParams(KnowledgeSourceParams, discriminator='mcpServer'): + + class azure.search.documents.knowledgebases.types.KnowledgeSourceSynchronizationError(TypedDict, total=False): + key "details": str + key "docId": str + key "documentationLink": str + key "name": str + key "statusCode": int + details: str + doc_id: str + documentation_link: str + errorMessage: Required[str] + error_message: str + name: str + status_code: int + + + class azure.search.documents.knowledgebases.types.KnowledgeSourceVectorizer(TypedDict, total=False): + key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters') + azure_open_ai_parameters: AzureOpenAIVectorizerParameters + kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + + + class azure.search.documents.knowledgebases.types.McpServerKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool enable_image_serving: bool fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Literal[KnowledgeSourceKind.MCP_SERVER] + kind: Required[Literal[KnowledgeSourceKind.MCP_SERVER]] + knowledgeSourceName: Required[str] knowledge_source_name: str max_output_documents: int + never_query_source: bool reranker_threshold: float - - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.search.documents.knowledgebases.models.PurviewSensitivityLabelInfo(_Model): - color: Optional[str] - display_name: Optional[str] - is_encrypted: Optional[bool] - priority: Optional[int] - sensitivity_label_id: Optional[str] - tool_tip: Optional[str] - - @overload - def __init__( - self, - *, - color: Optional[str] = ..., - display_name: Optional[str] = ..., - is_encrypted: Optional[bool] = ..., - priority: Optional[int] = ..., - sensitivity_label_id: Optional[str] = ..., - tool_tip: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.search.documents.knowledgebases.models.RemoteSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminator='remoteSharePoint'): + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.RemoteSharePointKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "filterExpressionAddOn": str + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool enable_image_serving: bool fail_on_error: bool - filter_expression_add_on: Optional[str] + filter_expression_add_on: str include_reference_source_data: bool include_references: bool - kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] + kind: Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] + knowledgeSourceName: Required[str] knowledge_source_name: str max_output_documents: int + never_query_source: bool reranker_threshold: float - - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - filter_expression_add_on: Optional[str] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.search.documents.knowledgebases.models.SearchIndexKnowledgeSourceParams(KnowledgeSourceParams, discriminator='searchIndex'): + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.SearchIndexKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "filterAddOn": str + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool enable_image_serving: bool fail_on_error: bool - filter_add_on: Optional[str] + filter_add_on: str include_reference_source_data: bool include_references: bool - kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] + kind: Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] + knowledgeSourceName: Required[str] knowledge_source_name: str max_output_documents: int + never_query_source: bool + query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float - - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - filter_add_on: Optional[str] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + results_processing: Union[str, KnowledgeSourceResultsProcessing] - class azure.search.documents.knowledgebases.models.SynchronizationState(_Model): - errors: Optional[list[KnowledgeSourceSynchronizationError]] + class azure.search.documents.knowledgebases.types.SynchronizationState(TypedDict, total=False): + key "errors": list[KnowledgeSourceSynchronizationError] + errors: list[KnowledgeSourceSynchronizationError] + itemsSkipped: Required[int] + itemsUpdatesFailed: Required[int] + itemsUpdatesProcessed: Required[int] items_skipped: int items_updates_failed: int items_updates_processed: int - start_time: datetime + startTime: Required[str] + start_time: str - @overload - def __init__( - self, - *, - errors: Optional[list[KnowledgeSourceSynchronizationError]] = ..., - items_skipped: int, - items_updates_failed: int, - items_updates_processed: int, - start_time: datetime - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.search.documents.knowledgebases.types.VectorSearchVectorizerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AI_SERVICES_VISION = "aiServicesVision" + AML = "aml" + AZURE_OPEN_AI = "azureOpenAI" + CUSTOM_WEB_API = "customWebApi" - class azure.search.documents.knowledgebases.models.WebKnowledgeSourceParams(KnowledgeSourceParams, discriminator='web'): + class azure.search.documents.knowledgebases.types.WebKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "count": int + key "enableImageServing": bool + key "failOnError": bool + key "freshness": str + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "language": str + key "market": str + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool - count: Optional[int] + count: int enable_image_serving: bool fail_on_error: bool - freshness: Optional[str] + freshness: str include_reference_source_data: bool include_references: bool - kind: Literal[KnowledgeSourceKind.WEB] + kind: Required[Literal[KnowledgeSourceKind.WEB]] + knowledgeSourceName: Required[str] knowledge_source_name: str - language: Optional[str] - market: Optional[str] + language: str + market: str max_output_documents: int + never_query_source: bool reranker_threshold: float - - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - count: Optional[int] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - freshness: Optional[str] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - language: Optional[str] = ..., - market: Optional[str] = ..., - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.search.documents.knowledgebases.models.WorkIQAttribution(_Model): - see_more_web_url: Optional[str] - - @overload - def __init__( - self, - *, - see_more_web_url: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.search.documents.knowledgebases.models.WorkIQKnowledgeSourceParams(KnowledgeSourceParams, discriminator='workIQ'): + results_processing: Union[str, KnowledgeSourceResultsProcessing] + + + class azure.search.documents.knowledgebases.types.WorkIQKnowledgeSourceParams(TypedDict, total=False): + key "alwaysQuerySource": bool + key "enableImageServing": bool + key "failOnError": bool + key "includeReferenceSourceData": bool + key "includeReferences": bool + key "maxOutputDocuments": int + key "neverQuerySource": bool + key "rerankerThreshold": float + key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool enable_image_serving: bool fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Literal[KnowledgeSourceKind.WORK_IQ] + kind: Required[Literal[KnowledgeSourceKind.WORK_IQ]] + knowledgeSourceName: Required[str] knowledge_source_name: str max_output_documents: int + never_query_source: bool reranker_threshold: float - - @overload - def __init__( - self, - *, - always_query_source: Optional[bool] = ..., - enable_image_serving: Optional[bool] = ..., - fail_on_error: Optional[bool] = ..., - include_reference_source_data: Optional[bool] = ..., - include_references: Optional[bool] = ..., - knowledge_source_name: str, - max_output_documents: Optional[int] = ..., - reranker_threshold: Optional[float] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + results_processing: Union[str, KnowledgeSourceResultsProcessing] namespace azure.search.documents.models @@ -10397,4 +14218,503 @@ namespace azure.search.documents.models subscores: Optional[QueryResultDocumentSubscores] +namespace azure.search.documents.types + + class azure.search.documents.types.AutocompleteItem(TypedDict, total=False): + queryPlusText: Required[str] + query_plus_text: str + text: Required[str] + + + class azure.search.documents.types.AutocompletePostRequest(TypedDict, total=False): + key "autocompleteMode": Union[str, AutocompleteMode] + key "filter": str + key "fuzzy": bool + key "highlightPostTag": str + key "highlightPreTag": str + key "minimumCoverage": float + key "searchFields": list[str] + key "top": int + autocomplete_mode: Union[str, AutocompleteMode] + filter: str + highlight_post_tag: str + highlight_pre_tag: str + minimum_coverage: float + search: Required[str] + search_fields: list[str] + search_text: str + suggesterName: Required[str] + suggester_name: str + top: int + use_fuzzy_matching: bool + + + class azure.search.documents.types.DebugInfo(TypedDict, total=False): + key "queryRewrites": ForwardRef('QueryRewritesDebugInfo') + query_rewrites: QueryRewritesDebugInfo + + + class azure.search.documents.types.DocumentDebugInfo(TypedDict, total=False): + key "innerHits": dict[str, list[QueryResultDocumentInnerHit]] + key "semantic": ForwardRef('SemanticDebugInfo') + key "vectors": ForwardRef('VectorsDebugInfo') + inner_hits: dict[str, list[QueryResultDocumentInnerHit]] + semantic: SemanticDebugInfo + vectors: VectorsDebugInfo + + + class azure.search.documents.types.FacetResult(TypedDict): + key "@search.facets": dict[str, list[FacetResult]] + key "avg": float + key "cardinality": int + key "count": int + key "max": float + key "min": float + key "sum": float + avg: float + cardinality: int + count: int + facets: dict[str, list[FacetResult]] + max: float + min: float + sum: float + + + class azure.search.documents.types.HybridSearch(TypedDict, total=False): + key "countAndFacetMode": Union[str, HybridCountAndFacetMode] + key "maxTextRecallSize": int + count_and_facet_mode: Union[str, HybridCountAndFacetMode] + max_text_recall_size: int + + + class azure.search.documents.types.IndexAction(TypedDict): + key "@search.action": Union[str, IndexActionType] + action_type: Union[str, IndexActionType] + + + class azure.search.documents.types.IndexDocumentsBatch(TypedDict, total=False): + actions: list[IndexAction] + value: Required[list[IndexAction]] + + + class azure.search.documents.types.IndexingResult(TypedDict, total=False): + key "errorMessage": str + error_message: str + key: Required[str] + status: Required[bool] + statusCode: Required[int] + status_code: int + succeeded: bool + + + class azure.search.documents.types.QueryAnswerResult(TypedDict, total=False): + key "highlights": Optional[str] + key "key": str + key "score": float + key "text": str + highlights: str + key: str + score: float + text: str + + + class azure.search.documents.types.QueryCaptionResult(TypedDict, total=False): + key "highlights": Optional[str] + key "text": str + highlights: str + text: str + + + class azure.search.documents.types.QueryResultDocumentInnerHit(TypedDict, total=False): + key "ordinal": int + key "vectors": list[dict[str, SingleVectorFieldResult]] + ordinal: int + vectors: list[dict[str, SingleVectorFieldResult]] + + + class azure.search.documents.types.QueryResultDocumentRerankerInput(TypedDict, total=False): + key "content": str + key "keywords": str + key "title": str + content: str + keywords: str + title: str + + + class azure.search.documents.types.QueryResultDocumentSemanticField(TypedDict, total=False): + key "name": str + key "state": Union[str, SemanticFieldState] + name: str + state: Union[str, SemanticFieldState] + + + class azure.search.documents.types.QueryResultDocumentSubscores(TypedDict, total=False): + key "documentBoost": float + key "text": ForwardRef('TextResult') + key "vectors": list[dict[str, SingleVectorFieldResult]] + document_boost: float + text: TextResult + vectors: list[dict[str, SingleVectorFieldResult]] + + + class azure.search.documents.types.QueryRewritesDebugInfo(TypedDict, total=False): + key "text": ForwardRef('QueryRewritesValuesDebugInfo') + key "vectors": list[QueryRewritesValuesDebugInfo] + text: QueryRewritesValuesDebugInfo + vectors: list[QueryRewritesValuesDebugInfo] + + + class azure.search.documents.types.QueryRewritesValuesDebugInfo(TypedDict, total=False): + key "inputQuery": str + key "rewrites": list[str] + input_query: str + rewrites: list[str] + + + class azure.search.documents.types.SearchDocumentsResult(TypedDict): + key "@odata.count": int + key "@odata.nextLink": str + key "@search.answers": Optional[list[QueryAnswerResult]] + key "@search.coverage": float + key "@search.debug": Optional[DebugInfo] + key "@search.facets": dict[str, list[FacetResult]] + key "@search.nextPageParameters": ForwardRef('SearchRequest') + key "@search.semanticPartialResponseReason": Union[str, SemanticErrorReason] + key "@search.semanticPartialResponseType": Union[str, SemanticSearchResultsType] + key "@search.semanticQueryRewritesResultType": Union[str, SemanticQueryRewritesResultType] + answers: list[QueryAnswerResult] + count: int + coverage: float + debug_info: DebugInfo + facets: dict[str, list[FacetResult]] + next_link: str + next_page_parameters: SearchRequest + results: list[SearchResult] + semantic_partial_response_reason: Union[str, SemanticErrorReason] + semantic_partial_response_type: Union[str, SemanticSearchResultsType] + semantic_query_rewrites_result_type: Union[str, SemanticQueryRewritesResultType] + value: Required[list[SearchResult]] + + + class azure.search.documents.types.SearchPostRequest(TypedDict, total=False): + key "answers": Union[str, QueryAnswerType] + key "captions": Union[str, QueryCaptionType] + key "count": bool + key "debug": Union[str, QueryDebugMode] + key "facets": list[str] + key "filter": str + key "highlight": list[str] + key "highlightPostTag": str + key "highlightPreTag": str + key "hybridSearch": ForwardRef('HybridSearch') + key "minimumCoverage": float + key "orderby": list[str] + key "queryLanguage": Union[str, QueryLanguage] + key "queryRewrites": Union[str, QueryRewritesType] + key "queryType": Union[str, QueryType] + key "scoringParameters": list[str] + key "scoringProfile": str + key "scoringStatistics": Union[str, ScoringStatistics] + key "search": str + key "searchFields": list[str] + key "searchMode": Union[str, SearchMode] + key "select": list[str] + key "semanticConfiguration": str + key "semanticErrorHandling": Union[str, SemanticErrorMode] + key "semanticFields": list[str] + key "semanticMaxWaitInMilliseconds": int + key "semanticQuery": str + key "sessionId": str + key "skip": int + key "speller": Union[str, QuerySpellerType] + key "top": int + key "vectorFilterMode": Union[str, VectorFilterMode] + key "vectorQueries": list[VectorQuery] + answers: Union[str, QueryAnswerType] + captions: Union[str, QueryCaptionType] + debug: Union[str, QueryDebugMode] + facets: list[str] + filter: str + highlight_fields: list[str] + highlight_post_tag: str + highlight_pre_tag: str + hybrid_search: HybridSearch + include_total_count: bool + minimum_coverage: float + order_by: list[str] + query_language: Union[str, QueryLanguage] + query_rewrites: Union[str, QueryRewritesType] + query_speller: Union[str, QuerySpellerType] + query_type: Union[str, QueryType] + scoring_parameters: list[str] + scoring_profile: str + scoring_statistics: Union[str, ScoringStatistics] + search_fields: list[str] + search_mode: Union[str, SearchMode] + search_text: str + select: list[str] + semantic_configuration_name: str + semantic_error_handling: Union[str, SemanticErrorMode] + semantic_fields: list[str] + semantic_max_wait_in_milliseconds: int + semantic_query: str + session_id: str + skip: int + top: int + vector_filter_mode: Union[str, VectorFilterMode] + vector_queries: list[VectorQuery] + + + class azure.search.documents.types.SearchRequest(TypedDict, total=False): + key "answers": Union[str, QueryAnswerType] + key "captions": Union[str, QueryCaptionType] + key "count": bool + key "debug": Union[str, QueryDebugMode] + key "facets": list[str] + key "filter": str + key "highlight": list[str] + key "highlightPostTag": str + key "highlightPreTag": str + key "hybridSearch": ForwardRef('HybridSearch') + key "minimumCoverage": float + key "orderby": list[str] + key "queryLanguage": Union[str, QueryLanguage] + key "queryRewrites": Union[str, QueryRewritesType] + key "queryType": Union[str, QueryType] + key "scoringParameters": list[str] + key "scoringProfile": str + key "scoringStatistics": Union[str, ScoringStatistics] + key "search": str + key "searchFields": list[str] + key "searchMode": Union[str, SearchMode] + key "select": list[str] + key "semanticConfiguration": str + key "semanticErrorHandling": Union[str, SemanticErrorMode] + key "semanticFields": list[str] + key "semanticMaxWaitInMilliseconds": int + key "semanticQuery": str + key "sessionId": str + key "skip": int + key "speller": Union[str, QuerySpellerType] + key "top": int + key "vectorFilterMode": Union[str, VectorFilterMode] + key "vectorQueries": list[VectorQuery] + answers: Union[str, QueryAnswerType] + captions: Union[str, QueryCaptionType] + debug: Union[str, QueryDebugMode] + facets: list[str] + filter: str + highlight_fields: list[str] + highlight_post_tag: str + highlight_pre_tag: str + hybrid_search: HybridSearch + include_total_count: bool + minimum_coverage: float + order_by: list[str] + query_language: Union[str, QueryLanguage] + query_rewrites: Union[str, QueryRewritesType] + query_speller: Union[str, QuerySpellerType] + query_type: Union[str, QueryType] + scoring_parameters: list[str] + scoring_profile: str + scoring_statistics: Union[str, ScoringStatistics] + search_fields: list[str] + search_mode: Union[str, SearchMode] + search_text: str + select: list[str] + semantic_configuration_name: str + semantic_error_handling: Union[str, SemanticErrorMode] + semantic_fields: list[str] + semantic_max_wait_in_milliseconds: int + semantic_query: str + session_id: str + skip: int + top: int + vector_filter_mode: Union[str, VectorFilterMode] + vector_queries: list[VectorQuery] + + + class azure.search.documents.types.SearchResult(TypedDict): + key "@search.captions": Optional[list[QueryCaptionResult]] + key "@search.documentDebugInfo": Optional[DocumentDebugInfo] + key "@search.highlights": dict[str, list[str]] + key "@search.rerankerBoostedScore": Optional[float] + key "@search.rerankerScore": Optional[float] + @search.score: Required[float] + captions: list[QueryCaptionResult] + document_debug_info: DocumentDebugInfo + highlights: dict[str, list[str]] + reranker_boosted_score: float + reranker_score: float + score: float + + + class azure.search.documents.types.SearchScoreThreshold(TypedDict, total=False): + kind: Required[Literal[VectorThresholdKind.SEARCH_SCORE]] + value: Required[float] + + + class azure.search.documents.types.SemanticDebugInfo(TypedDict, total=False): + key "contentFields": list[QueryResultDocumentSemanticField] + key "keywordFields": list[QueryResultDocumentSemanticField] + key "rerankerInput": ForwardRef('QueryResultDocumentRerankerInput') + key "titleField": ForwardRef('QueryResultDocumentSemanticField') + content_fields: list[QueryResultDocumentSemanticField] + keyword_fields: list[QueryResultDocumentSemanticField] + reranker_input: QueryResultDocumentRerankerInput + title_field: QueryResultDocumentSemanticField + + + class azure.search.documents.types.SingleVectorFieldResult(TypedDict, total=False): + key "searchScore": float + key "vectorSimilarity": float + search_score: float + vector_similarity: float + + + class azure.search.documents.types.SuggestPostRequest(TypedDict, total=False): + key "filter": str + key "fuzzy": bool + key "highlightPostTag": str + key "highlightPreTag": str + key "minimumCoverage": float + key "orderby": list[str] + key "searchFields": list[str] + key "select": list[str] + key "top": int + filter: str + highlight_post_tag: str + highlight_pre_tag: str + minimum_coverage: float + order_by: list[str] + search: Required[str] + search_fields: list[str] + search_text: str + select: list[str] + suggesterName: Required[str] + suggester_name: str + top: int + use_fuzzy_matching: bool + + + class azure.search.documents.types.SuggestResult(TypedDict): + @search.text: Required[str] + text: str + + + class azure.search.documents.types.TextResult(TypedDict, total=False): + key "searchScore": float + search_score: float + + + class azure.search.documents.types.VectorQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + IMAGE_BINARY = "imageBinary" + IMAGE_URL = "imageUrl" + TEXT = "text" + VECTOR = "vector" + + + class azure.search.documents.types.VectorSimilarityThreshold(TypedDict, total=False): + kind: Required[Literal[VectorThresholdKind.VECTOR_SIMILARITY]] + value: Required[float] + + + class azure.search.documents.types.VectorThresholdKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SEARCH_SCORE = "searchScore" + VECTOR_SIMILARITY = "vectorSimilarity" + + + class azure.search.documents.types.VectorizableImageBinaryQuery(TypedDict, total=False): + key "base64Image": str + key "exhaustive": bool + key "fields": str + key "filterOverride": str + key "k": int + key "oversampling": float + key "perDocumentVectorLimit": int + key "threshold": ForwardRef('VectorThreshold') + key "weight": float + base64_image: str + exhaustive: bool + fields: str + filter_override: str + k_nearest_neighbors: int + kind: Required[Literal[VectorQueryKind.IMAGE_BINARY]] + oversampling: float + per_document_vector_limit: int + threshold: VectorThreshold + weight: float + + + class azure.search.documents.types.VectorizableImageUrlQuery(TypedDict, total=False): + key "exhaustive": bool + key "fields": str + key "filterOverride": str + key "k": int + key "oversampling": float + key "perDocumentVectorLimit": int + key "threshold": ForwardRef('VectorThreshold') + key "url": str + key "weight": float + exhaustive: bool + fields: str + filter_override: str + k_nearest_neighbors: int + kind: Required[Literal[VectorQueryKind.IMAGE_URL]] + oversampling: float + per_document_vector_limit: int + threshold: VectorThreshold + url: str + weight: float + + + class azure.search.documents.types.VectorizableTextQuery(TypedDict, total=False): + key "exhaustive": bool + key "fields": str + key "filterOverride": str + key "k": int + key "oversampling": float + key "perDocumentVectorLimit": int + key "queryRewrites": Union[str, QueryRewritesType] + key "threshold": ForwardRef('VectorThreshold') + key "weight": float + exhaustive: bool + fields: str + filter_override: str + k_nearest_neighbors: int + kind: Required[Literal[VectorQueryKind.TEXT]] + oversampling: float + per_document_vector_limit: int + query_rewrites: Union[str, QueryRewritesType] + text: Required[str] + threshold: VectorThreshold + weight: float + + + class azure.search.documents.types.VectorizedQuery(TypedDict, total=False): + key "exhaustive": bool + key "fields": str + key "filterOverride": str + key "k": int + key "oversampling": float + key "perDocumentVectorLimit": int + key "threshold": ForwardRef('VectorThreshold') + key "weight": float + exhaustive: bool + fields: str + filter_override: str + k_nearest_neighbors: int + kind: Required[Literal[VectorQueryKind.VECTOR]] + oversampling: float + per_document_vector_limit: int + threshold: VectorThreshold + vector: Required[list[float]] + weight: float + + + class azure.search.documents.types.VectorsDebugInfo(TypedDict, total=False): + key "subscores": ForwardRef('QueryResultDocumentSubscores') + subscores: QueryResultDocumentSubscores + + ``` \ No newline at end of file diff --git a/sdk/search/azure-search-documents/api.metadata.yml b/sdk/search/azure-search-documents/api.metadata.yml index b5f806f0ac36..bf399b4b31df 100644 --- a/sdk/search/azure-search-documents/api.metadata.yml +++ b/sdk/search/azure-search-documents/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: cf9b5548f872667463b76b7b872cc6b9083f419238d4b4df3bc2410ad0d64c8b -parserVersion: 0.3.28 -pythonVersion: 3.12.13 +apiMdSha256: 608a6471906279d2f97ee54ae7e642d118e81b946ddde281ddd93654c5abf9b1 +parserVersion: 0.3.30 +pythonVersion: 3.10.20 From efdf4b965f27a2f021ce8e2815ab07b446620115 Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Tue, 11 Aug 2026 18:58:46 +0000 Subject: [PATCH 08/17] Export api md --- sdk/search/azure-search-documents/README.md | 2 +- sdk/search/azure-search-documents/api.md | 1486 ++++++++++------- .../azure-search-documents/api.metadata.yml | 4 +- .../search/documents/_operations/_patch.py | 2 +- .../azure/search/documents/_patch.py | 8 +- .../documents/aio/_operations/_patch.py | 2 +- .../azure/search/documents/aio/_patch.py | 8 +- .../azure/search/documents/indexes/_patch.py | 23 +- .../search/documents/indexes/aio/_patch.py | 8 +- .../search/documents/knowledgebases/_patch.py | 26 +- .../documents/knowledgebases/_stream.py | 15 +- .../documents/knowledgebases/aio/_patch.py | 6 +- .../sample_knowledge_source_workiq_preview.py | 4 +- ...e_knowledge_source_workiq_preview_async.py | 4 +- .../test_knowledge_base_retrieval_client.py | 6 +- 15 files changed, 917 insertions(+), 687 deletions(-) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 4d9b49bd461f..c46ba225c56e 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -48,7 +48,7 @@ pip install azure-search-documents ### Prerequisites -* Python 3.10 or later is required to use this package. +* Python 3.9 or later is required to use this package. * You need an [Azure subscription][azure_sub] and an [Azure AI Search service][search_resource] to use this package. diff --git a/sdk/search/azure-search-documents/api.md b/sdk/search/azure-search-documents/api.md index 52067fe067fc..3709cb46d755 100644 --- a/sdk/search/azure-search-documents/api.md +++ b/sdk/search/azure-search-documents/api.md @@ -8140,111 +8140,120 @@ namespace azure.search.documents.indexes.models namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.AIServicesAccountIdentity(TypedDict): + key "@odata.type": Required[Literal["#AIServicesByIdentity"]] key "description": str key "identity": Optional[SearchIndexerDataIdentity] - @odata.type: Required[Literal["#AIServicesByIdentity"]] + key "subdomainUrl": Required[str] description: str identity: SearchIndexerDataIdentity odata_type: Literal[#AIServicesByIdentity] - subdomainUrl: Required[str] subdomain_url: str class azure.search.documents.indexes.types.AIServicesAccountKey(TypedDict): + key "@odata.type": Required[Literal["#AIServicesByKey"]] key "description": str - @odata.type: Required[Literal["#AIServicesByKey"]] + key "key": Required[str] + key "subdomainUrl": Required[str] description: str - key: Required[str] + key: str odata_type: Literal[#AIServicesByKey] - subdomainUrl: Required[str] subdomain_url: str class azure.search.documents.indexes.types.AIServicesVisionParameters(TypedDict, total=False): key "apiKey": str key "authIdentity": Optional[SearchIndexerDataIdentity] + key "modelVersion": Required[Optional[str]] + key "resourceUri": Required[str] api_key: str auth_identity: SearchIndexerDataIdentity - modelVersion: Required[Optional[str]] model_version: str - resourceUri: Required[str] resource_uri: str class azure.search.documents.indexes.types.AIServicesVisionVectorizer(TypedDict, total=False): - key "aiServicesVisionParameters": ForwardRef('AIServicesVisionParameters') + key "aiServicesVisionParameters": ForwardRef('AIServicesVisionParameters', module='types') + key "kind": Required[Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION]] + key "name": Required[str] ai_services_vision_parameters: AIServicesVisionParameters - kind: Required[Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION]] - name: Required[str] + kind: Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION] vectorizer_name: str class azure.search.documents.indexes.types.AnalyzeResult(TypedDict, total=False): - tokens: Required[list[AnalyzedTokenInfo]] + key "tokens": Required[list[AnalyzedTokenInfo]] + tokens: list[AnalyzedTokenInfo] class azure.search.documents.indexes.types.AnalyzeTextOptions(TypedDict, total=False): key "analyzer": Union[str, LexicalAnalyzerName] - key "charFilters": list[Union[str, CharFilterName]] key "normalizer": Union[str, LexicalNormalizerName] - key "tokenFilters": list[Union[str, TokenFilterName]] + key "text": Required[str] key "tokenizer": Union[str, LexicalTokenizerName] analyzer_name: Union[str, LexicalAnalyzerName] + charFilters: list[Union[str, CharFilterName]] char_filters: list[Union[str, CharFilterName]] normalizer_name: Union[str, LexicalNormalizerName] - text: Required[str] + text: str + tokenFilters: list[Union[str, TokenFilterName]] token_filters: list[Union[str, TokenFilterName]] tokenizer_name: Union[str, LexicalTokenizerName] class azure.search.documents.indexes.types.AnalyzedTokenInfo(TypedDict, total=False): - endOffset: Required[int] + key "endOffset": Required[int] + key "position": Required[int] + key "startOffset": Required[int] + key "token": Required[str] end_offset: int - position: Required[int] - startOffset: Required[int] + position: int start_offset: int - token: Required[str] + token: str class azure.search.documents.indexes.types.AsciiFoldingTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#AsciiFoldingTokenFilter"]] + key "name": Required[str] key "preserveOriginal": bool - @odata.type: Required[Literal["#AsciiFoldingTokenFilter"]] - name: Required[str] + name: str odata_type: Literal[#AsciiFoldingTokenFilter] preserve_original: bool class azure.search.documents.indexes.types.AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): + key "applicationId": Required[str] key "applicationSecret": str - applicationId: Required[str] application_id: str application_secret: str class azure.search.documents.indexes.types.AzureBlobKnowledgeSource(TypedDict): key "@odata.etag": str + key "azureBlobParameters": Required[AzureBlobKnowledgeSourceParameters] key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "kind": Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - azureBlobParameters: Required[AzureBlobKnowledgeSourceParameters] azure_blob_parameters: AzureBlobKnowledgeSourceParameters description: str e_tag: str encryption_key: SearchResourceEncryptionKey - kind: Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.AZURE_BLOB] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.AzureBlobKnowledgeSourceParameters(TypedDict, total=False): - key "createdResources": ForwardRef('CreatedResources') + key "connectionString": Required[str] + key "containerName": Required[str] + key "createdResources": ForwardRef('CreatedResources', module='types') key "folderPath": Optional[str] key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "isADLSGen2": bool - key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') - connectionString: Required[str] + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') connection_string: str - containerName: Required[str] container_name: str created_resources: CreatedResources folder_path: str @@ -8259,34 +8268,36 @@ namespace azure.search.documents.indexes.types key "region": Optional[str] key "resourceId": Optional[str] key "timeout": Optional[str] + key "uri": Required[Optional[str]] authentication_key: str model_name: Union[str, AIFoundryModelCatalogName] region: str resource_id: str scoring_uri: str timeout: str - uri: Required[Optional[str]] class azure.search.documents.indexes.types.AzureMachineLearningSkill(TypedDict): + key "@odata.type": Required[Literal["#AmlSkill"]] key "context": str key "degreeOfParallelism": Optional[int] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "key": Optional[str] key "name": str + key "outputs": Required[list[OutputFieldMappingEntry]] key "region": Optional[str] key "resourceId": Optional[str] key "timeout": Optional[str] key "uri": Optional[str] - @odata.type: Required[Literal["#AmlSkill"]] authentication_key: str context: str degree_of_parallelism: int description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#AmlSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] region: str resource_id: str scoring_uri: str @@ -8294,56 +8305,60 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.AzureMachineLearningVectorizer(TypedDict, total=False): - key "amlParameters": ForwardRef('AzureMachineLearningParameters') + key "amlParameters": ForwardRef('AzureMachineLearningParameters', module='types') + key "kind": Required[Literal[VectorSearchVectorizerKind.AML]] + key "name": Required[str] aml_parameters: AzureMachineLearningParameters - kind: Required[Literal[VectorSearchVectorizerKind.AML]] - name: Required[str] + kind: Literal[VectorSearchVectorizerKind.AML] vectorizer_name: str class azure.search.documents.indexes.types.AzureOpenAIEmbeddingSkill(TypedDict): + key "@odata.type": Required[Literal["#AzureOpenAIEmbeddingSkill"]] key "apiKey": str - key "authIdentity": ForwardRef('SearchIndexerDataIdentity') + key "authIdentity": ForwardRef('SearchIndexerDataIdentity', module='types') key "context": str key "deploymentId": str key "description": str key "dimensions": Optional[int] + key "inputs": Required[list[InputFieldMappingEntry]] key "modelName": Union[str, AzureOpenAIModelName] key "name": str + key "outputs": Required[list[OutputFieldMappingEntry]] key "resourceUri": str - @odata.type: Required[Literal["#AzureOpenAIEmbeddingSkill"]] api_key: str auth_identity: SearchIndexerDataIdentity context: str deployment_name: str description: str dimensions: int - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] model_name: Union[str, AzureOpenAIModelName] name: str odata_type: Literal[#AzureOpenAIEmbeddingSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] resource_url: str class azure.search.documents.indexes.types.AzureOpenAITokenizerParameters(TypedDict, total=False): - key "allowedSpecialTokens": list[str] key "encoderModelName": Optional[Union[str, SplitSkillEncoderModelName]] + allowedSpecialTokens: list[str] allowed_special_tokens: list[str] encoder_model_name: Union[str, SplitSkillEncoderModelName] class azure.search.documents.indexes.types.AzureOpenAIVectorizer(TypedDict, total=False): - key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters') - kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] - name: Required[str] + key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters', module='types') + key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + key "name": Required[str] + kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] parameters: AzureOpenAIVectorizerParameters vectorizer_name: str class azure.search.documents.indexes.types.AzureOpenAIVectorizerParameters(TypedDict, total=False): key "apiKey": str - key "authIdentity": ForwardRef('SearchIndexerDataIdentity') + key "authIdentity": ForwardRef('SearchIndexerDataIdentity', module='types') key "deploymentId": str key "modelName": Union[str, AzureOpenAIModelName] key "resourceUri": str @@ -8355,20 +8370,21 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.BM25SimilarityAlgorithm(TypedDict): + key "@odata.type": Required[Literal["#BM25Similarity"]] key "b": Optional[float] key "k1": Optional[float] - @odata.type: Required[Literal["#BM25Similarity"]] b: float k1: float odata_type: Literal[#BM25Similarity] class azure.search.documents.indexes.types.BinaryQuantizationCompression(TypedDict, total=False): + key "kind": Required[Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION]] + key "name": Required[str] key "rescoringOptions": Optional[RescoringOptions] key "truncationDimension": Optional[int] compression_name: str - kind: Required[Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION]] - name: Required[str] + kind: Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION] rescoring_options: RescoringOptions truncation_dimension: int @@ -8400,7 +8416,6 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ChatCompletionSchema(TypedDict, total=False): key "additionalProperties": bool key "properties": str - key "required": list[str] key "type": str additional_properties: bool properties: str @@ -8411,7 +8426,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ChatCompletionSchemaProperties(TypedDict, total=False): key "description": Optional[str] key "name": Optional[str] - key "schema": ForwardRef('ChatCompletionSchema') + key "schema": ForwardRef('ChatCompletionSchema', module='types') key "strict": bool description: str name: str @@ -8420,16 +8435,19 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ChatCompletionSkill(TypedDict): + key "@odata.type": Required[Literal["#ChatCompletionSkill"]] key "apiKey": str key "authIdentity": Optional[SearchIndexerDataIdentity] - key "commonModelParameters": ForwardRef('ChatCompletionCommonModelParameters') + key "commonModelParameters": ForwardRef('ChatCompletionCommonModelParameters', module='types') key "context": str key "description": str key "extraParameters": Optional[dict[str, Any]] key "extraParametersBehavior": Union[str, ChatCompletionExtraParametersBehavior] + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str - key "responseFormat": ForwardRef('ChatCompletionResponseFormat') - @odata.type: Required[Literal["#ChatCompletionSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] + key "responseFormat": ForwardRef('ChatCompletionResponseFormat', module='types') + key "uri": Required[str] api_key: str auth_identity: SearchIndexerDataIdentity common_model_parameters: ChatCompletionCommonModelParameters @@ -8437,93 +8455,102 @@ namespace azure.search.documents.indexes.types description: str extra_parameters: dict[str, Any] extra_parameters_behavior: Union[str, ChatCompletionExtraParametersBehavior] - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#ChatCompletionSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] response_format: ChatCompletionResponseFormat - uri: Required[str] + uri: str class azure.search.documents.indexes.types.CjkBigramTokenFilter(TypedDict): - key "ignoreScripts": list[Union[str, CjkBigramTokenFilterScripts]] + key "@odata.type": Required[Literal["#CjkBigramTokenFilter"]] + key "name": Required[str] key "outputUnigrams": bool - @odata.type: Required[Literal["#CjkBigramTokenFilter"]] + ignoreScripts: list[Union[str, CjkBigramTokenFilterScripts]] ignore_scripts: list[Union[str, CjkBigramTokenFilterScripts]] - name: Required[str] + name: str odata_type: Literal[#CjkBigramTokenFilter] output_unigrams: bool class azure.search.documents.indexes.types.ClassicSimilarityAlgorithm(TypedDict): - @odata.type: Required[Literal["#ClassicSimilarity"]] + key "@odata.type": Required[Literal["#ClassicSimilarity"]] odata_type: Literal[#ClassicSimilarity] class azure.search.documents.indexes.types.ClassicTokenizer(TypedDict): + key "@odata.type": Required[Literal["#ClassicTokenizer"]] key "maxTokenLength": int - @odata.type: Required[Literal["#ClassicTokenizer"]] + key "name": Required[str] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#ClassicTokenizer] class azure.search.documents.indexes.types.CognitiveServicesAccountKey(TypedDict): + key "@odata.type": Required[Literal["#CognitiveServicesByKey"]] key "description": str - @odata.type: Required[Literal["#CognitiveServicesByKey"]] + key "key": Required[str] description: str - key: Required[str] + key: str odata_type: Literal[#CognitiveServicesByKey] class azure.search.documents.indexes.types.CommonGramTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#CommonGramTokenFilter"]] + key "commonWords": Required[list[str]] key "ignoreCase": bool + key "name": Required[str] key "queryMode": bool - @odata.type: Required[Literal["#CommonGramTokenFilter"]] - commonWords: Required[list[str]] common_words: list[str] ignore_case: bool - name: Required[str] + name: str odata_type: Literal[#CommonGramTokenFilter] use_query_mode: bool class azure.search.documents.indexes.types.ConditionalSkill(TypedDict): + key "@odata.type": Required[Literal["#ConditionalSkill"]] key "context": str key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str - @odata.type: Required[Literal["#ConditionalSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#ConditionalSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.ContentColumnMapping(TypedDict, total=False): - name: Required[str] - searchFieldType: Required[str] + key "name": Required[str] + key "searchFieldType": Required[str] + key "sourceField": Required[str] + name: str search_field_type: str - sourceField: Required[str] source_field: str class azure.search.documents.indexes.types.ContentUnderstandingSkill(TypedDict): + key "@odata.type": Required[Literal["#ContentUnderstandingSkill"]] key "chunkingProperties": Optional[ContentUnderstandingSkillChunkingProperties] key "context": str key "description": str key "extractionOptions": Optional[list[Union[str, ContentUnderstandingSkillExtractionOptions]]] + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str - @odata.type: Required[Literal["#ContentUnderstandingSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] chunking_properties: ContentUnderstandingSkillChunkingProperties context: str description: str extraction_options: list[Union[str, ContentUnderstandingSkillExtractionOptions]] - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#ContentUnderstandingSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.ContentUnderstandingSkillChunkingProperties(TypedDict, total=False): @@ -8538,8 +8565,8 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.CorsOptions(TypedDict, total=False): + key "allowedOrigins": Required[list[str]] key "maxAgeInSeconds": Optional[int] - allowedOrigins: Required[list[str]] allowed_origins: list[str] max_age_in_seconds: int @@ -8548,14 +8575,15 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.CustomAnalyzer(TypedDict): - key "charFilters": list[Union[str, CharFilterName]] - key "tokenFilters": list[Union[str, TokenFilterName]] - @odata.type: Required[Literal["#CustomAnalyzer"]] + key "@odata.type": Required[Literal["#CustomAnalyzer"]] + key "name": Required[str] + key "tokenizer": Required[Union[str, LexicalTokenizerName]] + charFilters: list[Union[str, CharFilterName]] char_filters: list[Union[str, CharFilterName]] - name: Required[str] + name: str odata_type: Literal[#CustomAnalyzer] + tokenFilters: list[Union[str, TokenFilterName]] token_filters: list[Union[str, TokenFilterName]] - tokenizer: Required[Union[str, LexicalTokenizerName]] tokenizer_name: Union[str, LexicalTokenizerName] @@ -8569,6 +8597,7 @@ namespace azure.search.documents.indexes.types key "description": Optional[str] key "fuzzyEditDistance": Optional[int] key "id": Optional[str] + key "name": Required[str] key "subtype": Optional[str] key "type": Optional[str] accent_sensitive: bool @@ -8580,7 +8609,7 @@ namespace azure.search.documents.indexes.types description: str fuzzy_edit_distance: int id: str - name: Required[str] + name: str subtype: str type: str @@ -8589,13 +8618,15 @@ namespace azure.search.documents.indexes.types key "accentSensitive": Optional[bool] key "caseSensitive": Optional[bool] key "fuzzyEditDistance": Optional[int] + key "text": Required[str] accent_sensitive: bool case_sensitive: bool fuzzy_edit_distance: int - text: Required[str] + text: str class azure.search.documents.indexes.types.CustomEntityLookupSkill(TypedDict): + key "@odata.type": Required[Literal["#CustomEntityLookupSkill"]] key "context": str key "defaultLanguageCode": Optional[Union[str, CustomEntityLookupSkillLanguage]] key "description": str @@ -8604,8 +8635,9 @@ namespace azure.search.documents.indexes.types key "globalDefaultCaseSensitive": Optional[bool] key "globalDefaultFuzzyEditDistance": Optional[int] key "inlineEntitiesDefinition": Optional[list[CustomEntity]] + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str - @odata.type: Required[Literal["#CustomEntityLookupSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: Union[str, CustomEntityLookupSkillLanguage] description: str @@ -8614,19 +8646,20 @@ namespace azure.search.documents.indexes.types global_default_case_sensitive: bool global_default_fuzzy_edit_distance: int inline_entities_definition: list[CustomEntity] - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#CustomEntityLookupSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.CustomNormalizer(TypedDict): - key "charFilters": list[Union[str, CharFilterName]] - key "tokenFilters": list[Union[str, TokenFilterName]] - @odata.type: Required[Literal["#CustomNormalizer"]] + key "@odata.type": Required[Literal["#CustomNormalizer"]] + key "name": Required[str] + charFilters: list[Union[str, CharFilterName]] char_filters: list[Union[str, CharFilterName]] - name: Required[str] + name: str odata_type: Literal[#CustomNormalizer] + tokenFilters: list[Union[str, TokenFilterName]] token_filters: list[Union[str, TokenFilterName]] @@ -8636,86 +8669,93 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.DefaultCognitiveServicesAccount(TypedDict): + key "@odata.type": Required[Literal["#DefaultCognitiveServices"]] key "description": str - @odata.type: Required[Literal["#DefaultCognitiveServices"]] description: str odata_type: Literal[#DefaultCognitiveServices] class azure.search.documents.indexes.types.DictionaryDecompounderTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#DictionaryDecompounderTokenFilter"]] key "maxSubwordSize": int key "minSubwordSize": int key "minWordSize": int + key "name": Required[str] key "onlyLongestMatch": bool - @odata.type: Required[Literal["#DictionaryDecompounderTokenFilter"]] + key "wordList": Required[list[str]] max_subword_size: int min_subword_size: int min_word_size: int - name: Required[str] + name: str odata_type: Literal[#DictionaryDecompounderTokenFilter] only_longest_match: bool - wordList: Required[list[str]] word_list: list[str] class azure.search.documents.indexes.types.DistanceScoringFunction(TypedDict, total=False): + key "boost": Required[float] + key "distance": Required[DistanceScoringParameters] + key "fieldName": Required[str] key "interpolation": Union[str, ScoringFunctionInterpolation] - boost: Required[float] - distance: Required[DistanceScoringParameters] - fieldName: Required[str] + key "type": Required[Literal["distance"]] + boost: float field_name: str interpolation: Union[str, ScoringFunctionInterpolation] parameters: DistanceScoringParameters - type: Required[Literal["distance"]] + type: Literal[distance] class azure.search.documents.indexes.types.DistanceScoringParameters(TypedDict, total=False): - boostingDistance: Required[float] + key "boostingDistance": Required[float] + key "referencePointParameter": Required[str] boosting_distance: float - referencePointParameter: Required[str] reference_point_parameter: str class azure.search.documents.indexes.types.DocumentExtractionSkill(TypedDict): + key "@odata.type": Required[Literal["#DocumentExtractionSkill"]] key "configuration": Optional[dict[str, Any]] key "context": str key "dataToExtract": Optional[str] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str + key "outputs": Required[list[OutputFieldMappingEntry]] key "parsingMode": Optional[str] - @odata.type: Required[Literal["#DocumentExtractionSkill"]] configuration: dict[str, Any] context: str data_to_extract: str description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#DocumentExtractionSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] parsing_mode: str class azure.search.documents.indexes.types.DocumentIntelligenceLayoutSkill(TypedDict): + key "@odata.type": Required[Literal["#DocumentIntelligenceLayoutSkill"]] key "chunkingProperties": Optional[DocumentIntelligenceLayoutSkillChunkingProperties] key "context": str key "description": str key "extractionOptions": Optional[list[Union[str, DocumentIntelligenceLayoutSkillExtractionOptions]]] + key "inputs": Required[list[InputFieldMappingEntry]] key "markdownHeaderDepth": Optional[Union[str, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth]] key "name": str key "outputFormat": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputFormat]] key "outputMode": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputMode]] - @odata.type: Required[Literal["#DocumentIntelligenceLayoutSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] chunking_properties: DocumentIntelligenceLayoutSkillChunkingProperties context: str description: str extraction_options: list[Union[str, DocumentIntelligenceLayoutSkillExtractionOptions]] - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] markdown_header_depth: Union[str, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth] name: str odata_type: Literal[#DocumentIntelligenceLayoutSkill] output_format: Union[str, DocumentIntelligenceLayoutSkillOutputFormat] output_mode: Union[str, DocumentIntelligenceLayoutSkillOutputMode] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.DocumentIntelligenceLayoutSkillChunkingProperties(TypedDict, total=False): @@ -8728,115 +8768,124 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.DocumentKeysOrIds(TypedDict, total=False): - key "datasourceDocumentIds": list[str] - key "documentKeys": list[str] + datasourceDocumentIds: list[str] datasource_document_ids: list[str] + documentKeys: list[str] document_keys: list[str] class azure.search.documents.indexes.types.EdgeNGramTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#EdgeNGramTokenFilter"]] key "maxGram": int key "minGram": int + key "name": Required[str] key "side": Union[str, EdgeNGramTokenFilterSide] - @odata.type: Required[Literal["#EdgeNGramTokenFilter"]] max_gram: int min_gram: int - name: Required[str] + name: str odata_type: Literal[#EdgeNGramTokenFilter] side: Union[str, EdgeNGramTokenFilterSide] class azure.search.documents.indexes.types.EdgeNGramTokenFilterV2(TypedDict): + key "@odata.type": Required[Literal["#EdgeNGramTokenFilterV2"]] key "maxGram": int key "minGram": int + key "name": Required[str] key "side": Union[str, EdgeNGramTokenFilterSide] - @odata.type: Required[Literal["#EdgeNGramTokenFilterV2"]] max_gram: int min_gram: int - name: Required[str] + name: str odata_type: Literal[#EdgeNGramTokenFilterV2] side: Union[str, EdgeNGramTokenFilterSide] class azure.search.documents.indexes.types.EdgeNGramTokenizer(TypedDict): + key "@odata.type": Required[Literal["#EdgeNGramTokenizer"]] key "maxGram": int key "minGram": int - key "tokenChars": list[Union[str, TokenCharacterKind]] - @odata.type: Required[Literal["#EdgeNGramTokenizer"]] + key "name": Required[str] max_gram: int min_gram: int - name: Required[str] + name: str odata_type: Literal[#EdgeNGramTokenizer] + tokenChars: list[Union[str, TokenCharacterKind]] token_chars: list[Union[str, TokenCharacterKind]] class azure.search.documents.indexes.types.ElisionTokenFilter(TypedDict): - key "articles": list[str] - @odata.type: Required[Literal["#ElisionTokenFilter"]] + key "@odata.type": Required[Literal["#ElisionTokenFilter"]] + key "name": Required[str] articles: list[str] - name: Required[str] + name: str odata_type: Literal[#ElisionTokenFilter] class azure.search.documents.indexes.types.EmbeddingColumnMapping(TypedDict, total=False): - name: Required[str] - sourceField: Required[str] + key "name": Required[str] + key "sourceField": Required[str] + name: str source_field: str class azure.search.documents.indexes.types.EntityLinkingSkill(TypedDict): + key "@odata.type": Required[Literal["#EntityLinkingSkill"]] key "context": str key "defaultLanguageCode": Optional[str] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "minimumPrecision": float key "modelVersion": Optional[str] key "name": str - @odata.type: Required[Literal["#EntityLinkingSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: str description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] minimum_precision: float model_version: str name: str odata_type: Literal[#EntityLinkingSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.EntityRecognitionSkillV3(TypedDict): - key "categories": list[Union[str, EntityCategory]] + key "@odata.type": Required[Literal["#EntityRecognitionSkill"]] key "context": str key "defaultLanguageCode": Optional[Union[str, EntityRecognitionSkillLanguage]] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "minimumPrecision": float key "modelVersion": Optional[str] key "name": str - @odata.type: Required[Literal["#EntityRecognitionSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] categories: list[Union[str, EntityCategory]] context: str default_language_code: Union[str, EntityRecognitionSkillLanguage] description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] minimum_precision: float model_version: str name: str odata_type: Literal[#EntityRecognitionSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.EntraAppAuthentication(TypedDict, total=False): + key "applicationId": Required[str] + key "federatedCredentialId": Required[str] key "tenantId": str - applicationId: Required[str] application_id: str - federatedCredentialId: Required[str] federated_credential_id: str tenant_id: str class azure.search.documents.indexes.types.ExhaustiveKnnAlgorithmConfiguration(TypedDict, total=False): - key "exhaustiveKnnParameters": ForwardRef('ExhaustiveKnnParameters') - kind: Required[Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN]] - name: Required[str] + key "exhaustiveKnnParameters": ForwardRef('ExhaustiveKnnParameters', module='types') + key "kind": Required[Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN]] + key "name": Required[str] + kind: Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN] + name: str parameters: ExhaustiveKnnParameters @@ -8849,21 +8898,23 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "fabricDataAgentParameters": Required[FabricDataAgentKnowledgeSourceParameters] + key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - fabricDataAgentParameters: Required[FabricDataAgentKnowledgeSourceParameters] fabric_data_agent_parameters: FabricDataAgentKnowledgeSourceParameters - kind: Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): - dataAgentId: Required[str] + key "dataAgentId": Required[str] + key "workspaceId": Required[str] data_agent_id: str - workspaceId: Required[str] workspace_id: str @@ -8871,60 +8922,65 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "fabricOntologyParameters": Required[FabricOntologyKnowledgeSourceParameters] + key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - fabricOntologyParameters: Required[FabricOntologyKnowledgeSourceParameters] fabric_ontology_parameters: FabricOntologyKnowledgeSourceParameters - kind: Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.FabricOntologyKnowledgeSourceParameters(TypedDict, total=False): - ontologyId: Required[str] + key "ontologyId": Required[str] + key "workspaceId": Required[str] ontology_id: str - workspaceId: Required[str] workspace_id: str class azure.search.documents.indexes.types.FieldMapping(TypedDict, total=False): key "mappingFunction": Optional[FieldMappingFunction] + key "sourceFieldName": Required[str] key "targetFieldName": str mapping_function: FieldMappingFunction - sourceFieldName: Required[str] source_field_name: str target_field_name: str class azure.search.documents.indexes.types.FieldMappingFunction(TypedDict, total=False): + key "name": Required[str] key "parameters": Optional[dict[str, Any]] - name: Required[str] + name: str parameters: dict[str, Any] class azure.search.documents.indexes.types.FileKnowledgeSource(TypedDict): key "@odata.etag": str - key "corsOptions": ForwardRef('CorsOptions') + key "corsOptions": ForwardRef('CorsOptions', module='types') key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "fileParameters": Required[FileKnowledgeSourceParameters] + key "kind": Required[Literal[KnowledgeSourceKind.FILE]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] cors_options: CorsOptions description: str e_tag: str encryption_key: SearchResourceEncryptionKey - fileParameters: Required[FileKnowledgeSourceParameters] file_parameters: FileKnowledgeSourceParameters - kind: Required[Literal[KnowledgeSourceKind.FILE]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.FILE] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.FileKnowledgeSourceParameters(TypedDict, total=False): - key "createdResources": ForwardRef('CreatedResources') - key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters') - key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "createdResources": ForwardRef('CreatedResources', module='types') + key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters', module='types') + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') created_resources: CreatedResources ingestion_parameters: KnowledgeSourceIngestionParameters query_hints: SearchIndexKnowledgeSourceQueryHints @@ -8932,47 +8988,50 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.FileUploadMetadata(TypedDict, total=False): key "fileName": str - key "metadata": dict[str, str] file_name: str metadata: dict[str, str] class azure.search.documents.indexes.types.FreshnessScoringFunction(TypedDict, total=False): + key "boost": Required[float] + key "fieldName": Required[str] + key "freshness": Required[FreshnessScoringParameters] key "interpolation": Union[str, ScoringFunctionInterpolation] - boost: Required[float] - fieldName: Required[str] + key "type": Required[Literal["freshness"]] + boost: float field_name: str - freshness: Required[FreshnessScoringParameters] interpolation: Union[str, ScoringFunctionInterpolation] parameters: FreshnessScoringParameters - type: Required[Literal["freshness"]] + type: Literal[freshness] class azure.search.documents.indexes.types.FreshnessScoringParameters(TypedDict, total=False): - boostingDuration: Required[str] + key "boostingDuration": Required[str] boosting_duration: str class azure.search.documents.indexes.types.GetIndexStatisticsResult(TypedDict, total=False): - documentCount: Required[int] + key "documentCount": Required[int] + key "storageSize": Required[int] + key "vectorIndexSize": Required[int] document_count: int - storageSize: Required[int] storage_size: int - vectorIndexSize: Required[int] vector_index_size: int class azure.search.documents.indexes.types.HighWaterMarkChangeDetectionPolicy(TypedDict): - @odata.type: Required[Literal["#HighWaterMarkChangeDetectionPolicy"]] - highWaterMarkColumnName: Required[str] + key "@odata.type": Required[Literal["#HighWaterMarkChangeDetectionPolicy"]] + key "highWaterMarkColumnName": Required[str] high_water_mark_column_name: str odata_type: Literal[#HighWaterMarkChangeDetectionPolicy] class azure.search.documents.indexes.types.HnswAlgorithmConfiguration(TypedDict, total=False): - key "hnswParameters": ForwardRef('HnswParameters') - kind: Required[Literal[VectorSearchAlgorithmKind.HNSW]] - name: Required[str] + key "hnswParameters": ForwardRef('HnswParameters', module='types') + key "kind": Required[Literal[VectorSearchAlgorithmKind.HNSW]] + key "name": Required[str] + kind: Literal[VectorSearchAlgorithmKind.HNSW] + name: str parameters: HnswParameters @@ -8988,21 +9047,22 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ImageAnalysisSkill(TypedDict): + key "@odata.type": Required[Literal["#ImageAnalysisSkill"]] key "context": str key "defaultLanguageCode": Union[str, ImageAnalysisSkillLanguage] key "description": str - key "details": list[Union[str, ImageDetail]] + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str - key "visualFeatures": list[Union[str, VisualFeature]] - @odata.type: Required[Literal["#ImageAnalysisSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: Union[str, ImageAnalysisSkillLanguage] description: str details: list[Union[str, ImageDetail]] - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#ImageAnalysisSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] + visualFeatures: list[Union[str, VisualFeature]] visual_features: list[Union[str, VisualFeature]] @@ -9010,27 +9070,29 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "indexedOneLakeParameters": Required[IndexedOneLakeKnowledgeSourceParameters] + key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - indexedOneLakeParameters: Required[IndexedOneLakeKnowledgeSourceParameters] indexed_one_lake_parameters: IndexedOneLakeKnowledgeSourceParameters - kind: Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): - key "createdResources": ForwardRef('CreatedResources') - key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters') - key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "createdResources": ForwardRef('CreatedResources', module='types') + key "fabricWorkspaceId": Required[str] + key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters', module='types') + key "lakehouseId": Required[str] + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "targetPath": Optional[str] created_resources: CreatedResources - fabricWorkspaceId: Required[str] fabric_workspace_id: str ingestion_parameters: KnowledgeSourceIngestionParameters - lakehouseId: Required[str] lakehouse_id: str query_hints: SearchIndexKnowledgeSourceQueryHints target_path: str @@ -9040,25 +9102,27 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "indexedSharePointParameters": Required[IndexedSharePointKnowledgeSourceParameters] + key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - indexedSharePointParameters: Required[IndexedSharePointKnowledgeSourceParameters] indexed_share_point_parameters: IndexedSharePointKnowledgeSourceParameters - kind: Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): - key "createdResources": ForwardRef('CreatedResources') + key "connectionString": Required[str] + key "containerName": Required[Union[str, IndexedSharePointContainerName]] + key "createdResources": ForwardRef('CreatedResources', module='types') key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "query": Optional[str] - key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') - connectionString: Required[str] + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') connection_string: str - containerName: Required[Union[str, IndexedSharePointContainerName]] container_name: Union[str, IndexedSharePointContainerName] created_resources: CreatedResources ingestion_parameters: KnowledgeSourceIngestionParameters @@ -9070,33 +9134,35 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "indexedSqlParameters": Required[IndexedSqlKnowledgeSourceParameters] + key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - indexedSqlParameters: Required[IndexedSqlKnowledgeSourceParameters] indexed_sql_parameters: IndexedSqlKnowledgeSourceParameters - kind: Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.INDEXED_SQL] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.IndexedSqlKnowledgeSourceParameters(TypedDict, total=False): - key "contentColumns": list[ContentColumnMapping] - key "createdResources": ForwardRef('CreatedResources') - key "embeddingColumns": list[EmbeddingColumnMapping] + key "connectionString": Required[str] + key "createdResources": ForwardRef('CreatedResources', module='types') key "highWaterMarkColumnName": str - key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters') - key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') - connectionString: Required[str] + key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters', module='types') + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') + key "tableOrView": Required[str] connection_string: str + contentColumns: list[ContentColumnMapping] content_columns: list[ContentColumnMapping] created_resources: CreatedResources + embeddingColumns: list[EmbeddingColumnMapping] embedding_columns: list[EmbeddingColumnMapping] high_water_mark_column_name: str ingestion_parameters: KnowledgeSourceIngestionParameters query_hints: SearchIndexKnowledgeSourceQueryHints - tableOrView: Required[str] table_or_view: str @@ -9107,7 +9173,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.IndexingParameters(TypedDict, total=False): key "batchSize": Optional[int] - key "configuration": ForwardRef('IndexingParametersConfiguration') + key "configuration": ForwardRef('IndexingParametersConfiguration', module='types') key "maxFailedItems": Optional[int] key "maxFailedItemsPerBatch": Optional[int] batch_size: int @@ -9156,96 +9222,103 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.IndexingSchedule(TypedDict, total=False): + key "interval": Required[str] key "startTime": str - interval: Required[str] + interval: str start_time: str class azure.search.documents.indexes.types.InputFieldMappingEntry(TypedDict, total=False): - key "inputs": list[InputFieldMappingEntry] + key "name": Required[str] key "source": str key "sourceContext": str inputs: list[InputFieldMappingEntry] - name: Required[str] + name: str source: str source_context: str class azure.search.documents.indexes.types.KeepTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#KeepTokenFilter"]] + key "keepWords": Required[list[str]] key "keepWordsCase": bool - @odata.type: Required[Literal["#KeepTokenFilter"]] - keepWords: Required[list[str]] + key "name": Required[str] keep_words: list[str] lower_case_keep_words: bool - name: Required[str] + name: str odata_type: Literal[#KeepTokenFilter] class azure.search.documents.indexes.types.KeyPhraseExtractionSkill(TypedDict): + key "@odata.type": Required[Literal["#KeyPhraseExtractionSkill"]] key "context": str key "defaultLanguageCode": Union[str, KeyPhraseExtractionSkillLanguage] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "maxKeyPhraseCount": Optional[int] key "modelVersion": Optional[str] key "name": str - @odata.type: Required[Literal["#KeyPhraseExtractionSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: Union[str, KeyPhraseExtractionSkillLanguage] description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] max_key_phrase_count: int model_version: str name: str odata_type: Literal[#KeyPhraseExtractionSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.KeywordMarkerTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#KeywordMarkerTokenFilter"]] key "ignoreCase": bool - @odata.type: Required[Literal["#KeywordMarkerTokenFilter"]] + key "keywords": Required[list[str]] + key "name": Required[str] ignore_case: bool - keywords: Required[list[str]] - name: Required[str] + keywords: list[str] + name: str odata_type: Literal[#KeywordMarkerTokenFilter] class azure.search.documents.indexes.types.KeywordTokenizer(TypedDict): + key "@odata.type": Required[Literal["#KeywordTokenizer"]] key "bufferSize": int - @odata.type: Required[Literal["#KeywordTokenizer"]] + key "name": Required[str] buffer_size: int - name: Required[str] + name: str odata_type: Literal[#KeywordTokenizer] class azure.search.documents.indexes.types.KeywordTokenizerV2(TypedDict): + key "@odata.type": Required[Literal["#KeywordTokenizerV2"]] key "maxTokenLength": int - @odata.type: Required[Literal["#KeywordTokenizerV2"]] + key "name": Required[str] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#KeywordTokenizerV2] class azure.search.documents.indexes.types.KnowledgeBase(TypedDict): key "@odata.etag": str key "answerInstructions": str - key "corsOptions": ForwardRef('CorsOptions') + key "corsOptions": ForwardRef('CorsOptions', module='types') key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] - key "models": list[KnowledgeBaseModel] + key "knowledgeSources": Required[list[KnowledgeSourceReference]] + key "name": Required[str] key "outputMode": Union[str, KnowledgeRetrievalOutputMode] key "retrievalInstructions": str - key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort') - key "retrieveDefaults": ForwardRef('KnowledgeBaseRetrieveDefaults') - key "tags": dict[str, str] + key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort', module='types') + key "retrieveDefaults": ForwardRef('KnowledgeBaseRetrieveDefaults', module='types') answer_instructions: str cors_options: CorsOptions description: str e_tag: str encryption_key: SearchResourceEncryptionKey - knowledgeSources: Required[list[KnowledgeSourceReference]] knowledge_sources: list[KnowledgeSourceReference] models: list[KnowledgeBaseModel] - name: Required[str] + name: str output_mode: Union[str, KnowledgeRetrievalOutputMode] retrieval_instructions: str retrieval_reasoning_effort: KnowledgeRetrievalReasoningEffort @@ -9254,15 +9327,17 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.KnowledgeBaseAzureOpenAIModel(TypedDict, total=False): - azureOpenAIParameters: Required[AzureOpenAIVectorizerParameters] + key "azureOpenAIParameters": Required[AzureOpenAIVectorizerParameters] + key "kind": Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] azure_open_ai_parameters: AzureOpenAIVectorizerParameters - kind: Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] + kind: Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI] class azure.search.documents.indexes.types.KnowledgeBaseModel(TypedDict, total=False): - azureOpenAIParameters: Required[AzureOpenAIVectorizerParameters] + key "azureOpenAIParameters": Required[AzureOpenAIVectorizerParameters] + key "kind": Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] azure_open_ai_parameters: AzureOpenAIVectorizerParameters - kind: Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] + kind: Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI] class azure.search.documents.indexes.types.KnowledgeBaseModelKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -9296,108 +9371,120 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.KnowledgeSourceReference(TypedDict, total=False): key "enableFreshness": bool key "enableImageServing": bool + key "name": Required[str] enable_freshness: bool enable_image_serving: bool - name: Required[str] + name: str class azure.search.documents.indexes.types.LanguageDetectionSkill(TypedDict): + key "@odata.type": Required[Literal["#LanguageDetectionSkill"]] key "context": str key "defaultCountryHint": Optional[str] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "modelVersion": Optional[str] key "name": str - @odata.type: Required[Literal["#LanguageDetectionSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_country_hint: str description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] model_version: str name: str odata_type: Literal[#LanguageDetectionSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.LengthTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#LengthTokenFilter"]] key "max": int key "min": int - @odata.type: Required[Literal["#LengthTokenFilter"]] + key "name": Required[str] max_length: int min_length: int - name: Required[str] + name: str odata_type: Literal[#LengthTokenFilter] class azure.search.documents.indexes.types.LexicalNormalizer(TypedDict): - key "charFilters": list[Union[str, CharFilterName]] - key "tokenFilters": list[Union[str, TokenFilterName]] - @odata.type: Required[Literal["#CustomNormalizer"]] + key "@odata.type": Required[Literal["#CustomNormalizer"]] + key "name": Required[str] + charFilters: list[Union[str, CharFilterName]] char_filters: list[Union[str, CharFilterName]] - name: Required[str] + name: str odata_type: Literal[#CustomNormalizer] + tokenFilters: list[Union[str, TokenFilterName]] token_filters: list[Union[str, TokenFilterName]] class azure.search.documents.indexes.types.LimitTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#LimitTokenFilter"]] key "consumeAllTokens": bool key "maxTokenCount": int - @odata.type: Required[Literal["#LimitTokenFilter"]] + key "name": Required[str] consume_all_tokens: bool max_token_count: int - name: Required[str] + name: str odata_type: Literal[#LimitTokenFilter] class azure.search.documents.indexes.types.LuceneStandardAnalyzer(TypedDict): + key "@odata.type": Required[Literal["#StandardAnalyzer"]] key "maxTokenLength": int - key "stopwords": list[str] - @odata.type: Required[Literal["#StandardAnalyzer"]] + key "name": Required[str] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#StandardAnalyzer] stopwords: list[str] class azure.search.documents.indexes.types.LuceneStandardTokenizer(TypedDict): + key "@odata.type": Required[Literal["#StandardTokenizer"]] key "maxTokenLength": int - @odata.type: Required[Literal["#StandardTokenizer"]] + key "name": Required[str] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#StandardTokenizer] class azure.search.documents.indexes.types.LuceneStandardTokenizerV2(TypedDict): + key "@odata.type": Required[Literal["#StandardTokenizerV2"]] key "maxTokenLength": int - @odata.type: Required[Literal["#StandardTokenizerV2"]] + key "name": Required[str] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#StandardTokenizerV2] class azure.search.documents.indexes.types.MagnitudeScoringFunction(TypedDict, total=False): + key "boost": Required[float] + key "fieldName": Required[str] key "interpolation": Union[str, ScoringFunctionInterpolation] - boost: Required[float] - fieldName: Required[str] + key "magnitude": Required[MagnitudeScoringParameters] + key "type": Required[Literal["magnitude"]] + boost: float field_name: str interpolation: Union[str, ScoringFunctionInterpolation] - magnitude: Required[MagnitudeScoringParameters] parameters: MagnitudeScoringParameters - type: Required[Literal["magnitude"]] + type: Literal[magnitude] class azure.search.documents.indexes.types.MagnitudeScoringParameters(TypedDict, total=False): + key "boostingRangeEnd": Required[float] + key "boostingRangeStart": Required[float] key "constantBoostBeyondRange": bool - boostingRangeEnd: Required[float] - boostingRangeStart: Required[float] boosting_range_end: float boosting_range_start: float should_boost_beyond_range_by_constant: bool class azure.search.documents.indexes.types.MappingCharFilter(TypedDict): - @odata.type: Required[Literal["#MappingCharFilter"]] - mappings: Required[list[str]] - name: Required[str] + key "@odata.type": Required[Literal["#MappingCharFilter"]] + key "mappings": Required[list[str]] + key "name": Required[str] + mappings: list[str] + name: str odata_type: Literal[#MappingCharFilter] @@ -9407,13 +9494,15 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.McpServerAutoOutputParsing(TypedDict, total=False): - kind: Required[Literal[McpServerOutputParsingKind.AUTO]] + key "kind": Required[Literal[McpServerOutputParsingKind.AUTO]] + kind: Literal[McpServerOutputParsingKind.AUTO] class azure.search.documents.indexes.types.McpServerFoundryConnectionAuthentication(TypedDict, total=False): - foundryConnectionParameters: Required[McpServerFoundryConnectionParameters] + key "foundryConnectionParameters": Required[McpServerFoundryConnectionParameters] + key "kind": Required[Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION]] foundry_connection_parameters: McpServerFoundryConnectionParameters - kind: Required[Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION]] + kind: Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION] class azure.search.documents.indexes.types.McpServerFoundryConnectionParameters(TypedDict, total=False): @@ -9425,41 +9514,46 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.McpServerJsonOutputParsing(TypedDict, total=False): - jsonParameters: Required[McpServerOutputParsingJsonParameters] + key "jsonParameters": Required[McpServerOutputParsingJsonParameters] + key "kind": Required[Literal[McpServerOutputParsingKind.JSON]] json_parameters: McpServerOutputParsingJsonParameters - kind: Required[Literal[McpServerOutputParsingKind.JSON]] + kind: Literal[McpServerOutputParsingKind.JSON] class azure.search.documents.indexes.types.McpServerKnowledgeSource(TypedDict): key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "kind": Required[Literal[KnowledgeSourceKind.MCP_SERVER]] + key "mcpServerParameters": Required[McpServerKnowledgeSourceParameters] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - kind: Required[Literal[KnowledgeSourceKind.MCP_SERVER]] - mcpServerParameters: Required[McpServerKnowledgeSourceParameters] + kind: Literal[KnowledgeSourceKind.MCP_SERVER] mcp_server_parameters: McpServerKnowledgeSourceParameters - name: Required[str] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.McpServerKnowledgeSourceParameters(TypedDict, total=False): - key "authentication": ForwardRef('McpServerAuthentication') + key "authentication": ForwardRef('McpServerAuthentication', module='types') + key "serverURL": Required[str] + key "tools": Required[list[McpServerTool]] authentication: McpServerAuthentication - serverURL: Required[str] server_url: str - tools: Required[list[McpServerTool]] + tools: list[McpServerTool] class azure.search.documents.indexes.types.McpServerNoneOutputParsing(TypedDict, total=False): - kind: Required[Literal[McpServerOutputParsingKind.NONE]] + key "kind": Required[Literal[McpServerOutputParsingKind.NONE]] + kind: Literal[McpServerOutputParsingKind.NONE] class azure.search.documents.indexes.types.McpServerOutputParsingJsonParameters(TypedDict, total=False): + key "documentsPath": Required[str] key "includeContext": bool - documentsPath: Required[str] documents_path: str include_context: bool @@ -9485,26 +9579,28 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.McpServerSplitOutputParsing(TypedDict, total=False): - key "splitParameters": ForwardRef('McpServerOutputParsingSplitParameters') - kind: Required[Literal[McpServerOutputParsingKind.SPLIT]] + key "kind": Required[Literal[McpServerOutputParsingKind.SPLIT]] + key "splitParameters": ForwardRef('McpServerOutputParsingSplitParameters', module='types') + kind: Literal[McpServerOutputParsingKind.SPLIT] split_parameters: McpServerOutputParsingSplitParameters class azure.search.documents.indexes.types.McpServerStoredHeadersAuthentication(TypedDict, total=False): - kind: Required[Literal[McpServerAuthenticationKind.STORED_HEADERS]] - storedHeadersParameters: Required[McpServerStoredHeadersParameters] + key "kind": Required[Literal[McpServerAuthenticationKind.STORED_HEADERS]] + key "storedHeadersParameters": Required[McpServerStoredHeadersParameters] + kind: Literal[McpServerAuthenticationKind.STORED_HEADERS] stored_headers_parameters: McpServerStoredHeadersParameters class azure.search.documents.indexes.types.McpServerStoredHeadersParameters(TypedDict, total=False): - key "headers": ForwardRef('McpServerHeaders') + key "headers": ForwardRef('McpServerHeaders', module='types') headers: McpServerHeaders class azure.search.documents.indexes.types.McpServerTool(TypedDict, total=False): key "maxOutputTokens": int key "name": str - key "outputParsing": ForwardRef('McpServerOutputParsing') + key "outputParsing": ForwardRef('McpServerOutputParsing', module='types') key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] max_output_tokens: int name: str @@ -9513,145 +9609,158 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.MergeSkill(TypedDict): + key "@odata.type": Required[Literal["#MergeSkill"]] key "context": str key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "insertPostTag": str key "insertPreTag": str key "name": str - @odata.type: Required[Literal["#MergeSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] insert_post_tag: str insert_pre_tag: str name: str odata_type: Literal[#MergeSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.MicrosoftLanguageStemmingTokenizer(TypedDict): + key "@odata.type": Required[Literal["#MicrosoftLanguageStemmingTokenizer"]] key "isSearchTokenizer": bool key "language": Union[str, MicrosoftStemmingTokenizerLanguage] key "maxTokenLength": int - @odata.type: Required[Literal["#MicrosoftLanguageStemmingTokenizer"]] + key "name": Required[str] is_search_tokenizer: bool language: Union[str, MicrosoftStemmingTokenizerLanguage] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#MicrosoftLanguageStemmingTokenizer] class azure.search.documents.indexes.types.MicrosoftLanguageTokenizer(TypedDict): + key "@odata.type": Required[Literal["#MicrosoftLanguageTokenizer"]] key "isSearchTokenizer": bool key "language": Union[str, MicrosoftTokenizerLanguage] key "maxTokenLength": int - @odata.type: Required[Literal["#MicrosoftLanguageTokenizer"]] + key "name": Required[str] is_search_tokenizer: bool language: Union[str, MicrosoftTokenizerLanguage] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#MicrosoftLanguageTokenizer] class azure.search.documents.indexes.types.NGramTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#NGramTokenFilter"]] key "maxGram": int key "minGram": int - @odata.type: Required[Literal["#NGramTokenFilter"]] + key "name": Required[str] max_gram: int min_gram: int - name: Required[str] + name: str odata_type: Literal[#NGramTokenFilter] class azure.search.documents.indexes.types.NGramTokenFilterV2(TypedDict): + key "@odata.type": Required[Literal["#NGramTokenFilterV2"]] key "maxGram": int key "minGram": int - @odata.type: Required[Literal["#NGramTokenFilterV2"]] + key "name": Required[str] max_gram: int min_gram: int - name: Required[str] + name: str odata_type: Literal[#NGramTokenFilterV2] class azure.search.documents.indexes.types.NGramTokenizer(TypedDict): + key "@odata.type": Required[Literal["#NGramTokenizer"]] key "maxGram": int key "minGram": int - key "tokenChars": list[Union[str, TokenCharacterKind]] - @odata.type: Required[Literal["#NGramTokenizer"]] + key "name": Required[str] max_gram: int min_gram: int - name: Required[str] + name: str odata_type: Literal[#NGramTokenizer] + tokenChars: list[Union[str, TokenCharacterKind]] token_chars: list[Union[str, TokenCharacterKind]] class azure.search.documents.indexes.types.NativeBlobSoftDeleteDeletionDetectionPolicy(TypedDict): - @odata.type: Required[Literal["#NativeBlobSoftDeleteDeletionDetectionPolicy"]] + key "@odata.type": Required[Literal["#NativeBlobSoftDeleteDeletionDetectionPolicy"]] odata_type: Literal[#NativeBlobSoftDeleteDeletionDetectionPolicy] class azure.search.documents.indexes.types.OcrSkill(TypedDict): + key "@odata.type": Required[Literal["#OcrSkill"]] key "context": str key "defaultLanguageCode": Union[str, OcrSkillLanguage] key "description": str key "detectOrientation": bool + key "inputs": Required[list[InputFieldMappingEntry]] key "lineEnding": Union[str, OcrLineEnding] key "name": str - @odata.type: Required[Literal["#OcrSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: Union[str, OcrSkillLanguage] description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] line_ending: Union[str, OcrLineEnding] name: str odata_type: Literal[#OcrSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] should_detect_orientation: bool class azure.search.documents.indexes.types.OutputFieldMappingEntry(TypedDict, total=False): + key "name": Required[str] key "targetName": str - name: Required[str] + name: str target_name: str class azure.search.documents.indexes.types.PIIDetectionSkill(TypedDict): + key "@odata.type": Required[Literal["#PIIDetectionSkill"]] key "context": str key "defaultLanguageCode": Optional[str] key "description": str key "domain": Optional[str] + key "inputs": Required[list[InputFieldMappingEntry]] key "maskingCharacter": str key "maskingMode": Union[str, PIIDetectionSkillMaskingMode] key "minimumPrecision": float key "modelVersion": Optional[str] key "name": str - key "piiCategories": list[str] - @odata.type: Required[Literal["#PIIDetectionSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: str description: str domain: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] mask: str masking_mode: Union[str, PIIDetectionSkillMaskingMode] minimum_precision: float model_version: str name: str odata_type: Literal[#PIIDetectionSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] + piiCategories: list[str] pii_categories: list[str] class azure.search.documents.indexes.types.PathHierarchyTokenizerV2(TypedDict): + key "@odata.type": Required[Literal["#PathHierarchyTokenizerV2"]] key "delimiter": str key "maxTokenLength": int + key "name": Required[str] key "replacement": str key "reverse": bool key "skip": int - @odata.type: Required[Literal["#PathHierarchyTokenizerV2"]] delimiter: str max_token_length: int - name: Required[str] + name: str number_of_tokens_to_skip: int odata_type: Literal[#PathHierarchyTokenizerV2] replacement: str @@ -9659,62 +9768,70 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.PatternAnalyzer(TypedDict): - key "flags": list[Union[str, RegexFlags]] + key "@odata.type": Required[Literal["#PatternAnalyzer"]] key "lowercase": bool + key "name": Required[str] key "pattern": str - key "stopwords": list[str] - @odata.type: Required[Literal["#PatternAnalyzer"]] flags: list[Union[str, RegexFlags]] lower_case_terms: bool - name: Required[str] + name: str odata_type: Literal[#PatternAnalyzer] pattern: str stopwords: list[str] class azure.search.documents.indexes.types.PatternCaptureTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#PatternCaptureTokenFilter"]] + key "name": Required[str] + key "patterns": Required[list[str]] key "preserveOriginal": bool - @odata.type: Required[Literal["#PatternCaptureTokenFilter"]] - name: Required[str] + name: str odata_type: Literal[#PatternCaptureTokenFilter] - patterns: Required[list[str]] + patterns: list[str] preserve_original: bool class azure.search.documents.indexes.types.PatternReplaceCharFilter(TypedDict): - @odata.type: Required[Literal["#PatternReplaceCharFilter"]] - name: Required[str] + key "@odata.type": Required[Literal["#PatternReplaceCharFilter"]] + key "name": Required[str] + key "pattern": Required[str] + key "replacement": Required[str] + name: str odata_type: Literal[#PatternReplaceCharFilter] - pattern: Required[str] - replacement: Required[str] + pattern: str + replacement: str class azure.search.documents.indexes.types.PatternReplaceTokenFilter(TypedDict): - @odata.type: Required[Literal["#PatternReplaceTokenFilter"]] - name: Required[str] + key "@odata.type": Required[Literal["#PatternReplaceTokenFilter"]] + key "name": Required[str] + key "pattern": Required[str] + key "replacement": Required[str] + name: str odata_type: Literal[#PatternReplaceTokenFilter] - pattern: Required[str] - replacement: Required[str] + pattern: str + replacement: str class azure.search.documents.indexes.types.PatternTokenizer(TypedDict): - key "flags": list[Union[str, RegexFlags]] + key "@odata.type": Required[Literal["#PatternTokenizer"]] key "group": int + key "name": Required[str] key "pattern": str - @odata.type: Required[Literal["#PatternTokenizer"]] flags: list[Union[str, RegexFlags]] group: int - name: Required[str] + name: str odata_type: Literal[#PatternTokenizer] pattern: str class azure.search.documents.indexes.types.PhoneticTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#PhoneticTokenFilter"]] key "encoder": Union[str, PhoneticEncoder] + key "name": Required[str] key "replace": bool - @odata.type: Required[Literal["#PhoneticTokenFilter"]] encoder: Union[str, PhoneticEncoder] - name: Required[str] + name: str odata_type: Literal[#PhoneticTokenFilter] replace_original_tokens: bool @@ -9723,13 +9840,15 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] - key "remoteSharePointParameters": ForwardRef('RemoteSharePointKnowledgeSourceParameters') + key "kind": Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] + key "name": Required[str] + key "remoteSharePointParameters": ForwardRef('RemoteSharePointKnowledgeSourceParameters', module='types') key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - kind: Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] + name: str remote_share_point_parameters: RemoteSharePointKnowledgeSourceParameters results_processing: Union[str, KnowledgeSourceResultsProcessing] @@ -9737,9 +9856,9 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.RemoteSharePointKnowledgeSourceParameters(TypedDict, total=False): key "containerTypeId": str key "filterExpression": str - key "resourceMetadata": list[str] container_type_id: str filter_expression: str + resourceMetadata: list[str] resource_metadata: list[str] @@ -9753,12 +9872,13 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ScalarQuantizationCompression(TypedDict, total=False): + key "kind": Required[Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION]] + key "name": Required[str] key "rescoringOptions": Optional[RescoringOptions] - key "scalarQuantizationParameters": ForwardRef('ScalarQuantizationParameters') + key "scalarQuantizationParameters": ForwardRef('ScalarQuantizationParameters', module='types') key "truncationDimension": Optional[int] compression_name: str - kind: Required[Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION]] - name: Required[str] + kind: Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION] parameters: ScalarQuantizationParameters rescoring_options: RescoringOptions truncation_dimension: int @@ -9771,29 +9891,31 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ScoringProfile(TypedDict, total=False): key "functionAggregation": Union[str, ScoringFunctionAggregation] - key "functions": list[ScoringFunction] + key "name": Required[str] key "text": Optional[TextWeights] function_aggregation: Union[str, ScoringFunctionAggregation] functions: list[ScoringFunction] - name: Required[str] + name: str text_weights: TextWeights class azure.search.documents.indexes.types.SearchAlias(TypedDict): key "@odata.etag": str + key "indexes": Required[list[str]] + key "name": Required[str] e_tag: str - indexes: Required[list[str]] - name: Required[str] + indexes: list[str] + name: str class azure.search.documents.indexes.types.SearchField(TypedDict, total=False): key "analyzer": Optional[Union[str, LexicalAnalyzerName]] key "dimensions": int key "facetable": bool - key "fields": list[SearchField] key "filterable": bool key "indexAnalyzer": Optional[Union[str, LexicalAnalyzerName]] key "key": bool + key "name": Required[str] key "normalizer": Optional[Union[str, LexicalNormalizerName]] key "permissionFilter": Optional[Union[str, PermissionFilter]] key "retrievable": bool @@ -9805,7 +9927,7 @@ namespace azure.search.documents.indexes.types key "sortable": bool key "sourceDocumentId": bool key "stored": bool - key "synonymMaps": list[str] + key "type": Required[Union[str, SearchFieldDataType]] key "vectorEncoding": Optional[Union[str, VectorEncodingFormat]] key "vectorSearchProfile": Optional[str] analyzer_name: Union[str, LexicalAnalyzerName] @@ -9814,7 +9936,7 @@ namespace azure.search.documents.indexes.types filterable: bool index_analyzer_name: Union[str, LexicalAnalyzerName] key: bool - name: Required[str] + name: str normalizer_name: Union[str, LexicalNormalizerName] permission_filter: Union[str, PermissionFilter] retrievable: bool @@ -9826,8 +9948,9 @@ namespace azure.search.documents.indexes.types sortable: bool source_document_id: bool stored: bool + synonymMaps: list[str] synonym_map_names: list[str] - type: Required[Union[str, SearchFieldDataType]] + type: Union[str, SearchFieldDataType] vector_encoding_format: Union[str, VectorEncodingFormat] vector_search_dimensions: int vector_search_profile_name: str @@ -9835,61 +9958,62 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndex(TypedDict): key "@odata.etag": str - key "analyzers": list[LexicalAnalyzer] - key "charFilters": list[CharFilter] key "corsOptions": Optional[CorsOptions] key "defaultScoringProfile": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] - key "normalizers": list[LexicalNormalizer] + key "fields": Required[list[SearchField]] + key "name": Required[str] key "permissionFilterOption": Optional[Union[str, SearchIndexPermissionFilterOption]] key "purviewEnabled": Optional[bool] - key "scoringProfiles": list[ScoringProfile] key "semantic": Optional[SemanticSearch] - key "sharePointConnectorAppRegistration": ForwardRef('SharePointConnectorAppRegistration') - key "similarity": ForwardRef('SimilarityAlgorithm') - key "suggesters": list[SearchSuggester] - key "tokenFilters": list[TokenFilter] - key "tokenizers": list[LexicalTokenizer] + key "sharePointConnectorAppRegistration": ForwardRef('SharePointConnectorAppRegistration', module='types') + key "similarity": ForwardRef('SimilarityAlgorithm', module='types') key "vectorSearch": Optional[VectorSearch] analyzers: list[LexicalAnalyzer] + charFilters: list[CharFilter] char_filters: list[CharFilter] cors_options: CorsOptions default_scoring_profile: str description: str e_tag: str encryption_key: SearchResourceEncryptionKey - fields: Required[list[SearchField]] - name: Required[str] + fields: list[SearchField] + name: str normalizers: list[LexicalNormalizer] permission_filter_option: Union[str, SearchIndexPermissionFilterOption] purview_enabled: bool + scoringProfiles: list[ScoringProfile] scoring_profiles: list[ScoringProfile] semantic_search: SemanticSearch share_point_connector_app_registration: SharePointConnectorAppRegistration similarity: SimilarityAlgorithm suggesters: list[SearchSuggester] + tokenFilters: list[TokenFilter] token_filters: list[TokenFilter] tokenizers: list[LexicalTokenizer] vector_search: VectorSearch class azure.search.documents.indexes.types.SearchIndexFieldReference(TypedDict, total=False): - name: Required[str] + key "name": Required[str] + name: str class azure.search.documents.indexes.types.SearchIndexKnowledgeSource(TypedDict): key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "kind": Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + key "searchIndexParameters": Required[SearchIndexKnowledgeSourceParameters] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - kind: Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] - searchIndexParameters: Required[SearchIndexKnowledgeSourceParameters] search_index_parameters: SearchIndexKnowledgeSourceParameters @@ -9899,50 +10023,54 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceFieldValueBoost(TypedDict, total=False): + key "boost": Required[float] key "boostInstructions": str - key "fieldValues": list[str] - boost: Required[float] + key "field": Required[str] + key "kind": Required[Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE]] + boost: float boost_instructions: str - field: Required[str] + field: str + fieldValues: list[str] field_values: list[str] - kind: Required[Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE]] + kind: Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE] class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceFilterHint(TypedDict, total=False): + key "field": Required[str] + key "fieldValues": Required[list[str]] key "filterInstructions": str - field: Required[str] - fieldValues: Required[list[str]] + field: str field_values: list[str] filter_instructions: str class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceMultiWordExpressionBoost(TypedDict, total=False): + key "boost": Required[float] key "boostInstructions": str - key "fieldValues": list[str] - boost: Required[float] + key "kind": Required[Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION]] + boost: float boost_instructions: str + fieldValues: list[str] field_values: list[str] - kind: Required[Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION]] + kind: Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION] class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceParameters(TypedDict, total=False): key "baseFilter": str - key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints') - key "searchFields": list[SearchIndexFieldReference] + key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') + key "searchIndexName": Required[str] key "semanticConfigurationName": str - key "sourceDataFields": list[SearchIndexFieldReference] base_filter: str query_hints: SearchIndexKnowledgeSourceQueryHints - searchIndexName: Required[str] + searchFields: list[SearchIndexFieldReference] search_fields: list[SearchIndexFieldReference] search_index_name: str semantic_configuration_name: str + sourceDataFields: list[SearchIndexFieldReference] source_data_fields: list[SearchIndexFieldReference] class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceQueryHints(TypedDict, total=False): - key "boosts": list[SearchIndexKnowledgeSourceBoost] - key "filters": list[SearchIndexKnowledgeSourceFilterHint] boosts: list[SearchIndexKnowledgeSourceBoost] filters: list[SearchIndexKnowledgeSourceFilterHint] @@ -9950,28 +10078,29 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexer(TypedDict): key "@odata.etag": str key "cache": Optional[SearchIndexerCache] + key "dataSourceName": Required[str] key "description": str key "disabled": Optional[bool] key "encryptionKey": Optional[SearchResourceEncryptionKey] - key "fieldMappings": list[FieldMapping] - key "outputFieldMappings": list[FieldMapping] + key "name": Required[str] key "parameters": Optional[IndexingParameters] key "schedule": Optional[IndexingSchedule] key "skillsetName": str + key "targetIndexName": Required[str] cache: SearchIndexerCache - dataSourceName: Required[str] data_source_name: str description: str e_tag: str encryption_key: SearchResourceEncryptionKey + fieldMappings: list[FieldMapping] field_mappings: list[FieldMapping] is_disabled: bool - name: Required[str] + name: str + outputFieldMappings: list[FieldMapping] output_field_mappings: list[FieldMapping] parameters: IndexingParameters schedule: IndexingSchedule skillset_name: str - targetIndexName: Required[str] target_index_name: str @@ -9987,27 +10116,32 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerDataContainer(TypedDict, total=False): + key "name": Required[str] key "query": str - name: Required[str] + name: str query: str class azure.search.documents.indexes.types.SearchIndexerDataNoneIdentity(TypedDict): - @odata.type: Required[Literal["#DataNoneIdentity"]] + key "@odata.type": Required[Literal["#DataNoneIdentity"]] odata_type: Literal[#DataNoneIdentity] class azure.search.documents.indexes.types.SearchIndexerDataSourceConnection(TypedDict): key "@odata.etag": str + key "container": Required[SearchIndexerDataContainer] + key "credentials": Required[DataSourceCredentials] key "dataChangeDetectionPolicy": Optional[DataChangeDetectionPolicy] key "dataDeletionDetectionPolicy": Optional[DataDeletionDetectionPolicy] key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] key "identity": Optional[SearchIndexerDataIdentity] key "indexerPermissionOptions": Optional[list[Union[str, IndexerPermissionOption]]] + key "name": Required[str] key "subType": str - container: Required[SearchIndexerDataContainer] - credentials: Required[DataSourceCredentials] + key "type": Required[Union[str, SearchIndexerDataSourceType]] + container: SearchIndexerDataContainer + credentials: DataSourceCredentials data_change_detection_policy: DataChangeDetectionPolicy data_deletion_detection_policy: DataDeletionDetectionPolicy description: str @@ -10015,33 +10149,35 @@ namespace azure.search.documents.indexes.types encryption_key: SearchResourceEncryptionKey identity: SearchIndexerDataIdentity indexer_permission_options: list[Union[str, IndexerPermissionOption]] - name: Required[str] + name: str sub_type: str - type: Required[Union[str, SearchIndexerDataSourceType]] + type: Union[str, SearchIndexerDataSourceType] class azure.search.documents.indexes.types.SearchIndexerDataUserAssignedIdentity(TypedDict): + key "@odata.type": Required[Literal["#DataUserAssignedIdentity"]] key "federatedIdentityClientId": str - @odata.type: Required[Literal["#DataUserAssignedIdentity"]] + key "userAssignedIdentity": Required[str] federated_identity_client_id: str odata_type: Literal[#DataUserAssignedIdentity] resource_id: str - userAssignedIdentity: Required[str] class azure.search.documents.indexes.types.SearchIndexerIndexProjection(TypedDict, total=False): - key "parameters": ForwardRef('SearchIndexerIndexProjectionsParameters') + key "parameters": ForwardRef('SearchIndexerIndexProjectionsParameters', module='types') + key "selectors": Required[list[SearchIndexerIndexProjectionSelector]] parameters: SearchIndexerIndexProjectionsParameters - selectors: Required[list[SearchIndexerIndexProjectionSelector]] + selectors: list[SearchIndexerIndexProjectionSelector] class azure.search.documents.indexes.types.SearchIndexerIndexProjectionSelector(TypedDict, total=False): - mappings: Required[list[InputFieldMappingEntry]] - parentKeyFieldName: Required[str] + key "mappings": Required[list[InputFieldMappingEntry]] + key "parentKeyFieldName": Required[str] + key "sourceContext": Required[str] + key "targetIndexName": Required[str] + mappings: list[InputFieldMappingEntry] parent_key_field_name: str - sourceContext: Required[str] source_context: str - targetIndexName: Required[str] target_index_name: str @@ -10052,56 +10188,54 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerKnowledgeStore(TypedDict, total=False): key "identity": Optional[SearchIndexerDataIdentity] - key "parameters": ForwardRef('SearchIndexerKnowledgeStoreParameters') + key "parameters": ForwardRef('SearchIndexerKnowledgeStoreParameters', module='types') + key "projections": Required[list[SearchIndexerKnowledgeStoreProjection]] + key "storageConnectionString": Required[str] identity: SearchIndexerDataIdentity parameters: SearchIndexerKnowledgeStoreParameters - projections: Required[list[SearchIndexerKnowledgeStoreProjection]] - storageConnectionString: Required[str] + projections: list[SearchIndexerKnowledgeStoreProjection] storage_connection_string: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreBlobProjectionSelector(SearchIndexerKnowledgeStoreProjectionSelector): key "generatedKeyName": str - key "inputs": list[InputFieldMappingEntry] key "referenceKeyName": str key "source": str key "sourceContext": str + key "storageContainer": Required[str] generated_key_name: str inputs: list[InputFieldMappingEntry] reference_key_name: str source: str source_context: str - storageContainer: Required[str] storage_container: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreFileProjectionSelector(SearchIndexerKnowledgeStoreBlobProjectionSelector): key "generatedKeyName": str - key "inputs": list[InputFieldMappingEntry] key "referenceKeyName": str key "source": str key "sourceContext": str + key "storageContainer": Required[str] generated_key_name: str inputs: list[InputFieldMappingEntry] reference_key_name: str source: str source_context: str - storageContainer: Required[str] storage_container: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreObjectProjectionSelector(SearchIndexerKnowledgeStoreBlobProjectionSelector): key "generatedKeyName": str - key "inputs": list[InputFieldMappingEntry] key "referenceKeyName": str key "source": str key "sourceContext": str + key "storageContainer": Required[str] generated_key_name: str inputs: list[InputFieldMappingEntry] reference_key_name: str source: str source_context: str - storageContainer: Required[str] storage_container: str @@ -10111,9 +10245,6 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): - key "files": list[SearchIndexerKnowledgeStoreFileProjectionSelector] - key "objects": list[SearchIndexerKnowledgeStoreObjectProjectionSelector] - key "tables": list[SearchIndexerKnowledgeStoreTableProjectionSelector] files: list[SearchIndexerKnowledgeStoreFileProjectionSelector] objects: list[SearchIndexerKnowledgeStoreObjectProjectionSelector] tables: list[SearchIndexerKnowledgeStoreTableProjectionSelector] @@ -10121,7 +10252,6 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreProjectionSelector(TypedDict, total=False): key "generatedKeyName": str - key "inputs": list[InputFieldMappingEntry] key "referenceKeyName": str key "source": str key "sourceContext": str @@ -10133,144 +10263,151 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreTableProjectionSelector(SearchIndexerKnowledgeStoreProjectionSelector): - key "inputs": list[InputFieldMappingEntry] + key "generatedKeyName": Required[str] key "referenceKeyName": str key "source": str key "sourceContext": str - generatedKeyName: Required[str] + key "tableName": Required[str] generated_key_name: str inputs: list[InputFieldMappingEntry] reference_key_name: str source: str source_context: str - tableName: Required[str] table_name: str class azure.search.documents.indexes.types.SearchIndexerSkillset(TypedDict): key "@odata.etag": str - key "cognitiveServices": ForwardRef('CognitiveServicesAccount') + key "cognitiveServices": ForwardRef('CognitiveServicesAccount', module='types') key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] - key "indexProjections": ForwardRef('SearchIndexerIndexProjection') - key "knowledgeStore": ForwardRef('SearchIndexerKnowledgeStore') + key "indexProjections": ForwardRef('SearchIndexerIndexProjection', module='types') + key "knowledgeStore": ForwardRef('SearchIndexerKnowledgeStore', module='types') + key "name": Required[str] + key "skills": Required[list[SearchIndexerSkill]] cognitive_services_account: CognitiveServicesAccount description: str e_tag: str encryption_key: SearchResourceEncryptionKey index_projection: SearchIndexerIndexProjection knowledge_store: SearchIndexerKnowledgeStore - name: Required[str] - skills: Required[list[SearchIndexerSkill]] + name: str + skills: list[SearchIndexerSkill] class azure.search.documents.indexes.types.SearchResourceEncryptionKey(TypedDict, total=False): - key "accessCredentials": ForwardRef('AzureActiveDirectoryApplicationCredentials') + key "accessCredentials": ForwardRef('AzureActiveDirectoryApplicationCredentials', module='types') key "identity": Optional[SearchIndexerDataIdentity] key "isServiceLevelKey": bool + key "keyVaultKeyName": Required[str] key "keyVaultKeyVersion": str + key "keyVaultUri": Required[str] access_credentials: AzureActiveDirectoryApplicationCredentials identity: SearchIndexerDataIdentity is_service_level_key: bool - keyVaultKeyName: Required[str] - keyVaultUri: Required[str] key_name: str key_version: str vault_uri: str class azure.search.documents.indexes.types.SearchSuggester(TypedDict, total=False): - name: Required[str] - searchMode: Required[Literal["analyzingInfixMatching"]] + key "name": Required[str] + key "searchMode": Required[Literal["analyzingInfixMatching"]] + key "sourceFields": Required[list[str]] + name: str search_mode: Literal[analyzingInfixMatching] - sourceFields: Required[list[str]] source_fields: list[str] class azure.search.documents.indexes.types.SemanticConfiguration(TypedDict, total=False): key "flightingOptIn": bool + key "name": Required[str] + key "prioritizedFields": Required[SemanticPrioritizedFields] key "rankingOrder": Optional[Union[str, RankingOrder]] flighting_opt_in: bool - name: Required[str] - prioritizedFields: Required[SemanticPrioritizedFields] + name: str prioritized_fields: SemanticPrioritizedFields ranking_order: Union[str, RankingOrder] class azure.search.documents.indexes.types.SemanticField(TypedDict, total=False): - fieldName: Required[str] + key "fieldName": Required[str] field_name: str class azure.search.documents.indexes.types.SemanticPrioritizedFields(TypedDict, total=False): - key "prioritizedContentFields": list[SemanticField] - key "prioritizedKeywordsFields": list[SemanticField] - key "titleField": ForwardRef('SemanticField') + key "titleField": ForwardRef('SemanticField', module='types') content_fields: list[SemanticField] keywords_fields: list[SemanticField] + prioritizedContentFields: list[SemanticField] + prioritizedKeywordsFields: list[SemanticField] title_field: SemanticField class azure.search.documents.indexes.types.SemanticSearch(TypedDict, total=False): - key "configurations": list[SemanticConfiguration] key "defaultConfiguration": str configurations: list[SemanticConfiguration] default_configuration_name: str class azure.search.documents.indexes.types.SentimentSkillV3(TypedDict): + key "@odata.type": Required[Literal["#SentimentSkill"]] key "context": str key "defaultLanguageCode": Optional[Union[str, SentimentSkillLanguage]] key "description": str key "includeOpinionMining": bool + key "inputs": Required[list[InputFieldMappingEntry]] key "modelVersion": Optional[str] key "name": str - @odata.type: Required[Literal["#SentimentSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str default_language_code: Union[str, SentimentSkillLanguage] description: str include_opinion_mining: bool - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] model_version: str name: str odata_type: Literal[#SentimentSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.ShaperSkill(TypedDict): + key "@odata.type": Required[Literal["#ShaperSkill"]] key "context": str key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str - @odata.type: Required[Literal["#ShaperSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#ShaperSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.SharePointConnectorAppRegistration(TypedDict, total=False): + key "applicationId": Required[str] + key "federatedCredentialId": Required[str] key "tenantId": str - applicationId: Required[str] application_id: str - federatedCredentialId: Required[str] federated_credential_id: str tenant_id: str class azure.search.documents.indexes.types.ShingleTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#ShingleTokenFilter"]] key "filterToken": str key "maxShingleSize": int key "minShingleSize": int + key "name": Required[str] key "outputUnigrams": bool key "outputUnigramsIfNoShingles": bool key "tokenSeparator": str - @odata.type: Required[Literal["#ShingleTokenFilter"]] filter_token: str max_shingle_size: int min_shingle_size: int - name: Required[str] + name: str odata_type: Literal[#ShingleTokenFilter] output_unigrams: bool output_unigrams_if_no_shingles: bool @@ -10278,88 +10415,96 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SkillNames(TypedDict, total=False): - key "skillNames": list[str] + skillNames: list[str] skill_names: list[str] class azure.search.documents.indexes.types.SnowballTokenFilter(TypedDict): - @odata.type: Required[Literal["#SnowballTokenFilter"]] - language: Required[Union[str, SnowballTokenFilterLanguage]] - name: Required[str] + key "@odata.type": Required[Literal["#SnowballTokenFilter"]] + key "language": Required[Union[str, SnowballTokenFilterLanguage]] + key "name": Required[str] + language: Union[str, SnowballTokenFilterLanguage] + name: str odata_type: Literal[#SnowballTokenFilter] class azure.search.documents.indexes.types.SoftDeleteColumnDeletionDetectionPolicy(TypedDict): + key "@odata.type": Required[Literal["#SoftDeleteColumnDeletionDetectionPolicy"]] key "softDeleteColumnName": str key "softDeleteMarkerValue": str - @odata.type: Required[Literal["#SoftDeleteColumnDeletionDetectionPolicy"]] odata_type: Literal[#SoftDeleteColumnDeletionDetectionPolicy] soft_delete_column_name: str soft_delete_marker_value: str class azure.search.documents.indexes.types.SplitSkill(TypedDict): + key "@odata.type": Required[Literal["#SplitSkill"]] key "azureOpenAITokenizerParameters": Optional[AzureOpenAITokenizerParameters] key "context": str key "defaultLanguageCode": Union[str, SplitSkillLanguage] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "maximumPageLength": Optional[int] key "maximumPagesToTake": Optional[int] key "name": str + key "outputs": Required[list[OutputFieldMappingEntry]] key "pageOverlapLength": Optional[int] key "textSplitMode": Union[str, TextSplitMode] key "unit": Optional[Union[str, SplitSkillUnit]] - @odata.type: Required[Literal["#SplitSkill"]] azure_open_ai_tokenizer_parameters: AzureOpenAITokenizerParameters context: str default_language_code: Union[str, SplitSkillLanguage] description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] maximum_page_length: int maximum_pages_to_take: int name: str odata_type: Literal[#SplitSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] page_overlap_length: int text_split_mode: Union[str, TextSplitMode] unit: Union[str, SplitSkillUnit] class azure.search.documents.indexes.types.SqlIntegratedChangeTrackingPolicy(TypedDict): - @odata.type: Required[Literal["#SqlIntegratedChangeTrackingPolicy"]] + key "@odata.type": Required[Literal["#SqlIntegratedChangeTrackingPolicy"]] odata_type: Literal[#SqlIntegratedChangeTrackingPolicy] class azure.search.documents.indexes.types.StemmerOverrideTokenFilter(TypedDict): - @odata.type: Required[Literal["#StemmerOverrideTokenFilter"]] - name: Required[str] + key "@odata.type": Required[Literal["#StemmerOverrideTokenFilter"]] + key "name": Required[str] + key "rules": Required[list[str]] + name: str odata_type: Literal[#StemmerOverrideTokenFilter] - rules: Required[list[str]] + rules: list[str] class azure.search.documents.indexes.types.StemmerTokenFilter(TypedDict): - @odata.type: Required[Literal["#StemmerTokenFilter"]] - language: Required[Union[str, StemmerTokenFilterLanguage]] - name: Required[str] + key "@odata.type": Required[Literal["#StemmerTokenFilter"]] + key "language": Required[Union[str, StemmerTokenFilterLanguage]] + key "name": Required[str] + language: Union[str, StemmerTokenFilterLanguage] + name: str odata_type: Literal[#StemmerTokenFilter] class azure.search.documents.indexes.types.StopAnalyzer(TypedDict): - key "stopwords": list[str] - @odata.type: Required[Literal["#StopAnalyzer"]] - name: Required[str] + key "@odata.type": Required[Literal["#StopAnalyzer"]] + key "name": Required[str] + name: str odata_type: Literal[#StopAnalyzer] stopwords: list[str] class azure.search.documents.indexes.types.StopwordsTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#StopwordsTokenFilter"]] key "ignoreCase": bool + key "name": Required[str] key "removeTrailing": bool - key "stopwords": list[str] key "stopwordsList": Union[str, StopwordsList] - @odata.type: Required[Literal["#StopwordsTokenFilter"]] ignore_case: bool - name: Required[str] + name: str odata_type: Literal[#StopwordsTokenFilter] remove_trailing_stop_words: bool stopwords: list[str] @@ -10369,102 +10514,115 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SynonymMap(TypedDict): key "@odata.etag": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "format": Required[Literal["solr"]] + key "name": Required[str] + key "synonyms": Required[list[str]] e_tag: str encryption_key: SearchResourceEncryptionKey - format: Required[Literal["solr"]] - name: Required[str] - synonyms: Required[list[str]] + format: Literal[solr] + name: str + synonyms: list[str] class azure.search.documents.indexes.types.SynonymTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#SynonymTokenFilter"]] key "expand": bool key "ignoreCase": bool - @odata.type: Required[Literal["#SynonymTokenFilter"]] + key "name": Required[str] + key "synonyms": Required[list[str]] expand: bool ignore_case: bool - name: Required[str] + name: str odata_type: Literal[#SynonymTokenFilter] - synonyms: Required[list[str]] + synonyms: list[str] class azure.search.documents.indexes.types.TagScoringFunction(TypedDict, total=False): + key "boost": Required[float] + key "fieldName": Required[str] key "interpolation": Union[str, ScoringFunctionInterpolation] - boost: Required[float] - fieldName: Required[str] + key "tag": Required[TagScoringParameters] + key "type": Required[Literal["tag"]] + boost: float field_name: str interpolation: Union[str, ScoringFunctionInterpolation] parameters: TagScoringParameters - tag: Required[TagScoringParameters] - type: Required[Literal["tag"]] + type: Literal[tag] class azure.search.documents.indexes.types.TagScoringParameters(TypedDict, total=False): - tagsParameter: Required[str] + key "tagsParameter": Required[str] tags_parameter: str class azure.search.documents.indexes.types.TextTranslationSkill(TypedDict): + key "@odata.type": Required[Literal["#TranslationSkill"]] key "context": str key "defaultFromLanguageCode": Union[str, TextTranslationSkillLanguage] + key "defaultToLanguageCode": Required[Union[str, TextTranslationSkillLanguage]] key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str + key "outputs": Required[list[OutputFieldMappingEntry]] key "suggestedFrom": Optional[Union[str, TextTranslationSkillLanguage]] - @odata.type: Required[Literal["#TranslationSkill"]] context: str - defaultToLanguageCode: Required[Union[str, TextTranslationSkillLanguage]] default_from_language_code: Union[str, TextTranslationSkillLanguage] default_to_language_code: Union[str, TextTranslationSkillLanguage] description: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#TranslationSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] suggested_from: Union[str, TextTranslationSkillLanguage] class azure.search.documents.indexes.types.TextWeights(TypedDict, total=False): - weights: Required[dict[str, float]] + key "weights": Required[dict[str, float]] + weights: dict[str, float] class azure.search.documents.indexes.types.TruncateTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#TruncateTokenFilter"]] key "length": int - @odata.type: Required[Literal["#TruncateTokenFilter"]] + key "name": Required[str] length: int - name: Required[str] + name: str odata_type: Literal[#TruncateTokenFilter] class azure.search.documents.indexes.types.UaxUrlEmailTokenizer(TypedDict): + key "@odata.type": Required[Literal["#UaxUrlEmailTokenizer"]] key "maxTokenLength": int - @odata.type: Required[Literal["#UaxUrlEmailTokenizer"]] + key "name": Required[str] max_token_length: int - name: Required[str] + name: str odata_type: Literal[#UaxUrlEmailTokenizer] class azure.search.documents.indexes.types.UniqueTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#UniqueTokenFilter"]] + key "name": Required[str] key "onlyOnSamePosition": bool - @odata.type: Required[Literal["#UniqueTokenFilter"]] - name: Required[str] + name: str odata_type: Literal[#UniqueTokenFilter] only_on_same_position: bool class azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest(TypedDict, total=False): - content: Required[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] - metadata: Required[FileUploadMetadata] + key "content": Required[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + key "metadata": Required[FileUploadMetadata] + content: FileType + metadata: FileUploadMetadata class azure.search.documents.indexes.types.UploadKnowledgeSourceFileMultipartRequest(TypedDict, total=False): - content: Required[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] - metadata: Required[FileUploadMetadata] + key "content": Required[Union[str, bytes, IO[str], IO[bytes], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]]], tuple[Optional[str], Union[str, bytes, IO[str], IO[bytes]], Optional[str]]]] + key "metadata": Required[FileUploadMetadata] + content: FileType + metadata: FileUploadMetadata class azure.search.documents.indexes.types.VectorSearch(TypedDict, total=False): - key "algorithms": list[VectorSearchAlgorithmConfiguration] - key "compressions": list[VectorSearchCompression] - key "profiles": list[VectorSearchProfile] - key "vectorizers": list[VectorSearchVectorizer] algorithms: list[VectorSearchAlgorithmConfiguration] compressions: list[VectorSearchCompression] profiles: list[VectorSearchProfile] @@ -10482,12 +10640,13 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.VectorSearchProfile(TypedDict, total=False): + key "algorithm": Required[str] key "compression": str + key "name": Required[str] key "vectorizer": str - algorithm: Required[str] algorithm_configuration_name: str compression_name: str - name: Required[str] + name: str vectorizer_name: str @@ -10499,35 +10658,40 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.VisionVectorizeSkill(TypedDict): + key "@odata.type": Required[Literal["#VectorizeSkill"]] key "context": str key "description": str + key "inputs": Required[list[InputFieldMappingEntry]] + key "modelVersion": Required[Optional[str]] key "name": str - @odata.type: Required[Literal["#VectorizeSkill"]] + key "outputs": Required[list[OutputFieldMappingEntry]] context: str description: str - inputs: Required[list[InputFieldMappingEntry]] - modelVersion: Required[Optional[str]] + inputs: list[InputFieldMappingEntry] model_version: str name: str odata_type: Literal[#VectorizeSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.WebApiHttpHeaders(TypedDict, total=False): class azure.search.documents.indexes.types.WebApiSkill(TypedDict): + key "@odata.type": Required[Literal["#WebApiSkill"]] key "authIdentity": Optional[SearchIndexerDataIdentity] key "authResourceId": Optional[str] key "batchSize": Optional[int] key "context": str key "degreeOfParallelism": Optional[int] key "description": str - key "httpHeaders": ForwardRef('WebApiHttpHeaders') + key "httpHeaders": ForwardRef('WebApiHttpHeaders', module='types') key "httpMethod": str + key "inputs": Required[list[InputFieldMappingEntry]] key "name": str + key "outputs": Required[list[OutputFieldMappingEntry]] key "timeout": str - @odata.type: Required[Literal["#WebApiSkill"]] + key "uri": Required[str] auth_identity: SearchIndexerDataIdentity auth_resource_id: str batch_size: int @@ -10536,18 +10700,19 @@ namespace azure.search.documents.indexes.types description: str http_headers: WebApiHttpHeaders http_method: str - inputs: Required[list[InputFieldMappingEntry]] + inputs: list[InputFieldMappingEntry] name: str odata_type: Literal[#WebApiSkill] - outputs: Required[list[OutputFieldMappingEntry]] + outputs: list[OutputFieldMappingEntry] timeout: str - uri: Required[str] + uri: str class azure.search.documents.indexes.types.WebApiVectorizer(TypedDict, total=False): - key "customWebApiParameters": ForwardRef('WebApiVectorizerParameters') - kind: Required[Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API]] - name: Required[str] + key "customWebApiParameters": ForwardRef('WebApiVectorizerParameters', module='types') + key "kind": Required[Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API]] + key "name": Required[str] + kind: Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API] vectorizer_name: str web_api_parameters: WebApiVectorizerParameters @@ -10555,12 +10720,12 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.WebApiVectorizerParameters(TypedDict, total=False): key "authIdentity": Optional[SearchIndexerDataIdentity] key "authResourceId": Optional[str] - key "httpHeaders": dict[str, str] key "httpMethod": str key "timeout": str key "uri": str auth_identity: SearchIndexerDataIdentity auth_resource_id: str + httpHeaders: dict[str, str] http_headers: dict[str, str] http_method: str timeout: str @@ -10571,33 +10736,36 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "kind": Required[Literal[KnowledgeSourceKind.WEB]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - key "webParameters": ForwardRef('WebKnowledgeSourceParameters') + key "webParameters": ForwardRef('WebKnowledgeSourceParameters', module='types') description: str e_tag: str encryption_key: SearchResourceEncryptionKey - kind: Required[Literal[KnowledgeSourceKind.WEB]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.WEB] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] web_parameters: WebKnowledgeSourceParameters class azure.search.documents.indexes.types.WebKnowledgeSourceDomain(TypedDict, total=False): + key "address": Required[str] key "includeSubpages": bool - address: Required[str] + address: str include_subpages: bool class azure.search.documents.indexes.types.WebKnowledgeSourceDomains(TypedDict, total=False): - key "allowedDomains": list[WebKnowledgeSourceDomain] - key "blockedDomains": list[WebKnowledgeSourceDomain] + allowedDomains: list[WebKnowledgeSourceDomain] allowed_domains: list[WebKnowledgeSourceDomain] + blockedDomains: list[WebKnowledgeSourceDomain] blocked_domains: list[WebKnowledgeSourceDomain] class azure.search.documents.indexes.types.WebKnowledgeSourceParameters(TypedDict, total=False): key "count": int - key "domains": ForwardRef('WebKnowledgeSourceDomains') + key "domains": ForwardRef('WebKnowledgeSourceDomains', module='types') key "freshness": str key "language": str key "market": str @@ -10609,25 +10777,26 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.WordDelimiterTokenFilter(TypedDict): + key "@odata.type": Required[Literal["#WordDelimiterTokenFilter"]] key "catenateAll": bool key "catenateNumbers": bool key "catenateWords": bool key "generateNumberParts": bool key "generateWordParts": bool + key "name": Required[str] key "preserveOriginal": bool - key "protectedWords": list[str] key "splitOnCaseChange": bool key "splitOnNumerics": bool key "stemEnglishPossessive": bool - @odata.type: Required[Literal["#WordDelimiterTokenFilter"]] catenate_all: bool catenate_numbers: bool catenate_words: bool generate_number_parts: bool generate_word_parts: bool - name: Required[str] + name: str odata_type: Literal[#WordDelimiterTokenFilter] preserve_original: bool + protectedWords: list[str] protected_words: list[str] split_on_case_change: bool split_on_numerics: bool @@ -10638,19 +10807,21 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "description": str key "encryptionKey": Optional[SearchResourceEncryptionKey] + key "kind": Required[Literal[KnowledgeSourceKind.WORK_IQ]] + key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + key "workIQParameters": Required[WorkIQKnowledgeSourceParameters] description: str e_tag: str encryption_key: SearchResourceEncryptionKey - kind: Required[Literal[KnowledgeSourceKind.WORK_IQ]] - name: Required[str] + kind: Literal[KnowledgeSourceKind.WORK_IQ] + name: str results_processing: Union[str, KnowledgeSourceResultsProcessing] - workIQParameters: Required[WorkIQKnowledgeSourceParameters] work_iq_parameters: WorkIQKnowledgeSourceParameters class azure.search.documents.indexes.types.WorkIQKnowledgeSourceParameters(TypedDict, total=False): - entraAppAuthentication: Required[EntraAppAuthentication] + key "entraAppAuthentication": Required[EntraAppAuthentication] entra_app_authentication: EntraAppAuthentication @@ -13088,14 +13259,15 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.AIServices(TypedDict, total=False): key "apiKey": str + key "uri": Required[str] api_key: str - uri: Required[str] + uri: str class azure.search.documents.knowledgebases.types.AssetStore(TypedDict, total=False): - connectionString: Required[str] + key "connectionString": Required[str] + key "containerName": Required[str] connection_string: str - containerName: Required[str] container_name: str @@ -13105,9 +13277,11 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13115,8 +13289,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.AZURE_BLOB] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13126,15 +13299,15 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.CompletedSynchronizationState(TypedDict, total=False): - endTime: Required[str] + key "endTime": Required[str] + key "itemsSkipped": Required[int] + key "itemsUpdatesFailed": Required[int] + key "itemsUpdatesProcessed": Required[int] + key "startTime": Required[str] end_time: str - itemsSkipped: Required[int] - itemsUpdatesFailed: Required[int] - itemsUpdatesProcessed: Required[int] items_skipped: int items_updates_failed: int items_updates_processed: int - startTime: Required[str] start_time: str @@ -13144,6 +13317,8 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool key "rerankerThreshold": float @@ -13153,8 +13328,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13168,6 +13342,8 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool key "rerankerThreshold": float @@ -13177,8 +13353,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13192,9 +13367,11 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.FILE]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13202,8 +13379,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.FILE]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.FILE] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13223,9 +13399,11 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13233,8 +13411,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13249,9 +13426,11 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13259,8 +13438,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13275,9 +13453,11 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13285,8 +13465,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.INDEXED_SQL] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13296,12 +13475,14 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeBaseImageContent(TypedDict, total=False): - url: Required[str] + key "url": Required[str] + url: str class azure.search.documents.knowledgebases.types.KnowledgeBaseMessage(TypedDict, total=False): + key "content": Required[list[KnowledgeBaseMessageContent]] key "role": str - content: Required[list[KnowledgeBaseMessageContent]] + content: list[KnowledgeBaseMessageContent] role: str @@ -13311,28 +13492,30 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeBaseMessageImageContent(TypedDict, total=False): - image: Required[KnowledgeBaseImageContent] - type: Required[Literal[KnowledgeBaseMessageContentType.IMAGE]] + key "image": Required[KnowledgeBaseImageContent] + key "type": Required[Literal[KnowledgeBaseMessageContentType.IMAGE]] + image: KnowledgeBaseImageContent + type: Literal[KnowledgeBaseMessageContentType.IMAGE] class azure.search.documents.knowledgebases.types.KnowledgeBaseMessageTextContent(TypedDict, total=False): - text: Required[str] - type: Required[Literal[KnowledgeBaseMessageContentType.TEXT]] + key "text": Required[str] + key "type": Required[Literal[KnowledgeBaseMessageContentType.TEXT]] + text: str + type: Literal[KnowledgeBaseMessageContentType.TEXT] class azure.search.documents.knowledgebases.types.KnowledgeBaseRetrievalRequest(TypedDict, total=False): key "includeActivity": bool - key "intents": list[KnowledgeRetrievalIntent] - key "knowledgeSourceParams": list[KnowledgeSourceParams] key "maxOutputDocuments": int key "maxOutputSize": int key "maxOutputSizeInTokens": int key "maxRuntimeInSeconds": int - key "messages": list[KnowledgeBaseMessage] key "outputMode": Union[str, KnowledgeRetrievalOutputMode] - key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort') + key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort', module='types') include_activity: bool intents: list[KnowledgeRetrievalIntent] + knowledgeSourceParams: list[KnowledgeSourceParams] knowledge_source_params: list[KnowledgeSourceParams] max_output_documents: int max_output_size: int @@ -13344,12 +13527,15 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeRetrievalAutoReasoningEffort(TypedDict, total=False): - kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.AUTO]] + key "kind": Required[Literal[KnowledgeRetrievalReasoningEffortKind.AUTO]] + kind: Literal[KnowledgeRetrievalReasoningEffortKind.AUTO] class azure.search.documents.knowledgebases.types.KnowledgeRetrievalIntent(TypedDict, total=False): - search: Required[str] - type: Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + key "search": Required[str] + key "type": Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + search: str + type: Literal[KnowledgeRetrievalIntentType.SEMANTIC] class azure.search.documents.knowledgebases.types.KnowledgeRetrievalIntentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -13357,15 +13543,18 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeRetrievalLowReasoningEffort(TypedDict, total=False): - kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.LOW]] + key "kind": Required[Literal[KnowledgeRetrievalReasoningEffortKind.LOW]] + kind: Literal[KnowledgeRetrievalReasoningEffortKind.LOW] class azure.search.documents.knowledgebases.types.KnowledgeRetrievalMediumReasoningEffort(TypedDict, total=False): - kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM]] + key "kind": Required[Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM]] + kind: Literal[KnowledgeRetrievalReasoningEffortKind.MEDIUM] class azure.search.documents.knowledgebases.types.KnowledgeRetrievalMinimalReasoningEffort(TypedDict, total=False): - kind: Required[Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL]] + key "kind": Required[Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL]] + kind: Literal[KnowledgeRetrievalReasoningEffortKind.MINIMAL] class azure.search.documents.knowledgebases.types.KnowledgeRetrievalReasoningEffortKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -13376,24 +13565,27 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeRetrievalSemanticIntent(TypedDict, total=False): - search: Required[str] - type: Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + key "search": Required[str] + key "type": Required[Literal[KnowledgeRetrievalIntentType.SEMANTIC]] + search: str + type: Literal[KnowledgeRetrievalIntentType.SEMANTIC] class azure.search.documents.knowledgebases.types.KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): - key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters') + key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters', module='types') + key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] azure_open_ai_parameters: AzureOpenAIVectorizerParameters - kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] class azure.search.documents.knowledgebases.types.KnowledgeSourceIngestionParameters(TypedDict, total=False): key "aiServices": Optional[AIServices] - key "assetStore": ForwardRef('AssetStore') + key "assetStore": ForwardRef('AssetStore', module='types') key "chatCompletionModel": Optional[KnowledgeBaseModel] key "contentExtractionMode": Optional[Union[str, KnowledgeSourceContentExtractionMode]] key "disableImageVerbalization": bool key "embeddingModel": Optional[KnowledgeSourceVectorizer] - key "freshnessPolicy": ForwardRef('FreshnessPolicy') + key "freshnessPolicy": ForwardRef('FreshnessPolicy', module='types') key "identity": Optional[SearchIndexerDataIdentity] key "ingestionPermissionOptions": Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] key "ingestionSchedule": Optional[IndexingSchedule] @@ -13427,11 +13619,11 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeSourceStatistics(TypedDict, total=False): - averageItemsProcessedPerSynchronization: Required[int] - averageSynchronizationDuration: Required[str] + key "averageItemsProcessedPerSynchronization": Required[int] + key "averageSynchronizationDuration": Required[str] + key "totalSynchronization": Required[int] average_items_processed_per_synchronization: int average_synchronization_duration: str - totalSynchronization: Required[int] total_synchronization: int @@ -13441,11 +13633,11 @@ namespace azure.search.documents.knowledgebases.types key "lastSynchronizationState": Optional[CompletedSynchronizationState] key "statistics": Optional[KnowledgeSourceStatistics] key "synchronizationInterval": Optional[str] + key "synchronizationStatus": Required[Union[str, KnowledgeSourceSynchronizationStatus]] current_synchronization_state: SynchronizationState kind: Union[str, KnowledgeSourceKind] last_synchronization_state: CompletedSynchronizationState statistics: KnowledgeSourceStatistics - synchronizationStatus: Required[Union[str, KnowledgeSourceSynchronizationStatus]] synchronization_interval: str synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] @@ -13454,21 +13646,22 @@ namespace azure.search.documents.knowledgebases.types key "details": str key "docId": str key "documentationLink": str + key "errorMessage": Required[str] key "name": str key "statusCode": int details: str doc_id: str documentation_link: str - errorMessage: Required[str] error_message: str name: str status_code: int class azure.search.documents.knowledgebases.types.KnowledgeSourceVectorizer(TypedDict, total=False): - key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters') + key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters', module='types') + key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] azure_open_ai_parameters: AzureOpenAIVectorizerParameters - kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] class azure.search.documents.knowledgebases.types.McpServerKnowledgeSourceParams(TypedDict, total=False): @@ -13477,6 +13670,8 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.MCP_SERVER]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool key "rerankerThreshold": float @@ -13486,8 +13681,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.MCP_SERVER]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.MCP_SERVER] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13502,6 +13696,8 @@ namespace azure.search.documents.knowledgebases.types key "filterExpressionAddOn": str key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool key "rerankerThreshold": float @@ -13512,8 +13708,7 @@ namespace azure.search.documents.knowledgebases.types filter_expression_add_on: str include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13528,9 +13723,11 @@ namespace azure.search.documents.knowledgebases.types key "filterAddOn": str key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints') + key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13539,8 +13736,7 @@ namespace azure.search.documents.knowledgebases.types filter_add_on: str include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.SEARCH_INDEX]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -13550,15 +13746,14 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.SynchronizationState(TypedDict, total=False): - key "errors": list[KnowledgeSourceSynchronizationError] + key "itemsSkipped": Required[int] + key "itemsUpdatesFailed": Required[int] + key "itemsUpdatesProcessed": Required[int] + key "startTime": Required[str] errors: list[KnowledgeSourceSynchronizationError] - itemsSkipped: Required[int] - itemsUpdatesFailed: Required[int] - itemsUpdatesProcessed: Required[int] items_skipped: int items_updates_failed: int items_updates_processed: int - startTime: Required[str] start_time: str @@ -13577,6 +13772,8 @@ namespace azure.search.documents.knowledgebases.types key "freshness": str key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.WEB]] + key "knowledgeSourceName": Required[str] key "language": str key "market": str key "maxOutputDocuments": int @@ -13590,8 +13787,7 @@ namespace azure.search.documents.knowledgebases.types freshness: str include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.WEB]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.WEB] knowledge_source_name: str language: str market: str @@ -13607,6 +13803,8 @@ namespace azure.search.documents.knowledgebases.types key "failOnError": bool key "includeReferenceSourceData": bool key "includeReferences": bool + key "kind": Required[Literal[KnowledgeSourceKind.WORK_IQ]] + key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool key "rerankerThreshold": float @@ -13616,8 +13814,7 @@ namespace azure.search.documents.knowledgebases.types fail_on_error: bool include_reference_source_data: bool include_references: bool - kind: Required[Literal[KnowledgeSourceKind.WORK_IQ]] - knowledgeSourceName: Required[str] + kind: Literal[KnowledgeSourceKind.WORK_IQ] knowledge_source_name: str max_output_documents: int never_query_source: bool @@ -14221,9 +14418,10 @@ namespace azure.search.documents.models namespace azure.search.documents.types class azure.search.documents.types.AutocompleteItem(TypedDict, total=False): - queryPlusText: Required[str] + key "queryPlusText": Required[str] + key "text": Required[str] query_plus_text: str - text: Required[str] + text: str class azure.search.documents.types.AutocompletePostRequest(TypedDict, total=False): @@ -14233,44 +14431,44 @@ namespace azure.search.documents.types key "highlightPostTag": str key "highlightPreTag": str key "minimumCoverage": float - key "searchFields": list[str] + key "search": Required[str] + key "suggesterName": Required[str] key "top": int autocomplete_mode: Union[str, AutocompleteMode] filter: str highlight_post_tag: str highlight_pre_tag: str minimum_coverage: float - search: Required[str] + searchFields: list[str] search_fields: list[str] search_text: str - suggesterName: Required[str] suggester_name: str top: int use_fuzzy_matching: bool class azure.search.documents.types.DebugInfo(TypedDict, total=False): - key "queryRewrites": ForwardRef('QueryRewritesDebugInfo') + key "queryRewrites": ForwardRef('QueryRewritesDebugInfo', module='types') query_rewrites: QueryRewritesDebugInfo class azure.search.documents.types.DocumentDebugInfo(TypedDict, total=False): - key "innerHits": dict[str, list[QueryResultDocumentInnerHit]] - key "semantic": ForwardRef('SemanticDebugInfo') - key "vectors": ForwardRef('VectorsDebugInfo') + key "semantic": ForwardRef('SemanticDebugInfo', module='types') + key "vectors": ForwardRef('VectorsDebugInfo', module='types') + innerHits: dict[str, list[QueryResultDocumentInnerHit]] inner_hits: dict[str, list[QueryResultDocumentInnerHit]] semantic: SemanticDebugInfo vectors: VectorsDebugInfo class azure.search.documents.types.FacetResult(TypedDict): - key "@search.facets": dict[str, list[FacetResult]] key "avg": float key "cardinality": int key "count": int key "max": float key "min": float key "sum": float + @search.facets: dict[str, list[FacetResult]] avg: float cardinality: int count: int @@ -14293,16 +14491,17 @@ namespace azure.search.documents.types class azure.search.documents.types.IndexDocumentsBatch(TypedDict, total=False): + key "value": Required[list[IndexAction]] actions: list[IndexAction] - value: Required[list[IndexAction]] class azure.search.documents.types.IndexingResult(TypedDict, total=False): key "errorMessage": str + key "key": Required[str] + key "status": Required[bool] + key "statusCode": Required[int] error_message: str - key: Required[str] - status: Required[bool] - statusCode: Required[int] + key: str status_code: int succeeded: bool @@ -14327,7 +14526,6 @@ namespace azure.search.documents.types class azure.search.documents.types.QueryResultDocumentInnerHit(TypedDict, total=False): key "ordinal": int - key "vectors": list[dict[str, SingleVectorFieldResult]] ordinal: int vectors: list[dict[str, SingleVectorFieldResult]] @@ -14350,23 +14548,20 @@ namespace azure.search.documents.types class azure.search.documents.types.QueryResultDocumentSubscores(TypedDict, total=False): key "documentBoost": float - key "text": ForwardRef('TextResult') - key "vectors": list[dict[str, SingleVectorFieldResult]] + key "text": ForwardRef('TextResult', module='types') document_boost: float text: TextResult vectors: list[dict[str, SingleVectorFieldResult]] class azure.search.documents.types.QueryRewritesDebugInfo(TypedDict, total=False): - key "text": ForwardRef('QueryRewritesValuesDebugInfo') - key "vectors": list[QueryRewritesValuesDebugInfo] + key "text": ForwardRef('QueryRewritesValuesDebugInfo', module='types') text: QueryRewritesValuesDebugInfo vectors: list[QueryRewritesValuesDebugInfo] class azure.search.documents.types.QueryRewritesValuesDebugInfo(TypedDict, total=False): key "inputQuery": str - key "rewrites": list[str] input_query: str rewrites: list[str] @@ -14377,11 +14572,12 @@ namespace azure.search.documents.types key "@search.answers": Optional[list[QueryAnswerResult]] key "@search.coverage": float key "@search.debug": Optional[DebugInfo] - key "@search.facets": dict[str, list[FacetResult]] - key "@search.nextPageParameters": ForwardRef('SearchRequest') + key "@search.nextPageParameters": ForwardRef('SearchRequest', module='types') key "@search.semanticPartialResponseReason": Union[str, SemanticErrorReason] key "@search.semanticPartialResponseType": Union[str, SemanticSearchResultsType] key "@search.semanticQueryRewritesResultType": Union[str, SemanticQueryRewritesResultType] + key "value": Required[list[SearchResult]] + @search.facets: dict[str, list[FacetResult]] answers: list[QueryAnswerResult] count: int coverage: float @@ -14393,7 +14589,6 @@ namespace azure.search.documents.types semantic_partial_response_reason: Union[str, SemanticErrorReason] semantic_partial_response_type: Union[str, SemanticSearchResultsType] semantic_query_rewrites_result_type: Union[str, SemanticQueryRewritesResultType] - value: Required[list[SearchResult]] class azure.search.documents.types.SearchPostRequest(TypedDict, total=False): @@ -14401,27 +14596,20 @@ namespace azure.search.documents.types key "captions": Union[str, QueryCaptionType] key "count": bool key "debug": Union[str, QueryDebugMode] - key "facets": list[str] key "filter": str - key "highlight": list[str] key "highlightPostTag": str key "highlightPreTag": str - key "hybridSearch": ForwardRef('HybridSearch') + key "hybridSearch": ForwardRef('HybridSearch', module='types') key "minimumCoverage": float - key "orderby": list[str] key "queryLanguage": Union[str, QueryLanguage] key "queryRewrites": Union[str, QueryRewritesType] key "queryType": Union[str, QueryType] - key "scoringParameters": list[str] key "scoringProfile": str key "scoringStatistics": Union[str, ScoringStatistics] key "search": str - key "searchFields": list[str] key "searchMode": Union[str, SearchMode] - key "select": list[str] key "semanticConfiguration": str key "semanticErrorHandling": Union[str, SemanticErrorMode] - key "semanticFields": list[str] key "semanticMaxWaitInMilliseconds": int key "semanticQuery": str key "sessionId": str @@ -14429,12 +14617,12 @@ namespace azure.search.documents.types key "speller": Union[str, QuerySpellerType] key "top": int key "vectorFilterMode": Union[str, VectorFilterMode] - key "vectorQueries": list[VectorQuery] answers: Union[str, QueryAnswerType] captions: Union[str, QueryCaptionType] debug: Union[str, QueryDebugMode] facets: list[str] filter: str + highlight: list[str] highlight_fields: list[str] highlight_post_tag: str highlight_pre_tag: str @@ -14442,17 +14630,21 @@ namespace azure.search.documents.types include_total_count: bool minimum_coverage: float order_by: list[str] + orderby: list[str] query_language: Union[str, QueryLanguage] query_rewrites: Union[str, QueryRewritesType] query_speller: Union[str, QuerySpellerType] query_type: Union[str, QueryType] + scoringParameters: list[str] scoring_parameters: list[str] scoring_profile: str scoring_statistics: Union[str, ScoringStatistics] + searchFields: list[str] search_fields: list[str] search_mode: Union[str, SearchMode] search_text: str select: list[str] + semanticFields: list[str] semantic_configuration_name: str semantic_error_handling: Union[str, SemanticErrorMode] semantic_fields: list[str] @@ -14461,6 +14653,7 @@ namespace azure.search.documents.types session_id: str skip: int top: int + vectorQueries: list[VectorQuery] vector_filter_mode: Union[str, VectorFilterMode] vector_queries: list[VectorQuery] @@ -14470,27 +14663,20 @@ namespace azure.search.documents.types key "captions": Union[str, QueryCaptionType] key "count": bool key "debug": Union[str, QueryDebugMode] - key "facets": list[str] key "filter": str - key "highlight": list[str] key "highlightPostTag": str key "highlightPreTag": str - key "hybridSearch": ForwardRef('HybridSearch') + key "hybridSearch": ForwardRef('HybridSearch', module='types') key "minimumCoverage": float - key "orderby": list[str] key "queryLanguage": Union[str, QueryLanguage] key "queryRewrites": Union[str, QueryRewritesType] key "queryType": Union[str, QueryType] - key "scoringParameters": list[str] key "scoringProfile": str key "scoringStatistics": Union[str, ScoringStatistics] key "search": str - key "searchFields": list[str] key "searchMode": Union[str, SearchMode] - key "select": list[str] key "semanticConfiguration": str key "semanticErrorHandling": Union[str, SemanticErrorMode] - key "semanticFields": list[str] key "semanticMaxWaitInMilliseconds": int key "semanticQuery": str key "sessionId": str @@ -14498,12 +14684,12 @@ namespace azure.search.documents.types key "speller": Union[str, QuerySpellerType] key "top": int key "vectorFilterMode": Union[str, VectorFilterMode] - key "vectorQueries": list[VectorQuery] answers: Union[str, QueryAnswerType] captions: Union[str, QueryCaptionType] debug: Union[str, QueryDebugMode] facets: list[str] filter: str + highlight: list[str] highlight_fields: list[str] highlight_post_tag: str highlight_pre_tag: str @@ -14511,17 +14697,21 @@ namespace azure.search.documents.types include_total_count: bool minimum_coverage: float order_by: list[str] + orderby: list[str] query_language: Union[str, QueryLanguage] query_rewrites: Union[str, QueryRewritesType] query_speller: Union[str, QuerySpellerType] query_type: Union[str, QueryType] + scoringParameters: list[str] scoring_parameters: list[str] scoring_profile: str scoring_statistics: Union[str, ScoringStatistics] + searchFields: list[str] search_fields: list[str] search_mode: Union[str, SearchMode] search_text: str select: list[str] + semanticFields: list[str] semantic_configuration_name: str semantic_error_handling: Union[str, SemanticErrorMode] semantic_fields: list[str] @@ -14530,6 +14720,7 @@ namespace azure.search.documents.types session_id: str skip: int top: int + vectorQueries: list[VectorQuery] vector_filter_mode: Union[str, VectorFilterMode] vector_queries: list[VectorQuery] @@ -14537,10 +14728,10 @@ namespace azure.search.documents.types class azure.search.documents.types.SearchResult(TypedDict): key "@search.captions": Optional[list[QueryCaptionResult]] key "@search.documentDebugInfo": Optional[DocumentDebugInfo] - key "@search.highlights": dict[str, list[str]] key "@search.rerankerBoostedScore": Optional[float] key "@search.rerankerScore": Optional[float] - @search.score: Required[float] + key "@search.score": Required[float] + @search.highlights: dict[str, list[str]] captions: list[QueryCaptionResult] document_debug_info: DocumentDebugInfo highlights: dict[str, list[str]] @@ -14550,16 +14741,18 @@ namespace azure.search.documents.types class azure.search.documents.types.SearchScoreThreshold(TypedDict, total=False): - kind: Required[Literal[VectorThresholdKind.SEARCH_SCORE]] - value: Required[float] + key "kind": Required[Literal[VectorThresholdKind.SEARCH_SCORE]] + key "value": Required[float] + kind: Literal[VectorThresholdKind.SEARCH_SCORE] + value: float class azure.search.documents.types.SemanticDebugInfo(TypedDict, total=False): - key "contentFields": list[QueryResultDocumentSemanticField] - key "keywordFields": list[QueryResultDocumentSemanticField] - key "rerankerInput": ForwardRef('QueryResultDocumentRerankerInput') - key "titleField": ForwardRef('QueryResultDocumentSemanticField') + key "rerankerInput": ForwardRef('QueryResultDocumentRerankerInput', module='types') + key "titleField": ForwardRef('QueryResultDocumentSemanticField', module='types') + contentFields: list[QueryResultDocumentSemanticField] content_fields: list[QueryResultDocumentSemanticField] + keywordFields: list[QueryResultDocumentSemanticField] keyword_fields: list[QueryResultDocumentSemanticField] reranker_input: QueryResultDocumentRerankerInput title_field: QueryResultDocumentSemanticField @@ -14578,27 +14771,26 @@ namespace azure.search.documents.types key "highlightPostTag": str key "highlightPreTag": str key "minimumCoverage": float - key "orderby": list[str] - key "searchFields": list[str] - key "select": list[str] + key "search": Required[str] + key "suggesterName": Required[str] key "top": int filter: str highlight_post_tag: str highlight_pre_tag: str minimum_coverage: float order_by: list[str] - search: Required[str] + orderby: list[str] + searchFields: list[str] search_fields: list[str] search_text: str select: list[str] - suggesterName: Required[str] suggester_name: str top: int use_fuzzy_matching: bool class azure.search.documents.types.SuggestResult(TypedDict): - @search.text: Required[str] + key "@search.text": Required[str] text: str @@ -14615,8 +14807,10 @@ namespace azure.search.documents.types class azure.search.documents.types.VectorSimilarityThreshold(TypedDict, total=False): - kind: Required[Literal[VectorThresholdKind.VECTOR_SIMILARITY]] - value: Required[float] + key "kind": Required[Literal[VectorThresholdKind.VECTOR_SIMILARITY]] + key "value": Required[float] + kind: Literal[VectorThresholdKind.VECTOR_SIMILARITY] + value: float class azure.search.documents.types.VectorThresholdKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -14630,16 +14824,17 @@ namespace azure.search.documents.types key "fields": str key "filterOverride": str key "k": int + key "kind": Required[Literal[VectorQueryKind.IMAGE_BINARY]] key "oversampling": float key "perDocumentVectorLimit": int - key "threshold": ForwardRef('VectorThreshold') + key "threshold": ForwardRef('VectorThreshold', module='types') key "weight": float base64_image: str exhaustive: bool fields: str filter_override: str k_nearest_neighbors: int - kind: Required[Literal[VectorQueryKind.IMAGE_BINARY]] + kind: Literal[VectorQueryKind.IMAGE_BINARY] oversampling: float per_document_vector_limit: int threshold: VectorThreshold @@ -14651,16 +14846,17 @@ namespace azure.search.documents.types key "fields": str key "filterOverride": str key "k": int + key "kind": Required[Literal[VectorQueryKind.IMAGE_URL]] key "oversampling": float key "perDocumentVectorLimit": int - key "threshold": ForwardRef('VectorThreshold') + key "threshold": ForwardRef('VectorThreshold', module='types') key "url": str key "weight": float exhaustive: bool fields: str filter_override: str k_nearest_neighbors: int - kind: Required[Literal[VectorQueryKind.IMAGE_URL]] + kind: Literal[VectorQueryKind.IMAGE_URL] oversampling: float per_document_vector_limit: int threshold: VectorThreshold @@ -14673,20 +14869,22 @@ namespace azure.search.documents.types key "fields": str key "filterOverride": str key "k": int + key "kind": Required[Literal[VectorQueryKind.TEXT]] key "oversampling": float key "perDocumentVectorLimit": int key "queryRewrites": Union[str, QueryRewritesType] - key "threshold": ForwardRef('VectorThreshold') + key "text": Required[str] + key "threshold": ForwardRef('VectorThreshold', module='types') key "weight": float exhaustive: bool fields: str filter_override: str k_nearest_neighbors: int - kind: Required[Literal[VectorQueryKind.TEXT]] + kind: Literal[VectorQueryKind.TEXT] oversampling: float per_document_vector_limit: int query_rewrites: Union[str, QueryRewritesType] - text: Required[str] + text: str threshold: VectorThreshold weight: float @@ -14696,24 +14894,26 @@ namespace azure.search.documents.types key "fields": str key "filterOverride": str key "k": int + key "kind": Required[Literal[VectorQueryKind.VECTOR]] key "oversampling": float key "perDocumentVectorLimit": int - key "threshold": ForwardRef('VectorThreshold') + key "threshold": ForwardRef('VectorThreshold', module='types') + key "vector": Required[list[float]] key "weight": float exhaustive: bool fields: str filter_override: str k_nearest_neighbors: int - kind: Required[Literal[VectorQueryKind.VECTOR]] + kind: Literal[VectorQueryKind.VECTOR] oversampling: float per_document_vector_limit: int threshold: VectorThreshold - vector: Required[list[float]] + vector: list[float] weight: float class azure.search.documents.types.VectorsDebugInfo(TypedDict, total=False): - key "subscores": ForwardRef('QueryResultDocumentSubscores') + key "subscores": ForwardRef('QueryResultDocumentSubscores', module='types') subscores: QueryResultDocumentSubscores diff --git a/sdk/search/azure-search-documents/api.metadata.yml b/sdk/search/azure-search-documents/api.metadata.yml index bf399b4b31df..515b978f2e12 100644 --- a/sdk/search/azure-search-documents/api.metadata.yml +++ b/sdk/search/azure-search-documents/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 608a6471906279d2f97ee54ae7e642d118e81b946ddde281ddd93654c5abf9b1 +apiMdSha256: 15242ffde2d534307d6d26de5cf43e24d00ae06750e6bc655bf966ba0561f1a3 parserVersion: 0.3.30 -pythonVersion: 3.10.20 +pythonVersion: 3.12.1 diff --git a/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py index c51f8545a393..ae52ce7ff051 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py @@ -372,7 +372,7 @@ def index_documents(self, batch: _models.IndexDocumentsBatch, **kwargs: Any) -> :param batch: A batch of document operations to perform. :type batch: IndexDocumentsBatch :return: List of IndexingResult - :rtype: list[IndexingResult] + :rtype: list[~azure.search.documents.types.IndexingResult] :raises ~azure.search.documents.RequestEntityTooLargeError: The request is too large. """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_patch.py index 57cbd19e6d37..505866a1dbc5 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_patch.py @@ -59,9 +59,9 @@ class SearchClient(_SearchClient): :param index_name: The name of the index. Required. :type index_name: str :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -165,7 +165,7 @@ def __repr__(self) -> str: def actions(self) -> List[IndexAction]: """The list of currently index actions in queue to index. - :rtype: list[IndexAction] + :rtype: list[~azure.search.documents.types.IndexAction] """ return self._index_documents_batch.actions if self._index_documents_batch.actions else [] @@ -327,7 +327,7 @@ def index_documents(self, batch: IndexDocumentsBatch, **kwargs) -> List[Indexing :param batch: A batch of document operations to perform. :type batch: IndexDocumentsBatch :return: Indexing result of each action in the batch. - :rtype: list[IndexingResult] + :rtype: list[~azure.search.documents.types.IndexingResult] :raises ~azure.search.documents.RequestEntityTooLargeError: The request is too large. """ return self._index_documents_actions(actions=batch.actions if batch.actions else [], **kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py index b57bcb798e70..54f7153bc1ed 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py @@ -189,7 +189,7 @@ async def index_documents(self, batch: _models.IndexDocumentsBatch, **kwargs: An :param batch: A batch of document operations to perform. :type batch: ~azure.search.documents.models.IndexDocumentsBatch :return: List of IndexingResult - :rtype: list[IndexingResult] + :rtype: list[~azure.search.documents.types.IndexingResult] :raises ~azure.search.documents.RequestEntityTooLargeError: The request is too large. """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py index 4c5d8182bf57..0a8b10ce0931 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py @@ -36,9 +36,9 @@ class SearchClient(_SearchClient): :param index_name: The name of the index. Required. :type index_name: str :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -150,7 +150,7 @@ def __repr__(self) -> str: def actions(self) -> List[IndexAction]: """The list of currently index actions in queue to index. - :rtype: list[IndexAction] + :rtype: list[~azure.search.documents.types.IndexAction] """ return self._index_documents_batch.actions if self._index_documents_batch.actions else [] @@ -307,7 +307,7 @@ async def index_documents(self, batch: IndexDocumentsBatch, **kwargs) -> List[In :param batch: A batch of document operations to perform. :type batch: ~azure.search.documents.models.IndexDocumentsBatch :return: Indexing result of each action in the batch. - :rtype: list[IndexingResult] + :rtype: list[~azure.search.documents.types.IndexingResult] :raises ~azure.search.documents.RequestEntityTooLargeError: The request is too large. """ return await self._index_documents_actions(actions=batch.actions if batch.actions else [], **kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py index 3ec6d6602cbe..41a0f266124f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py @@ -7,7 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Union +from typing import Any, Optional, Union from azure.core.credentials import AzureKeyCredential, TokenCredential @@ -25,9 +25,9 @@ class SearchIndexClient(_SearchIndexClient): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -51,9 +51,9 @@ class SearchIndexerClient(_SearchIndexerClient): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -80,3 +80,16 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from . import types + + ingestion_parameter_types = ( + types.AzureBlobKnowledgeSourceParameters, + types.FileKnowledgeSourceParameters, + types.IndexedOneLakeKnowledgeSourceParameters, + types.IndexedSharePointKnowledgeSourceParameters, + types.IndexedSqlKnowledgeSourceParameters, + ) + for parameter_type in ingestion_parameter_types: + parameter_type.__annotations__["ingestionParameters"] = Optional[ + "azure.search.documents.knowledgebases.types.KnowledgeSourceIngestionParameters" + ] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py index a6b864c592a8..b728c5352f78 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py @@ -26,9 +26,9 @@ class SearchIndexClient(_SearchIndexClient): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -54,9 +54,9 @@ class SearchIndexerClient(_SearchIndexerClient): :type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py index 4c2004352cee..897f0ae0b8eb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py @@ -10,6 +10,7 @@ from typing import Any, IO, Optional, Union from azure.core.credentials import AzureKeyCredential, TokenCredential +from azure.core.tracing.decorator import distributed_trace from ._client import KnowledgeBaseRetrievalClient as _KnowledgeBaseRetrievalClient from . import models @@ -28,9 +29,9 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): :param knowledge_base_name: The name of the knowledge base. Required. :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -43,6 +44,7 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre kwargs.setdefault("credential_scopes", [audience.rstrip("/") + "/.default"]) super().__init__(endpoint=endpoint, credential=credential, **kwargs) + @distributed_trace def retrieve_stream( self, retrieval_request: Union[models.KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], @@ -108,3 +110,23 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from . import types + + query_parameter_types = ( + types.AzureBlobKnowledgeSourceParams, + types.FileKnowledgeSourceParams, + types.IndexedOneLakeKnowledgeSourceParams, + types.IndexedSharePointKnowledgeSourceParams, + types.IndexedSqlKnowledgeSourceParams, + types.SearchIndexKnowledgeSourceParams, + ) + for parameter_type in query_parameter_types: + parameter_type.__annotations__["queryHintOverrides"] = ( + "azure.search.documents.indexes.types.SearchIndexKnowledgeSourceQueryHints" + ) + types.KnowledgeSourceAzureOpenAIVectorizer.__annotations__["azureOpenAIParameters"] = ( + "azure.search.documents.indexes.types.AzureOpenAIVectorizerParameters" + ) + types.KnowledgeSourceIngestionParameters.__annotations__["ingestionSchedule"] = Optional[ + "azure.search.documents.indexes.types.IndexingSchedule" + ] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py index d023fe60c818..dd18091df38c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py @@ -8,14 +8,9 @@ import codecs import json -import sys from types import TracebackType from typing import Any, AsyncGenerator, AsyncIterator, Generator, Iterator, Optional, Tuple, Type, Union - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self # type: ignore +from typing_extensions import Self from . import models from ._utils.model_base import _deserialize @@ -61,6 +56,9 @@ def __repr__(self) -> str: return f"KnowledgeBaseRetrievalEvent(event_type={self.event_type!r}, data={self.data!r})" +KnowledgeBaseRetrievalEvent.__module__ = "azure.search.documents.knowledgebases" + + def _split_sse_lines(buffer: str) -> Tuple[list[str], str]: lines: list[str] = [] start = 0 @@ -165,8 +163,7 @@ def _deserialize_event(event_type: str, data: str) -> KnowledgeBaseRetrievalEven return KnowledgeBaseRetrievalEvent(event_type, event_data) if event_type == "references.completed": references = [ - models.KnowledgeBaseReference._deserialize(item, []) # pylint: disable=protected-access - for item in payload + models.KnowledgeBaseReference._deserialize(item, []) for item in payload # pylint: disable=protected-access ] return KnowledgeBaseRetrievalEvent(event_type, references) deserializer = { @@ -311,4 +308,4 @@ async def __aexit__( "KnowledgeBaseRetrievalEvent", "KnowledgeBaseRetrievalEventData", "KnowledgeBaseRetrievalStream", -] \ No newline at end of file +] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py index ba065a5bc517..623944427d31 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py @@ -11,6 +11,7 @@ from azure.core.credentials import AzureKeyCredential from azure.core.credentials_async import AsyncTokenCredential +from azure.core.tracing.decorator_async import distributed_trace_async from ._client import KnowledgeBaseRetrievalClient as _KnowledgeBaseRetrievalClient from .. import models @@ -29,9 +30,9 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient): :param knowledge_base_name: The name of the knowledge base. Required. :type knowledge_base_name: str :keyword api_version: The API version to use for this operation. Known values are - listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is + listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is ``ApiVersion.V2026_08_01_PREVIEW``. Note that overriding this default value may - result in unsupported behavior. + result in unsupported behavior. :paramtype api_version: str or ~azure.search.documents.ApiVersion :keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud @@ -46,6 +47,7 @@ def __init__( kwargs.setdefault("credential_scopes", [audience.rstrip("/") + "/.default"]) super().__init__(endpoint=endpoint, credential=credential, **kwargs) + @distributed_trace_async async def retrieve_stream( self, retrieval_request: Union[models.KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py index 4f5cd0f247c8..9456b78d3da3 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py @@ -102,9 +102,7 @@ def main(): ) retrieval_result = retrieval_client.retrieve( request, - query_work_iq_source_authorization=os.environ[ - "AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION" - ], + query_work_iq_source_authorization=os.environ["AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION"], ) finally: retrieval_client.close() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py index f3c1fafe8b43..a533fc3dadf9 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py @@ -104,9 +104,7 @@ async def main(): ) retrieval_result = await retrieval_client.retrieve( request, - query_work_iq_source_authorization=os.environ[ - "AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION" - ], + query_work_iq_source_authorization=os.environ["AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION"], ) finally: await retrieval_client.close() diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py index dcdee2654274..32466de31433 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py @@ -133,8 +133,8 @@ def test_stream_handles_fragmented_utf8_line_endings_comments_and_unknown_events payload = ( b"\xef\xbb\xbf: keep-alive\r\n" b"event: future.event\r" - b"data: {\"message\":\r\n" - b"data: \"caf\xc3\xa9\"}\r\n\r\n" + b'data: {"message":\r\n' + b'data: "caf\xc3\xa9"}\r\n\r\n' ) chunks = [payload[index : index + chunk_size] for index in range(0, len(payload), chunk_size)] response = _Response() @@ -231,4 +231,4 @@ def raising_cls(_pipeline_response, _typed_stream, _headers): client.retrieve_stream(KnowledgeBaseRetrievalRequest(), cls=raising_cls) assert response.closed assert raw_stream.closed - client.close() \ No newline at end of file + client.close() From bd17d60804106fcd32e186d382ebc1811e42934b Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Tue, 11 Aug 2026 19:08:23 +0000 Subject: [PATCH 09/17] updatet api.md --- sdk/search/azure-search-documents/api.md | 24 ++++++++++--------- .../azure-search-documents/api.metadata.yml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/sdk/search/azure-search-documents/api.md b/sdk/search/azure-search-documents/api.md index 3709cb46d755..b40e3032d17a 100644 --- a/sdk/search/azure-search-documents/api.md +++ b/sdk/search/azure-search-documents/api.md @@ -8979,7 +8979,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.FileKnowledgeSourceParameters(TypedDict, total=False): key "createdResources": ForwardRef('CreatedResources', module='types') - key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters', module='types') + key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') created_resources: CreatedResources ingestion_parameters: KnowledgeSourceIngestionParameters @@ -9086,7 +9086,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): key "createdResources": ForwardRef('CreatedResources', module='types') key "fabricWorkspaceId": Required[str] - key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters', module='types') + key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "lakehouseId": Required[str] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "targetPath": Optional[str] @@ -9151,7 +9151,7 @@ namespace azure.search.documents.indexes.types key "connectionString": Required[str] key "createdResources": ForwardRef('CreatedResources', module='types') key "highWaterMarkColumnName": str - key "ingestionParameters": ForwardRef('KnowledgeSourceIngestionParameters', module='types') + key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "tableOrView": Required[str] connection_string: str @@ -10874,6 +10874,7 @@ namespace azure.search.documents.knowledgebases **kwargs: Any ) -> KnowledgeBaseRetrievalResponse: ... + @distributed_trace def retrieve_stream( self, retrieval_request: Union[KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], @@ -10978,6 +10979,7 @@ namespace azure.search.documents.knowledgebases.aio **kwargs: Any ) -> KnowledgeBaseRetrievalResponse: ... + @distributed_trace_async async def retrieve_stream( self, retrieval_request: Union[KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], @@ -13281,7 +13283,6 @@ namespace azure.search.documents.knowledgebases.types key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13293,6 +13294,7 @@ namespace azure.search.documents.knowledgebases.types knowledge_source_name: str max_output_documents: int never_query_source: bool + queryHintOverrides: SearchIndexKnowledgeSourceQueryHints query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float results_processing: Union[str, KnowledgeSourceResultsProcessing] @@ -13371,7 +13373,6 @@ namespace azure.search.documents.knowledgebases.types key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13383,6 +13384,7 @@ namespace azure.search.documents.knowledgebases.types knowledge_source_name: str max_output_documents: int never_query_source: bool + queryHintOverrides: SearchIndexKnowledgeSourceQueryHints query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float results_processing: Union[str, KnowledgeSourceResultsProcessing] @@ -13403,7 +13405,6 @@ namespace azure.search.documents.knowledgebases.types key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13415,6 +13416,7 @@ namespace azure.search.documents.knowledgebases.types knowledge_source_name: str max_output_documents: int never_query_source: bool + queryHintOverrides: SearchIndexKnowledgeSourceQueryHints query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float results_processing: Union[str, KnowledgeSourceResultsProcessing] @@ -13430,7 +13432,6 @@ namespace azure.search.documents.knowledgebases.types key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13442,6 +13443,7 @@ namespace azure.search.documents.knowledgebases.types knowledge_source_name: str max_output_documents: int never_query_source: bool + queryHintOverrides: SearchIndexKnowledgeSourceQueryHints query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float results_processing: Union[str, KnowledgeSourceResultsProcessing] @@ -13457,7 +13459,6 @@ namespace azure.search.documents.knowledgebases.types key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13469,6 +13470,7 @@ namespace azure.search.documents.knowledgebases.types knowledge_source_name: str max_output_documents: int never_query_source: bool + queryHintOverrides: SearchIndexKnowledgeSourceQueryHints query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float results_processing: Union[str, KnowledgeSourceResultsProcessing] @@ -13572,8 +13574,8 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): - key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters', module='types') key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + azureOpenAIParameters: AzureOpenAIVectorizerParameters azure_open_ai_parameters: AzureOpenAIVectorizerParameters kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] @@ -13658,8 +13660,8 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeSourceVectorizer(TypedDict, total=False): - key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters', module='types') key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] + azureOpenAIParameters: AzureOpenAIVectorizerParameters azure_open_ai_parameters: AzureOpenAIVectorizerParameters kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] @@ -13727,7 +13729,6 @@ namespace azure.search.documents.knowledgebases.types key "knowledgeSourceName": Required[str] key "maxOutputDocuments": int key "neverQuerySource": bool - key "queryHintOverrides": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] always_query_source: bool @@ -13740,6 +13741,7 @@ namespace azure.search.documents.knowledgebases.types knowledge_source_name: str max_output_documents: int never_query_source: bool + queryHintOverrides: SearchIndexKnowledgeSourceQueryHints query_hint_overrides: SearchIndexKnowledgeSourceQueryHints reranker_threshold: float results_processing: Union[str, KnowledgeSourceResultsProcessing] diff --git a/sdk/search/azure-search-documents/api.metadata.yml b/sdk/search/azure-search-documents/api.metadata.yml index 515b978f2e12..8e69c4a5a365 100644 --- a/sdk/search/azure-search-documents/api.metadata.yml +++ b/sdk/search/azure-search-documents/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 15242ffde2d534307d6d26de5cf43e24d00ae06750e6bc655bf966ba0561f1a3 +apiMdSha256: fde5d1711aad8c472cf86241b437322f651b61545669521a96561017fa6eab30 parserVersion: 0.3.30 pythonVersion: 3.12.1 From 4412fcb1a858be52b6f215db21387569747b6e85 Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Tue, 11 Aug 2026 20:01:18 +0000 Subject: [PATCH 10/17] regen w/ new version --- .../azure-search-documents/api.metadata.yml | 2 +- .../azure/search/documents/_client.py | 2 +- .../azure/search/documents/_configuration.py | 3 +- .../search/documents/_utils/model_base.py | 18 +- .../search/documents/_utils/serialization.py | 6 +- .../azure/search/documents/aio/_client.py | 2 +- .../search/documents/aio/_configuration.py | 3 +- .../azure/search/documents/indexes/_client.py | 8 +- .../documents/indexes/_configuration.py | 5 +- .../indexes/_operations/_operations.py | 35 +- .../documents/indexes/_utils/model_base.py | 18 +- .../documents/indexes/_utils/serialization.py | 6 +- .../search/documents/indexes/aio/_client.py | 8 +- .../documents/indexes/aio/_configuration.py | 5 +- .../indexes/aio/_operations/_operations.py | 30 +- .../documents/indexes/models/_models.py | 666 ++-- .../azure/search/documents/indexes/types.py | 2701 ++++++++--------- .../documents/knowledgebases/_client.py | 4 +- .../knowledgebases/_configuration.py | 3 +- .../knowledgebases/_utils/model_base.py | 18 +- .../knowledgebases/_utils/serialization.py | 6 +- .../documents/knowledgebases/aio/_client.py | 4 +- .../knowledgebases/aio/_configuration.py | 3 +- .../knowledgebases/models/_models.py | 254 +- .../search/documents/knowledgebases/types.py | 750 ++--- .../azure/search/documents/models/_models.py | 38 +- .../azure/search/documents/types.py | 588 ++-- 27 files changed, 2797 insertions(+), 2389 deletions(-) diff --git a/sdk/search/azure-search-documents/api.metadata.yml b/sdk/search/azure-search-documents/api.metadata.yml index 8e69c4a5a365..16c9694cfb64 100644 --- a/sdk/search/azure-search-documents/api.metadata.yml +++ b/sdk/search/azure-search-documents/api.metadata.yml @@ -1,3 +1,3 @@ apiMdSha256: fde5d1711aad8c472cf86241b437322f651b61545669521a96561017fa6eab30 -parserVersion: 0.3.30 +parserVersion: 0.3.31 pythonVersion: 3.12.1 diff --git a/sdk/search/azure-search-documents/azure/search/documents/_client.py b/sdk/search/azure-search-documents/azure/search/documents/_client.py index c19b882b0990..64d9a3865607 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_client.py @@ -28,7 +28,7 @@ from azure.core.credentials import TokenCredential -class SearchClient(_SearchClientOperationsMixin): +class SearchClient(_SearchClientOperationsMixin): # pylint: disable=docstring-keyword-should-match-keyword-only """SearchClient. :param endpoint: The endpoint URL of the search service. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_configuration.py index 19dc1261e170..85b237927565 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ from azure.core.credentials import TokenCredential -class SearchClientConfiguration: # pylint: disable=too-many-instance-attributes +class SearchClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for SearchClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py b/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py index 0f2c5bdfe70f..35d5fc024978 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_utils/model_base.py @@ -158,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -342,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -369,6 +383,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: diff --git a/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py b/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py index 75906e2eb77f..ae08f9d89f74 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_utils/serialization.py @@ -480,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py index 7c651992fa82..2258b7f1fed2 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_client.py @@ -28,7 +28,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class SearchClient(_SearchClientOperationsMixin): +class SearchClient(_SearchClientOperationsMixin): # pylint: disable=docstring-keyword-should-match-keyword-only """SearchClient. :param endpoint: The endpoint URL of the search service. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py index 2d071d697d69..ddd5e3e5cedc 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class SearchClientConfiguration: # pylint: disable=too-many-instance-attributes +class SearchClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for SearchClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py index 6e89b4ebd388..8459f987eccf 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_client.py @@ -28,7 +28,9 @@ from azure.core.credentials import TokenCredential -class SearchIndexClient(_SearchIndexClientOperationsMixin): +class SearchIndexClient( + _SearchIndexClientOperationsMixin +): # pylint: disable=docstring-keyword-should-match-keyword-only """SearchIndexClient. :param endpoint: The endpoint URL of the search service. Required. @@ -108,7 +110,9 @@ def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) -class SearchIndexerClient(_SearchIndexerClientOperationsMixin): +class SearchIndexerClient( + _SearchIndexerClientOperationsMixin +): # pylint: disable=docstring-keyword-should-match-keyword-only """SearchIndexerClient. :param endpoint: The endpoint URL of the search service. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py index 779c9a60f5c4..4f84d2fcb079 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ from azure.core.credentials import TokenCredential -class SearchIndexClientConfiguration: # pylint: disable=too-many-instance-attributes +class SearchIndexClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for SearchIndexClient. Note that all parameters used to create this instance are saved as instance @@ -73,7 +74,7 @@ def _configure(self, **kwargs: Any) -> None: self.authentication_policy = self._infer_policy(**kwargs) -class SearchIndexerClientConfiguration: # pylint: disable=too-many-instance-attributes +class SearchIndexerClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for SearchIndexerClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py index aa0076751f03..0a355a67d36b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py @@ -940,7 +940,7 @@ def build_search_index_upload_knowledge_source_file_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: str = kwargs.pop("content_type") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-08-01-preview")) accept = _headers.pop("Accept", "application/json") @@ -956,7 +956,8 @@ def build_search_index_upload_knowledge_source_file_request( # pylint: disable= _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") + if content_type is not None: + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Content-Disposition"] = _SERIALIZER.header("content_disposition", content_disposition, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4725,6 +4726,27 @@ def get_knowledge_source_status(self, name: str, **kwargs: Any) -> _knowledgebas return deserialized # type: ignore + @overload + def _upload_knowledge_source_file( + self, + name: str, + file: bytes, + *, + content_disposition: str, + content_type: str = "application/octet-stream", + **kwargs: Any, + ) -> _models1.KnowledgeSourceFile: ... + @overload + def _upload_knowledge_source_file( + self, + name: str, + file: IO[bytes], + *, + content_disposition: str, + content_type: str = "application/octet-stream", + **kwargs: Any, + ) -> _models1.KnowledgeSourceFile: ... + @distributed_trace @api_version_validation( method_added_on="2026-05-01-preview", @@ -4741,14 +4763,14 @@ def get_knowledge_source_status(self, name: str, **kwargs: Any) -> _knowledgebas api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) def _upload_knowledge_source_file( - self, name: str, file: bytes, *, content_disposition: str, **kwargs: Any + self, name: str, file: Union[bytes, IO[bytes]], *, content_disposition: str, **kwargs: Any ) -> _models1.KnowledgeSourceFile: """Uploads a file to a File knowledge source for processing and indexing. :param name: The name of the knowledge source. Required. :type name: str - :param file: The file content to upload. Required. - :type file: bytes + :param file: The file content to upload. Is either a bytes type or a IO[bytes] type. Required. + :type file: bytes or IO[bytes] :keyword content_disposition: The Content-Disposition header specifying the filename of the uploaded file. Must follow the format: ``attachment; filename=""``. @@ -4769,9 +4791,10 @@ def _upload_knowledge_source_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) cls: ClsType[_models1.KnowledgeSourceFile] = kwargs.pop("cls", None) + content_type = content_type or "application/octet-stream" _content = file _request = build_search_index_upload_knowledge_source_file_request( diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py index 0f2c5bdfe70f..35d5fc024978 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/model_base.py @@ -158,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -342,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -369,6 +383,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py index 75906e2eb77f..ae08f9d89f74 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/serialization.py @@ -480,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py index e906abeef969..a68dcf474b6e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_client.py @@ -28,7 +28,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class SearchIndexClient(_SearchIndexClientOperationsMixin): +class SearchIndexClient( + _SearchIndexClientOperationsMixin +): # pylint: disable=docstring-keyword-should-match-keyword-only """SearchIndexClient. :param endpoint: The endpoint URL of the search service. Required. @@ -112,7 +114,9 @@ async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) -class SearchIndexerClient(_SearchIndexerClientOperationsMixin): +class SearchIndexerClient( + _SearchIndexerClientOperationsMixin +): # pylint: disable=docstring-keyword-should-match-keyword-only """SearchIndexerClient. :param endpoint: The endpoint URL of the search service. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py index 4ba519bf8061..b13d1ed65042 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class SearchIndexClientConfiguration: # pylint: disable=too-many-instance-attributes +class SearchIndexClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for SearchIndexClient. Note that all parameters used to create this instance are saved as instance @@ -75,7 +76,7 @@ def _configure(self, **kwargs: Any) -> None: self.authentication_policy = self._infer_policy(**kwargs) -class SearchIndexerClientConfiguration: # pylint: disable=too-many-instance-attributes +class SearchIndexerClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for SearchIndexerClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py index c07ed891c164..7fd89e603a2a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py @@ -3026,6 +3026,27 @@ async def get_knowledge_source_status( return deserialized # type: ignore + @overload + async def _upload_knowledge_source_file( + self, + name: str, + file: bytes, + *, + content_disposition: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models2.KnowledgeSourceFile: ... + @overload + async def _upload_knowledge_source_file( + self, + name: str, + file: IO[bytes], + *, + content_disposition: str, + content_type: str = "application/octet-stream", + **kwargs: Any + ) -> _models2.KnowledgeSourceFile: ... + @distributed_trace_async @api_version_validation( method_added_on="2026-05-01-preview", @@ -3042,14 +3063,14 @@ async def get_knowledge_source_status( api_versions_list=["2026-05-01-preview", "2026-08-01-preview"], ) async def _upload_knowledge_source_file( - self, name: str, file: bytes, *, content_disposition: str, **kwargs: Any + self, name: str, file: Union[bytes, IO[bytes]], *, content_disposition: str, **kwargs: Any ) -> _models2.KnowledgeSourceFile: """Uploads a file to a File knowledge source for processing and indexing. :param name: The name of the knowledge source. Required. :type name: str - :param file: The file content to upload. Required. - :type file: bytes + :param file: The file content to upload. Is either a bytes type or a IO[bytes] type. Required. + :type file: bytes or IO[bytes] :keyword content_disposition: The Content-Disposition header specifying the filename of the uploaded file. Must follow the format: ``attachment; filename=""``. @@ -3070,9 +3091,10 @@ async def _upload_knowledge_source_file( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/octet-stream")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) cls: ClsType[_models2.KnowledgeSourceFile] = kwargs.pop("cls", None) + content_type = content_type or "application/octet-stream" _content = file _request = build_search_index_upload_knowledge_source_file_request( diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py index 4c9e478cf930..1d56a5e7f99a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py @@ -29,7 +29,7 @@ from ...knowledgebases import models as _knowledgebases_models3 -class CognitiveServicesAccount(_Model): +class CognitiveServicesAccount(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for describing any Azure AI service resource attached to a skillset. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -67,7 +67,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AIServicesAccountIdentity(CognitiveServicesAccount, discriminator="#Microsoft.Azure.Search.AIServicesByIdentity"): +class AIServicesAccountIdentity( + CognitiveServicesAccount, discriminator="#Microsoft.Azure.Search.AIServicesByIdentity" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The multi-region account of an Azure AI service resource that's attached to a skillset. :ivar description: Description of the Azure AI service resource attached to a skillset. @@ -119,7 +121,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.AIServicesByIdentity" # type: ignore -class AIServicesAccountKey(CognitiveServicesAccount, discriminator="#Microsoft.Azure.Search.AIServicesByKey"): +class AIServicesAccountKey( + CognitiveServicesAccount, discriminator="#Microsoft.Azure.Search.AIServicesByKey" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The account key of an Azure AI service resource that's attached to a skillset, to be used with the resource's subdomain. @@ -165,7 +169,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.AIServicesByKey" # type: ignore -class AIServicesVisionParameters(_Model): +class AIServicesVisionParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the AI Services Vision parameters for vectorizing a query image or text. :ivar model_version: The version of the model to use when calling the AI Services Vision @@ -218,7 +222,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VectorSearchVectorizer(_Model): +class VectorSearchVectorizer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the vectorization method to be used during query time. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -259,7 +263,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AIServicesVisionVectorizer(VectorSearchVectorizer, discriminator="aiServicesVision"): +class AIServicesVisionVectorizer( + VectorSearchVectorizer, discriminator="aiServicesVision" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Clears the identity property of a datasource. :ivar vectorizer_name: The name to associate with this particular vectorization method. @@ -333,7 +339,7 @@ class AnalyzedTokenInfo(_Model): Required.""" -class AnalyzeResult(_Model): +class AnalyzeResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The result of testing an analyzer on text. :ivar tokens: The list of tokens returned by the analyzer specified in the request. Required. @@ -361,7 +367,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AnalyzeTextOptions(_Model): +class AnalyzeTextOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies some text and analysis components used to break that text into tokens. :ivar text: The text to break into tokens. Required. @@ -478,7 +484,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TokenFilter(_Model): +class TokenFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for token filters. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -525,7 +531,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AsciiFoldingTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.AsciiFoldingTokenFilter"): +class AsciiFoldingTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.AsciiFoldingTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such equivalents exist. This token filter is implemented using Apache Lucene. @@ -570,7 +578,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.AsciiFoldingTokenFilter" # type: ignore -class AzureActiveDirectoryApplicationCredentials(_Model): # pylint: disable=name-too-long +class AzureActiveDirectoryApplicationCredentials( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Credentials of a registered application created for your search service, used for authenticated access to the encryption keys stored in Azure Key Vault. @@ -610,7 +620,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeSource(_Model): +class KnowledgeSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a knowledge source definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -697,7 +707,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureBlobKnowledgeSource(KnowledgeSource, discriminator="azureBlob"): +class AzureBlobKnowledgeSource( + KnowledgeSource, discriminator="azureBlob" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Azure Blob Storage knowledge source. :ivar name: The name of the knowledge source. Required. @@ -760,7 +772,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.AZURE_BLOB # type: ignore -class AzureBlobKnowledgeSourceParameters(_Model): +class AzureBlobKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for Azure Blob Storage knowledge source. :ivar connection_string: Key-based connection string or the ResourceId format if using a @@ -834,7 +846,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureMachineLearningParameters(_Model): +class AzureMachineLearningParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the properties for connecting to an AML vectorizer. :ivar scoring_uri: (Required for no authentication or key authentication) The scoring URI of @@ -910,7 +922,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerSkill(_Model): +class SearchIndexerSkill(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for skills. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -987,7 +999,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureMachineLearningSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Custom.AmlSkill"): +class AzureMachineLearningSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Custom.AmlSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """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. @@ -1092,7 +1106,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Custom.AmlSkill" # type: ignore -class AzureMachineLearningVectorizer(VectorSearchVectorizer, discriminator="aml"): +class AzureMachineLearningVectorizer( + VectorSearchVectorizer, discriminator="aml" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog for generating the vector embedding of a query string. @@ -1136,7 +1152,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchVectorizerKind.AML # type: ignore -class AzureOpenAIEmbeddingSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"): +class AzureOpenAIEmbeddingSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Allows you to generate a vector embedding for a given text input using the Azure OpenAI resource. @@ -1236,7 +1254,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill" # type: ignore -class AzureOpenAITokenizerParameters(_Model): +class AzureOpenAITokenizerParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure OpenAI Tokenizer parameters. :ivar encoder_model_name: Only applies if the unit is set to azureOpenAITokens. Options include @@ -1281,7 +1299,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureOpenAIVectorizer(VectorSearchVectorizer, discriminator="azureOpenAI"): +class AzureOpenAIVectorizer( + VectorSearchVectorizer, discriminator="azureOpenAI" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the Azure OpenAI resource used to vectorize a query string. :ivar vectorizer_name: The name to associate with this particular vectorization method. @@ -1322,7 +1342,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchVectorizerKind.AZURE_OPEN_AI # type: ignore -class AzureOpenAIVectorizerParameters(_Model): +class AzureOpenAIVectorizerParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the parameters for connecting to the Azure OpenAI resource. :ivar resource_url: The resource URI of the Azure OpenAI resource. @@ -1386,7 +1406,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VectorSearchCompression(_Model): +class VectorSearchCompression(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options specific to the compression method used during indexing or querying. @@ -1449,7 +1469,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BinaryQuantizationCompression(VectorSearchCompression, discriminator="binaryQuantization"): +class BinaryQuantizationCompression( + VectorSearchCompression, discriminator="binaryQuantization" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options specific to the binary quantization compression method used during indexing and querying. @@ -1500,7 +1522,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchCompressionKind.BINARY_QUANTIZATION # type: ignore -class SimilarityAlgorithm(_Model): +class SimilarityAlgorithm(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for similarity algorithms. Similarity algorithms are used to calculate scores that tie queries to documents. The higher the score, the more relevant the document is to that specific query. Those scores are used to rank the search results. @@ -1534,7 +1556,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BM25SimilarityAlgorithm(SimilarityAlgorithm, discriminator="#Microsoft.Azure.Search.BM25Similarity"): +class BM25SimilarityAlgorithm( + SimilarityAlgorithm, discriminator="#Microsoft.Azure.Search.BM25Similarity" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a TF-IDF-like algorithm that includes length normalization (controlled by the 'b' parameter) as well as term frequency saturation (controlled by the 'k1' parameter). @@ -1584,7 +1608,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.BM25Similarity" # type: ignore -class CharFilter(_Model): +class CharFilter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for character filters. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1625,7 +1649,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatCompletionCommonModelParameters(_Model): +class ChatCompletionCommonModelParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Common language model parameters for Chat Completions. If omitted, default values are used. :ivar model_name: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not @@ -1693,7 +1717,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatCompletionResponseFormat(_Model): +class ChatCompletionResponseFormat(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Determines how the language model's response should be serialized. Defaults to 'text'. :ivar type: Specifies how the LLM should format the response. Known values are: "text", @@ -1734,7 +1758,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatCompletionSchema(_Model): +class ChatCompletionSchema(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Object defining the custom schema the model will use to structure its output. :ivar type: Type of schema representation. Usually 'object'. Default is 'object'. @@ -1785,7 +1809,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatCompletionSchemaProperties(_Model): +class ChatCompletionSchemaProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for JSON schema response format. :ivar name: Name of the json schema the model will adhere to. @@ -1831,7 +1855,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatCompletionSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Custom.ChatCompletionSkill"): +class ChatCompletionSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Custom.ChatCompletionSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that calls a language model via Azure AI Foundry's Chat Completions endpoint. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -1944,7 +1970,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Custom.ChatCompletionSkill" # type: ignore -class CjkBigramTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.CjkBigramTokenFilter"): +class CjkBigramTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.CjkBigramTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Forms bigrams of CJK terms that are generated from the standard tokenizer. This token filter is implemented using Apache Lucene. @@ -2028,7 +2056,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.ClassicSimilarity" # type: ignore -class LexicalTokenizer(_Model): +class LexicalTokenizer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for tokenizers. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2072,7 +2100,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClassicTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.ClassicTokenizer"): +class ClassicTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.ClassicTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Grammar-based tokenizer that is suitable for processing most European-language documents. This tokenizer is implemented using Apache Lucene. @@ -2119,7 +2149,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class CognitiveServicesAccountKey( CognitiveServicesAccount, discriminator="#Microsoft.Azure.Search.CognitiveServicesByKey" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """The multi-region account key of an Azure AI service resource that's attached to a skillset. :ivar description: Description of the Azure AI service resource attached to a skillset. @@ -2158,7 +2188,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.CognitiveServicesByKey" # type: ignore -class CommonGramTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.CommonGramTokenFilter"): +class CommonGramTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.CommonGramTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Construct bigrams for frequently occurring terms while indexing. Single terms are still indexed too, with bigrams overlaid. This token filter is implemented using Apache Lucene. @@ -2218,7 +2250,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.CommonGramTokenFilter" # type: ignore -class ConditionalSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.ConditionalSkill"): +class ConditionalSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.ConditionalSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that enables scenarios that require a Boolean operation to determine the data to assign to an output. @@ -2270,7 +2304,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Util.ConditionalSkill" # type: ignore -class ContentColumnMapping(_Model): +class ContentColumnMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Maps a SQL column to a search index field. :ivar name: Target index field name. Required. @@ -2310,7 +2344,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContentUnderstandingSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.ContentUnderstandingSkill"): +class ContentUnderstandingSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.ContentUnderstandingSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that leverages Azure AI Content Understanding to process and extract structured insights from documents, enabling enriched, searchable content for enhanced document indexing and retrieval. @@ -2380,7 +2416,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Util.ContentUnderstandingSkill" # type: ignore -class ContentUnderstandingSkillChunkingProperties(_Model): # pylint: disable=name-too-long +class ContentUnderstandingSkillChunkingProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Controls the cardinality for chunking the content. :ivar method: The chunking strategy. 'fixedSize' (default) or 'semantic'. Known values are: @@ -2435,7 +2473,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CorsOptions(_Model): +class CorsOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines options to control Cross-Origin Resource Sharing (CORS) for an index. :ivar allowed_origins: The list of origins from which JavaScript code will be granted access to @@ -2485,7 +2523,7 @@ class CreatedResources(_Model): """ -class LexicalAnalyzer(_Model): +class LexicalAnalyzer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for analyzers. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2526,7 +2564,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomAnalyzer(LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.CustomAnalyzer"): +class CustomAnalyzer( + LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.CustomAnalyzer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Allows you to take control over the process of converting text into indexable/searchable tokens. It's a user-defined configuration consisting of a single predefined tokenizer and one or more filters. The tokenizer is responsible for breaking text into tokens, and the filters @@ -2601,7 +2641,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.CustomAnalyzer" # type: ignore -class CustomEntity(_Model): +class CustomEntity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An object that contains information about the matches that were found, and related metadata. :ivar name: The top-level entity descriptor. Matches in the skill output will be grouped by @@ -2735,7 +2775,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomEntityAlias(_Model): +class CustomEntityAlias(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A complex object that can be used to specify alternative spellings or synonyms to the root entity name. @@ -2785,7 +2825,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomEntityLookupSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.CustomEntityLookupSkill"): +class CustomEntityLookupSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.CustomEntityLookupSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill looks for text from a custom, user-defined list of words and phrases. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -2893,7 +2935,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.CustomEntityLookupSkill" # type: ignore -class LexicalNormalizer(_Model): +class LexicalNormalizer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for normalizers. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2934,7 +2976,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CustomNormalizer(LexicalNormalizer, discriminator="#Microsoft.Azure.Search.CustomNormalizer"): +class CustomNormalizer( + LexicalNormalizer, discriminator="#Microsoft.Azure.Search.CustomNormalizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Allows you to configure normalization for filterable, sortable, and facetable fields, which by default operate with strict matching. This is a user-defined configuration consisting of at least one or more filters, which modify the token that is stored. @@ -2993,7 +3037,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.CustomNormalizer" # type: ignore -class DataChangeDetectionPolicy(_Model): +class DataChangeDetectionPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for data change detection policies. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3025,7 +3069,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataDeletionDetectionPolicy(_Model): +class DataDeletionDetectionPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for data deletion detection policies. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3057,7 +3101,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataSourceCredentials(_Model): +class DataSourceCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents credentials that can be used to connect to a datasource. :ivar connection_string: The connection string for the datasource. Set to ```` (with @@ -3093,7 +3137,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class DefaultCognitiveServicesAccount( CognitiveServicesAccount, discriminator="#Microsoft.Azure.Search.DefaultCognitiveServices" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """An empty object that represents the default Azure AI service resource for a skillset. :ivar description: Description of the Azure AI service resource attached to a skillset. @@ -3128,7 +3172,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class DictionaryDecompounderTokenFilter( TokenFilter, discriminator="#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """Decomposes compound words found in many Germanic languages. This token filter is implemented using Apache Lucene. @@ -3204,7 +3248,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter" # type: ignore -class ScoringFunction(_Model): +class ScoringFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for functions that can modify document scores during ranking. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -3258,7 +3302,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DistanceScoringFunction(ScoringFunction, discriminator="distance"): +class DistanceScoringFunction( + ScoringFunction, discriminator="distance" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a function that boosts scores based on distance from a geographic location. :ivar field_name: The name of the field used as input to the scoring function. Required. @@ -3308,7 +3354,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "distance" # type: ignore -class DistanceScoringParameters(_Model): +class DistanceScoringParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Provides parameter values to a distance scoring function. :ivar reference_point_parameter: The name of the parameter passed in search queries to specify @@ -3347,7 +3393,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DocumentExtractionSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.DocumentExtractionSkill"): +class DocumentExtractionSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.DocumentExtractionSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that extracts content from a file within the enrichment pipeline. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -3421,7 +3469,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class DocumentIntelligenceLayoutSkill( SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that extracts content and layout information, via Azure AI Services, from files within the enrichment pipeline. @@ -3523,7 +3571,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill" # type: ignore -class DocumentIntelligenceLayoutSkillChunkingProperties(_Model): # pylint: disable=name-too-long +class DocumentIntelligenceLayoutSkillChunkingProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Controls the cardinality for chunking the content. :ivar unit: The unit of the chunk. "characters" @@ -3568,7 +3618,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DocumentKeysOrIds(_Model): +class DocumentKeysOrIds(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type of the keysOrIds. :ivar document_keys: document keys to be reset. @@ -3605,7 +3655,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EdgeNGramTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.EdgeNGramTokenFilter"): +class EdgeNGramTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.EdgeNGramTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene. @@ -3661,7 +3713,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.EdgeNGramTokenFilter" # type: ignore -class EdgeNGramTokenFilterV2(TokenFilter, discriminator="#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"): +class EdgeNGramTokenFilterV2( + TokenFilter, discriminator="#Microsoft.Azure.Search.EdgeNGramTokenFilterV2" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene. @@ -3718,7 +3772,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2" # type: ignore -class EdgeNGramTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.EdgeNGramTokenizer"): +class EdgeNGramTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.EdgeNGramTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Tokenizes the input from an edge into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene. @@ -3773,7 +3829,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.EdgeNGramTokenizer" # type: ignore -class ElisionTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.ElisionTokenFilter"): +class ElisionTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.ElisionTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). This token filter is implemented using Apache Lucene. @@ -3814,7 +3872,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.ElisionTokenFilter" # type: ignore -class EmbeddingColumnMapping(_Model): +class EmbeddingColumnMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Maps a SQL column to a vector field for embedding. :ivar name: Target vector field name in the search index. Required. @@ -3847,7 +3905,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EntityLinkingSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.V3.EntityLinkingSkill"): +class EntityLinkingSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.V3.EntityLinkingSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Using the Text Analytics API, extracts linked entities from text. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -3927,7 +3987,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.V3.EntityLinkingSkill" # type: ignore -class EntityRecognitionSkillV3(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.V3.EntityRecognitionSkill"): +class EntityRecognitionSkillV3( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.V3.EntityRecognitionSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Using the Text Analytics API, extracts entities of different types from text. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -4020,7 +4082,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.V3.EntityRecognitionSkill" # type: ignore -class EntraAppAuthentication(_Model): +class EntraAppAuthentication(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for a customer-owned Microsoft Entra app registration used for federated credential-based on-behalf-of authentication. @@ -4067,7 +4129,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VectorSearchAlgorithmConfiguration(_Model): +class VectorSearchAlgorithmConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options specific to the algorithm used during indexing or querying. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4106,7 +4168,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ExhaustiveKnnAlgorithmConfiguration(VectorSearchAlgorithmConfiguration, discriminator="exhaustiveKnn"): +class ExhaustiveKnnAlgorithmConfiguration( + VectorSearchAlgorithmConfiguration, discriminator="exhaustiveKnn" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options specific to the exhaustive KNN algorithm used during querying, which will perform brute-force search across the entire vector index. @@ -4147,7 +4211,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchAlgorithmKind.EXHAUSTIVE_KNN # type: ignore -class ExhaustiveKnnParameters(_Model): +class ExhaustiveKnnParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains the parameters specific to exhaustive KNN algorithm. :ivar metric: The similarity metric to use for vector comparisons. Known values are: "cosine", @@ -4179,7 +4243,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricDataAgentKnowledgeSource(KnowledgeSource, discriminator="fabricDataAgent"): +class FabricDataAgentKnowledgeSource( + KnowledgeSource, discriminator="fabricDataAgent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Fabric Data Agent knowledge source. :ivar name: The name of the knowledge source. Required. @@ -4243,7 +4309,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.FABRIC_DATA_AGENT # type: ignore -class FabricDataAgentKnowledgeSourceParameters(_Model): +class FabricDataAgentKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for Fabric Data Agent knowledge source. :ivar workspace_id: Fabric workspace ID. Required. @@ -4276,7 +4342,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricOntologyKnowledgeSource(KnowledgeSource, discriminator="fabricOntology"): +class FabricOntologyKnowledgeSource( + KnowledgeSource, discriminator="fabricOntology" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for Fabric Ontology knowledge source. :ivar name: The name of the knowledge source. Required. @@ -4340,7 +4408,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.FABRIC_ONTOLOGY # type: ignore -class FabricOntologyKnowledgeSourceParameters(_Model): +class FabricOntologyKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for Fabric Ontology knowledge source. :ivar workspace_id: The Fabric workspace ID containing the ontology. Required. @@ -4373,7 +4441,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FieldMapping(_Model): +class FieldMapping(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a mapping between a field in a data source and a target field in an index. :ivar source_field_name: The name of the field in the data source. Required. @@ -4418,7 +4486,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FieldMappingFunction(_Model): +class FieldMappingFunction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a function that transforms a value from a data source before indexing. :ivar name: The name of the field mapping function. Required. @@ -4453,7 +4521,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FileKnowledgeSource(KnowledgeSource, discriminator="file"): +class FileKnowledgeSource( + KnowledgeSource, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for File knowledge source that supports direct file upload and indexing. :ivar name: The name of the knowledge source. Required. @@ -4524,7 +4594,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.FILE # type: ignore -class FileKnowledgeSourceParameters(_Model): +class FileKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for File knowledge source. :ivar ingestion_parameters: Consolidates all general ingestion settings for the File knowledge @@ -4572,7 +4642,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FileUploadMetadata(_Model): +class FileUploadMetadata(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The JSON 'metadata' part of a multipart/form-data file upload: the full file name/path and custom key/value metadata. The parsing mode and extraction mode are both chosen by the service and are not supplied by the caller. @@ -4608,7 +4678,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FreshnessScoringFunction(ScoringFunction, discriminator="freshness"): +class FreshnessScoringFunction( + ScoringFunction, discriminator="freshness" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a function that boosts scores based on the value of a date-time field. :ivar field_name: The name of the field used as input to the scoring function. Required. @@ -4659,7 +4731,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "freshness" # type: ignore -class FreshnessScoringParameters(_Model): +class FreshnessScoringParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Provides parameter values to a freshness scoring function. :ivar boosting_duration: The expiration period after which boosting will stop for a particular @@ -4713,7 +4785,7 @@ class GetIndexStatisticsResult(_Model): class HighWaterMarkChangeDetectionPolicy( DataChangeDetectionPolicy, discriminator="#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a data change detection policy that captures changes based on the value of a high water mark column. @@ -4751,7 +4823,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy" # type: ignore -class HnswAlgorithmConfiguration(VectorSearchAlgorithmConfiguration, discriminator="hnsw"): +class HnswAlgorithmConfiguration( + VectorSearchAlgorithmConfiguration, discriminator="hnsw" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options specific to the HNSW approximate nearest neighbors algorithm used during indexing and querying. The HNSW algorithm offers a tunable trade-off between search speed and accuracy. @@ -4794,7 +4868,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchAlgorithmKind.HNSW # type: ignore -class HnswParameters(_Model): +class HnswParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains the parameters specific to the HNSW algorithm. :ivar m: The number of bi-directional links created for every new element during construction. @@ -4858,7 +4932,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageAnalysisSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Vision.ImageAnalysisSkill"): +class ImageAnalysisSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Vision.ImageAnalysisSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that analyzes image files. It extracts a rich set of visual features based on the image content. @@ -4941,7 +5017,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Vision.ImageAnalysisSkill" # type: ignore -class IndexedOneLakeKnowledgeSource(KnowledgeSource, discriminator="indexedOneLake"): +class IndexedOneLakeKnowledgeSource( + KnowledgeSource, discriminator="indexedOneLake" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for OneLake knowledge source. :ivar name: The name of the knowledge source. Required. @@ -5002,7 +5080,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.INDEXED_ONELAKE # type: ignore -class IndexedOneLakeKnowledgeSourceParameters(_Model): +class IndexedOneLakeKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for OneLake knowledge source. :ivar fabric_workspace_id: OneLake workspace ID. Required. @@ -5067,7 +5145,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexedSharePointKnowledgeSource(KnowledgeSource, discriminator="indexedSharePoint"): +class IndexedSharePointKnowledgeSource( + KnowledgeSource, discriminator="indexedSharePoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for SharePoint knowledge source. :ivar name: The name of the knowledge source. Required. @@ -5128,7 +5208,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.INDEXED_SHARE_POINT # type: ignore -class IndexedSharePointKnowledgeSourceParameters(_Model): # pylint: disable=name-too-long +class IndexedSharePointKnowledgeSourceParameters( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Parameters for SharePoint knowledge source. :ivar connection_string: SharePoint connection string with format: @@ -5201,7 +5283,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexedSqlKnowledgeSource(KnowledgeSource, discriminator="indexedSql"): +class IndexedSqlKnowledgeSource( + KnowledgeSource, discriminator="indexedSql" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for indexed SQL knowledge source. :ivar name: The name of the knowledge source. Required. @@ -5264,7 +5348,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.INDEXED_SQL # type: ignore -class IndexedSqlKnowledgeSourceParameters(_Model): +class IndexedSqlKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for indexed SQL knowledge source. :ivar connection_string: The connection string for the Azure SQL Database or SQL Managed @@ -5482,7 +5566,7 @@ class IndexerExecutionResult(_Model): """Change tracking state with which an indexer execution finished.""" -class IndexerResyncBody(_Model): +class IndexerResyncBody(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Request body for resync indexer operation. :ivar options: Re-sync options that have been pre-defined from data source. @@ -5512,7 +5596,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexerRuntime(_Model): +class IndexerRuntime(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the indexer's cumulative runtime consumption in the service. :ivar used_seconds: Cumulative runtime of the indexer from the beginningTime to endingTime, in @@ -5567,7 +5651,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexingParameters(_Model): +class IndexingParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents parameters for indexer execution. :ivar batch_size: The number of items that are read from the data source and indexed as a @@ -5624,7 +5708,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexingParametersConfiguration(_Model): +class IndexingParametersConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. @@ -5841,7 +5925,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexingSchedule(_Model): +class IndexingSchedule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a schedule for indexer execution. :ivar interval: The interval of time between indexer executions. Required. @@ -5876,7 +5960,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexStatisticsSummary(_Model): +class IndexStatisticsSummary(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date. @@ -5918,7 +6002,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InputFieldMappingEntry(_Model): +class InputFieldMappingEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Input field mapping for a skill. :ivar name: The name of the input. Required. @@ -5965,7 +6049,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KeepTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.KeepTokenFilter"): +class KeepTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.KeepTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A token filter that only keeps tokens with text contained in a specified list of words. This token filter is implemented using Apache Lucene. @@ -6014,7 +6100,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.KeepTokenFilter" # type: ignore -class KeyPhraseExtractionSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.KeyPhraseExtractionSkill"): +class KeyPhraseExtractionSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.KeyPhraseExtractionSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that uses text analytics for key phrase extraction. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -6097,7 +6185,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill" # type: ignore -class KeywordMarkerTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.KeywordMarkerTokenFilter"): +class KeywordMarkerTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.KeywordMarkerTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Marks terms as keywords. This token filter is implemented using Apache Lucene. :ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes @@ -6146,7 +6236,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.KeywordMarkerTokenFilter" # type: ignore -class KeywordTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.KeywordTokenizer"): +class KeywordTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.KeywordTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. :ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or @@ -6188,7 +6280,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.KeywordTokenizer" # type: ignore -class KeywordTokenizerV2(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.KeywordTokenizerV2"): +class KeywordTokenizerV2( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.KeywordTokenizerV2" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. :ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or @@ -6232,7 +6326,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.KeywordTokenizerV2" # type: ignore -class KnowledgeBase(_Model): +class KnowledgeBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a knowledge base definition. :ivar name: The name of the knowledge base. Required. @@ -6353,7 +6447,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseModel(_Model): +class KnowledgeBaseModel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the connection parameters for the model to use for query planning. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6385,7 +6479,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseAzureOpenAIModel(KnowledgeBaseModel, discriminator="azureOpenAI"): +class KnowledgeBaseAzureOpenAIModel( + KnowledgeBaseModel, discriminator="azureOpenAI" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the Azure OpenAI resource used to do query planning. :ivar kind: Required. Use Azure Open AI models for query planning. @@ -6421,7 +6517,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeBaseModelKind.AZURE_OPEN_AI # type: ignore -class KnowledgeBaseRetrieveDefaults(_Model): +class KnowledgeBaseRetrieveDefaults(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """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. @@ -6528,7 +6624,7 @@ class KnowledgeSourceFile(_Model): """The extraction mode applied to the file. Known values are: \"minimal\" and \"standard\".""" -class KnowledgeSourceReference(_Model): +class KnowledgeSourceReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Reference to a knowledge source. :ivar name: The name of the knowledge source. Required. @@ -6577,7 +6673,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LanguageDetectionSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.LanguageDetectionSkill"): +class LanguageDetectionSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.LanguageDetectionSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that detects the language of input text and reports a single language code for every document submitted on the request. The language code is paired with a score indicating the confidence of the analysis. @@ -6650,7 +6748,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.LanguageDetectionSkill" # type: ignore -class LengthTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.LengthTokenFilter"): +class LengthTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.LengthTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Removes words that are too long or too short. This token filter is implemented using Apache Lucene. @@ -6698,7 +6798,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.LengthTokenFilter" # type: ignore -class LimitTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.LimitTokenFilter"): +class LimitTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.LimitTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Limits the number of tokens while indexing. This token filter is implemented using Apache Lucene. @@ -6815,7 +6917,9 @@ class ListSynonymMapsResult(_Model): """The URL that can be used to fetch the next set of results.""" -class LuceneStandardAnalyzer(LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.StandardAnalyzer"): +class LuceneStandardAnalyzer( + LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.StandardAnalyzer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter. @@ -6865,7 +6969,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StandardAnalyzer" # type: ignore -class LuceneStandardTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.StandardTokenizer"): +class LuceneStandardTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.StandardTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using Apache Lucene. @@ -6909,7 +7015,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StandardTokenizer" # type: ignore -class LuceneStandardTokenizerV2(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.StandardTokenizerV2"): +class LuceneStandardTokenizerV2( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.StandardTokenizerV2" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using Apache Lucene. @@ -6954,7 +7062,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StandardTokenizerV2" # type: ignore -class MagnitudeScoringFunction(ScoringFunction, discriminator="magnitude"): +class MagnitudeScoringFunction( + ScoringFunction, discriminator="magnitude" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a function that boosts scores based on the magnitude of a numeric field. :ivar field_name: The name of the field used as input to the scoring function. Required. @@ -7005,7 +7115,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "magnitude" # type: ignore -class MagnitudeScoringParameters(_Model): +class MagnitudeScoringParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Provides parameter values to a magnitude scoring function. :ivar boosting_range_start: The field value at which boosting starts. Required. @@ -7051,7 +7161,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MappingCharFilter(CharFilter, discriminator="#Microsoft.Azure.Search.MappingCharFilter"): +class MappingCharFilter( + CharFilter, discriminator="#Microsoft.Azure.Search.MappingCharFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A character filter that applies mappings defined with the mappings option. Matching is greedy (longest pattern matching at a given point wins). Replacement is allowed to be the empty string. This character filter is implemented using Apache Lucene. @@ -7095,7 +7207,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.MappingCharFilter" # type: ignore -class McpServerAuthentication(_Model): +class McpServerAuthentication(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Authentication configuration for an MCP server knowledge source. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -7129,7 +7241,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class McpServerOutputParsing(_Model): +class McpServerOutputParsing(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Output parsing configuration for an MCP server tool. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -7193,7 +7305,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = McpServerOutputParsingKind.AUTO # type: ignore -class McpServerFoundryConnectionAuthentication(McpServerAuthentication, discriminator="foundryConnection"): +class McpServerFoundryConnectionAuthentication( + McpServerAuthentication, discriminator="foundryConnection" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Authentication using an Azure AI Foundry connection. :ivar kind: The discriminator value. Required. Authenticate using an Azure AI Foundry @@ -7231,7 +7345,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = McpServerAuthenticationKind.FOUNDRY_CONNECTION # type: ignore -class McpServerFoundryConnectionParameters(_Model): +class McpServerFoundryConnectionParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for Foundry connection authentication. :ivar connection_id: The Azure AI Foundry connection identifier. @@ -7265,7 +7379,9 @@ class McpServerHeaders(_Model): """A dictionary of HTTP header names and values.""" -class McpServerJsonOutputParsing(McpServerOutputParsing, discriminator="json"): +class McpServerJsonOutputParsing( + McpServerOutputParsing, discriminator="json" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Parse the output as a JSON document using the configured JSON parameters. :ivar kind: The discriminator value. Required. Parse the output as a JSON document using the @@ -7304,7 +7420,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = McpServerOutputParsingKind.JSON # type: ignore -class McpServerKnowledgeSource(KnowledgeSource, discriminator="mcpServer"): +class McpServerKnowledgeSource( + KnowledgeSource, discriminator="mcpServer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for a knowledge source backed by an MCP (Model Context Protocol) server. :ivar name: The name of the knowledge source. Required. @@ -7367,7 +7485,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.MCP_SERVER # type: ignore -class McpServerKnowledgeSourceParameters(_Model): +class McpServerKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for an MCP server knowledge source. :ivar server_url: The URL of the MCP server endpoint. Required. @@ -7435,7 +7553,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = McpServerOutputParsingKind.NONE # type: ignore -class McpServerOutputParsingJsonParameters(_Model): +class McpServerOutputParsingJsonParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for JSON output parsing. :ivar documents_path: The JSON path to the array of documents in the tool output. Required. @@ -7471,7 +7589,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class McpServerOutputParsingSplitParameters(_Model): +class McpServerOutputParsingSplitParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for split output parsing. :ivar text_split_mode: The text split mode to use. Known values are: "pages" and "sentences". @@ -7536,7 +7654,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class McpServerSplitOutputParsing(McpServerOutputParsing, discriminator="split"): +class McpServerSplitOutputParsing( + McpServerOutputParsing, discriminator="split" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Split the output into pages using the configured split parameters. :ivar kind: The discriminator value. Required. Split the output into pages using the configured @@ -7574,7 +7694,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = McpServerOutputParsingKind.SPLIT # type: ignore -class McpServerStoredHeadersAuthentication(McpServerAuthentication, discriminator="storedHeaders"): +class McpServerStoredHeadersAuthentication( + McpServerAuthentication, discriminator="storedHeaders" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Authentication using stored HTTP headers. :ivar kind: The discriminator value. Required. Authenticate using stored HTTP headers. @@ -7610,7 +7732,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = McpServerAuthenticationKind.STORED_HEADERS # type: ignore -class McpServerStoredHeadersParameters(_Model): +class McpServerStoredHeadersParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for stored headers authentication. :ivar headers: The stored HTTP headers to include in MCP server requests. @@ -7640,7 +7762,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class McpServerTool(_Model): +class McpServerTool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a single tool within an MCP server knowledge source. :ivar name: The name of the MCP tool to invoke. @@ -7693,7 +7815,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MergeSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.MergeSkill"): +class MergeSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.MergeSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill for merging two or more strings into a single unified string, with an optional user-defined delimiter separating each component part. @@ -7763,7 +7887,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class MicrosoftLanguageStemmingTokenizer( LexicalTokenizer, discriminator="#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """Divides text using language-specific rules and reduces words to their base forms. :ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or @@ -7841,7 +7965,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer" # type: ignore -class MicrosoftLanguageTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"): +class MicrosoftLanguageTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.MicrosoftLanguageTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Divides text using language-specific rules. :ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or @@ -7951,7 +8077,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy" # type: ignore -class NGramTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.NGramTokenFilter"): +class NGramTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.NGramTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. :ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes @@ -7997,7 +8125,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.NGramTokenFilter" # type: ignore -class NGramTokenFilterV2(TokenFilter, discriminator="#Microsoft.Azure.Search.NGramTokenFilterV2"): +class NGramTokenFilterV2( + TokenFilter, discriminator="#Microsoft.Azure.Search.NGramTokenFilterV2" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. :ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes @@ -8044,7 +8174,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.NGramTokenFilterV2" # type: ignore -class NGramTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.NGramTokenizer"): +class NGramTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.NGramTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Tokenizes the input into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene. @@ -8099,7 +8231,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.NGramTokenizer" # type: ignore -class OcrSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Vision.OcrSkill"): +class OcrSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Vision.OcrSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that extracts text from image files. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -8206,7 +8340,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Vision.OcrSkill" # type: ignore -class OutputFieldMappingEntry(_Model): +class OutputFieldMappingEntry(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Output field mapping for a skill. :ivar name: The name of the output defined by the skill. Required. @@ -8241,7 +8375,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PathHierarchyTokenizerV2(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.PathHierarchyTokenizerV2"): +class PathHierarchyTokenizerV2( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.PathHierarchyTokenizerV2" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Tokenizer for path-like hierarchies. This tokenizer is implemented using Apache Lucene. :ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or @@ -8308,7 +8444,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PathHierarchyTokenizerV2" # type: ignore -class PatternAnalyzer(LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.PatternAnalyzer"): +class PatternAnalyzer( + LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.PatternAnalyzer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Flexibly separates text into terms via a regular expression pattern. This analyzer is implemented using Apache Lucene. @@ -8372,7 +8510,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PatternAnalyzer" # type: ignore -class PatternCaptureTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.PatternCaptureTokenFilter"): +class PatternCaptureTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.PatternCaptureTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Uses Java regexes to emit multiple tokens - one for each capture group in one or more patterns. This token filter is implemented using Apache Lucene. @@ -8422,7 +8562,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PatternCaptureTokenFilter" # type: ignore -class PatternReplaceCharFilter(CharFilter, discriminator="#Microsoft.Azure.Search.PatternReplaceCharFilter"): +class PatternReplaceCharFilter( + CharFilter, discriminator="#Microsoft.Azure.Search.PatternReplaceCharFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A character filter that replaces characters in the input string. It uses a regular expression to identify character sequences to preserve and a replacement pattern to identify characters to replace. For example, given the input text "aa bb aa bb", pattern "(aa)\\\\s+(bb)", and @@ -8471,7 +8613,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PatternReplaceCharFilter" # type: ignore -class PatternReplaceTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.PatternReplaceTokenFilter"): +class PatternReplaceTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.PatternReplaceTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A character filter that replaces characters in the input string. It uses a regular expression to identify character sequences to preserve and a replacement pattern to identify characters to replace. For example, given the input text "aa bb aa bb", pattern "(aa)\\\\s+(bb)", and @@ -8520,7 +8664,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PatternReplaceTokenFilter" # type: ignore -class PatternTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.PatternTokenizer"): +class PatternTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.PatternTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Tokenizer that uses regex pattern matching to construct distinct tokens. This tokenizer is implemented using Apache Lucene. @@ -8580,7 +8726,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PatternTokenizer" # type: ignore -class PhoneticTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.PhoneticTokenFilter"): +class PhoneticTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.PhoneticTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Create tokens for phonetic matches. This token filter is implemented using Apache Lucene. :ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes @@ -8635,7 +8783,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.PhoneticTokenFilter" # type: ignore -class PIIDetectionSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.PIIDetectionSkill"): +class PIIDetectionSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.PIIDetectionSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Using the Text Analytics API, extracts personal information from an input text and gives you the option of masking it. @@ -8749,7 +8899,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.PIIDetectionSkill" # type: ignore -class RemoteSharePointKnowledgeSource(KnowledgeSource, discriminator="remoteSharePoint"): +class RemoteSharePointKnowledgeSource( + KnowledgeSource, discriminator="remoteSharePoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for remote SharePoint knowledge source. :ivar name: The name of the knowledge source. Required. @@ -8810,7 +8962,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.REMOTE_SHARE_POINT # type: ignore -class RemoteSharePointKnowledgeSourceParameters(_Model): # pylint: disable=name-too-long +class RemoteSharePointKnowledgeSourceParameters( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Parameters for remote SharePoint knowledge source. :ivar filter_expression: Keyword Query Language (KQL) expression with queryable SharePoint @@ -8861,7 +9015,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RescoringOptions(_Model): +class RescoringOptions(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains the options for rescoring. :ivar enable_rescoring: If set to true, after the initial search on the compressed vectors, the @@ -8920,7 +9074,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResourceCounter(_Model): +class ResourceCounter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a resource's usage and quota. :ivar usage: The resource usage amount. Required. @@ -8953,7 +9107,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ScalarQuantizationCompression(VectorSearchCompression, discriminator="scalarQuantization"): +class ScalarQuantizationCompression( + VectorSearchCompression, discriminator="scalarQuantization" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options specific to the scalar quantization compression method used during indexing and querying. @@ -9011,7 +9167,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchCompressionKind.SCALAR_QUANTIZATION # type: ignore -class ScalarQuantizationParameters(_Model): +class ScalarQuantizationParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains the parameters specific to Scalar Quantization. :ivar quantized_data_type: The quantized data type of compressed vector values. "int8" @@ -9042,7 +9198,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ScoringProfile(_Model): +class ScoringProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines parameters for a search index that influence scoring in search queries. :ivar name: The name of the scoring profile. Required. @@ -9097,7 +9253,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchAlias(_Model): +class SearchAlias(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an index alias, which describes a mapping from the alias name to an index. The alias name can be used in place of the index name for supported operations. @@ -9137,7 +9293,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchField(_Model): +class SearchField(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a field in an index definition, which describes the name, data type, and search behavior of a field. @@ -9557,7 +9713,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndex(_Model): +class SearchIndex(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a search index definition, which describes the fields and search behavior of an index. @@ -9744,7 +9900,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexer(_Model): +class SearchIndexer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an indexer. :ivar name: The name of the indexer. Required. @@ -9874,7 +10030,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerCache(_Model): +class SearchIndexerCache(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type of the cache. :ivar id: A guid for the SearchIndexerCache. @@ -9932,7 +10088,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerDataContainer(_Model): +class SearchIndexerDataContainer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents information about the entity (such as Azure SQL table or CosmosDB collection) that will be indexed. @@ -9970,7 +10126,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerDataIdentity(_Model): +class SearchIndexerDataIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Abstract base type for data identities. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -10034,7 +10190,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.DataNoneIdentity" # type: ignore -class SearchIndexerDataSourceConnection(_Model): +class SearchIndexerDataSourceConnection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a datasource definition, which can be used to configure an indexer. :ivar name: The name of the datasource. Required. @@ -10180,7 +10336,7 @@ def __setattr__(self, key: str, value: Any) -> None: class SearchIndexerDataUserAssignedIdentity( SearchIndexerDataIdentity, discriminator="#Microsoft.Azure.Search.DataUserAssignedIdentity" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the identity for a datasource to use. :ivar resource_id: The fully qualified Azure resource Id of a user assigned managed identity @@ -10275,7 +10431,7 @@ class SearchIndexerError(_Model): available.""" -class SearchIndexerIndexProjection(_Model): +class SearchIndexerIndexProjection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of additional projections to secondary search indexes. :ivar selectors: A list of projections to be performed to secondary search indexes. Required. @@ -10316,7 +10472,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerIndexProjectionSelector(_Model): +class SearchIndexerIndexProjectionSelector(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Description for what data to store in the designated search index. :ivar target_index_name: Name of the search index to project to. Must have a key field with the @@ -10373,7 +10529,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerIndexProjectionsParameters(_Model): +class SearchIndexerIndexProjectionsParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A dictionary of index projection-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. @@ -10406,7 +10562,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerKnowledgeStore(_Model): +class SearchIndexerKnowledgeStore(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of additional projections to azure blob, table, or files, of enriched data. :ivar storage_connection_string: The connection string to the storage account projections will @@ -10470,7 +10626,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerKnowledgeStoreProjectionSelector(_Model): # pylint: disable=name-too-long +class SearchIndexerKnowledgeStoreProjectionSelector( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Abstract class to share properties between concrete selectors. :ivar reference_key_name: Name of reference key to different projection. @@ -10528,7 +10686,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SearchIndexerKnowledgeStoreBlobProjectionSelector( SearchIndexerKnowledgeStoreProjectionSelector -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Abstract class to share properties between concrete selectors. :ivar reference_key_name: Name of reference key to different projection. @@ -10575,7 +10733,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SearchIndexerKnowledgeStoreFileProjectionSelector( SearchIndexerKnowledgeStoreBlobProjectionSelector -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Projection definition for what data to store in Azure Files. :ivar reference_key_name: Name of reference key to different projection. @@ -10617,7 +10775,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SearchIndexerKnowledgeStoreObjectProjectionSelector( SearchIndexerKnowledgeStoreBlobProjectionSelector -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Projection definition for what data to store in Azure Blob. :ivar reference_key_name: Name of reference key to different projection. @@ -10657,7 +10815,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerKnowledgeStoreParameters(_Model): +class SearchIndexerKnowledgeStoreParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """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. @@ -10689,7 +10847,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexerKnowledgeStoreProjection(_Model): +class SearchIndexerKnowledgeStoreProjection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Container object for various projection selectors. :ivar tables: Projections to Azure Table storage. @@ -10738,7 +10896,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SearchIndexerKnowledgeStoreTableProjectionSelector( SearchIndexerKnowledgeStoreProjectionSelector -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Description for what data to store in Azure Tables. :ivar reference_key_name: Name of reference key to different projection. @@ -10809,7 +10967,7 @@ class SearchIndexerLimits(_Model): """The maximum number of characters that will be extracted from a document picked up for indexing.""" -class SearchIndexerSkillset(_Model): +class SearchIndexerSkillset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A list of skills. :ivar name: The name of the skillset. Required. @@ -10971,7 +11129,7 @@ class SearchIndexerWarning(_Model): available.""" -class SearchIndexFieldReference(_Model): +class SearchIndexFieldReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Field reference for a search index. :ivar name: The name of the field. Required. @@ -10999,7 +11157,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexKnowledgeSource(KnowledgeSource, discriminator="searchIndex"): +class SearchIndexKnowledgeSource( + KnowledgeSource, discriminator="searchIndex" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Knowledge Source targeting a search index. :ivar name: The name of the knowledge source. Required. @@ -11060,7 +11220,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.SEARCH_INDEX # type: ignore -class SearchIndexKnowledgeSourceBoost(_Model): +class SearchIndexKnowledgeSourceBoost(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A hint that identifies a condition the query planner can use to influence document ranking. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -11104,7 +11264,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SearchIndexKnowledgeSourceFieldValueBoost( SearchIndexKnowledgeSourceBoost, discriminator="fieldValue" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """A hint that boosts documents based on a field value. :ivar boost_instructions: Natural-language instructions that explain when and how to apply the @@ -11154,7 +11314,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE # type: ignore -class SearchIndexKnowledgeSourceFilterHint(_Model): +class SearchIndexKnowledgeSourceFilterHint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A hint that identifies a field and representative values the query planner can use when constructing a filter. @@ -11198,7 +11358,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SearchIndexKnowledgeSourceMultiWordExpressionBoost( SearchIndexKnowledgeSourceBoost, discriminator="multiWordExpression" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """A hint that boosts documents based on a multi-word expression. :ivar boost_instructions: Natural-language instructions that explain when and how to apply the @@ -11244,7 +11404,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION # type: ignore -class SearchIndexKnowledgeSourceParameters(_Model): +class SearchIndexKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for search index knowledge source. :ivar search_index_name: The name of the Search index. Required. @@ -11318,7 +11478,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexKnowledgeSourceQueryHints(_Model): +class SearchIndexKnowledgeSourceQueryHints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Hints that guide query planning toward useful filters and boosts for a search index knowledge source. @@ -11360,7 +11520,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchIndexResponse(_Model): +class SearchIndexResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a search index definition, which describes the fields and search behavior of an index. @@ -11537,7 +11697,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchResourceEncryptionKey(_Model): +class SearchResourceEncryptionKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest, such as indexes and synonym maps. @@ -11635,7 +11795,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class SearchServiceCounters(_Model): +class SearchServiceCounters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents service-level resource counters and quotas. :ivar alias_counter: Total number of aliases. Required. @@ -11736,7 +11896,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchServiceLimits(_Model): +class SearchServiceLimits(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents various service level limits. :ivar max_fields_per_index: The maximum allowed fields per index. @@ -11814,7 +11974,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchServiceStatistics(_Model): +class SearchServiceStatistics(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Response from a get service statistics request. If successful, it includes service level counters and limits. @@ -11855,7 +12015,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchSuggester(_Model): +class SearchSuggester(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines how the Suggest API should apply to a group of fields in the index. :ivar name: The name of the suggester. Required. @@ -11901,7 +12061,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.search_mode: Literal["analyzingInfixMatching"] = "analyzingInfixMatching" -class SemanticConfiguration(_Model): +class SemanticConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a specific configuration to be used in the context of semantic capabilities. :ivar name: The name of the semantic configuration. Required. @@ -11957,7 +12117,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SemanticField(_Model): +class SemanticField(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A field that is used as part of the semantic configuration. :ivar field_name: File name. Required. @@ -11985,7 +12145,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SemanticPrioritizedFields(_Model): +class SemanticPrioritizedFields(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Describes the title, content, and keywords fields to be used for semantic ranking, captions, highlights, and answers. @@ -12044,7 +12204,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SemanticSearch(_Model): +class SemanticSearch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines parameters for a search index that influence semantic capabilities. :ivar default_configuration_name: Allows you to set the name of a default semantic @@ -12083,7 +12243,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SentimentSkillV3(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.V3.SentimentSkill"): +class SentimentSkillV3( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.V3.SentimentSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Using the Text Analytics API, evaluates unstructured text and for each record, provides sentiment labels (such as "negative", "neutral" and "positive") based on the highest confidence score found by the service at a sentence and document-level. @@ -12170,7 +12332,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.V3.SentimentSkill" # type: ignore -class ServiceIndexersRuntime(_Model): +class ServiceIndexersRuntime(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents service-level indexer runtime counters. :ivar used_seconds: Cumulative runtime of all indexers in the service from the beginningTime to @@ -12226,7 +12388,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ShaperSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.ShaperSkill"): +class ShaperSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Util.ShaperSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill for reshaping the outputs. It creates a complex type to support composite fields (also known as multipart fields). @@ -12278,7 +12442,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Util.ShaperSkill" # type: ignore -class SharePointConnectorAppRegistration(_Model): +class SharePointConnectorAppRegistration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configures a SharePoint connector app registration for the index, enabling document-level permissions from SharePoint. @@ -12323,7 +12487,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ShingleTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.ShingleTokenFilter"): +class ShingleTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.ShingleTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Creates combinations of tokens as a single token. This token filter is implemented using Apache Lucene. @@ -12412,7 +12578,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.ShingleTokenFilter" # type: ignore -class SkillNames(_Model): +class SkillNames(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type of the skill names. :ivar skill_names: the names of skills to be reset. @@ -12442,7 +12608,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SnowballTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.SnowballTokenFilter"): +class SnowballTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.SnowballTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A filter that stems words using a Snowball-generated stemmer. This token filter is implemented using Apache Lucene. @@ -12493,7 +12661,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SoftDeleteColumnDeletionDetectionPolicy( DataDeletionDetectionPolicy, discriminator="#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy" -): +): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a data deletion detection policy that implements a soft-deletion strategy. It determines whether an item should be deleted based on the value of a designated 'soft delete' column. @@ -12539,7 +12707,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy" # type: ignore -class SplitSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.SplitSkill"): +class SplitSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.SplitSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill to split a string into chunks of text. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -12697,7 +12867,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy" # type: ignore -class StemmerOverrideTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.StemmerOverrideTokenFilter"): +class StemmerOverrideTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.StemmerOverrideTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Provides the ability to override other stemming filters with custom dictionary-based stemming. Any dictionary-stemmed terms will be marked as keywords so that they will not be stemmed with stemmers down the chain. Must be placed before any stemming filters. This token filter is @@ -12744,7 +12916,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StemmerOverrideTokenFilter" # type: ignore -class StemmerTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.StemmerTokenFilter"): +class StemmerTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.StemmerTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Language specific stemming filter. This token filter is implemented using Apache Lucene. See `https://learn.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#TokenFilters `_. @@ -12806,7 +12980,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StemmerTokenFilter" # type: ignore -class StopAnalyzer(LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.StopAnalyzer"): +class StopAnalyzer( + LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.StopAnalyzer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Divides text at non-letters; Applies the lowercase and stopword token filters. This analyzer is implemented using Apache Lucene. @@ -12847,7 +13023,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StopAnalyzer" # type: ignore -class StopwordsTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.StopwordsTokenFilter"): +class StopwordsTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.StopwordsTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Removes stop words from a token stream. This token filter is implemented using Apache Lucene. See `http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopFilter.html @@ -12925,7 +13103,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.StopwordsTokenFilter" # type: ignore -class SynonymMap(_Model): +class SynonymMap(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a synonym map definition. :ivar name: The name of the synonym map. Required. @@ -12994,7 +13172,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.format: Literal["solr"] = "solr" -class SynonymTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.SynonymTokenFilter"): +class SynonymTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.SynonymTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Matches single or multi-word synonyms in a token stream. This token filter is implemented using Apache Lucene. @@ -13067,7 +13247,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.SynonymTokenFilter" # type: ignore -class TagScoringFunction(ScoringFunction, discriminator="tag"): +class TagScoringFunction( + ScoringFunction, discriminator="tag" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a function that boosts scores of documents with string values matching a given list of tags. @@ -13118,7 +13300,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "tag" # type: ignore -class TagScoringParameters(_Model): +class TagScoringParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Provides parameter values to a tag scoring function. :ivar tags_parameter: The name of the parameter passed in search queries to specify the list of @@ -13148,7 +13330,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TextTranslationSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.TranslationSkill"): +class TextTranslationSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Text.TranslationSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill to translate text from one language to another. :ivar name: The name of the skill which uniquely identifies it within the skillset. A skill @@ -13267,7 +13451,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Text.TranslationSkill" # type: ignore -class TextWeights(_Model): +class TextWeights(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines weights on index fields for which matches should boost scoring in search queries. :ivar weights: The dictionary of per-field weights to boost document scoring. The keys are @@ -13297,7 +13481,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TruncateTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.TruncateTokenFilter"): +class TruncateTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.TruncateTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Truncates the terms to a specific length. This token filter is implemented using Apache Lucene. :ivar name: The name of the token filter. It must only contain letters, digits, spaces, dashes @@ -13337,7 +13523,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.TruncateTokenFilter" # type: ignore -class UaxUrlEmailTokenizer(LexicalTokenizer, discriminator="#Microsoft.Azure.Search.UaxUrlEmailTokenizer"): +class UaxUrlEmailTokenizer( + LexicalTokenizer, discriminator="#Microsoft.Azure.Search.UaxUrlEmailTokenizer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Tokenizes urls and emails as one token. This tokenizer is implemented using Apache Lucene. :ivar name: The name of the tokenizer. It must only contain letters, digits, spaces, dashes or @@ -13381,7 +13569,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.UaxUrlEmailTokenizer" # type: ignore -class UniqueTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.UniqueTokenFilter"): +class UniqueTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.UniqueTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Filters out tokens with same text as the previous token. This token filter is implemented using Apache Lucene. @@ -13425,7 +13615,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.UniqueTokenFilter" # type: ignore -class UpdateKnowledgeSourceFileRequest(_Model): +class UpdateKnowledgeSourceFileRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Multipart request for updating a file in a File knowledge source. :ivar metadata: The JSON metadata describing the file. Required. @@ -13460,7 +13650,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UploadKnowledgeSourceFileMultipartRequest(_Model): # pylint: disable=name-too-long +class UploadKnowledgeSourceFileMultipartRequest( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Multipart request for uploading a file to a File knowledge source. :ivar metadata: The JSON metadata describing the file. Required. @@ -13495,7 +13687,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VectorSearch(_Model): +class VectorSearch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains configuration options related to vector search. :ivar profiles: Defines combinations of configurations to use with vector search. @@ -13550,7 +13742,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VectorSearchProfile(_Model): +class VectorSearchProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines a combination of configurations to use with vector search. :ivar name: The name to associate with this particular vector search profile. Required. @@ -13604,7 +13796,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VisionVectorizeSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Vision.VectorizeSkill"): +class VisionVectorizeSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Vision.VectorizeSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Allows you to generate a vector embedding for a given image or text input using the Azure AI Services Vision Vectorize API. @@ -13667,7 +13861,9 @@ class WebApiHttpHeaders(_Model): """A dictionary of http request headers.""" -class WebApiSkill(SearchIndexerSkill, discriminator="#Microsoft.Skills.Custom.WebApiSkill"): +class WebApiSkill( + SearchIndexerSkill, discriminator="#Microsoft.Skills.Custom.WebApiSkill" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code. @@ -13786,7 +13982,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Skills.Custom.WebApiSkill" # type: ignore -class WebApiVectorizer(VectorSearchVectorizer, discriminator="customWebApi"): +class WebApiVectorizer( + VectorSearchVectorizer, discriminator="customWebApi" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies a user-defined vectorizer for generating the vector embedding of a query string. Integration of an external vectorizer is achieved using the custom Web API interface of a skillset. @@ -13829,7 +14027,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchVectorizerKind.CUSTOM_WEB_API # type: ignore -class WebApiVectorizerParameters(_Model): +class WebApiVectorizerParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the properties for connecting to a user-defined vectorizer. :ivar url: The URI of the Web API providing the vectorizer. @@ -13906,7 +14104,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebKnowledgeSource(KnowledgeSource, discriminator="web"): +class WebKnowledgeSource( + KnowledgeSource, discriminator="web" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Knowledge Source targeting web results. :ivar name: The name of the knowledge source. Required. @@ -13966,7 +14166,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.WEB # type: ignore -class WebKnowledgeSourceDomain(_Model): +class WebKnowledgeSourceDomain(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for web knowledge source domain. :ivar address: The address of the domain. Required. @@ -14001,7 +14201,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebKnowledgeSourceDomains(_Model): +class WebKnowledgeSourceDomains(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Domain allow/block configuration for web knowledge source. :ivar allowed_domains: Domains that are allowed for web results. @@ -14038,7 +14238,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebKnowledgeSourceParameters(_Model): +class WebKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for web knowledge source. :ivar domains: Domain allow/block configuration for web results. @@ -14096,7 +14296,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WordDelimiterTokenFilter(TokenFilter, discriminator="#Microsoft.Azure.Search.WordDelimiterTokenFilter"): +class WordDelimiterTokenFilter( + TokenFilter, discriminator="#Microsoft.Azure.Search.WordDelimiterTokenFilter" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Splits words into subwords and performs optional transformations on subword groups. This token filter is implemented using Apache Lucene. @@ -14219,7 +14421,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.WordDelimiterTokenFilter" # type: ignore -class WorkIQKnowledgeSource(KnowledgeSource, discriminator="workIQ"): +class WorkIQKnowledgeSource( + KnowledgeSource, discriminator="workIQ" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for WorkIQ knowledge source. :ivar name: The name of the knowledge source. Required. @@ -14282,7 +14486,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.WORK_IQ # type: ignore -class WorkIQKnowledgeSourceParameters(_Model): +class WorkIQKnowledgeSourceParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for a WorkIQ knowledge source. :ivar entra_app_authentication: The customer-owned Microsoft Entra app registration diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py index a7095f069d0c..5d2d6eef45b2 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py @@ -114,12 +114,12 @@ identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. :vartype identity: "SearchIndexerDataIdentity" -:ivar subdomain_url: The subdomain/Azure AI Services endpoint url for the corresponding AI +:ivar subdomainUrl: The subdomain/Azure AI Services endpoint url for the corresponding AI Service. Required. -:vartype subdomain_url: str -:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a - skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByIdentity". -:vartype odata_type: Literal["#Microsoft.Azure.Search.AIServicesByIdentity"] +:vartype subdomainUrl: str +:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to + a skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByIdentity". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.AIServicesByIdentity"] """ @@ -141,30 +141,30 @@ :ivar key: The key used to provision the Azure AI service resource attached to a skillset. Required. :vartype key: str -:ivar subdomain_url: The subdomain/Azure AI Services endpoint url for the corresponding AI +:ivar subdomainUrl: The subdomain/Azure AI Services endpoint url for the corresponding AI Service. Required. -:vartype subdomain_url: str -:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a - skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByKey". -:vartype odata_type: Literal["#Microsoft.Azure.Search.AIServicesByKey"] +:vartype subdomainUrl: str +:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to + a skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByKey". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.AIServicesByKey"] """ class AIServicesVisionParameters(TypedDict, total=False): """Specifies the AI Services Vision parameters for vectorizing a query image or text. - :ivar model_version: The version of the model to use when calling the AI Services Vision + :ivar modelVersion: The version of the model to use when calling the AI Services Vision service. It will default to the latest available when not specified. Required. - :vartype model_version: str - :ivar resource_uri: The resource URI of the AI Services resource. Required. - :vartype resource_uri: str - :ivar api_key: API key of the designated AI Services resource. - :vartype api_key: str - :ivar auth_identity: The user-assigned managed identity used for outbound connections. If an + :vartype modelVersion: str + :ivar resourceUri: The resource URI of the AI Services resource. Required. + :vartype resourceUri: str + :ivar apiKey: API key of the designated AI Services resource. + :vartype apiKey: str + :ivar authIdentity: 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. - :vartype auth_identity: "SearchIndexerDataIdentity" + :vartype authIdentity: "SearchIndexerDataIdentity" """ modelVersion: Required[Optional[str]] @@ -184,12 +184,11 @@ class AIServicesVisionParameters(TypedDict, total=False): class AIServicesVisionVectorizer(TypedDict, total=False): """Clears the identity property of a datasource. - :ivar vectorizer_name: The name to associate with this particular vectorization method. - Required. - :vartype vectorizer_name: str - :ivar ai_services_vision_parameters: Contains the parameters specific to AI Services Vision + :ivar name: The name to associate with this particular vectorization method. Required. + :vartype name: str + :ivar aiServicesVisionParameters: Contains the parameters specific to AI Services Vision embedding vectorization. - :vartype ai_services_vision_parameters: "AIServicesVisionParameters" + :vartype aiServicesVisionParameters: "AIServicesVisionParameters" :ivar kind: The name of the kind of vectorization method being configured for use with vector search. Required. Generate embeddings for an image or text input at query time using the Azure AI Services Vision Vectorize API. @@ -211,10 +210,10 @@ class AnalyzedTokenInfo(TypedDict, total=False): :ivar token: The token returned by the analyzer. Required. :vartype token: str - :ivar start_offset: The index of the first character of the token in the input text. Required. - :vartype start_offset: int - :ivar end_offset: The index of the last character of the token in the input text. Required. - :vartype end_offset: int + :ivar startOffset: The index of the first character of the token in the input text. Required. + :vartype startOffset: int + :ivar endOffset: The index of the last character of the token in the input text. Required. + :vartype endOffset: int :ivar position: The position of the token in the input text relative to other tokens. The first token in the input text has position 0, the next has position 1, and so on. Depending on the analyzer used, some tokens might have the same position, for example if they are synonyms of @@ -251,41 +250,41 @@ class AnalyzeTextOptions(TypedDict, total=False): :ivar text: The text to break into tokens. Required. :vartype text: str - :ivar analyzer_name: The name of the analyzer to use to break the given text. If this parameter - is not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters - are mutually exclusive. Known values are: "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", and "whitespace". - :vartype analyzer_name: Union[str, "LexicalAnalyzerName"] - :ivar tokenizer_name: The name of the tokenizer to use to break the given text. If this - parameter is not specified, you must specify an analyzer instead. The tokenizer and analyzer - parameters are mutually exclusive. Known values are: "classic", "edgeNGram", "keyword_v2", - "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", - "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", and "whitespace". - :vartype tokenizer_name: Union[str, "LexicalTokenizerName"] - :ivar normalizer_name: The name of the normalizer to use to normalize the given text. Known - values are: "asciifolding", "elision", "lowercase", "standard", and "uppercase". - :vartype normalizer_name: Union[str, "LexicalNormalizerName"] - :ivar token_filters: An optional list of token filters to use when breaking the given text. - This parameter can only be set when using the tokenizer parameter. - :vartype token_filters: list[Union[str, "TokenFilterName"]] - :ivar char_filters: An optional list of character filters to use when breaking the given text. + :ivar analyzer: The name of the analyzer to use to break the given text. If this parameter is + not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are + mutually exclusive. Known values are: "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", and + "whitespace". + :vartype analyzer: Union[str, "LexicalAnalyzerName"] + :ivar tokenizer: The name of the tokenizer to use to break the given text. If this parameter is + not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters are + mutually exclusive. Known values are: "classic", "edgeNGram", "keyword_v2", "letter", + "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", + "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", and "whitespace". + :vartype tokenizer: Union[str, "LexicalTokenizerName"] + :ivar normalizer: The name of the normalizer to use to normalize the given text. Known values + are: "asciifolding", "elision", "lowercase", "standard", and "uppercase". + :vartype normalizer: Union[str, "LexicalNormalizerName"] + :ivar tokenFilters: An optional list of token filters to use when breaking the given text. This + parameter can only be set when using the tokenizer parameter. + :vartype tokenFilters: list[Union[str, "TokenFilterName"]] + :ivar charFilters: An optional list of character filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :vartype char_filters: list[Union[str, "CharFilterName"]] + :vartype charFilters: list[Union[str, "CharFilterName"]] """ text: Required[str] @@ -348,12 +347,12 @@ class AnalyzeTextOptions(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar preserve_original: A value indicating whether the original token will be kept. Default is +:ivar preserveOriginal: A value indicating whether the original token will be kept. Default is false. -:vartype preserve_original: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype preserveOriginal: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.AsciiFoldingTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.AsciiFoldingTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.AsciiFoldingTokenFilter"] """ @@ -361,12 +360,12 @@ class AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): # pyl """Credentials of a registered application created for your search service, used for authenticated access to the encryption keys stored in Azure Key Vault. - :ivar application_id: An AAD Application ID that was granted the required access permissions to + :ivar applicationId: An AAD Application ID that was granted the required access permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The Application ID should not be confused with the Object ID for your AAD Application. Required. - :vartype application_id: str - :ivar application_secret: The authentication key of the specified AAD application. - :vartype application_secret: str + :vartype applicationId: str + :ivar applicationSecret: The authentication key of the specified AAD application. + :vartype applicationSecret: str """ applicationId: Required[str] @@ -396,13 +395,13 @@ class AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): # pyl :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -410,36 +409,35 @@ class AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): # pyl as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: Required. A knowledge source that read and ingest data from Azure Blob Storage to a Search Index. :vartype kind: Literal[KnowledgeSourceKind.AZURE_BLOB] -:ivar azure_blob_parameters: The type of the knowledge source. Required. -:vartype azure_blob_parameters: "AzureBlobKnowledgeSourceParameters" +:ivar azureBlobParameters: The type of the knowledge source. Required. +:vartype azureBlobParameters: "AzureBlobKnowledgeSourceParameters" """ class AzureBlobKnowledgeSourceParameters(TypedDict, total=False): """Parameters for Azure Blob Storage knowledge source. - :ivar connection_string: Key-based connection string or the ResourceId format if using a - managed identity. Required. - :vartype connection_string: str - :ivar container_name: The name of the blob storage container. Required. - :vartype container_name: str - :ivar folder_path: Optional folder path within the container. - :vartype folder_path: str - :ivar is_adls_gen2: Set to true if connecting to an ADLS Gen2 storage account. Default is - false. - :vartype is_adls_gen2: bool - :ivar ingestion_parameters: Consolidates all general ingestion settings. - :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" - :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + :ivar connectionString: Key-based connection string or the ResourceId format if using a managed + identity. Required. + :vartype connectionString: str + :ivar containerName: The name of the blob storage container. Required. + :vartype containerName: str + :ivar folderPath: Optional folder path within the container. + :vartype folderPath: str + :ivar isADLSGen2: Set to true if connecting to an ADLS Gen2 storage account. Default is false. + :vartype isADLSGen2: bool + :ivar ingestionParameters: Consolidates all general ingestion settings. + :vartype ingestionParameters: "KnowledgeSourceIngestionParameters" + :ivar queryHints: Default hints that guide query planning toward useful filters and boosts for this index-backed knowledge source. Request-time query hints replace these defaults as a complete object. - :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" - :ivar created_resources: Resources created by the knowledge source. - :vartype created_resources: "CreatedResources" + :vartype queryHints: "SearchIndexKnowledgeSourceQueryHints" + :ivar createdResources: Resources created by the knowledge source. + :vartype createdResources: "CreatedResources" """ connectionString: Required[str] @@ -462,28 +460,27 @@ class AzureBlobKnowledgeSourceParameters(TypedDict, total=False): class AzureMachineLearningParameters(TypedDict, total=False): """Specifies the properties for connecting to an AML vectorizer. - :ivar scoring_uri: (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. - Required. - :vartype scoring_uri: str - :ivar authentication_key: (Required for key authentication) The key for the AML service. - :vartype authentication_key: str - :ivar resource_id: (Required for token authentication). The Azure Resource Manager resource ID + :ivar uri: (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. Required. + :vartype uri: str + :ivar key: (Required for key authentication) The key for the AML service. + :vartype key: str + :ivar resourceId: (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}. - :vartype resource_id: str + :vartype resourceId: str :ivar timeout: (Optional) When specified, indicates the timeout for the http client making the API call. :vartype timeout: str :ivar region: (Optional for token authentication). The region the AML service is deployed in. :vartype region: str - :ivar model_name: The name of the embedding model from the Azure AI Foundry Catalog that is + :ivar modelName: The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the provided endpoint. Known values are: "OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32", "OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336", "Facebook-DinoV2-Image-Embeddings-ViT-Base", "Facebook-DinoV2-Image-Embeddings-ViT-Giant", "Cohere-embed-v3-english", "Cohere-embed-v3-multilingual", and "Cohere-embed-v4". - :vartype model_name: Union[str, "AIFoundryModelCatalogName"] + :vartype modelName: Union[str, "AIFoundryModelCatalogName"] """ uri: Required[Optional[str]] @@ -545,30 +542,30 @@ class AzureMachineLearningParameters(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar scoring_uri: (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. -:vartype scoring_uri: str -:ivar authentication_key: (Required for key authentication) The key for the AML service. -:vartype authentication_key: str -:ivar resource_id: (Required for token authentication). The Azure Resource Manager resource ID +:ivar uri: (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. +:vartype uri: str +:ivar key: (Required for key authentication) The key for the AML service. +:vartype key: str +:ivar resourceId: (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}. -:vartype resource_id: str +:vartype resourceId: str :ivar timeout: (Optional) When specified, indicates the timeout for the http client making the API call. :vartype timeout: str :ivar region: (Optional for token authentication). The region the AML service is deployed in. :vartype region: str -:ivar degree_of_parallelism: (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. -:vartype degree_of_parallelism: int -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar degreeOfParallelism: (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. +:vartype degreeOfParallelism: int +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Custom.AmlSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Custom.AmlSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Custom.AmlSkill"] """ @@ -576,11 +573,10 @@ class AzureMachineLearningVectorizer(TypedDict, total=False): """Specifies an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog for generating the vector embedding of a query string. - :ivar vectorizer_name: The name to associate with this particular vectorization method. - Required. - :vartype vectorizer_name: str - :ivar aml_parameters: Specifies the properties of the AML vectorizer. - :vartype aml_parameters: "AzureMachineLearningParameters" + :ivar name: The name to associate with this particular vectorization method. Required. + :vartype name: str + :ivar amlParameters: Specifies the properties of the AML vectorizer. + :vartype amlParameters: "AzureMachineLearningParameters" :ivar kind: The name of the kind of vectorization method being configured for use with vector search. Required. Generate embeddings using an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog at query time. @@ -634,40 +630,40 @@ class AzureMachineLearningVectorizer(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar resource_url: The resource URI of the Azure OpenAI resource. -:vartype resource_url: str -:ivar deployment_name: ID of the Azure OpenAI model deployment on the designated resource. -:vartype deployment_name: str -:ivar api_key: API key of the designated Azure OpenAI resource. -:vartype api_key: str -:ivar auth_identity: The user-assigned managed identity used for outbound connections. -:vartype auth_identity: "SearchIndexerDataIdentity" -:ivar model_name: The name of the embedding model that is deployed at the provided deploymentId +:ivar resourceUri: The resource URI of the Azure OpenAI resource. +:vartype resourceUri: str +:ivar deploymentId: ID of the Azure OpenAI model deployment on the designated resource. +:vartype deploymentId: str +:ivar apiKey: API key of the designated Azure OpenAI resource. +:vartype apiKey: str +:ivar authIdentity: The user-assigned managed identity used for outbound connections. +:vartype authIdentity: "SearchIndexerDataIdentity" +:ivar modelName: The name of the embedding model that is deployed at the provided deploymentId path. Known values are: "text-embedding-ada-002", "text-embedding-3-large", "text-embedding-3-small", "gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", and "gpt-5.6-luna". -:vartype model_name: Union[str, "AzureOpenAIModelName"] +:vartype modelName: Union[str, "AzureOpenAIModelName"] :ivar dimensions: The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. :vartype dimensions: int -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"] """ class AzureOpenAITokenizerParameters(TypedDict, total=False): """Azure OpenAI Tokenizer parameters. - :ivar encoder_model_name: Only applies if the unit is set to azureOpenAITokens. Options include + :ivar encoderModelName: 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'. Known values are: "r50k_base", "p50k_base", "p50k_edit", and "cl100k_base". - :vartype encoder_model_name: Union[str, "SplitSkillEncoderModelName"] - :ivar allowed_special_tokens: (Optional) Only applies if the unit is set to azureOpenAITokens. + :vartype encoderModelName: Union[str, "SplitSkillEncoderModelName"] + :ivar allowedSpecialTokens: (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. - :vartype allowed_special_tokens: list[str] + :vartype allowedSpecialTokens: list[str] """ encoderModelName: Optional[Union[str, "SplitSkillEncoderModelName"]] @@ -682,11 +678,11 @@ class AzureOpenAITokenizerParameters(TypedDict, total=False): class AzureOpenAIVectorizer(TypedDict, total=False): """Specifies the Azure OpenAI resource used to vectorize a query string. - :ivar vectorizer_name: The name to associate with this particular vectorization method. - Required. - :vartype vectorizer_name: str - :ivar parameters: Contains the parameters specific to Azure OpenAI embedding vectorization. - :vartype parameters: "AzureOpenAIVectorizerParameters" + :ivar name: The name to associate with this particular vectorization method. Required. + :vartype name: str + :ivar azureOpenAIParameters: Contains the parameters specific to Azure OpenAI embedding + vectorization. + :vartype azureOpenAIParameters: "AzureOpenAIVectorizerParameters" :ivar kind: The name of the kind of vectorization method being configured for use with vector search. Required. Generate embeddings using an Azure OpenAI resource at query time. :vartype kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] @@ -704,20 +700,20 @@ class AzureOpenAIVectorizer(TypedDict, total=False): class AzureOpenAIVectorizerParameters(TypedDict, total=False): """Specifies the parameters for connecting to the Azure OpenAI resource. - :ivar resource_url: The resource URI of the Azure OpenAI resource. - :vartype resource_url: str - :ivar deployment_name: ID of the Azure OpenAI model deployment on the designated resource. - :vartype deployment_name: str - :ivar api_key: API key of the designated Azure OpenAI resource. - :vartype api_key: str - :ivar auth_identity: The user-assigned managed identity used for outbound connections. - :vartype auth_identity: "SearchIndexerDataIdentity" - :ivar model_name: The name of the embedding model that is deployed at the provided deploymentId + :ivar resourceUri: The resource URI of the Azure OpenAI resource. + :vartype resourceUri: str + :ivar deploymentId: ID of the Azure OpenAI model deployment on the designated resource. + :vartype deploymentId: str + :ivar apiKey: API key of the designated Azure OpenAI resource. + :vartype apiKey: str + :ivar authIdentity: The user-assigned managed identity used for outbound connections. + :vartype authIdentity: "SearchIndexerDataIdentity" + :ivar modelName: The name of the embedding model that is deployed at the provided deploymentId path. Known values are: "text-embedding-ada-002", "text-embedding-3-large", "text-embedding-3-small", "gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.2", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", and "gpt-5.6-luna". - :vartype model_name: Union[str, "AzureOpenAIModelName"] + :vartype modelName: Union[str, "AzureOpenAIModelName"] """ resourceUri: str @@ -740,17 +736,17 @@ class BinaryQuantizationCompression(TypedDict, total=False): """Contains configuration options specific to the binary quantization compression method used during indexing and querying. - :ivar compression_name: The name to associate with this particular configuration. Required. - :vartype compression_name: str - :ivar rescoring_options: Contains the options for rescoring. - :vartype rescoring_options: "RescoringOptions" - :ivar truncation_dimension: The number of dimensions to truncate the vectors to. Truncating the + :ivar name: The name to associate with this particular configuration. Required. + :vartype name: str + :ivar rescoringOptions: Contains the options for rescoring. + :vartype rescoringOptions: "RescoringOptions" + :ivar truncationDimension: The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. - :vartype truncation_dimension: int + :vartype truncationDimension: int :ivar kind: The name of the kind of compression method being configured for use with vector search. Required. Binary Quantization, a type of compression method. In binary quantization, the original vectors values are compressed to the narrower binary type by discretizing and @@ -798,26 +794,26 @@ class BinaryQuantizationCompression(TypedDict, total=False): default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document. :vartype b: float -:ivar odata_type: The discriminator for derived types. Required. Default value is +:ivar @odata.type: The discriminator for derived types. Required. Default value is "#Microsoft.Azure.Search.BM25Similarity". -:vartype odata_type: Literal["#Microsoft.Azure.Search.BM25Similarity"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.BM25Similarity"] """ class ChatCompletionCommonModelParameters(TypedDict, total=False): """Common language model parameters for Chat Completions. If omitted, default values are used. - :ivar model_name: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not + :ivar model: The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified. - :vartype model_name: str - :ivar frequency_penalty: A float in the range [-2,2] that reduces or increases likelihood of + :vartype model: str + :ivar frequencyPenalty: A float in the range [-2,2] that reduces or increases likelihood of repeated tokens. Default is 0. - :vartype frequency_penalty: float - :ivar presence_penalty: A float in the range [-2,2] that penalizes new tokens based on their + :vartype frequencyPenalty: float + :ivar presencePenalty: A float in the range [-2,2] that penalizes new tokens based on their existing presence. Default is 0. - :vartype presence_penalty: float - :ivar max_tokens: Maximum number of tokens to generate. - :vartype max_tokens: int + :vartype presencePenalty: float + :ivar maxTokens: Maximum number of tokens to generate. + :vartype maxTokens: int :ivar temperature: Sampling temperature. Default is 0.7. :vartype temperature: float :ivar seed: Random seed for controlling deterministic outputs. If omitted, randomization is @@ -851,9 +847,9 @@ class ChatCompletionResponseFormat(TypedDict, total=False): :ivar type: Specifies how the LLM should format the response. Known values are: "text", "jsonObject", and "jsonSchema". :vartype type: Union[str, "ChatCompletionResponseFormatType"] - :ivar json_schema_properties: An open dictionary for extended properties. Required if 'type' == + :ivar jsonSchemaProperties: An open dictionary for extended properties. Required if 'type' == 'json_schema'. - :vartype json_schema_properties: "ChatCompletionSchemaProperties" + :vartype jsonSchemaProperties: "ChatCompletionSchemaProperties" """ type: Union[str, "ChatCompletionResponseFormatType"] @@ -874,9 +870,9 @@ class ChatCompletionSchema(TypedDict, total=False): :ivar required: An array of the property names that are required to be part of the model's response. All properties must be included for structured outputs. :vartype required: list[str] - :ivar additional_properties: Controls whether it is allowable for an object to contain + :ivar additionalProperties: Controls whether it is allowable for an object to contain additional keys / values that were not defined in the JSON Schema. Default is false. - :vartype additional_properties: bool + :vartype additionalProperties: bool """ type: str @@ -955,29 +951,29 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :vartype outputs: list["OutputFieldMappingEntry"] :ivar uri: The url for the Web API. Required. :vartype uri: str -:ivar auth_identity: The user-assigned managed identity used for outbound connections. If an +:ivar authIdentity: The user-assigned managed identity used for outbound connections. If an authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. -:vartype auth_identity: "SearchIndexerDataIdentity" -:ivar api_key: API key for authenticating to the model. Both apiKey and authIdentity cannot be +:vartype authIdentity: "SearchIndexerDataIdentity" +:ivar apiKey: API key for authenticating to the model. Both apiKey and authIdentity cannot be specified at the same time. -:vartype api_key: str -:ivar common_model_parameters: Common language model parameters that customers can tweak. If +:vartype apiKey: str +:ivar commonModelParameters: Common language model parameters that customers can tweak. If omitted, reasonable defaults will be applied. -:vartype common_model_parameters: "ChatCompletionCommonModelParameters" -:ivar extra_parameters: Open-type dictionary for model-specific parameters that should be +:vartype commonModelParameters: "ChatCompletionCommonModelParameters" +:ivar extraParameters: Open-type dictionary for model-specific parameters that should be appended to the chat completions call. Follows Azure AI Foundry's extensibility pattern. -:vartype extra_parameters: dict[str, Any] -:ivar extra_parameters_behavior: How extra parameters are handled by Azure AI Foundry. Default - is 'error'. Known values are: "passThrough", "drop", and "error". -:vartype extra_parameters_behavior: Union[str, "ChatCompletionExtraParametersBehavior"] -:ivar response_format: Determines how the LLM should format its response. Defaults to 'text' +:vartype extraParameters: dict[str, Any] +:ivar extraParametersBehavior: How extra parameters are handled by Azure AI Foundry. Default is + 'error'. Known values are: "passThrough", "drop", and "error". +:vartype extraParametersBehavior: Union[str, "ChatCompletionExtraParametersBehavior"] +:ivar responseFormat: Determines how the LLM should format its response. Defaults to 'text' response type. -:vartype response_format: "ChatCompletionResponseFormat" -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype responseFormat: "ChatCompletionResponseFormat" +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Custom.ChatCompletionSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Custom.ChatCompletionSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Custom.ChatCompletionSkill"] """ @@ -998,14 +994,14 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar ignore_scripts: The scripts to ignore. -:vartype ignore_scripts: list[Union[str, "CjkBigramTokenFilterScripts"]] -:ivar output_unigrams: A value indicating whether to output both unigrams and bigrams (if - true), or just bigrams (if false). Default is false. -:vartype output_unigrams: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar ignoreScripts: The scripts to ignore. +:vartype ignoreScripts: list[Union[str, "CjkBigramTokenFilterScripts"]] +:ivar outputUnigrams: A value indicating whether to output both unigrams and bigrams (if true), + or just bigrams (if false). Default is false. +:vartype outputUnigrams: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.CjkBigramTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.CjkBigramTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.CjkBigramTokenFilter"] """ @@ -1020,9 +1016,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): This variation of TF-IDF introduces static document length normalization as well as coordinating factors that penalize documents that only partially match the searched queries. -:ivar odata_type: The discriminator for derived types. Required. Default value is +:ivar @odata.type: The discriminator for derived types. Required. Default value is "#Microsoft.Azure.Search.ClassicSimilarity". -:vartype odata_type: Literal["#Microsoft.Azure.Search.ClassicSimilarity"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.ClassicSimilarity"] """ @@ -1042,12 +1038,12 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. -:vartype max_token_length: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum + length are split. The maximum token length that can be used is 300 characters. +:vartype maxTokenLength: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.ClassicTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.ClassicTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.ClassicTokenizer"] """ @@ -1067,9 +1063,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar key: The key used to provision the Azure AI service resource attached to a skillset. Required. :vartype key: str -:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a - skillset. Required. Default value is "#Microsoft.Azure.Search.CognitiveServicesByKey". -:vartype odata_type: Literal["#Microsoft.Azure.Search.CognitiveServicesByKey"] +:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to + a skillset. Required. Default value is "#Microsoft.Azure.Search.CognitiveServicesByKey". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.CognitiveServicesByKey"] """ @@ -1091,18 +1087,18 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar common_words: The set of common words. Required. -:vartype common_words: list[str] -:ivar ignore_case: A value indicating whether common words matching will be case insensitive. +:ivar commonWords: The set of common words. Required. +:vartype commonWords: list[str] +:ivar ignoreCase: A value indicating whether common words matching will be case insensitive. Default is false. -:vartype ignore_case: bool -:ivar use_query_mode: A value that indicates whether the token filter is in query mode. When in +:vartype ignoreCase: bool +:ivar queryMode: A value that indicates whether the token filter is in query mode. When in query mode, the token filter generates bigrams and then removes common words and single terms followed by a common word. Default is false. -:vartype use_query_mode: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype queryMode: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.CommonGramTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.CommonGramTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.CommonGramTokenFilter"] """ @@ -1137,9 +1133,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.ConditionalSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Util.ConditionalSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Util.ConditionalSkill"] """ @@ -1148,10 +1144,10 @@ class ContentColumnMapping(TypedDict, total=False): :ivar name: Target index field name. Required. :vartype name: str - :ivar source_field: SQL column name. Required. - :vartype source_field: str - :ivar search_field_type: Azure AI Search field type (e.g., Edm.String, Edm.Int32). Required. - :vartype search_field_type: str + :ivar sourceField: SQL column name. Required. + :vartype sourceField: str + :ivar searchFieldType: Azure AI Search field type (e.g., Edm.String, Edm.Int32). Required. + :vartype searchFieldType: str """ name: Required[str] @@ -1196,14 +1192,14 @@ class ContentColumnMapping(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar extraction_options: Controls the cardinality of the content extracted from the document - by the skill. -:vartype extraction_options: list[Union[str, "ContentUnderstandingSkillExtractionOptions"]] -:ivar chunking_properties: Controls the cardinality for chunking the content. -:vartype chunking_properties: "ContentUnderstandingSkillChunkingProperties" -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar extractionOptions: Controls the cardinality of the content extracted from the document by + the skill. +:vartype extractionOptions: list[Union[str, "ContentUnderstandingSkillExtractionOptions"]] +:ivar chunkingProperties: Controls the cardinality for chunking the content. +:vartype chunkingProperties: "ContentUnderstandingSkillChunkingProperties" +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.ContentUnderstandingSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Util.ContentUnderstandingSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Util.ContentUnderstandingSkill"] """ @@ -1215,10 +1211,10 @@ class ContentUnderstandingSkillChunkingProperties(TypedDict, total=False): # py :vartype method: Union[str, "ContentUnderstandingSkillChunkingMethod"] :ivar unit: The unit of the chunk. Known values are: "characters" and "tokens". :vartype unit: Union[str, "ContentUnderstandingSkillChunkingUnit"] - :ivar maximum_length: The maximum chunk length in characters. Default is 500. - :vartype maximum_length: int - :ivar overlap_length: The length of overlap provided between two text chunks. Default is 0. - :vartype overlap_length: int + :ivar maximumLength: The maximum chunk length in characters. Default is 500. + :vartype maximumLength: int + :ivar overlapLength: The length of overlap provided between two text chunks. Default is 0. + :vartype overlapLength: int """ method: Union[str, "ContentUnderstandingSkillChunkingMethod"] @@ -1235,14 +1231,14 @@ class ContentUnderstandingSkillChunkingProperties(TypedDict, total=False): # py class CorsOptions(TypedDict, total=False): """Defines options to control Cross-Origin Resource Sharing (CORS) for an index. - :ivar allowed_origins: The list of origins from which JavaScript code will be granted access to + :ivar allowedOrigins: The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). Required. - :vartype allowed_origins: list[str] - :ivar max_age_in_seconds: The duration for which browsers should cache CORS preflight - responses. Defaults to 5 minutes. - :vartype max_age_in_seconds: int + :vartype allowedOrigins: list[str] + :ivar maxAgeInSeconds: The duration for which browsers should cache CORS preflight responses. + Defaults to 5 minutes. + :vartype maxAgeInSeconds: int """ allowedOrigins: Required[list[str]] @@ -1280,23 +1276,23 @@ class CreatedResources(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar tokenizer_name: The name of the tokenizer to use to divide continuous text into a - sequence of tokens, such as breaking a sentence into words. Required. Known values are: - "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", +:ivar tokenizer: The name of the tokenizer to use to divide continuous text into a sequence of + tokens, such as breaking a sentence into words. Required. Known values are: "classic", + "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", and "whitespace". -:vartype tokenizer_name: Union[str, "LexicalTokenizerName"] -:ivar token_filters: A list of token filters used to filter out or modify the tokens generated +:vartype tokenizer: Union[str, "LexicalTokenizerName"] +:ivar tokenFilters: A list of token filters used to filter out or modify the tokens generated by a tokenizer. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. -:vartype token_filters: list[Union[str, "TokenFilterName"]] -:ivar char_filters: A list of character filters used to prepare input text before it is +:vartype tokenFilters: list[Union[str, "TokenFilterName"]] +:ivar charFilters: A list of character filters used to prepare input text before it is processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. -:vartype char_filters: list[Union[str, "CharFilterName"]] -:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is +:vartype charFilters: list[Union[str, "CharFilterName"]] +:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is "#Microsoft.Azure.Search.CustomAnalyzer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.CustomAnalyzer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.CustomAnalyzer"] """ @@ -1322,29 +1318,29 @@ class CustomEntity(TypedDict, total=False): text(s). The value of this field will appear with every match of its entity in the skill output. :vartype id: str - :ivar case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the + :ivar caseSensitive: Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to character casing. Sample case insensitive matches of "Microsoft" could be: microsoft, microSoft, MICROSOFT. - :vartype case_sensitive: bool - :ivar accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with the + :vartype caseSensitive: bool + :ivar accentSensitive: Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to accent. - :vartype accent_sensitive: bool - :ivar fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of + :vartype accentSensitive: bool + :ivar fuzzyEditDistance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of divergent characters that would still constitute a match with the entity name. The smallest possible fuzziness for any given match is returned. For instance, if the edit distance is set to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but otherwise do. - :vartype fuzzy_edit_distance: int - :ivar default_case_sensitive: Changes the default case sensitivity value for this entity. It be + :vartype fuzzyEditDistance: int + :ivar defaultCaseSensitive: Changes the default case sensitivity value for this entity. It be used to change the default value of all aliases caseSensitive values. - :vartype default_case_sensitive: bool - :ivar default_accent_sensitive: Changes the default accent sensitivity value for this entity. - It be used to change the default value of all aliases accentSensitive values. - :vartype default_accent_sensitive: bool - :ivar default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this - entity. It can be used to change the default value of all aliases fuzzyEditDistance values. - :vartype default_fuzzy_edit_distance: int + :vartype defaultCaseSensitive: bool + :ivar defaultAccentSensitive: Changes the default accent sensitivity value for this entity. It + be used to change the default value of all aliases accentSensitive values. + :vartype defaultAccentSensitive: bool + :ivar defaultFuzzyEditDistance: Changes the default fuzzy edit distance value for this entity. + It can be used to change the default value of all aliases fuzzyEditDistance values. + :vartype defaultFuzzyEditDistance: int :ivar aliases: An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. :vartype aliases: list["CustomEntityAlias"] @@ -1398,12 +1394,12 @@ class CustomEntityAlias(TypedDict, total=False): :ivar text: The text of the alias. Required. :vartype text: str - :ivar case_sensitive: Determine if the alias is case sensitive. - :vartype case_sensitive: bool - :ivar accent_sensitive: Determine if the alias is accent sensitive. - :vartype accent_sensitive: bool - :ivar fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. - :vartype fuzzy_edit_distance: int + :ivar caseSensitive: Determine if the alias is case sensitive. + :vartype caseSensitive: bool + :ivar accentSensitive: Determine if the alias is accent sensitive. + :vartype accentSensitive: bool + :ivar fuzzyEditDistance: Determine the fuzzy edit distance of the alias. + :vartype fuzzyEditDistance: int """ text: Required[str] @@ -1452,28 +1448,28 @@ class CustomEntityAlias(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "da", "de", "en", "es", "fi", "fr", "it", "ko", and "pt". -:vartype default_language_code: Union[str, "CustomEntityLookupSkillLanguage"] -:ivar entities_definition_uri: Path to a JSON or CSV file containing all the target text to - match against. This entity definition is read at the beginning of an indexer run. Any updates - to this file during an indexer run will not take effect until subsequent runs. This config must - be accessible over HTTPS. -:vartype entities_definition_uri: str -:ivar inline_entities_definition: The inline CustomEntity definition. -:vartype inline_entities_definition: list["CustomEntity"] -:ivar global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not - set in CustomEntity, this value will be the default value. -:vartype global_default_case_sensitive: bool -:ivar global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive is +:vartype defaultLanguageCode: Union[str, "CustomEntityLookupSkillLanguage"] +:ivar entitiesDefinitionUri: Path to a JSON or CSV file containing all the target text to match + against. This entity definition is read at the beginning of an indexer run. Any updates to this + file during an indexer run will not take effect until subsequent runs. This config must be + accessible over HTTPS. +:vartype entitiesDefinitionUri: str +:ivar inlineEntitiesDefinition: The inline CustomEntity definition. +:vartype inlineEntitiesDefinition: list["CustomEntity"] +:ivar globalDefaultCaseSensitive: A global flag for CaseSensitive. If CaseSensitive is not set + in CustomEntity, this value will be the default value. +:vartype globalDefaultCaseSensitive: bool +:ivar globalDefaultAccentSensitive: A global flag for AccentSensitive. If AccentSensitive is not set in CustomEntity, this value will be the default value. -:vartype global_default_accent_sensitive: bool -:ivar global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If - FuzzyEditDistance is not set in CustomEntity, this value will be the default value. -:vartype global_default_fuzzy_edit_distance: int -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype globalDefaultAccentSensitive: bool +:ivar globalDefaultFuzzyEditDistance: A global flag for FuzzyEditDistance. If FuzzyEditDistance + is not set in CustomEntity, this value will be the default value. +:vartype globalDefaultFuzzyEditDistance: int +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.CustomEntityLookupSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.CustomEntityLookupSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.CustomEntityLookupSkill"] """ @@ -1495,27 +1491,27 @@ class CustomEntityAlias(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar token_filters: A list of token filters used to filter out or modify the input token. For +:ivar tokenFilters: A list of token filters used to filter out or modify the input token. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. -:vartype token_filters: list[Union[str, "TokenFilterName"]] -:ivar char_filters: A list of character filters used to prepare input text before it is +:vartype tokenFilters: list[Union[str, "TokenFilterName"]] +:ivar charFilters: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. -:vartype char_filters: list[Union[str, "CharFilterName"]] -:ivar odata_type: A URI fragment specifying the type of normalizer. Required. Default value is +:vartype charFilters: list[Union[str, "CharFilterName"]] +:ivar @odata.type: A URI fragment specifying the type of normalizer. Required. Default value is "#Microsoft.Azure.Search.CustomNormalizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.CustomNormalizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.CustomNormalizer"] """ class DataSourceCredentials(TypedDict, total=False): """Represents credentials that can be used to connect to a datasource. - :ivar connection_string: The connection string for the datasource. Set to ```` (with + :ivar connectionString: The connection string for the datasource. Set to ```` (with brackets) if you don't want the connection string updated. Set to ```` if you want to remove the connection string value from the datasource. - :vartype connection_string: str + :vartype connectionString: str """ connectionString: str @@ -1536,9 +1532,9 @@ class DataSourceCredentials(TypedDict, total=False): :ivar description: Description of the Azure AI service resource attached to a skillset. :vartype description: str -:ivar odata_type: A URI fragment specifying the type of Azure AI service resource attached to a - skillset. Required. Default value is "#Microsoft.Azure.Search.DefaultCognitiveServices". -:vartype odata_type: Literal["#Microsoft.Azure.Search.DefaultCognitiveServices"] +:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to + a skillset. Required. Default value is "#Microsoft.Azure.Search.DefaultCognitiveServices". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.DefaultCognitiveServices"] """ @@ -1562,31 +1558,31 @@ class DataSourceCredentials(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar word_list: The list of words to match against. Required. -:vartype word_list: list[str] -:ivar min_word_size: The minimum word size. Only words longer than this get processed. Default - is 5. Maximum is 300. -:vartype min_word_size: int -:ivar min_subword_size: The minimum subword size. Only subwords longer than this are outputted. +:ivar wordList: The list of words to match against. Required. +:vartype wordList: list[str] +:ivar minWordSize: The minimum word size. Only words longer than this get processed. Default is + 5. Maximum is 300. +:vartype minWordSize: int +:ivar minSubwordSize: The minimum subword size. Only subwords longer than this are outputted. Default is 2. Maximum is 300. -:vartype min_subword_size: int -:ivar max_subword_size: The maximum subword size. Only subwords shorter than this are - outputted. Default is 15. Maximum is 300. -:vartype max_subword_size: int -:ivar only_longest_match: A value indicating whether to add only the longest matching subword - to the output. Default is false. -:vartype only_longest_match: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype minSubwordSize: int +:ivar maxSubwordSize: The maximum subword size. Only subwords shorter than this are outputted. + Default is 15. Maximum is 300. +:vartype maxSubwordSize: int +:ivar onlyLongestMatch: A value indicating whether to add only the longest matching subword to + the output. Default is false. +:vartype onlyLongestMatch: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"] """ class DistanceScoringFunction(TypedDict, total=False): """Defines a function that boosts scores based on distance from a geographic location. - :ivar field_name: The name of the field used as input to the scoring function. Required. - :vartype field_name: str + :ivar fieldName: The name of the field used as input to the scoring function. Required. + :vartype fieldName: str :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. Required. :vartype boost: float @@ -1594,8 +1590,8 @@ class DistanceScoringFunction(TypedDict, total=False): scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and "logarithmic". :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] - :ivar parameters: Parameter values for the distance scoring function. Required. - :vartype parameters: "DistanceScoringParameters" + :ivar distance: Parameter values for the distance scoring function. Required. + :vartype distance: "DistanceScoringParameters" :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case. Required. Default value is "distance". :vartype type: Literal["distance"] @@ -1618,12 +1614,12 @@ class DistanceScoringFunction(TypedDict, total=False): class DistanceScoringParameters(TypedDict, total=False): """Provides parameter values to a distance scoring function. - :ivar reference_point_parameter: The name of the parameter passed in search queries to specify + :ivar referencePointParameter: The name of the parameter passed in search queries to specify the reference location. Required. - :vartype reference_point_parameter: str - :ivar boosting_distance: The distance in kilometers from the reference location where the + :vartype referencePointParameter: str + :ivar boostingDistance: The distance in kilometers from the reference location where the boosting range ends. Required. - :vartype boosting_distance: float + :vartype boostingDistance: float """ referencePointParameter: Required[str] @@ -1665,16 +1661,16 @@ class DistanceScoringParameters(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. -:vartype parsing_mode: str -:ivar data_to_extract: The type of data to be extracted for the skill. Will be set to +:ivar parsingMode: The parsingMode for the skill. Will be set to 'default' if not defined. +:vartype parsingMode: str +:ivar dataToExtract: The type of data to be extracted for the skill. Will be set to 'contentAndMetadata' if not defined. -:vartype data_to_extract: str +:vartype dataToExtract: str :ivar configuration: A dictionary of configurations for the skill. :vartype configuration: dict[str, Any] -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.DocumentExtractionSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Util.DocumentExtractionSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Util.DocumentExtractionSkill"] """ @@ -1714,25 +1710,24 @@ class DistanceScoringParameters(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar output_format: Controls the output format. Default is 'markdown'. Known values are: - "text" and "markdown". -:vartype output_format: Union[str, "DocumentIntelligenceLayoutSkillOutputFormat"] -:ivar output_mode: Controls the cardinality of the output produced by the skill. Default is +:ivar outputFormat: Controls the output format. Default is 'markdown'. Known values are: "text" + and "markdown". +:vartype outputFormat: Union[str, "DocumentIntelligenceLayoutSkillOutputFormat"] +:ivar outputMode: Controls the cardinality of the output produced by the skill. Default is 'oneToMany'. "oneToMany" -:vartype output_mode: Union[str, "DocumentIntelligenceLayoutSkillOutputMode"] -:ivar markdown_header_depth: The depth of headers in the markdown output. Default is h6. Known +:vartype outputMode: Union[str, "DocumentIntelligenceLayoutSkillOutputMode"] +:ivar markdownHeaderDepth: The depth of headers in the markdown output. Default is h6. Known values are: "h1", "h2", "h3", "h4", "h5", and "h6". -:vartype markdown_header_depth: Union[str, - "DocumentIntelligenceLayoutSkillMarkdownHeaderDepth"] -:ivar extraction_options: Controls the cardinality of the content extracted from the document - by the skill. -:vartype extraction_options: list[Union[str, +:vartype markdownHeaderDepth: Union[str, "DocumentIntelligenceLayoutSkillMarkdownHeaderDepth"] +:ivar extractionOptions: Controls the cardinality of the content extracted from the document by + the skill. +:vartype extractionOptions: list[Union[str, "DocumentIntelligenceLayoutSkillExtractionOptions"]] -:ivar chunking_properties: Controls the cardinality for chunking the content. -:vartype chunking_properties: "DocumentIntelligenceLayoutSkillChunkingProperties" -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar chunkingProperties: Controls the cardinality for chunking the content. +:vartype chunkingProperties: "DocumentIntelligenceLayoutSkillChunkingProperties" +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"] """ @@ -1741,10 +1736,10 @@ class DocumentIntelligenceLayoutSkillChunkingProperties(TypedDict, total=False): :ivar unit: The unit of the chunk. "characters" :vartype unit: Union[str, "DocumentIntelligenceLayoutSkillChunkingUnit"] - :ivar maximum_length: The maximum chunk length in characters. Default is 500. - :vartype maximum_length: int - :ivar overlap_length: The length of overlap provided between two text chunks. Default is 0. - :vartype overlap_length: int + :ivar maximumLength: The maximum chunk length in characters. Default is 500. + :vartype maximumLength: int + :ivar overlapLength: The length of overlap provided between two text chunks. Default is 0. + :vartype overlapLength: int """ unit: Optional[Union[str, "DocumentIntelligenceLayoutSkillChunkingUnit"]] @@ -1758,10 +1753,10 @@ class DocumentIntelligenceLayoutSkillChunkingProperties(TypedDict, total=False): class DocumentKeysOrIds(TypedDict, total=False): """The type of the keysOrIds. - :ivar document_keys: document keys to be reset. - :vartype document_keys: list[str] - :ivar datasource_document_ids: datasource document identifiers to be reset. - :vartype datasource_document_ids: list[str] + :ivar documentKeys: document keys to be reset. + :vartype documentKeys: list[str] + :ivar datasourceDocumentIds: datasource document identifiers to be reset. + :vartype datasourceDocumentIds: list[str] """ documentKeys: list[str] @@ -1788,17 +1783,16 @@ class DocumentKeysOrIds(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_gram: The minimum n-gram length. Default is 1. Must be less than the value of - maxGram. -:vartype min_gram: int -:ivar max_gram: The maximum n-gram length. Default is 2. -:vartype max_gram: int +:ivar minGram: The minimum n-gram length. Default is 1. Must be less than the value of maxGram. +:vartype minGram: int +:ivar maxGram: The maximum n-gram length. Default is 2. +:vartype maxGram: int :ivar side: Specifies which side of the input the n-gram should be generated from. Default is "front". Known values are: "front" and "back". :vartype side: Union[str, "EdgeNGramTokenFilterSide"] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.EdgeNGramTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilter"] """ @@ -1820,17 +1814,17 @@ class DocumentKeysOrIds(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the +:ivar minGram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram. -:vartype min_gram: int -:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. -:vartype max_gram: int +:vartype minGram: int +:ivar maxGram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype maxGram: int :ivar side: Specifies which side of the input the n-gram should be generated from. Default is "front". Known values are: "front" and "back". :vartype side: Union[str, "EdgeNGramTokenFilterSide"] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2". -:vartype odata_type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"] """ @@ -1852,16 +1846,16 @@ class DocumentKeysOrIds(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the +:ivar minGram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram. -:vartype min_gram: int -:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. -:vartype max_gram: int -:ivar token_chars: Character classes to keep in the tokens. -:vartype token_chars: list[Union[str, "TokenCharacterKind"]] -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:vartype minGram: int +:ivar maxGram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype maxGram: int +:ivar tokenChars: Character classes to keep in the tokens. +:vartype tokenChars: list[Union[str, "TokenCharacterKind"]] +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.EdgeNGramTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenizer"] """ @@ -1883,9 +1877,9 @@ class DocumentKeysOrIds(TypedDict, total=False): :vartype name: str :ivar articles: The set of articles to remove. :vartype articles: list[str] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.ElisionTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.ElisionTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.ElisionTokenFilter"] """ @@ -1894,8 +1888,8 @@ class EmbeddingColumnMapping(TypedDict, total=False): :ivar name: Target vector field name in the search index. Required. :vartype name: str - :ivar source_field: SQL column used as input for embedding generation. Required. - :vartype source_field: str + :ivar sourceField: SQL column used as input for embedding generation. Required. + :vartype sourceField: str """ name: Required[str] @@ -1937,19 +1931,19 @@ class EmbeddingColumnMapping(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. -:vartype default_language_code: str -:ivar minimum_precision: A value between 0 and 1 that be used to only include entities whose +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. +:vartype defaultLanguageCode: str +:ivar minimumPrecision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. -:vartype minimum_precision: float -:ivar model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. -:vartype model_version: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype minimumPrecision: float +:ivar modelVersion: The version of the model to use when calling the Text Analytics service. It + will default to the latest available when not specified. We recommend you do not specify this + value unless absolutely necessary. +:vartype modelVersion: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.V3.EntityLinkingSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.V3.EntityLinkingSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.V3.EntityLinkingSkill"] """ @@ -1989,21 +1983,21 @@ class EmbeddingColumnMapping(TypedDict, total=False): :vartype outputs: list["OutputFieldMappingEntry"] :ivar categories: A list of entity categories that should be extracted. :vartype categories: list[Union[str, "EntityCategory"]] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", and "tr". -:vartype default_language_code: Union[str, "EntityRecognitionSkillLanguage"] -:ivar minimum_precision: A value between 0 and 1 that be used to only include entities whose +:vartype defaultLanguageCode: Union[str, "EntityRecognitionSkillLanguage"] +:ivar minimumPrecision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. -:vartype minimum_precision: float -:ivar model_version: The version of the model to use when calling the Text Analytics API. It +:vartype minimumPrecision: float +:ivar modelVersion: The version of the model to use when calling the Text Analytics API. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. -:vartype model_version: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype modelVersion: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.V3.EntityRecognitionSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.V3.EntityRecognitionSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.V3.EntityRecognitionSkill"] """ @@ -2011,16 +2005,16 @@ class EntraAppAuthentication(TypedDict, total=False): """Configuration for a customer-owned Microsoft Entra app registration used for federated credential-based on-behalf-of authentication. - :ivar application_id: The application (client) ID of the customer-owned Entra app registration. + :ivar applicationId: The application (client) ID of the customer-owned Entra app registration. Required. - :vartype application_id: str - :ivar federated_credential_id: The federated credential ID configured on the app registration, + :vartype applicationId: str + :ivar federatedCredentialId: The federated credential ID configured on the app registration, enabling the search service to authenticate as the app without a stored client secret. Required. - :vartype federated_credential_id: str - :ivar tenant_id: 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. - :vartype tenant_id: str + :vartype federatedCredentialId: str + :ivar tenantId: 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. + :vartype tenantId: str """ applicationId: Required[str] @@ -2039,8 +2033,8 @@ class ExhaustiveKnnAlgorithmConfiguration(TypedDict, total=False): :ivar name: The name to associate with this particular configuration. Required. :vartype name: str - :ivar parameters: Contains the parameters specific to exhaustive KNN algorithm. - :vartype parameters: "ExhaustiveKnnParameters" + :ivar exhaustiveKnnParameters: Contains the parameters specific to exhaustive KNN algorithm. + :vartype exhaustiveKnnParameters: "ExhaustiveKnnParameters" :ivar kind: The name of the kind of algorithm being configured for use with vector search. Required. Exhaustive KNN algorithm which will perform brute-force search. :vartype kind: Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN] @@ -2087,13 +2081,13 @@ class ExhaustiveKnnParameters(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -2101,23 +2095,23 @@ class ExhaustiveKnnParameters(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: The discriminator value. Required. A knowledge source that retrieves data from a Fabric Data Agent. :vartype kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] -:ivar fabric_data_agent_parameters: The parameters for the Fabric Data Agent knowledge source. +:ivar fabricDataAgentParameters: The parameters for the Fabric Data Agent knowledge source. Required. -:vartype fabric_data_agent_parameters: "FabricDataAgentKnowledgeSourceParameters" +:vartype fabricDataAgentParameters: "FabricDataAgentKnowledgeSourceParameters" """ class FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): """Parameters for Fabric Data Agent knowledge source. - :ivar workspace_id: Fabric workspace ID. Required. - :vartype workspace_id: str - :ivar data_agent_id: Specifies which Fabric Data Agent to access. Required. - :vartype data_agent_id: str + :ivar workspaceId: Fabric workspace ID. Required. + :vartype workspaceId: str + :ivar dataAgentId: Specifies which Fabric Data Agent to access. Required. + :vartype dataAgentId: str """ workspaceId: Required[str] @@ -2145,13 +2139,13 @@ class FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -2159,23 +2153,23 @@ class FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: The discriminator value. Required. A knowledge source that retrieves data from Microsoft Fabric Ontology ontologies. :vartype kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] -:ivar fabric_ontology_parameters: The parameters for the Fabric Ontology knowledge source. +:ivar fabricOntologyParameters: The parameters for the Fabric Ontology knowledge source. Required. -:vartype fabric_ontology_parameters: "FabricOntologyKnowledgeSourceParameters" +:vartype fabricOntologyParameters: "FabricOntologyKnowledgeSourceParameters" """ class FabricOntologyKnowledgeSourceParameters(TypedDict, total=False): """Parameters for Fabric Ontology knowledge source. - :ivar workspace_id: The Fabric workspace ID containing the ontology. Required. - :vartype workspace_id: str - :ivar ontology_id: The ID of the ontology to use from the Fabric workspace. Required. - :vartype ontology_id: str + :ivar workspaceId: The Fabric workspace ID containing the ontology. Required. + :vartype workspaceId: str + :ivar ontologyId: The ID of the ontology to use from the Fabric workspace. Required. + :vartype ontologyId: str """ workspaceId: Required[str] @@ -2187,13 +2181,13 @@ class FabricOntologyKnowledgeSourceParameters(TypedDict, total=False): class FieldMapping(TypedDict, total=False): """Defines a mapping between a field in a data source and a target field in an index. - :ivar source_field_name: The name of the field in the data source. Required. - :vartype source_field_name: str - :ivar target_field_name: The name of the target field in the index. Same as the source field - name by default. - :vartype target_field_name: str - :ivar mapping_function: A function to apply to each source field value before indexing. - :vartype mapping_function: "FieldMappingFunction" + :ivar sourceFieldName: The name of the field in the data source. Required. + :vartype sourceFieldName: str + :ivar targetFieldName: The name of the target field in the index. Same as the source field name + by default. + :vartype targetFieldName: str + :ivar mappingFunction: A function to apply to each source field value before indexing. + :vartype mappingFunction: "FieldMappingFunction" """ sourceFieldName: Required[str] @@ -2241,13 +2235,13 @@ class FieldMappingFunction(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -2255,30 +2249,30 @@ class FieldMappingFunction(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: The discriminator value. Required. A knowledge source that supports direct file upload and indexing. :vartype kind: Literal[KnowledgeSourceKind.FILE] -:ivar file_parameters: The parameters for the File knowledge source. Required. -:vartype file_parameters: "FileKnowledgeSourceParameters" -:ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the File +:ivar fileParameters: The parameters for the File knowledge source. Required. +:vartype fileParameters: "FileKnowledgeSourceParameters" +:ivar corsOptions: Options to control Cross-Origin Resource Sharing (CORS) for the File knowledge source's file endpoints (upload, list, update, delete). -:vartype cors_options: "CorsOptions" +:vartype corsOptions: "CorsOptions" """ class FileKnowledgeSourceParameters(TypedDict, total=False): """Parameters for File knowledge source. - :ivar ingestion_parameters: Consolidates all general ingestion settings for the File knowledge + :ivar ingestionParameters: Consolidates all general ingestion settings for the File knowledge source, including the content extraction mode and an optional embeddingModel. - :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" - :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + :vartype ingestionParameters: "KnowledgeSourceIngestionParameters" + :ivar queryHints: Default hints that guide query planning toward useful filters and boosts for this index-backed knowledge source. Request-time query hints replace these defaults as a complete object. - :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" - :ivar created_resources: Resources created by the file knowledge source. - :vartype created_resources: "CreatedResources" + :vartype queryHints: "SearchIndexKnowledgeSourceQueryHints" + :ivar createdResources: Resources created by the file knowledge source. + :vartype createdResources: "CreatedResources" """ ingestionParameters: "KnowledgeSourceIngestionParameters" @@ -2296,9 +2290,9 @@ class FileUploadMetadata(TypedDict, total=False): custom key/value metadata. The parsing mode and extraction mode are both chosen by the service and are not supplied by the caller. - :ivar file_name: The full relative file name/path to store the file under (prefixes are derived + :ivar fileName: The full relative file name/path to store the file under (prefixes are derived from it). - :vartype file_name: str + :vartype fileName: str :ivar metadata: Custom key/value metadata to store with the file. :vartype metadata: dict[str, str] """ @@ -2312,8 +2306,8 @@ class FileUploadMetadata(TypedDict, total=False): class FreshnessScoringFunction(TypedDict, total=False): """Defines a function that boosts scores based on the value of a date-time field. - :ivar field_name: The name of the field used as input to the scoring function. Required. - :vartype field_name: str + :ivar fieldName: The name of the field used as input to the scoring function. Required. + :vartype fieldName: str :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. Required. :vartype boost: float @@ -2321,8 +2315,8 @@ class FreshnessScoringFunction(TypedDict, total=False): scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and "logarithmic". :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] - :ivar parameters: Parameter values for the freshness scoring function. Required. - :vartype parameters: "FreshnessScoringParameters" + :ivar freshness: Parameter values for the freshness scoring function. Required. + :vartype freshness: "FreshnessScoringParameters" :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case. Required. Default value is "freshness". @@ -2346,9 +2340,9 @@ class FreshnessScoringFunction(TypedDict, total=False): class FreshnessScoringParameters(TypedDict, total=False): """Provides parameter values to a freshness scoring function. - :ivar boosting_duration: The expiration period after which boosting will stop for a particular + :ivar boostingDuration: The expiration period after which boosting will stop for a particular document. Required. - :vartype boosting_duration: str + :vartype boostingDuration: str """ boostingDuration: Required[str] @@ -2359,13 +2353,13 @@ class GetIndexStatisticsResult(TypedDict, total=False): """Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date. - :ivar document_count: The number of documents in the index. Required. - :vartype document_count: int - :ivar storage_size: The amount of storage in bytes consumed by the index. Required. - :vartype storage_size: int - :ivar vector_index_size: The amount of memory in bytes consumed by vectors in the index. + :ivar documentCount: The number of documents in the index. Required. + :vartype documentCount: int + :ivar storageSize: The amount of storage in bytes consumed by the index. Required. + :vartype storageSize: int + :ivar vectorIndexSize: The amount of memory in bytes consumed by vectors in the index. Required. - :vartype vector_index_size: int + :vartype vectorIndexSize: int """ documentCount: Required[int] @@ -2387,11 +2381,11 @@ class GetIndexStatisticsResult(TypedDict, total=False): HighWaterMarkChangeDetectionPolicy.__doc__ = """Defines a data change detection policy that captures changes based on the value of a high water mark column. -:ivar high_water_mark_column_name: The name of the high water mark column. Required. -:vartype high_water_mark_column_name: str -:ivar odata_type: A URI fragment specifying the type of data change detection policy. Required. - Default value is "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy". -:vartype odata_type: Literal["#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"] +:ivar highWaterMarkColumnName: The name of the high water mark column. Required. +:vartype highWaterMarkColumnName: str +:ivar @odata.type: A URI fragment specifying the type of data change detection policy. + Required. Default value is "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"] """ @@ -2402,8 +2396,8 @@ class HnswAlgorithmConfiguration(TypedDict, total=False): :ivar name: The name to associate with this particular configuration. Required. :vartype name: str - :ivar parameters: Contains the parameters specific to HNSW algorithm. - :vartype parameters: "HnswParameters" + :ivar hnswParameters: Contains the parameters specific to HNSW algorithm. + :vartype hnswParameters: "HnswParameters" :ivar kind: The name of the kind of algorithm being configured for use with vector search. Required. HNSW (Hierarchical Navigable Small World), a type of approximate nearest neighbors algorithm. @@ -2427,15 +2421,15 @@ class HnswParameters(TypedDict, total=False): high intrinsic dimensionality at the expense of increased memory consumption and longer indexing time. :vartype m: int - :ivar ef_construction: The size of the dynamic list containing the nearest neighbors, which is + :ivar efConstruction: The size of the dynamic list containing the nearest neighbors, which is used during index time. Increasing this parameter may improve index quality, at the expense of increased indexing time. At a certain point, increasing this parameter leads to diminishing returns. - :vartype ef_construction: int - :ivar ef_search: The size of the dynamic list containing the nearest neighbors, which is used + :vartype efConstruction: int + :ivar efSearch: The size of the dynamic list containing the nearest neighbors, which is used during search time. Increasing this parameter may improve search results, at the expense of slower search. At a certain point, increasing this parameter leads to diminishing returns. - :vartype ef_search: int + :vartype efSearch: int :ivar metric: The similarity metric to use for vector comparisons. Known values are: "cosine", "euclidean", "dotProduct", and "hamming". :vartype metric: Union[str, "VectorSearchAlgorithmMetric"] @@ -2493,19 +2487,19 @@ class HnswParameters(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "ar", "az", "bg", "bs", "ca", "cs", "cy", "da", "de", "el", "en", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hu", "id", "it", "ja", "kk", "ko", "lt", "lv", "mk", "ms", "nb", "nl", "pl", "prs", "pt-BR", "pt", "pt-PT", "ro", "ru", "sk", "sl", "sr-Cyrl", "sr-Latn", "sv", "th", "tr", "uk", "vi", "zh", "zh-Hans", and "zh-Hant". -:vartype default_language_code: Union[str, "ImageAnalysisSkillLanguage"] -:ivar visual_features: A list of visual features. -:vartype visual_features: list[Union[str, "VisualFeature"]] +:vartype defaultLanguageCode: Union[str, "ImageAnalysisSkillLanguage"] +:ivar visualFeatures: A list of visual features. +:vartype visualFeatures: list[Union[str, "VisualFeature"]] :ivar details: A string indicating which domain-specific details to return. :vartype details: list[Union[str, "ImageDetail"]] -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Vision.ImageAnalysisSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Vision.ImageAnalysisSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Vision.ImageAnalysisSkill"] """ @@ -2528,13 +2522,13 @@ class HnswParameters(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -2542,31 +2536,31 @@ class HnswParameters(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: Required. A knowledge source that reads data from indexed OneLake. :vartype kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] -:ivar indexed_one_lake_parameters: The parameters for the knowledge source. Required. -:vartype indexed_one_lake_parameters: "IndexedOneLakeKnowledgeSourceParameters" +:ivar indexedOneLakeParameters: The parameters for the knowledge source. Required. +:vartype indexedOneLakeParameters: "IndexedOneLakeKnowledgeSourceParameters" """ class IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): """Parameters for OneLake knowledge source. - :ivar fabric_workspace_id: OneLake workspace ID. Required. - :vartype fabric_workspace_id: str - :ivar lakehouse_id: Specifies which OneLake lakehouse to access. Required. - :vartype lakehouse_id: str - :ivar target_path: Optional OneLakehouse folder or shortcut to filter OneLake content. - :vartype target_path: str - :ivar ingestion_parameters: Consolidates all general ingestion settings. - :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" - :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + :ivar fabricWorkspaceId: OneLake workspace ID. Required. + :vartype fabricWorkspaceId: str + :ivar lakehouseId: Specifies which OneLake lakehouse to access. Required. + :vartype lakehouseId: str + :ivar targetPath: Optional OneLakehouse folder or shortcut to filter OneLake content. + :vartype targetPath: str + :ivar ingestionParameters: Consolidates all general ingestion settings. + :vartype ingestionParameters: "KnowledgeSourceIngestionParameters" + :ivar queryHints: Default hints that guide query planning toward useful filters and boosts for this index-backed knowledge source. Request-time query hints replace these defaults as a complete object. - :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" - :ivar created_resources: Resources created by the knowledge source. - :vartype created_resources: "CreatedResources" + :vartype queryHints: "SearchIndexKnowledgeSourceQueryHints" + :ivar createdResources: Resources created by the knowledge source. + :vartype createdResources: "CreatedResources" """ fabricWorkspaceId: Required[str] @@ -2603,13 +2597,13 @@ class IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -2617,35 +2611,35 @@ class IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: Required. A knowledge source that reads data from indexed SharePoint. :vartype kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] -:ivar indexed_share_point_parameters: The parameters for the knowledge source. Required. -:vartype indexed_share_point_parameters: "IndexedSharePointKnowledgeSourceParameters" +:ivar indexedSharePointParameters: The parameters for the knowledge source. Required. +:vartype indexedSharePointParameters: "IndexedSharePointKnowledgeSourceParameters" """ class IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): # pylint: disable=name-too-long """Parameters for SharePoint knowledge source. - :ivar connection_string: SharePoint connection string with format: + :ivar connectionString: SharePoint connection string with format: SharePointOnlineEndpoint=[SharePoint site url];ApplicationId=[Azure AD App ID];ApplicationSecret=[Azure AD App client secret];TenantId=[SharePoint site tenant id]. Required. - :vartype connection_string: str - :ivar container_name: Specifies which SharePoint libraries to access. Required. Known values + :vartype connectionString: str + :ivar containerName: Specifies which SharePoint libraries to access. Required. Known values are: "defaultSiteLibrary", "allSiteLibraries", and "useQuery". - :vartype container_name: Union[str, "IndexedSharePointContainerName"] + :vartype containerName: Union[str, "IndexedSharePointContainerName"] :ivar query: Optional query to filter SharePoint content. :vartype query: str - :ivar ingestion_parameters: Consolidates all general ingestion settings. - :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" - :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + :ivar ingestionParameters: Consolidates all general ingestion settings. + :vartype ingestionParameters: "KnowledgeSourceIngestionParameters" + :ivar queryHints: Default hints that guide query planning toward useful filters and boosts for this index-backed knowledge source. Request-time query hints replace these defaults as a complete object. - :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" - :ivar created_resources: Resources created by the knowledge source. - :vartype created_resources: "CreatedResources" + :vartype queryHints: "SearchIndexKnowledgeSourceQueryHints" + :ivar createdResources: Resources created by the knowledge source. + :vartype createdResources: "CreatedResources" """ connectionString: Required[str] @@ -2685,13 +2679,13 @@ class IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): # pyl :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -2699,42 +2693,42 @@ class IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): # pyl as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: The discriminator value. Required. A knowledge source that retrieves and ingests data from Azure SQL Database or SQL Managed Instance to a Search Index. :vartype kind: Literal[KnowledgeSourceKind.INDEXED_SQL] -:ivar indexed_sql_parameters: The parameters for the SQL knowledge source. Required. -:vartype indexed_sql_parameters: "IndexedSqlKnowledgeSourceParameters" +:ivar indexedSqlParameters: The parameters for the SQL knowledge source. Required. +:vartype indexedSqlParameters: "IndexedSqlKnowledgeSourceParameters" """ class IndexedSqlKnowledgeSourceParameters(TypedDict, total=False): """Parameters for indexed SQL knowledge source. - :ivar connection_string: The connection string for the Azure SQL Database or SQL Managed + :ivar connectionString: The connection string for the Azure SQL Database or SQL Managed Instance. Required. - :vartype connection_string: str - :ivar table_or_view: The name of the table or view to index. Can be schema-qualified (e.g., + :vartype connectionString: str + :ivar tableOrView: The name of the table or view to index. Can be schema-qualified (e.g., 'dbo.MyTable'). Required. - :vartype table_or_view: str - :ivar high_water_mark_column_name: Optional column name for high water mark change detection. - If provided, uses HighWaterMarkChangeDetectionPolicy. - :vartype high_water_mark_column_name: str - :ivar content_columns: Optional column mappings for content fields. If omitted, all columns are + :vartype tableOrView: str + :ivar highWaterMarkColumnName: Optional column name for high water mark change detection. If + provided, uses HighWaterMarkChangeDetectionPolicy. + :vartype highWaterMarkColumnName: str + :ivar contentColumns: Optional column mappings for content fields. If omitted, all columns are auto-discovered. - :vartype content_columns: list["ContentColumnMapping"] - :ivar embedding_columns: Optional column mappings for embedding vector fields. If omitted, no + :vartype contentColumns: list["ContentColumnMapping"] + :ivar embeddingColumns: Optional column mappings for embedding vector fields. If omitted, no vector fields are created. - :vartype embedding_columns: list["EmbeddingColumnMapping"] - :ivar ingestion_parameters: Consolidates all general ingestion settings including embedding + :vartype embeddingColumns: list["EmbeddingColumnMapping"] + :ivar ingestionParameters: Consolidates all general ingestion settings including embedding model, schedule, and identity. - :vartype ingestion_parameters: "KnowledgeSourceIngestionParameters" - :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + :vartype ingestionParameters: "KnowledgeSourceIngestionParameters" + :ivar queryHints: Default hints that guide query planning toward useful filters and boosts for this index-backed knowledge source. Request-time query hints replace these defaults as a complete object. - :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" - :ivar created_resources: Resources created by the knowledge source. - :vartype created_resources: "CreatedResources" + :vartype queryHints: "SearchIndexKnowledgeSourceQueryHints" + :ivar createdResources: Resources created by the knowledge source. + :vartype createdResources: "CreatedResources" """ connectionString: Required[str] @@ -2772,15 +2766,15 @@ class IndexerResyncBody(TypedDict, total=False): class IndexingParameters(TypedDict, total=False): """Represents parameters for indexer execution. - :ivar batch_size: The number of items that are read from the data source and indexed as a - single batch in order to improve performance. The default depends on the data source type. - :vartype batch_size: int - :ivar max_failed_items: The maximum number of items that can fail indexing for indexer - execution to still be considered successful. -1 means no limit. Default is 0. - :vartype max_failed_items: int - :ivar max_failed_items_per_batch: The maximum number of items in a single batch that can fail + :ivar batchSize: The number of items that are read from the data source and indexed as a single + batch in order to improve performance. The default depends on the data source type. + :vartype batchSize: int + :ivar maxFailedItems: The maximum number of items that can fail indexing for indexer execution + to still be considered successful. -1 means no limit. Default is 0. + :vartype maxFailedItems: int + :ivar maxFailedItemsPerBatch: The maximum number of items in a single batch that can fail indexing for the batch to still be considered successful. -1 means no limit. Default is 0. - :vartype max_failed_items_per_batch: int + :vartype maxFailedItemsPerBatch: int :ivar configuration: A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. :vartype configuration: "IndexingParametersConfiguration" @@ -2804,76 +2798,76 @@ class IndexingParametersConfiguration(TypedDict, total=False): """A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :ivar parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. + :ivar parsingMode: Represents the parsing mode for indexing from an Azure blob data source. Known values are: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines", and "markdown". - :vartype parsing_mode: Union[str, "BlobIndexerParsingMode"] - :ivar excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore when + :vartype parsingMode: Union[str, "BlobIndexerParsingMode"] + :ivar excludedFileNameExtensions: Comma-delimited list of filename extensions to ignore when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip over those files during indexing. - :vartype excluded_file_name_extensions: str - :ivar indexed_file_name_extensions: Comma-delimited list of filename extensions to select when + :vartype excludedFileNameExtensions: str + :ivar indexedFileNameExtensions: Comma-delimited list of filename extensions to select when processing from Azure blob storage. For example, you could focus indexing on specific application files ".docx, .pptx, .msg" to specifically include those file types. - :vartype indexed_file_name_extensions: str - :ivar fail_on_unsupported_content_type: For Azure blobs, set to false if you want to continue + :vartype indexedFileNameExtensions: str + :ivar failOnUnsupportedContentType: For Azure blobs, set to false if you want to continue indexing when an unsupported content type is encountered, and you don't know all the content types (file extensions) in advance. - :vartype fail_on_unsupported_content_type: bool - :ivar fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue + :vartype failOnUnsupportedContentType: bool + :ivar failOnUnprocessableDocument: For Azure blobs, set to false if you want to continue indexing if a document fails indexing. - :vartype fail_on_unprocessable_document: bool - :ivar index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this property - to true to still index storage metadata for blob content that is too large to process. - Oversized blobs are treated as errors by default. For limits on blob size, see + :vartype failOnUnprocessableDocument: bool + :ivar indexStorageMetadataOnlyForOversizedDocuments: For Azure blobs, set this property to true + to still index storage metadata for blob content that is too large to process. Oversized blobs + are treated as errors by default. For limits on blob size, see `https://learn.microsoft.com/azure/search/search-limits-quotas-capacity `_. - :vartype index_storage_metadata_only_for_oversized_documents: bool - :ivar delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column - headers, useful for mapping source fields to destination fields in an index. - :vartype delimited_text_headers: str - :ivar delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character + :vartype indexStorageMetadataOnlyForOversizedDocuments: bool + :ivar delimitedTextHeaders: For CSV blobs, specifies a comma-delimited list of column headers, + useful for mapping source fields to destination fields in an index. + :vartype delimitedTextHeaders: str + :ivar delimitedTextDelimiter: For CSV blobs, specifies the end-of-line single-character delimiter for CSV files where each line starts a new document (for example, "|"). - :vartype delimited_text_delimiter: str - :ivar first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line of + :vartype delimitedTextDelimiter: str + :ivar firstLineContainsHeaders: For CSV blobs, indicates that the first (non-blank) line of each blob contains headers. - :vartype first_line_contains_headers: bool - :ivar markdown_parsing_submode: Specifies the submode that will determine whether a markdown - file will be parsed into exactly one search document or multiple search documents. Default is + :vartype firstLineContainsHeaders: bool + :ivar markdownParsingSubmode: Specifies the submode that will determine whether a markdown file + will be parsed into exactly one search document or multiple search documents. Default is ``oneToMany``. Known values are: "oneToMany" and "oneToOne". - :vartype markdown_parsing_submode: Union[str, "MarkdownParsingSubmode"] - :ivar markdown_header_depth: Specifies the max header depth that will be considered while + :vartype markdownParsingSubmode: Union[str, "MarkdownParsingSubmode"] + :ivar markdownHeaderDepth: Specifies the max header depth that will be considered while grouping markdown content. Default is ``h6``. Known values are: "h1", "h2", "h3", "h4", "h5", and "h6". - :vartype markdown_header_depth: Union[str, "MarkdownHeaderDepth"] - :ivar document_root: For JSON arrays, given a structured or semi-structured document, you can + :vartype markdownHeaderDepth: Union[str, "MarkdownHeaderDepth"] + :ivar documentRoot: For JSON arrays, given a structured or semi-structured document, you can specify a path to the array using this property. - :vartype document_root: str - :ivar data_to_extract: Specifies the data to extract from Azure blob storage and tells the + :vartype documentRoot: str + :ivar dataToExtract: Specifies the data to extract from Azure blob storage and tells the indexer which data to extract from image content when "imageAction" is set to a value other than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. Known values are: "storageMetadata", "allMetadata", and "contentAndMetadata". - :vartype data_to_extract: Union[str, "BlobIndexerDataToExtract"] - :ivar image_action: Determines how to process embedded images and image files in Azure blob + :vartype dataToExtract: Union[str, "BlobIndexerDataToExtract"] + :ivar imageAction: Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. Known values are: "none", "generateNormalizedImages", and "generateNormalizedImagePerPage". - :vartype image_action: Union[str, "BlobIndexerImageAction"] - :ivar allow_skillset_to_read_file_data: If true, will create a path //document//file_data that - is an object representing the original file data downloaded from your blob data source. This - allows you to pass the original file data to a custom skill for processing within the - enrichment pipeline, or to the Document Extraction skill. - :vartype allow_skillset_to_read_file_data: bool - :ivar pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in + :vartype imageAction: Union[str, "BlobIndexerImageAction"] + :ivar allowSkillsetToReadFileData: If true, will create a path //document//file_data that is an + object representing the original file data downloaded from your blob data source. This allows + you to pass the original file data to a custom skill for processing within the enrichment + pipeline, or to the Document Extraction skill. + :vartype allowSkillsetToReadFileData: bool + :ivar pdfTextRotationAlgorithm: Determines algorithm for text extraction from PDF files in Azure blob storage. Known values are: "none" and "detectAngles". - :vartype pdf_text_rotation_algorithm: Union[str, "BlobIndexerPDFTextRotationAlgorithm"] - :ivar execution_environment: Specifies the environment in which the indexer should execute. + :vartype pdfTextRotationAlgorithm: Union[str, "BlobIndexerPDFTextRotationAlgorithm"] + :ivar executionEnvironment: Specifies the environment in which the indexer should execute. Known values are: "standard" and "private". - :vartype execution_environment: Union[str, "IndexerExecutionEnvironment"] - :ivar query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database + :vartype executionEnvironment: Union[str, "IndexerExecutionEnvironment"] + :ivar queryTimeout: Increases the timeout beyond the 5-minute default for Azure SQL database data sources, specified in the format "hh:mm:ss". - :vartype query_timeout: str + :vartype queryTimeout: str """ parsingMode: Union[str, "BlobIndexerParsingMode"] @@ -2947,8 +2941,8 @@ class IndexingSchedule(TypedDict, total=False): :ivar interval: The interval of time between indexer executions. Required. :vartype interval: str - :ivar start_time: The time when an indexer should start running. - :vartype start_time: str + :ivar startTime: The time when an indexer should start running. + :vartype startTime: str """ interval: Required[str] @@ -2964,8 +2958,8 @@ class InputFieldMappingEntry(TypedDict, total=False): :vartype name: str :ivar source: The source of the input. :vartype source: str - :ivar source_context: The source context used for selecting recursive inputs. - :vartype source_context: str + :ivar sourceContext: The source context used for selecting recursive inputs. + :vartype sourceContext: str :ivar inputs: The recursive inputs used when creating a complex type. :vartype inputs: list["InputFieldMappingEntry"] """ @@ -2997,14 +2991,14 @@ class InputFieldMappingEntry(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar keep_words: The list of words to keep. Required. -:vartype keep_words: list[str] -:ivar lower_case_keep_words: A value indicating whether to lower case all words first. Default - is false. -:vartype lower_case_keep_words: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar keepWords: The list of words to keep. Required. +:vartype keepWords: list[str] +:ivar keepWordsCase: A value indicating whether to lower case all words first. Default is + false. +:vartype keepWordsCase: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.KeepTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.KeepTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeepTokenFilter"] """ @@ -3041,20 +3035,20 @@ class InputFieldMappingEntry(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", and "sv". -:vartype default_language_code: Union[str, "KeyPhraseExtractionSkillLanguage"] -:ivar max_key_phrase_count: A number indicating how many key phrases to return. If absent, all +:vartype defaultLanguageCode: Union[str, "KeyPhraseExtractionSkillLanguage"] +:ivar maxKeyPhraseCount: A number indicating how many key phrases to return. If absent, all identified key phrases will be returned. -:vartype max_key_phrase_count: int -:ivar model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. -:vartype model_version: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype maxKeyPhraseCount: int +:ivar modelVersion: The version of the model to use when calling the Text Analytics service. It + will default to the latest available when not specified. We recommend you do not specify this + value unless absolutely necessary. +:vartype modelVersion: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.KeyPhraseExtractionSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.KeyPhraseExtractionSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.KeyPhraseExtractionSkill"] """ @@ -3076,12 +3070,12 @@ class InputFieldMappingEntry(TypedDict, total=False): :vartype name: str :ivar keywords: A list of words to mark as keywords. Required. :vartype keywords: list[str] -:ivar ignore_case: A value indicating whether to ignore case. If true, all words are converted +:ivar ignoreCase: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false. -:vartype ignore_case: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype ignoreCase: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.KeywordMarkerTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.KeywordMarkerTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeywordMarkerTokenFilter"] """ @@ -3100,11 +3094,11 @@ class InputFieldMappingEntry(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar buffer_size: The read buffer size in bytes. Default is 256. -:vartype buffer_size: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar bufferSize: The read buffer size in bytes. Default is 256. +:vartype bufferSize: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.KeywordTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.KeywordTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeywordTokenizer"] """ @@ -3123,12 +3117,12 @@ class InputFieldMappingEntry(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Default is 256. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. -:vartype max_token_length: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar maxTokenLength: The maximum token length. Default is 256. Tokens longer than the maximum + length are split. The maximum token length that can be used is 300 characters. +:vartype maxTokenLength: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.KeywordTokenizerV2". -:vartype odata_type: Literal["#Microsoft.Azure.Search.KeywordTokenizerV2"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeywordTokenizerV2"] """ @@ -3155,37 +3149,37 @@ class InputFieldMappingEntry(TypedDict, total=False): :ivar name: The name of the knowledge base. Required. :vartype name: str -:ivar knowledge_sources: Knowledge sources referenced by this knowledge base. Required. -:vartype knowledge_sources: list["KnowledgeSourceReference"] +:ivar knowledgeSources: Knowledge sources referenced by this knowledge base. Required. +:vartype knowledgeSources: list["KnowledgeSourceReference"] :ivar models: Contains configuration options on how to connect to AI models. :vartype models: list["KnowledgeBaseModel"] -:ivar retrieval_reasoning_effort: The retrieval reasoning effort configuration. -:vartype retrieval_reasoning_effort: "KnowledgeRetrievalReasoningEffort" -:ivar output_mode: The output mode for the knowledge base. Known values are: "extractiveData" +:ivar retrievalReasoningEffort: The retrieval reasoning effort configuration. +:vartype retrievalReasoningEffort: "KnowledgeRetrievalReasoningEffort" +:ivar outputMode: The output mode for the knowledge base. Known values are: "extractiveData" and "answerSynthesis". -:vartype output_mode: Union[str, "KnowledgeRetrievalOutputMode"] -:ivar e_tag: The ETag of the knowledge base. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype outputMode: Union[str, "KnowledgeRetrievalOutputMode"] +:ivar @odata.etag: The ETag of the knowledge base. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar description: The description of the knowledge base. :vartype description: str :ivar tags: User-defined key-value pairs for categorizing the knowledge base and attributing its usage and costs. :vartype tags: dict[str, str] -:ivar retrieval_instructions: Instructions considered by the knowledge base when developing +:ivar retrievalInstructions: Instructions considered by the knowledge base when developing query plan. -:vartype retrieval_instructions: str -:ivar answer_instructions: Instructions considered by the knowledge base when generating +:vartype retrievalInstructions: str +:ivar answerInstructions: Instructions considered by the knowledge base when generating answers. -:vartype answer_instructions: str -:ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the knowledge +:vartype answerInstructions: str +:ivar corsOptions: Options to control Cross-Origin Resource Sharing (CORS) for the knowledge base. -:vartype cors_options: "CorsOptions" -:ivar retrieve_defaults: 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. -:vartype retrieve_defaults: "KnowledgeBaseRetrieveDefaults" +:vartype corsOptions: "CorsOptions" +:ivar retrieveDefaults: 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. +:vartype retrieveDefaults: "KnowledgeBaseRetrieveDefaults" """ @@ -3194,8 +3188,8 @@ class KnowledgeBaseAzureOpenAIModel(TypedDict, total=False): :ivar kind: Required. Use Azure Open AI models for query planning. :vartype kind: Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI] - :ivar azure_open_ai_parameters: Azure OpenAI parameters. Required. - :vartype azure_open_ai_parameters: "AzureOpenAIVectorizerParameters" + :ivar azureOpenAIParameters: Azure OpenAI parameters. Required. + :vartype azureOpenAIParameters: "AzureOpenAIVectorizerParameters" """ kind: Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] @@ -3209,13 +3203,13 @@ class KnowledgeBaseRetrieveDefaults(TypedDict, total=False): default for the matching retrieve-request field; service defaults apply when unset, and request-time values take precedence when present. - :ivar max_runtime_in_seconds: The default maximum runtime in seconds for a retrieve request. - :vartype max_runtime_in_seconds: int - :ivar max_output_documents: The default maximum number of documents in the retrieve output. - :vartype max_output_documents: int - :ivar max_output_size_in_tokens: The default maximum size, in tokens, of the content in the + :ivar maxRuntimeInSeconds: The default maximum runtime in seconds for a retrieve request. + :vartype maxRuntimeInSeconds: int + :ivar maxOutputDocuments: The default maximum number of documents in the retrieve output. + :vartype maxOutputDocuments: int + :ivar maxOutputSizeInTokens: The default maximum size, in tokens, of the content in the retrieve output. - :vartype max_output_size_in_tokens: int + :vartype maxOutputSizeInTokens: int """ maxRuntimeInSeconds: int @@ -3231,14 +3225,14 @@ class KnowledgeSourceReference(TypedDict, total=False): :ivar name: The name of the knowledge source. Required. :vartype name: str - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool - :ivar enable_freshness: Indicates whether freshness-aware retrieval should be enabled for this + :ivar enableImageServing: 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. + :vartype enableImageServing: bool + :ivar enableFreshness: 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. - :vartype enable_freshness: bool + :vartype enableFreshness: bool """ name: Required[str] @@ -3286,16 +3280,16 @@ class KnowledgeSourceReference(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_country_hint: A country code to use as a hint to the language detection model if - it cannot disambiguate the language. -:vartype default_country_hint: str -:ivar model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. -:vartype model_version: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar defaultCountryHint: A country code to use as a hint to the language detection model if it + cannot disambiguate the language. +:vartype defaultCountryHint: str +:ivar modelVersion: The version of the model to use when calling the Text Analytics service. It + will default to the latest available when not specified. We recommend you do not specify this + value unless absolutely necessary. +:vartype modelVersion: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.LanguageDetectionSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.LanguageDetectionSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.LanguageDetectionSkill"] """ @@ -3316,14 +3310,14 @@ class KnowledgeSourceReference(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be less - than the value of max. -:vartype min_length: int -:ivar max_length: The maximum length in characters. Default and maximum is 300. -:vartype max_length: int -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar min: The minimum length in characters. Default is 0. Maximum is 300. Must be less than + the value of max. +:vartype min: int +:ivar max: The maximum length in characters. Default and maximum is 300. +:vartype max: int +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.LengthTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.LengthTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.LengthTokenFilter"] """ @@ -3344,14 +3338,14 @@ class KnowledgeSourceReference(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_count: The maximum number of tokens to produce. Default is 1. -:vartype max_token_count: int -:ivar consume_all_tokens: A value indicating whether all tokens from the input must be consumed +:ivar maxTokenCount: The maximum number of tokens to produce. Default is 1. +:vartype maxTokenCount: int +:ivar consumeAllTokens: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false. -:vartype consume_all_tokens: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype consumeAllTokens: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.LimitTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.LimitTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.LimitTokenFilter"] """ @@ -3372,14 +3366,14 @@ class KnowledgeSourceReference(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. -:vartype max_token_length: int +:ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum + length are split. The maximum token length that can be used is 300 characters. +:vartype maxTokenLength: int :ivar stopwords: A list of stopwords. :vartype stopwords: list[str] -:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is "#Microsoft.Azure.Search.StandardAnalyzer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StandardAnalyzer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StandardAnalyzer"] """ @@ -3399,12 +3393,12 @@ class KnowledgeSourceReference(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. -:vartype max_token_length: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum + length are split. +:vartype maxTokenLength: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.StandardTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StandardTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StandardTokenizer"] """ @@ -3424,20 +3418,20 @@ class KnowledgeSourceReference(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. -:vartype max_token_length: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum + length are split. The maximum token length that can be used is 300 characters. +:vartype maxTokenLength: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.StandardTokenizerV2". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StandardTokenizerV2"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StandardTokenizerV2"] """ class MagnitudeScoringFunction(TypedDict, total=False): """Defines a function that boosts scores based on the magnitude of a numeric field. - :ivar field_name: The name of the field used as input to the scoring function. Required. - :vartype field_name: str + :ivar fieldName: The name of the field used as input to the scoring function. Required. + :vartype fieldName: str :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. Required. :vartype boost: float @@ -3445,8 +3439,8 @@ class MagnitudeScoringFunction(TypedDict, total=False): scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and "logarithmic". :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] - :ivar parameters: Parameter values for the magnitude scoring function. Required. - :vartype parameters: "MagnitudeScoringParameters" + :ivar magnitude: Parameter values for the magnitude scoring function. Required. + :vartype magnitude: "MagnitudeScoringParameters" :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case. Required. Default value is "magnitude". @@ -3470,13 +3464,13 @@ class MagnitudeScoringFunction(TypedDict, total=False): class MagnitudeScoringParameters(TypedDict, total=False): """Provides parameter values to a magnitude scoring function. - :ivar boosting_range_start: The field value at which boosting starts. Required. - :vartype boosting_range_start: float - :ivar boosting_range_end: The field value at which boosting ends. Required. - :vartype boosting_range_end: float - :ivar should_boost_beyond_range_by_constant: A value indicating whether to apply a constant - boost for field values beyond the range end value; default is false. - :vartype should_boost_beyond_range_by_constant: bool + :ivar boostingRangeStart: The field value at which boosting starts. Required. + :vartype boostingRangeStart: float + :ivar boostingRangeEnd: The field value at which boosting ends. Required. + :vartype boostingRangeEnd: float + :ivar constantBoostBeyondRange: A value indicating whether to apply a constant boost for field + values beyond the range end value; default is false. + :vartype constantBoostBeyondRange: bool """ boostingRangeStart: Required[float] @@ -3508,9 +3502,9 @@ class MagnitudeScoringParameters(TypedDict, total=False): :ivar mappings: A list of mappings of the following format: "a=>b" (all occurrences of the character "a" will be replaced with character "b"). Required. :vartype mappings: list[str] -:ivar odata_type: A URI fragment specifying the type of char filter. Required. Default value is - "#Microsoft.Azure.Search.MappingCharFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.MappingCharFilter"] +:ivar @odata.type: A URI fragment specifying the type of char filter. Required. Default value + is "#Microsoft.Azure.Search.MappingCharFilter". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.MappingCharFilter"] """ @@ -3533,9 +3527,8 @@ class McpServerFoundryConnectionAuthentication(TypedDict, total=False): :ivar kind: The discriminator value. Required. Authenticate using an Azure AI Foundry connection. :vartype kind: Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION] - :ivar foundry_connection_parameters: Parameters for Foundry connection authentication. - Required. - :vartype foundry_connection_parameters: "McpServerFoundryConnectionParameters" + :ivar foundryConnectionParameters: Parameters for Foundry connection authentication. Required. + :vartype foundryConnectionParameters: "McpServerFoundryConnectionParameters" """ kind: Required[Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION]] @@ -3547,8 +3540,8 @@ class McpServerFoundryConnectionAuthentication(TypedDict, total=False): class McpServerFoundryConnectionParameters(TypedDict, total=False): """Parameters for Foundry connection authentication. - :ivar connection_id: The Azure AI Foundry connection identifier. - :vartype connection_id: str + :ivar connectionId: The Azure AI Foundry connection identifier. + :vartype connectionId: str """ connectionId: str @@ -3565,9 +3558,9 @@ class McpServerJsonOutputParsing(TypedDict, total=False): :ivar kind: The discriminator value. Required. Parse the output as a JSON document using the configured JSON parameters. :vartype kind: Literal[McpServerOutputParsingKind.JSON] - :ivar json_parameters: Parameters for JSON output parsing. Required when kind is 'json'. + :ivar jsonParameters: Parameters for JSON output parsing. Required when kind is 'json'. Required. - :vartype json_parameters: "McpServerOutputParsingJsonParameters" + :vartype jsonParameters: "McpServerOutputParsingJsonParameters" """ kind: Required[Literal[McpServerOutputParsingKind.JSON]] @@ -3596,13 +3589,13 @@ class McpServerJsonOutputParsing(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -3610,20 +3603,20 @@ class McpServerJsonOutputParsing(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: The discriminator value. Required. A knowledge source backed by an MCP (Model Context Protocol) server. :vartype kind: Literal[KnowledgeSourceKind.MCP_SERVER] -:ivar mcp_server_parameters: The parameters for the MCP server knowledge source. Required. -:vartype mcp_server_parameters: "McpServerKnowledgeSourceParameters" +:ivar mcpServerParameters: The parameters for the MCP server knowledge source. Required. +:vartype mcpServerParameters: "McpServerKnowledgeSourceParameters" """ class McpServerKnowledgeSourceParameters(TypedDict, total=False): """Parameters for an MCP server knowledge source. - :ivar server_url: The URL of the MCP server endpoint. Required. - :vartype server_url: str + :ivar serverURL: The URL of the MCP server endpoint. Required. + :vartype serverURL: str :ivar authentication: The authentication configuration for the MCP server. :vartype authentication: "McpServerAuthentication" :ivar tools: The list of tools to invoke on the MCP server. Required. @@ -3653,11 +3646,11 @@ class McpServerNoneOutputParsing(TypedDict, total=False): class McpServerOutputParsingJsonParameters(TypedDict, total=False): """Parameters for JSON output parsing. - :ivar documents_path: The JSON path to the array of documents in the tool output. Required. - :vartype documents_path: str - :ivar include_context: Whether to include surrounding context from the JSON output alongside + :ivar documentsPath: The JSON path to the array of documents in the tool output. Required. + :vartype documentsPath: str + :ivar includeContext: Whether to include surrounding context from the JSON output alongside extracted documents. - :vartype include_context: bool + :vartype includeContext: bool """ documentsPath: Required[str] @@ -3669,19 +3662,19 @@ class McpServerOutputParsingJsonParameters(TypedDict, total=False): class McpServerOutputParsingSplitParameters(TypedDict, total=False): """Parameters for split output parsing. - :ivar text_split_mode: The text split mode to use. Known values are: "pages" and "sentences". - :vartype text_split_mode: Union[str, "TextSplitMode"] - :ivar maximum_page_length: The maximum number of characters per page. - :vartype maximum_page_length: int - :ivar page_overlap_length: The number of characters to overlap between pages. - :vartype page_overlap_length: int - :ivar maximum_pages_to_take: The maximum number of pages to take from the output. - :vartype maximum_pages_to_take: int - :ivar default_language_code: A value indicating which language code to use. Default is ``en``. + :ivar textSplitMode: The text split mode to use. Known values are: "pages" and "sentences". + :vartype textSplitMode: Union[str, "TextSplitMode"] + :ivar maximumPageLength: The maximum number of characters per page. + :vartype maximumPageLength: int + :ivar pageOverlapLength: The number of characters to overlap between pages. + :vartype pageOverlapLength: int + :ivar maximumPagesToTake: The maximum number of pages to take from the output. + :vartype maximumPagesToTake: int + :ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "am", "bs", "cs", "da", "de", "en", "es", "et", "fi", "fr", "he", "hi", "hr", "hu", "id", "is", "it", "ja", "ko", "lv", "nb", "nl", "pl", "pt", "pt-br", "ru", "sk", "sl", "sr", "sv", "tr", "ur", and "zh". - :vartype default_language_code: Union[str, "SplitSkillLanguage"] + :vartype defaultLanguageCode: Union[str, "SplitSkillLanguage"] """ textSplitMode: Union[str, "TextSplitMode"] @@ -3705,8 +3698,8 @@ class McpServerSplitOutputParsing(TypedDict, total=False): :ivar kind: The discriminator value. Required. Split the output into pages using the configured split parameters. :vartype kind: Literal[McpServerOutputParsingKind.SPLIT] - :ivar split_parameters: Parameters for split output parsing. - :vartype split_parameters: "McpServerOutputParsingSplitParameters" + :ivar splitParameters: Parameters for split output parsing. + :vartype splitParameters: "McpServerOutputParsingSplitParameters" """ kind: Required[Literal[McpServerOutputParsingKind.SPLIT]] @@ -3721,8 +3714,8 @@ class McpServerStoredHeadersAuthentication(TypedDict, total=False): :ivar kind: The discriminator value. Required. Authenticate using stored HTTP headers. :vartype kind: Literal[McpServerAuthenticationKind.STORED_HEADERS] - :ivar stored_headers_parameters: Parameters for stored headers authentication. Required. - :vartype stored_headers_parameters: "McpServerStoredHeadersParameters" + :ivar storedHeadersParameters: Parameters for stored headers authentication. Required. + :vartype storedHeadersParameters: "McpServerStoredHeadersParameters" """ kind: Required[Literal[McpServerAuthenticationKind.STORED_HEADERS]] @@ -3747,14 +3740,14 @@ class McpServerTool(TypedDict, total=False): :ivar name: The name of the MCP tool to invoke. :vartype name: str - :ivar output_parsing: Optional configuration for parsing the tool's output. - :vartype output_parsing: "McpServerOutputParsing" - :ivar results_processing: Controls whether the parsed results from this tool are reranked. + :ivar outputParsing: Optional configuration for parsing the tool's output. + :vartype outputParsing: "McpServerOutputParsing" + :ivar resultsProcessing: Controls whether the parsed results from this tool are reranked. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_tokens: Optional post-parsing token cap for this tool's output. Must be - greater than 0 when specified. - :vartype max_output_tokens: int + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputTokens: Optional post-parsing token cap for this tool's output. Must be greater + than 0 when specified. + :vartype maxOutputTokens: int """ name: str @@ -3801,15 +3794,15 @@ class McpServerTool(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is an +:ivar insertPreTag: The tag indicates the start of the merged text. By default, the tag is an empty space. -:vartype insert_pre_tag: str -:ivar insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an +:vartype insertPreTag: str +:ivar insertPostTag: The tag indicates the end of the merged text. By default, the tag is an empty space. -:vartype insert_post_tag: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype insertPostTag: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.MergeSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.MergeSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.MergeSkill"] """ @@ -3830,14 +3823,14 @@ class McpServerTool(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Tokens longer than the maximum length are +:ivar maxTokenLength: The maximum token length. Tokens longer than the maximum length are split. Maximum token length that can be used is 300 characters. Tokens longer than 300 characters are first split into tokens of length 300 and then each of those tokens is split based on the max token length set. Default is 255. -:vartype max_token_length: int -:ivar is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as +:vartype maxTokenLength: int +:ivar isSearchTokenizer: A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. -:vartype is_search_tokenizer: bool +:vartype isSearchTokenizer: bool :ivar language: The language to use. The default is English. Known values are: "arabic", "bangla", "bulgarian", "catalan", "croatian", "czech", "danish", "dutch", "english", "estonian", "finnish", "french", "german", "greek", "gujarati", "hebrew", "hindi", "hungarian", @@ -3846,9 +3839,9 @@ class McpServerTool(TypedDict, total=False): "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", "swedish", "tamil", "telugu", "turkish", "ukrainian", and "urdu". :vartype language: Union[str, "MicrosoftStemmingTokenizerLanguage"] -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"] """ @@ -3869,14 +3862,14 @@ class McpServerTool(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Tokens longer than the maximum length are +:ivar maxTokenLength: The maximum token length. Tokens longer than the maximum length are split. Maximum token length that can be used is 300 characters. Tokens longer than 300 characters are first split into tokens of length 300 and then each of those tokens is split based on the max token length set. Default is 255. -:vartype max_token_length: int -:ivar is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as +:vartype maxTokenLength: int +:ivar isSearchTokenizer: A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. -:vartype is_search_tokenizer: bool +:vartype isSearchTokenizer: bool :ivar language: The language to use. The default is English. Known values are: "bangla", "bulgarian", "catalan", "chineseSimplified", "chineseTraditional", "croatian", "czech", "danish", "dutch", "english", "french", "german", "greek", "gujarati", "hindi", "icelandic", @@ -3885,9 +3878,9 @@ class McpServerTool(TypedDict, total=False): "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", "telugu", "thai", "ukrainian", "urdu", and "vietnamese". :vartype language: Union[str, "MicrosoftTokenizerLanguage"] -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"] """ @@ -3901,10 +3894,10 @@ class McpServerTool(TypedDict, total=False): NativeBlobSoftDeleteDeletionDetectionPolicy.__doc__ = """Defines a data deletion detection policy utilizing Azure Blob Storage's native soft delete feature for deletion detection. -:ivar odata_type: A URI fragment specifying the type of data deletion detection policy. +:ivar @odata.type: A URI fragment specifying the type of data deletion detection policy. Required. Default value is "#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy". -:vartype odata_type: +:vartype @odata.type: Literal["#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy"] """ @@ -3925,14 +3918,13 @@ class McpServerTool(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_gram: The minimum n-gram length. Default is 1. Must be less than the value of - maxGram. -:vartype min_gram: int -:ivar max_gram: The maximum n-gram length. Default is 2. -:vartype max_gram: int -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar minGram: The minimum n-gram length. Default is 1. Must be less than the value of maxGram. +:vartype minGram: int +:ivar maxGram: The maximum n-gram length. Default is 2. +:vartype maxGram: int +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.NGramTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.NGramTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.NGramTokenFilter"] """ @@ -3952,14 +3944,14 @@ class McpServerTool(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the +:ivar minGram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram. -:vartype min_gram: int -:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. -:vartype max_gram: int -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype minGram: int +:ivar maxGram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype maxGram: int +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.NGramTokenFilterV2". -:vartype odata_type: Literal["#Microsoft.Azure.Search.NGramTokenFilterV2"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.NGramTokenFilterV2"] """ @@ -3981,16 +3973,16 @@ class McpServerTool(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the +:ivar minGram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram. -:vartype min_gram: int -:ivar max_gram: The maximum n-gram length. Default is 2. Maximum is 300. -:vartype max_gram: int -:ivar token_chars: Character classes to keep in the tokens. -:vartype token_chars: list[Union[str, "TokenCharacterKind"]] -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:vartype minGram: int +:ivar maxGram: The maximum n-gram length. Default is 2. Maximum is 300. +:vartype maxGram: int +:ivar tokenChars: Character classes to keep in the tokens. +:vartype tokenChars: list[Union[str, "TokenCharacterKind"]] +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.NGramTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.NGramTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.NGramTokenizer"] """ @@ -4027,7 +4019,7 @@ class McpServerTool(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "af", "sq", "anp", "ar", "ast", "awa", "az", "bfy", "eu", "be", "be-cyrl", "be-latn", "bho", "bi", "brx", "bs", "bra", "br", "bg", "bns", "bua", "ca", "ceb", "rab", "ch", "hne", "zh-Hans", "zh-Hant", "kw", "co", "crh", "hr", "cs", "da", "prs", "dhi", "doi", "nl", @@ -4041,17 +4033,17 @@ class McpServerTool(TypedDict, total=False): "gd", "sr", "sr-Cyrl", "sr-Latn", "xsr", "srx", "sms", "sk", "sl", "so", "sma", "es", "sw", "sv", "tg", "tt", "tet", "thf", "to", "tr", "tk", "tyv", "hsb", "ur", "ug", "uz-arab", "uz-cyrl", "uz", "vo", "wae", "cy", "fy", "yua", "za", "zu", and "unk". -:vartype default_language_code: Union[str, "OcrSkillLanguage"] -:ivar should_detect_orientation: A value indicating to turn orientation detection on or not. - Default is false. -:vartype should_detect_orientation: bool -:ivar line_ending: Defines the sequence of characters to use between the lines of text +:vartype defaultLanguageCode: Union[str, "OcrSkillLanguage"] +:ivar detectOrientation: A value indicating to turn orientation detection on or not. Default is + false. +:vartype detectOrientation: bool +:ivar lineEnding: Defines the sequence of characters to use between the lines of text recognized by the OCR skill. The default value is "space". Known values are: "space", "carriageReturn", "lineFeed", and "carriageReturnLineFeed". -:vartype line_ending: Union[str, "OcrLineEnding"] -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype lineEnding: Union[str, "OcrLineEnding"] +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Vision.OcrSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Vision.OcrSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Vision.OcrSkill"] """ @@ -4060,8 +4052,8 @@ class OutputFieldMappingEntry(TypedDict, total=False): :ivar name: The name of the output defined by the skill. Required. :vartype name: str - :ivar target_name: The target name of the output. It is optional and default to name. - :vartype target_name: str + :ivar targetName: The target name of the output. It is optional and default to name. + :vartype targetName: str """ name: Required[str] @@ -4093,16 +4085,16 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype delimiter: str :ivar replacement: A value that, if set, replaces the delimiter character. Default is "/". :vartype replacement: str -:ivar max_token_length: The maximum token length. Default and maximum is 300. -:vartype max_token_length: int -:ivar reverse_token_order: A value indicating whether to generate tokens in reverse order. - Default is false. -:vartype reverse_token_order: bool -:ivar number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. -:vartype number_of_tokens_to_skip: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar maxTokenLength: The maximum token length. Default and maximum is 300. +:vartype maxTokenLength: int +:ivar reverse: A value indicating whether to generate tokens in reverse order. Default is + false. +:vartype reverse: bool +:ivar skip: The number of initial tokens to skip. Default is 0. +:vartype skip: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.PathHierarchyTokenizerV2". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PathHierarchyTokenizerV2"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PathHierarchyTokenizerV2"] """ @@ -4125,9 +4117,8 @@ class OutputFieldMappingEntry(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar lower_case_terms: A value indicating whether terms should be lower-cased. Default is - true. -:vartype lower_case_terms: bool +:ivar lowercase: A value indicating whether terms should be lower-cased. Default is true. +:vartype lowercase: bool :ivar pattern: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters. :vartype pattern: str @@ -4136,9 +4127,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype flags: list[Union[str, "RegexFlags"]] :ivar stopwords: A list of stopwords. :vartype stopwords: list[str] -:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is "#Microsoft.Azure.Search.PatternAnalyzer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternAnalyzer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternAnalyzer"] """ @@ -4161,12 +4152,12 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype name: str :ivar patterns: A list of patterns to match against each token. Required. :vartype patterns: list[str] -:ivar preserve_original: A value indicating whether to return the original token even if one of +:ivar preserveOriginal: A value indicating whether to return the original token even if one of the patterns matches. Default is true. -:vartype preserve_original: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype preserveOriginal: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.PatternCaptureTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternCaptureTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternCaptureTokenFilter"] """ @@ -4194,9 +4185,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype pattern: str :ivar replacement: The replacement text. Required. :vartype replacement: str -:ivar odata_type: A URI fragment specifying the type of char filter. Required. Default value is - "#Microsoft.Azure.Search.PatternReplaceCharFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternReplaceCharFilter"] +:ivar @odata.type: A URI fragment specifying the type of char filter. Required. Default value + is "#Microsoft.Azure.Search.PatternReplaceCharFilter". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternReplaceCharFilter"] """ @@ -4224,9 +4215,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype pattern: str :ivar replacement: The replacement text. Required. :vartype replacement: str -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.PatternReplaceTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternReplaceTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternReplaceTokenFilter"] """ @@ -4258,9 +4249,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. :vartype group: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.PatternTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PatternTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternTokenizer"] """ @@ -4284,12 +4275,12 @@ class OutputFieldMappingEntry(TypedDict, total=False): "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", and "beiderMorse". :vartype encoder: Union[str, "PhoneticEncoder"] -:ivar replace_original_tokens: A value indicating whether encoded tokens should replace - original tokens. If false, encoded tokens are added as synonyms. Default is true. -:vartype replace_original_tokens: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar replace: A value indicating whether encoded tokens should replace original tokens. If + false, encoded tokens are added as synonyms. Default is true. +:vartype replace: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.PhoneticTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.PhoneticTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.PhoneticTokenFilter"] """ @@ -4331,30 +4322,30 @@ class OutputFieldMappingEntry(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. -:vartype default_language_code: str -:ivar minimum_precision: A value between 0 and 1 that be used to only include entities whose +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. +:vartype defaultLanguageCode: str +:ivar minimumPrecision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. -:vartype minimum_precision: float -:ivar masking_mode: A parameter that provides various ways to mask the personal information +:vartype minimumPrecision: float +:ivar maskingMode: A parameter that provides various ways to mask the personal information detected in the input text. Default is 'none'. Known values are: "none" and "replace". -:vartype masking_mode: Union[str, "PIIDetectionSkillMaskingMode"] -:ivar mask: The character used to mask the text if the maskingMode parameter is set to replace. - Default is '*'. -:vartype mask: str -:ivar model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. -:vartype model_version: str -:ivar pii_categories: A list of PII entity categories that should be extracted and masked. -:vartype pii_categories: list[str] +:vartype maskingMode: Union[str, "PIIDetectionSkillMaskingMode"] +:ivar maskingCharacter: The character used to mask the text if the maskingMode parameter is set + to replace. Default is '*'. +:vartype maskingCharacter: str +:ivar modelVersion: The version of the model to use when calling the Text Analytics service. It + will default to the latest available when not specified. We recommend you do not specify this + value unless absolutely necessary. +:vartype modelVersion: str +:ivar piiCategories: A list of PII entity categories that should be extracted and masked. +:vartype piiCategories: list[str] :ivar domain: If specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'phi', 'none'. Default is 'none'. :vartype domain: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.PIIDetectionSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.PIIDetectionSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.PIIDetectionSkill"] """ @@ -4377,13 +4368,13 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -4391,27 +4382,27 @@ class OutputFieldMappingEntry(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: Required. A knowledge source that reads data from remote SharePoint. :vartype kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] -:ivar remote_share_point_parameters: The parameters for the remote SharePoint knowledge source. -:vartype remote_share_point_parameters: "RemoteSharePointKnowledgeSourceParameters" +:ivar remoteSharePointParameters: The parameters for the remote SharePoint knowledge source. +:vartype remoteSharePointParameters: "RemoteSharePointKnowledgeSourceParameters" """ class RemoteSharePointKnowledgeSourceParameters(TypedDict, total=False): # pylint: disable=name-too-long """Parameters for remote SharePoint knowledge source. - :ivar filter_expression: Keyword Query Language (KQL) expression with queryable SharePoint + :ivar filterExpression: Keyword Query Language (KQL) expression with queryable SharePoint properties and attributes to scope the retrieval before the query runs. - :vartype filter_expression: str - :ivar resource_metadata: 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. - :vartype resource_metadata: list[str] - :ivar container_type_id: Container ID for SharePoint Embedded connection. When this is null, it + :vartype filterExpression: str + :ivar resourceMetadata: 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. + :vartype resourceMetadata: list[str] + :ivar containerTypeId: Container ID for SharePoint Embedded connection. When this is null, it will use SharePoint Online. - :vartype container_type_id: str + :vartype containerTypeId: str """ filterExpression: str @@ -4428,19 +4419,19 @@ class RemoteSharePointKnowledgeSourceParameters(TypedDict, total=False): # pyli class RescoringOptions(TypedDict, total=False): """Contains the options for rescoring. - :ivar enable_rescoring: If set to true, after the initial search on the compressed vectors, the + :ivar enableRescoring: If set to true, after the initial search on the compressed vectors, the similarity scores are recalculated using the full-precision vectors. This will improve recall at the expense of latency. - :vartype enable_rescoring: bool - :ivar default_oversampling: Default oversampling factor. Oversampling retrieves a greater set - of potential documents to offset the resolution loss due to quantization. This increases the - set of results that will be rescored on full-precision vectors. Minimum value is 1, meaning no + :vartype enableRescoring: bool + :ivar defaultOversampling: Default oversampling factor. Oversampling retrieves a greater set of + potential documents to offset the resolution loss due to quantization. This increases the set + of results that will be rescored on full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be set when 'enableRescoring' is true. Higher values improve recall at the expense of latency. - :vartype default_oversampling: float - :ivar rescore_storage_method: Controls the storage method for original vectors. This setting is + :vartype defaultOversampling: float + :ivar rescoreStorageMethod: Controls the storage method for original vectors. This setting is immutable. Known values are: "preserveOriginals" and "discardOriginals". - :vartype rescore_storage_method: Union[str, "VectorSearchCompressionRescoreStorageMethod"] + :vartype rescoreStorageMethod: Union[str, "VectorSearchCompressionRescoreStorageMethod"] """ enableRescoring: Optional[bool] @@ -4462,19 +4453,19 @@ class ScalarQuantizationCompression(TypedDict, total=False): """Contains configuration options specific to the scalar quantization compression method used during indexing and querying. - :ivar compression_name: The name to associate with this particular configuration. Required. - :vartype compression_name: str - :ivar rescoring_options: Contains the options for rescoring. - :vartype rescoring_options: "RescoringOptions" - :ivar truncation_dimension: The number of dimensions to truncate the vectors to. Truncating the + :ivar name: The name to associate with this particular configuration. Required. + :vartype name: str + :ivar rescoringOptions: Contains the options for rescoring. + :vartype rescoringOptions: "RescoringOptions" + :ivar truncationDimension: The number of dimensions to truncate the vectors to. Truncating the vectors reduces the size of the vectors and the amount of data that needs to be transferred during search. This can save storage cost and improve search performance at the expense of recall. It should be only used for embeddings trained with Matryoshka Representation Learning (MRL) such as OpenAI text-embedding-3-large (small). The default value is null, which means no truncation. - :vartype truncation_dimension: int - :ivar parameters: Contains the parameters specific to Scalar Quantization. - :vartype parameters: "ScalarQuantizationParameters" + :vartype truncationDimension: int + :ivar scalarQuantizationParameters: Contains the parameters specific to Scalar Quantization. + :vartype scalarQuantizationParameters: "ScalarQuantizationParameters" :ivar kind: The name of the kind of compression method being configured for use with vector search. Required. Scalar Quantization, a type of compression method. In scalar quantization, the original vectors values are compressed to a narrower type by discretizing and representing @@ -4506,8 +4497,8 @@ class ScalarQuantizationCompression(TypedDict, total=False): class ScalarQuantizationParameters(TypedDict, total=False): """Contains the parameters specific to Scalar Quantization. - :ivar quantized_data_type: The quantized data type of compressed vector values. "int8" - :vartype quantized_data_type: Union[str, "VectorSearchCompressionTarget"] + :ivar quantizedDataType: The quantized data type of compressed vector values. "int8" + :vartype quantizedDataType: Union[str, "VectorSearchCompressionTarget"] """ quantizedDataType: Optional[Union[str, "VectorSearchCompressionTarget"]] @@ -4519,15 +4510,14 @@ class ScoringProfile(TypedDict, total=False): :ivar name: The name of the scoring profile. Required. :vartype name: str - :ivar text_weights: Parameters that boost scoring based on text matches in certain index - fields. - :vartype text_weights: "TextWeights" + :ivar text: Parameters that boost scoring based on text matches in certain index fields. + :vartype text: "TextWeights" :ivar functions: The collection of functions that influence the scoring of documents. :vartype functions: list["ScoringFunction"] - :ivar function_aggregation: A value indicating how the results of individual scoring functions + :ivar functionAggregation: A value indicating how the results of individual scoring functions should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Known values are: "sum", "average", "minimum", "maximum", "firstMatching", and "product". - :vartype function_aggregation: Union[str, "ScoringFunctionAggregation"] + :vartype functionAggregation: Union[str, "ScoringFunctionAggregation"] """ name: Required[str] @@ -4559,8 +4549,8 @@ class ScoringProfile(TypedDict, total=False): :ivar indexes: The name of the index this alias maps to. Only one index name may be specified. Required. :vartype indexes: list[str] -:ivar e_tag: The ETag of the alias. -:vartype e_tag: str +:ivar @odata.etag: The ETag of the alias. +:vartype @odata.etag: str """ @@ -4632,24 +4622,24 @@ class SearchField(TypedDict, total=False): Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple fields. :vartype facetable: bool - :ivar permission_filter: A value indicating whether the field should be used as a permission + :ivar permissionFilter: A value indicating whether the field should be used as a permission filter. Known values are: "userIds", "groupIds", and "rbacScope". - :vartype permission_filter: Union[str, "PermissionFilter"] - :ivar sensitivity_label_id: A value indicating whether the field should be used for sensitivity + :vartype permissionFilter: Union[str, "PermissionFilter"] + :ivar sensitivityLabelId: 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. - :vartype sensitivity_label_id: bool - :ivar sensitivity_label_name: A value indicating whether the field contains the name of a + :vartype sensitivityLabelId: bool + :ivar sensitivityLabelName: A value indicating whether the field contains the name of a Microsoft Purview sensitivity label applied to the document. - :vartype sensitivity_label_name: bool - :ivar source_document_id: A value indicating whether the field contains the source document + :vartype sensitivityLabelName: bool + :ivar sourceDocumentId: A value indicating whether the field contains the source document identifier used for Purview audit tracking. - :vartype source_document_id: bool - :ivar sharepoint_site_url: A value indicating whether the field contains a SharePoint site URL + :vartype sourceDocumentId: bool + :ivar sharepointSiteUrl: A value indicating whether the field contains a SharePoint site URL used for SharePoint group-based filtering. - :vartype sharepoint_site_url: bool - :ivar analyzer_name: The name of the analyzer to use for the field. This option can be used - only with searchable fields and it can't be set together with either searchAnalyzer or + :vartype sharepointSiteUrl: bool + :ivar analyzer: The name of the analyzer to use for the field. This option can be used only + with searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Known values are: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", @@ -4668,11 +4658,11 @@ class SearchField(TypedDict, total=False): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", and "whitespace". - :vartype analyzer_name: Union[str, "LexicalAnalyzerName"] - :ivar search_analyzer_name: The name of the analyzer used at search time for the field. This - option can be used only with searchable fields. It must be set together with indexAnalyzer and - it cannot be set together with the analyzer option. This property cannot be set to the name of - a language analyzer; use the analyzer property instead if you need a language analyzer. This + :vartype analyzer: Union[str, "LexicalAnalyzerName"] + :ivar searchAnalyzer: The name of the analyzer used at search time for the field. This option + can be used only with searchable fields. It must be set together with indexAnalyzer and it + cannot be set together with the analyzer option. This property cannot be set to the name of a + language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields. Known values are: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", @@ -4691,13 +4681,13 @@ class SearchField(TypedDict, total=False): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", and "whitespace". - :vartype search_analyzer_name: Union[str, "LexicalAnalyzerName"] - :ivar index_analyzer_name: The name of the analyzer used at indexing time for the field. This - option can be used only with searchable fields. It must be set together with searchAnalyzer and - it cannot be set together with the analyzer option. This property cannot be set to the name of - a language analyzer; use the analyzer property instead if you need a language analyzer. Once - the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. - Known values are: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", + :vartype searchAnalyzer: Union[str, "LexicalAnalyzerName"] + :ivar indexAnalyzer: The name of the analyzer used at indexing time for the field. This option + can be used only with searchable fields. It must be set together with searchAnalyzer and it + cannot be set together with the analyzer option. This property cannot be set to the name of a + language analyzer; use the analyzer property instead if you need a language analyzer. Once the + analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Known + values are: "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", @@ -4714,25 +4704,25 @@ class SearchField(TypedDict, total=False): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", and "whitespace". - :vartype index_analyzer_name: Union[str, "LexicalAnalyzerName"] - :ivar normalizer_name: The name of the normalizer to use for the field. This option can be used - only with fields with filterable, sortable, or facetable enabled. Once the normalizer is - chosen, it cannot be changed for the field. Must be null for complex fields. Known values are: + :vartype indexAnalyzer: Union[str, "LexicalAnalyzerName"] + :ivar normalizer: The name of the normalizer to use for the field. This option can be used only + with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it + cannot be changed for the field. Must be null for complex fields. Known values are: "asciifolding", "elision", "lowercase", "standard", and "uppercase". - :vartype normalizer_name: Union[str, "LexicalNormalizerName"] - :ivar vector_search_dimensions: The dimensionality of the vector field. - :vartype vector_search_dimensions: int - :ivar vector_search_profile_name: The name of the vector search profile that specifies the - algorithm and vectorizer to use when searching the vector field. - :vartype vector_search_profile_name: str - :ivar vector_encoding_format: The encoding format to interpret the field contents. "packedBit" - :vartype vector_encoding_format: Union[str, "VectorEncodingFormat"] - :ivar synonym_map_names: A list of the names of synonym maps to associate with this field. This + :vartype normalizer: Union[str, "LexicalNormalizerName"] + :ivar dimensions: The dimensionality of the vector field. + :vartype dimensions: int + :ivar vectorSearchProfile: The name of the vector search profile that specifies the algorithm + and vectorizer to use when searching the vector field. + :vartype vectorSearchProfile: str + :ivar vectorEncoding: The encoding format to interpret the field contents. "packedBit" + :vartype vectorEncoding: Union[str, "VectorEncodingFormat"] + :ivar synonymMaps: A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using the rules in the synonym map. This attribute can be changed on existing fields. Must be null or an empty collection for complex fields. - :vartype synonym_map_names: list[str] + :vartype synonymMaps: list[str] :ivar fields: A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. :vartype fields: list["SearchField"] @@ -4948,27 +4938,27 @@ class SearchField(TypedDict, total=False): :vartype description: str :ivar fields: The fields of the index. Required. :vartype fields: list["SearchField"] -:ivar scoring_profiles: The scoring profiles for the index. -:vartype scoring_profiles: list["ScoringProfile"] -:ivar default_scoring_profile: The name of the scoring profile to use if none is specified in - the query. If this property is not set and no scoring profile is specified in the query, then +:ivar scoringProfiles: The scoring profiles for the index. +:vartype scoringProfiles: list["ScoringProfile"] +:ivar defaultScoringProfile: The name of the scoring profile to use if none is specified in the + query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used. -:vartype default_scoring_profile: str -:ivar cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. -:vartype cors_options: "CorsOptions" +:vartype defaultScoringProfile: str +:ivar corsOptions: Options to control Cross-Origin Resource Sharing (CORS) for the index. +:vartype corsOptions: "CorsOptions" :ivar suggesters: The suggesters for the index. :vartype suggesters: list["SearchSuggester"] :ivar analyzers: The analyzers for the index. :vartype analyzers: list["LexicalAnalyzer"] :ivar tokenizers: The tokenizers for the index. :vartype tokenizers: list["LexicalTokenizer"] -:ivar token_filters: The token filters for the index. -:vartype token_filters: list["TokenFilter"] -:ivar char_filters: The character filters for the index. -:vartype char_filters: list["CharFilter"] +:ivar tokenFilters: The token filters for the index. +:vartype tokenFilters: list["TokenFilter"] +:ivar charFilters: The character filters for the index. +:vartype charFilters: list["CharFilter"] :ivar normalizers: The normalizers for the index. :vartype normalizers: list["LexicalNormalizer"] -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data. Once you have encrypted your data, it will always remain encrypted. The search service will ignore attempts @@ -4976,28 +4966,27 @@ class SearchField(TypedDict, total=False): encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar similarity: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. :vartype similarity: "SimilarityAlgorithm" -:ivar semantic_search: Defines parameters for a search index that influence semantic - capabilities. -:vartype semantic_search: "SemanticSearch" -:ivar vector_search: Contains configuration options related to vector search. -:vartype vector_search: "VectorSearch" -:ivar permission_filter_option: A value indicating whether permission filtering is enabled for +:ivar semantic: Defines parameters for a search index that influence semantic capabilities. +:vartype semantic: "SemanticSearch" +:ivar vectorSearch: Contains configuration options related to vector search. +:vartype vectorSearch: "VectorSearch" +:ivar permissionFilterOption: A value indicating whether permission filtering is enabled for the index. Known values are: "enabled" and "disabled". -:vartype permission_filter_option: Union[str, "SearchIndexPermissionFilterOption"] -:ivar purview_enabled: A value indicating whether Purview is enabled for the index. -:vartype purview_enabled: bool -:ivar share_point_connector_app_registration: Configures a SharePoint connector app - registration for the index, enabling document-level permissions from SharePoint. If provided, - the applicationId and federatedCredentialId properties are required. -:vartype share_point_connector_app_registration: "SharePointConnectorAppRegistration" -:ivar e_tag: The ETag of the index. -:vartype e_tag: str +:vartype permissionFilterOption: Union[str, "SearchIndexPermissionFilterOption"] +:ivar purviewEnabled: A value indicating whether Purview is enabled for the index. +:vartype purviewEnabled: bool +:ivar sharePointConnectorAppRegistration: Configures a SharePoint connector app registration + for the index, enabling document-level permissions from SharePoint. If provided, the + applicationId and federatedCredentialId properties are required. +:vartype sharePointConnectorAppRegistration: "SharePointConnectorAppRegistration" +:ivar @odata.etag: The ETag of the index. +:vartype @odata.etag: str """ @@ -5026,28 +5015,27 @@ class SearchField(TypedDict, total=False): :vartype name: str :ivar description: The description of the indexer. :vartype description: str -:ivar data_source_name: The name of the datasource from which this indexer reads data. - Required. -:vartype data_source_name: str -:ivar skillset_name: The name of the skillset executing with this indexer. -:vartype skillset_name: str -:ivar target_index_name: The name of the index to which this indexer writes data. Required. -:vartype target_index_name: str +:ivar dataSourceName: The name of the datasource from which this indexer reads data. Required. +:vartype dataSourceName: str +:ivar skillsetName: The name of the skillset executing with this indexer. +:vartype skillsetName: str +:ivar targetIndexName: The name of the index to which this indexer writes data. Required. +:vartype targetIndexName: str :ivar schedule: The schedule for this indexer. :vartype schedule: "IndexingSchedule" :ivar parameters: Parameters for indexer execution. :vartype parameters: "IndexingParameters" -:ivar field_mappings: Defines mappings between fields in the data source and corresponding +:ivar fieldMappings: Defines mappings between fields in the data source and corresponding target fields in the index. -:vartype field_mappings: list["FieldMapping"] -:ivar output_field_mappings: Output field mappings are applied after enrichment and immediately +:vartype fieldMappings: list["FieldMapping"] +:ivar outputFieldMappings: Output field mappings are applied after enrichment and immediately before indexing. -:vartype output_field_mappings: list["FieldMapping"] -:ivar is_disabled: A value indicating whether the indexer is disabled. Default is false. -:vartype is_disabled: bool -:ivar e_tag: The ETag of the indexer. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype outputFieldMappings: list["FieldMapping"] +:ivar disabled: A value indicating whether the indexer is disabled. Default is false. +:vartype disabled: bool +:ivar @odata.etag: The ETag of the indexer. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your indexer definition (as well as indexer execution status) when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your indexer definition, it will @@ -5056,7 +5044,7 @@ class SearchField(TypedDict, total=False): definition (and indexer execution status) will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar cache: Adds caching to an enrichment pipeline to allow for incremental modification steps without having to rebuild the index every time. :vartype cache: "SearchIndexerCache" @@ -5068,11 +5056,11 @@ class SearchIndexerCache(TypedDict, total=False): :ivar id: A guid for the SearchIndexerCache. :vartype id: str - :ivar storage_connection_string: The connection string to the storage account where the cache + :ivar storageConnectionString: The connection string to the storage account where the cache data will be persisted. - :vartype storage_connection_string: str - :ivar enable_reprocessing: Specifies whether incremental reprocessing is enabled. - :vartype enable_reprocessing: bool + :vartype storageConnectionString: str + :ivar enableReprocessing: Specifies whether incremental reprocessing is enabled. + :vartype enableReprocessing: bool :ivar identity: 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 @@ -5124,9 +5112,9 @@ class SearchIndexerDataContainer(TypedDict, total=False): ) SearchIndexerDataNoneIdentity.__doc__ = """Clears the identity property of a datasource. -:ivar odata_type: The discriminator for derived types. Required. Default value is +:ivar @odata.type: The discriminator for derived types. Required. Default value is "#Microsoft.Azure.Search.DataNoneIdentity". -:vartype odata_type: Literal["#Microsoft.Azure.Search.DataNoneIdentity"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.DataNoneIdentity"] """ @@ -5157,9 +5145,9 @@ class SearchIndexerDataContainer(TypedDict, total=False): :ivar type: The type of the datasource. Required. Known values are: "azuresql", "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2", "onelake", and "sharepoint". :vartype type: Union[str, "SearchIndexerDataSourceType"] -:ivar sub_type: A specific type of the data source, in case the resource is capable of - different modalities. For example, 'MongoDb' for certain 'cosmosDb' accounts. -:vartype sub_type: str +:ivar subType: A specific type of the data source, in case the resource is capable of different + modalities. For example, 'MongoDb' for certain 'cosmosDb' accounts. +:vartype subType: str :ivar credentials: Credentials for the datasource. Required. :vartype credentials: "DataSourceCredentials" :ivar container: The data container for the datasource. Required. @@ -5169,15 +5157,15 @@ class SearchIndexerDataContainer(TypedDict, total=False): not specified, the value remains unchanged. If "none" is specified, the value of this property is cleared. :vartype identity: "SearchIndexerDataIdentity" -:ivar indexer_permission_options: Ingestion options with various types of permission data. -:vartype indexer_permission_options: list[Union[str, "IndexerPermissionOption"]] -:ivar data_change_detection_policy: The data change detection policy for the datasource. -:vartype data_change_detection_policy: "DataChangeDetectionPolicy" -:ivar data_deletion_detection_policy: The data deletion detection policy for the datasource. -:vartype data_deletion_detection_policy: "DataDeletionDetectionPolicy" -:ivar e_tag: The ETag of the data source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:ivar indexerPermissionOptions: Ingestion options with various types of permission data. +:vartype indexerPermissionOptions: list[Union[str, "IndexerPermissionOption"]] +:ivar dataChangeDetectionPolicy: The data change detection policy for the datasource. +:vartype dataChangeDetectionPolicy: "DataChangeDetectionPolicy" +:ivar dataDeletionDetectionPolicy: The data deletion detection policy for the datasource. +:vartype dataDeletionDetectionPolicy: "DataDeletionDetectionPolicy" +:ivar @odata.etag: The ETag of the data source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your datasource definition when you want full assurance that no one, not even Microsoft, can decrypt your data source definition. Once you have encrypted your data source definition, it will always remain @@ -5185,7 +5173,7 @@ class SearchIndexerDataContainer(TypedDict, total=False): this property as needed if you want to rotate your encryption key; Your datasource definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" """ @@ -5200,18 +5188,18 @@ class SearchIndexerDataContainer(TypedDict, total=False): ) SearchIndexerDataUserAssignedIdentity.__doc__ = """Specifies the identity for a datasource to use. -:ivar resource_id: The fully qualified Azure resource Id of a user assigned managed identity - typically in the form +:ivar userAssignedIdentity: The fully qualified Azure resource Id of a user assigned managed + identity typically in the form "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" that should have been assigned to the search service. Required. -:vartype resource_id: str -:ivar odata_type: A URI fragment specifying the type of identity. Required. Default value is +:vartype userAssignedIdentity: str +:ivar @odata.type: A URI fragment specifying the type of identity. Required. Default value is "#Microsoft.Azure.Search.DataUserAssignedIdentity". -:vartype odata_type: Literal["#Microsoft.Azure.Search.DataUserAssignedIdentity"] -:ivar federated_identity_client_id: Multi-tenant User-Assigned Managed Identity Support: The +:vartype @odata.type: Literal["#Microsoft.Azure.Search.DataUserAssignedIdentity"] +:ivar federatedIdentityClientId: Multi-tenant User-Assigned Managed Identity Support: The client id of the multi-tentant App that has been configured to federate with the user-assigned managed identity. -:vartype federated_identity_client_id: str +:vartype federatedIdentityClientId: str """ @@ -5235,15 +5223,15 @@ class SearchIndexerIndexProjection(TypedDict, total=False): class SearchIndexerIndexProjectionSelector(TypedDict, total=False): """Description for what data to store in the designated search index. - :ivar target_index_name: Name of the search index to project to. Must have a key field with the + :ivar targetIndexName: Name of the search index to project to. Must have a key field with the 'keyword' analyzer set. Required. - :vartype target_index_name: str - :ivar parent_key_field_name: Name of the field in the search index to map the parent document's + :vartype targetIndexName: str + :ivar parentKeyFieldName: Name of the field in the search index to map the parent document's key value to. Must be a string field that is filterable and not the key field. Required. - :vartype parent_key_field_name: str - :ivar source_context: Source context for the projections. Represents the cardinality at which + :vartype parentKeyFieldName: str + :ivar sourceContext: Source context for the projections. Represents the cardinality at which the document will be split into multiple sub documents. Required. - :vartype source_context: str + :vartype sourceContext: str :ivar mappings: Mappings for the projection, or which source should be mapped to which field in the target index. Required. :vartype mappings: list["InputFieldMappingEntry"] @@ -5267,9 +5255,9 @@ class SearchIndexerIndexProjectionsParameters(TypedDict, total=False): """A dictionary of index projection-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :ivar projection_mode: Defines behavior of the index projections in relation to the rest of the + :ivar projectionMode: Defines behavior of the index projections in relation to the rest of the indexer. Known values are: "skipIndexingParentDocuments" and "includeIndexingParentDocuments". - :vartype projection_mode: Union[str, "IndexProjectionMode"] + :vartype projectionMode: Union[str, "IndexProjectionMode"] """ projectionMode: Union[str, "IndexProjectionMode"] @@ -5280,9 +5268,9 @@ class SearchIndexerIndexProjectionsParameters(TypedDict, total=False): class SearchIndexerKnowledgeStore(TypedDict, total=False): """Definition of additional projections to azure blob, table, or files, of enriched data. - :ivar storage_connection_string: The connection string to the storage account projections will - be stored in. Required. - :vartype storage_connection_string: str + :ivar storageConnectionString: The connection string to the storage account projections will be + stored in. Required. + :vartype storageConnectionString: str :ivar projections: A list of additional projections to perform during indexing. Required. :vartype projections: list["SearchIndexerKnowledgeStoreProjection"] :ivar identity: The user-assigned managed identity used for connections to Azure Storage when @@ -5314,14 +5302,14 @@ class SearchIndexerKnowledgeStore(TypedDict, total=False): class SearchIndexerKnowledgeStoreProjectionSelector(TypedDict, total=False): # pylint: disable=name-too-long """Abstract class to share properties between concrete selectors. - :ivar reference_key_name: Name of reference key to different projection. - :vartype reference_key_name: str - :ivar generated_key_name: Name of generated key to store projection under. - :vartype generated_key_name: str + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str + :ivar generatedKeyName: Name of generated key to store projection under. + :vartype generatedKeyName: str :ivar source: Source data to project. :vartype source: str - :ivar source_context: Source context for complex projections. - :vartype source_context: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str :ivar inputs: Nested inputs for complex projections. :vartype inputs: list["InputFieldMappingEntry"] """ @@ -5343,18 +5331,18 @@ class SearchIndexerKnowledgeStoreBlobProjectionSelector( ): # pylint: disable=name-too-long """Abstract class to share properties between concrete selectors. - :ivar reference_key_name: Name of reference key to different projection. - :vartype reference_key_name: str - :ivar generated_key_name: Name of generated key to store projection under. - :vartype generated_key_name: str + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str + :ivar generatedKeyName: Name of generated key to store projection under. + :vartype generatedKeyName: str :ivar source: Source data to project. :vartype source: str - :ivar source_context: Source context for complex projections. - :vartype source_context: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str :ivar inputs: Nested inputs for complex projections. :vartype inputs: list["InputFieldMappingEntry"] - :ivar storage_container: Blob container to store projections in. Required. - :vartype storage_container: str + :ivar storageContainer: Blob container to store projections in. Required. + :vartype storageContainer: str """ storageContainer: Required[str] @@ -5366,18 +5354,18 @@ class SearchIndexerKnowledgeStoreFileProjectionSelector( ): # pylint: disable=name-too-long """Projection definition for what data to store in Azure Files. - :ivar reference_key_name: Name of reference key to different projection. - :vartype reference_key_name: str - :ivar generated_key_name: Name of generated key to store projection under. - :vartype generated_key_name: str + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str + :ivar generatedKeyName: Name of generated key to store projection under. + :vartype generatedKeyName: str :ivar source: Source data to project. :vartype source: str - :ivar source_context: Source context for complex projections. - :vartype source_context: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str :ivar inputs: Nested inputs for complex projections. :vartype inputs: list["InputFieldMappingEntry"] - :ivar storage_container: Blob container to store projections in. Required. - :vartype storage_container: str + :ivar storageContainer: Blob container to store projections in. Required. + :vartype storageContainer: str """ @@ -5386,18 +5374,18 @@ class SearchIndexerKnowledgeStoreObjectProjectionSelector( ): # pylint: disable=name-too-long """Projection definition for what data to store in Azure Blob. - :ivar reference_key_name: Name of reference key to different projection. - :vartype reference_key_name: str - :ivar generated_key_name: Name of generated key to store projection under. - :vartype generated_key_name: str + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str + :ivar generatedKeyName: Name of generated key to store projection under. + :vartype generatedKeyName: str :ivar source: Source data to project. :vartype source: str - :ivar source_context: Source context for complex projections. - :vartype source_context: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str :ivar inputs: Nested inputs for complex projections. :vartype inputs: list["InputFieldMappingEntry"] - :ivar storage_container: Blob container to store projections in. Required. - :vartype storage_container: str + :ivar storageContainer: Blob container to store projections in. Required. + :vartype storageContainer: str """ @@ -5405,9 +5393,9 @@ class SearchIndexerKnowledgeStoreParameters(TypedDict, total=False): """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. - :ivar synthesize_generated_key_name: Whether or not projections should synthesize a generated - key name if one isn't already present. - :vartype synthesize_generated_key_name: bool + :ivar synthesizeGeneratedKeyName: Whether or not projections should synthesize a generated key + name if one isn't already present. + :vartype synthesizeGeneratedKeyName: bool """ synthesizeGeneratedKeyName: bool @@ -5438,18 +5426,18 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector( ): # pylint: disable=name-too-long """Description for what data to store in Azure Tables. - :ivar reference_key_name: Name of reference key to different projection. - :vartype reference_key_name: str + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str :ivar source: Source data to project. :vartype source: str - :ivar source_context: Source context for complex projections. - :vartype source_context: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str :ivar inputs: Nested inputs for complex projections. :vartype inputs: list["InputFieldMappingEntry"] - :ivar generated_key_name: Name of generated key to store projection under. Required. - :vartype generated_key_name: str - :ivar table_name: Name of the Azure table to store projected data in. Required. - :vartype table_name: str + :ivar generatedKeyName: Name of generated key to store projection under. Required. + :vartype generatedKeyName: str + :ivar tableName: Name of the Azure table to store projected data in. Required. + :vartype tableName: str """ generatedKeyName: Required[str] @@ -5480,17 +5468,16 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector( :vartype description: str :ivar skills: A list of skills in the skillset. Required. :vartype skills: list["SearchIndexerSkill"] -:ivar cognitive_services_account: Details about the Azure AI service to be used when running - skills. -:vartype cognitive_services_account: "CognitiveServicesAccount" -:ivar knowledge_store: Definition of additional projections to Azure blob, table, or files, of +:ivar cognitiveServices: Details about the Azure AI service to be used when running skills. +:vartype cognitiveServices: "CognitiveServicesAccount" +:ivar knowledgeStore: Definition of additional projections to Azure blob, table, or files, of enriched data. -:vartype knowledge_store: "SearchIndexerKnowledgeStore" -:ivar index_projection: Definition of additional projections to secondary search index(es). -:vartype index_projection: "SearchIndexerIndexProjection" -:ivar e_tag: The ETag of the skillset. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype knowledgeStore: "SearchIndexerKnowledgeStore" +:ivar indexProjections: Definition of additional projections to secondary search index(es). +:vartype indexProjections: "SearchIndexerIndexProjection" +:ivar @odata.etag: The ETag of the skillset. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your skillset definition when you want full assurance that no one, not even Microsoft, can decrypt your skillset definition. Once you have encrypted your skillset definition, it will always remain @@ -5498,7 +5485,7 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector( this property as needed if you want to rotate your encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" """ @@ -5532,13 +5519,13 @@ class SearchIndexFieldReference(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -5546,26 +5533,26 @@ class SearchIndexFieldReference(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: Required. A knowledge source that reads data from a Search Index. :vartype kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] -:ivar search_index_parameters: The parameters for the knowledge source. Required. -:vartype search_index_parameters: "SearchIndexKnowledgeSourceParameters" +:ivar searchIndexParameters: The parameters for the knowledge source. Required. +:vartype searchIndexParameters: "SearchIndexKnowledgeSourceParameters" """ class SearchIndexKnowledgeSourceFieldValueBoost(TypedDict, total=False): # pylint: disable=name-too-long """A hint that boosts documents based on a field value. - :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + :ivar boostInstructions: Natural-language instructions that explain when and how to apply the boost. - :vartype boost_instructions: str + :vartype boostInstructions: str :ivar kind: The discriminator value. Required. Boost documents based on a field value. :vartype kind: Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE] :ivar field: The name of the search index field. Required. :vartype field: str - :ivar field_values: Representative values for the field. - :vartype field_values: list[str] + :ivar fieldValues: Representative values for the field. + :vartype fieldValues: list[str] :ivar boost: A multiplier for the document score. Must be a positive number not equal to 1.0. Required. :vartype boost: float @@ -5589,11 +5576,11 @@ class SearchIndexKnowledgeSourceFilterHint(TypedDict, total=False): :ivar field: The name of the filterable search index field. Required. :vartype field: str - :ivar field_values: Representative values for the field. Required. - :vartype field_values: list[str] - :ivar filter_instructions: Natural-language instructions that explain when and how to filter on + :ivar fieldValues: Representative values for the field. Required. + :vartype fieldValues: list[str] + :ivar filterInstructions: Natural-language instructions that explain when and how to filter on the field. - :vartype filter_instructions: str + :vartype filterInstructions: str """ field: Required[str] @@ -5607,14 +5594,14 @@ class SearchIndexKnowledgeSourceFilterHint(TypedDict, total=False): class SearchIndexKnowledgeSourceMultiWordExpressionBoost(TypedDict, total=False): # pylint: disable=name-too-long """A hint that boosts documents based on a multi-word expression. - :ivar boost_instructions: Natural-language instructions that explain when and how to apply the + :ivar boostInstructions: Natural-language instructions that explain when and how to apply the boost. - :vartype boost_instructions: str + :vartype boostInstructions: str :ivar kind: The discriminator value. Required. Boost documents based on a multi-word expression. :vartype kind: Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION] - :ivar field_values: Representative values for the boost. - :vartype field_values: list[str] + :ivar fieldValues: Representative values for the boost. + :vartype fieldValues: list[str] :ivar boost: A multiplier for the document score. Must be a positive number not equal to 1.0. Required. :vartype boost: float @@ -5633,22 +5620,22 @@ class SearchIndexKnowledgeSourceMultiWordExpressionBoost(TypedDict, total=False) class SearchIndexKnowledgeSourceParameters(TypedDict, total=False): """Parameters for search index knowledge source. - :ivar search_index_name: The name of the Search index. Required. - :vartype search_index_name: str - :ivar source_data_fields: Used to request additional fields for referenced source data. - :vartype source_data_fields: list["SearchIndexFieldReference"] - :ivar search_fields: Used to restrict which fields to search on the search index. - :vartype search_fields: list["SearchIndexFieldReference"] - :ivar semantic_configuration_name: Used to specify a different semantic configuration on the + :ivar searchIndexName: The name of the Search index. Required. + :vartype searchIndexName: str + :ivar sourceDataFields: Used to request additional fields for referenced source data. + :vartype sourceDataFields: list["SearchIndexFieldReference"] + :ivar searchFields: Used to restrict which fields to search on the search index. + :vartype searchFields: list["SearchIndexFieldReference"] + :ivar semanticConfigurationName: Used to specify a different semantic configuration on the target search index other than the default one. - :vartype semantic_configuration_name: str - :ivar base_filter: A default filter condition applied to the index at retrieval time (e.g., + :vartype semanticConfigurationName: str + :ivar baseFilter: A default filter condition applied to the index at retrieval time (e.g., 'State eq VA'). Can be overridden at query time via knowledge source runtime parameters. - :vartype base_filter: str - :ivar query_hints: Default hints that guide query planning toward useful filters and boosts for + :vartype baseFilter: str + :ivar queryHints: 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. - :vartype query_hints: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHints: "SearchIndexKnowledgeSourceQueryHints" """ searchIndexName: Required[str] @@ -5691,27 +5678,27 @@ class SearchResourceEncryptionKey(TypedDict, total=False): """A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest, such as indexes and synonym maps. - :ivar key_name: The name of your Azure Key Vault key to be used to encrypt your data at rest. - Required. - :vartype key_name: str - :ivar key_version: The version of your Azure Key Vault key to be used to encrypt your data at - rest. - :vartype key_version: str - :ivar vault_uri: The URI of your Azure Key Vault, also referred to as DNS name, that contains + :ivar keyVaultKeyName: The name of your Azure Key Vault key to be used to encrypt your data at + rest. Required. + :vartype keyVaultKeyName: str + :ivar keyVaultKeyVersion: The version of your Azure Key Vault key to be used to encrypt your + data at rest. + :vartype keyVaultKeyVersion: str + :ivar keyVaultUri: The URI of your Azure Key Vault, also referred to as DNS name, that contains the key to be used to encrypt your data at rest. An example URI might be ``https://my-keyvault-name.vault.azure.net``. Required. - :vartype vault_uri: str - :ivar access_credentials: Optional Azure Active Directory credentials used for accessing your + :vartype keyVaultUri: str + :ivar accessCredentials: Optional Azure Active Directory credentials used for accessing your Azure Key Vault. Not required if using managed identity instead. - :vartype access_credentials: "AzureActiveDirectoryApplicationCredentials" + :vartype accessCredentials: "AzureActiveDirectoryApplicationCredentials" :ivar identity: An explicit managed identity to use for this encryption key. If not specified and the access credentials property is null, the system-assigned managed identity is used. On update to the resource, if the explicit identity is unspecified, it remains unchanged. If "none" is specified, the value of this property is cleared. :vartype identity: "SearchIndexerDataIdentity" - :ivar is_service_level_key: An optional value indicating whether this key is a service-level - key. Default is false. - :vartype is_service_level_key: bool + :ivar isServiceLevelKey: An optional value indicating whether this key is a service-level key. + Default is false. + :vartype isServiceLevelKey: bool """ keyVaultKeyName: Required[str] @@ -5739,12 +5726,12 @@ class SearchSuggester(TypedDict, total=False): :ivar name: The name of the suggester. Required. :vartype name: str - :ivar search_mode: A value indicating the capabilities of the suggester. Required. Default - value is "analyzingInfixMatching". - :vartype search_mode: Literal["analyzingInfixMatching"] - :ivar source_fields: The list of field names to which the suggester applies. Each field must be + :ivar searchMode: A value indicating the capabilities of the suggester. Required. Default value + is "analyzingInfixMatching". + :vartype searchMode: Literal["analyzingInfixMatching"] + :ivar sourceFields: The list of field names to which the suggester applies. Each field must be searchable. Required. - :vartype source_fields: list[str] + :vartype sourceFields: list[str] """ name: Required[str] @@ -5762,16 +5749,16 @@ class SemanticConfiguration(TypedDict, total=False): :ivar name: The name of the semantic configuration. Required. :vartype name: str - :ivar prioritized_fields: Describes the title, content, and keyword fields to be used for + :ivar prioritizedFields: Describes the title, content, and keyword fields to be used for semantic ranking, captions, highlights, and answers. At least one of the three sub properties (titleField, prioritizedKeywordsFields and prioritizedContentFields) need to be set. Required. - :vartype prioritized_fields: "SemanticPrioritizedFields" - :ivar ranking_order: Specifies the score type to be used for the sort order of the search + :vartype prioritizedFields: "SemanticPrioritizedFields" + :ivar rankingOrder: Specifies the score type to be used for the sort order of the search results. Known values are: "BoostedRerankerScore" and "RerankerScore". - :vartype ranking_order: Union[str, "RankingOrder"] - :ivar flighting_opt_in: Determines which semantic or query rewrite models to use during model + :vartype rankingOrder: Union[str, "RankingOrder"] + :ivar flightingOptIn: Determines which semantic or query rewrite models to use during model flighting/upgrades. - :vartype flighting_opt_in: bool + :vartype flightingOptIn: bool """ name: Required[str] @@ -5790,8 +5777,8 @@ class SemanticConfiguration(TypedDict, total=False): class SemanticField(TypedDict, total=False): """A field that is used as part of the semantic configuration. - :ivar field_name: File name. Required. - :vartype field_name: str + :ivar fieldName: File name. Required. + :vartype fieldName: str """ fieldName: Required[str] @@ -5802,19 +5789,19 @@ class SemanticPrioritizedFields(TypedDict, total=False): """Describes the title, content, and keywords fields to be used for semantic ranking, captions, highlights, and answers. - :ivar title_field: Defines the title field to be used for semantic ranking, captions, + :ivar titleField: Defines the title field to be used for semantic ranking, captions, highlights, and answers. If you don't have a title field in your index, leave this blank. - :vartype title_field: "SemanticField" - :ivar content_fields: Defines the content fields to be used for semantic ranking, captions, - highlights, and answers. For the best result, the selected fields should contain text in - natural language form. The order of the fields in the array represents their priority. Fields - with lower priority may get truncated if the content is long. - :vartype content_fields: list["SemanticField"] - :ivar keywords_fields: Defines the keyword fields to be used for semantic ranking, captions, - highlights, and answers. For the best result, the selected fields should contain a list of - keywords. The order of the fields in the array represents their priority. Fields with lower - priority may get truncated if the content is long. - :vartype keywords_fields: list["SemanticField"] + :vartype titleField: "SemanticField" + :ivar prioritizedContentFields: Defines the content fields to be used for semantic ranking, + captions, highlights, and answers. For the best result, the selected fields should contain text + in natural language form. The order of the fields in the array represents their priority. + Fields with lower priority may get truncated if the content is long. + :vartype prioritizedContentFields: list["SemanticField"] + :ivar prioritizedKeywordsFields: Defines the keyword fields to be used for semantic ranking, + captions, highlights, and answers. For the best result, the selected fields should contain a + list of keywords. The order of the fields in the array represents their priority. Fields with + lower priority may get truncated if the content is long. + :vartype prioritizedKeywordsFields: list["SemanticField"] """ titleField: "SemanticField" @@ -5835,9 +5822,9 @@ class SemanticPrioritizedFields(TypedDict, total=False): class SemanticSearch(TypedDict, total=False): """Defines parameters for a search index that influence semantic capabilities. - :ivar default_configuration_name: Allows you to set the name of a default semantic - configuration in your index, making it optional to pass it on as a query parameter every time. - :vartype default_configuration_name: str + :ivar defaultConfiguration: Allows you to set the name of a default semantic configuration in + your index, making it optional to pass it on as a query parameter every time. + :vartype defaultConfiguration: str :ivar configurations: The semantic configurations for the index. :vartype configurations: list["SemanticConfiguration"] """ @@ -5884,21 +5871,21 @@ class SemanticSearch(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", "es", "sv", and "tr". -:vartype default_language_code: Union[str, "SentimentSkillLanguage"] -:ivar include_opinion_mining: If set to true, the skill output will include information from - Text Analytics for opinion mining, namely targets (nouns or verbs) and their associated - assessment (adjective) in the text. Default is false. -:vartype include_opinion_mining: bool -:ivar model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. -:vartype model_version: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype defaultLanguageCode: Union[str, "SentimentSkillLanguage"] +:ivar includeOpinionMining: If set to true, the skill output will include information from Text + Analytics for opinion mining, namely targets (nouns or verbs) and their associated assessment + (adjective) in the text. Default is false. +:vartype includeOpinionMining: bool +:ivar modelVersion: The version of the model to use when calling the Text Analytics service. It + will default to the latest available when not specified. We recommend you do not specify this + value unless absolutely necessary. +:vartype modelVersion: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.V3.SentimentSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.V3.SentimentSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.V3.SentimentSkill"] """ @@ -5933,9 +5920,9 @@ class SemanticSearch(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.ShaperSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Util.ShaperSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Util.ShaperSkill"] """ @@ -5943,15 +5930,15 @@ class SharePointConnectorAppRegistration(TypedDict, total=False): """Configures a SharePoint connector app registration for the index, enabling document-level permissions from SharePoint. - :ivar application_id: The application (client) ID of the app registration used to connect to + :ivar applicationId: The application (client) ID of the app registration used to connect to SharePoint. Required. - :vartype application_id: str - :ivar federated_credential_id: The federated credential ID configured on the app registration. + :vartype applicationId: str + :ivar federatedCredentialId: The federated credential ID configured on the app registration. Required. - :vartype federated_credential_id: str - :ivar tenant_id: The tenant ID of the app registration. If not specified, the tenant of the + :vartype federatedCredentialId: str + :ivar tenantId: The tenant ID of the app registration. If not specified, the tenant of the search service is used. - :vartype tenant_id: str + :vartype tenantId: str """ applicationId: Required[str] @@ -5984,35 +5971,35 @@ class SharePointConnectorAppRegistration(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_shingle_size: The maximum shingle size. Default and minimum value is 2. -:vartype max_shingle_size: int -:ivar min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be less +:ivar maxShingleSize: The maximum shingle size. Default and minimum value is 2. +:vartype maxShingleSize: int +:ivar minShingleSize: The minimum shingle size. Default and minimum value is 2. Must be less than the value of maxShingleSize. -:vartype min_shingle_size: int -:ivar output_unigrams: A value indicating whether the output stream will contain the input +:vartype minShingleSize: int +:ivar outputUnigrams: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles. Default is true. -:vartype output_unigrams: bool -:ivar output_unigrams_if_no_shingles: A value indicating whether to output unigrams for those - times when no shingles are available. This property takes precedence when outputUnigrams is set - to false. Default is false. -:vartype output_unigrams_if_no_shingles: bool -:ivar token_separator: The string to use when joining adjacent tokens to form a shingle. - Default is a single space (" "). -:vartype token_separator: str -:ivar filter_token: The string to insert for each position at which there is no token. Default +:vartype outputUnigrams: bool +:ivar outputUnigramsIfNoShingles: A value indicating whether to output unigrams for those times + when no shingles are available. This property takes precedence when outputUnigrams is set to + false. Default is false. +:vartype outputUnigramsIfNoShingles: bool +:ivar tokenSeparator: The string to use when joining adjacent tokens to form a shingle. Default + is a single space (" "). +:vartype tokenSeparator: str +:ivar filterToken: The string to insert for each position at which there is no token. Default is an underscore ("_"). -:vartype filter_token: str -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype filterToken: str +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.ShingleTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.ShingleTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.ShingleTokenFilter"] """ class SkillNames(TypedDict, total=False): """The type of the skill names. - :ivar skill_names: the names of skills to be reset. - :vartype skill_names: list[str] + :ivar skillNames: the names of skills to be reset. + :vartype skillNames: list[str] """ skillNames: list[str] @@ -6040,9 +6027,9 @@ class SkillNames(TypedDict, total=False): "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", "spanish", "swedish", and "turkish". :vartype language: Union[str, "SnowballTokenFilterLanguage"] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.SnowballTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.SnowballTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.SnowballTokenFilter"] """ @@ -6059,13 +6046,14 @@ class SkillNames(TypedDict, total=False): determines whether an item should be deleted based on the value of a designated 'soft delete' column. -:ivar soft_delete_column_name: The name of the column to use for soft-deletion detection. -:vartype soft_delete_column_name: str -:ivar soft_delete_marker_value: The marker value that identifies an item as deleted. -:vartype soft_delete_marker_value: str -:ivar odata_type: A URI fragment specifying the type of data deletion detection policy. +:ivar softDeleteColumnName: The name of the column to use for soft-deletion detection. +:vartype softDeleteColumnName: str +:ivar softDeleteMarkerValue: The marker value that identifies an item as deleted. +:vartype softDeleteMarkerValue: str +:ivar @odata.type: A URI fragment specifying the type of data deletion detection policy. Required. Default value is "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy". -:vartype odata_type: Literal["#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"] +:vartype @odata.type: + Literal["#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"] """ @@ -6106,36 +6094,36 @@ class SkillNames(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_language_code: A value indicating which language code to use. Default is ``en``. +:ivar defaultLanguageCode: A value indicating which language code to use. Default is ``en``. Known values are: "am", "bs", "cs", "da", "de", "en", "es", "et", "fi", "fr", "he", "hi", "hr", "hu", "id", "is", "it", "ja", "ko", "lv", "nb", "nl", "pl", "pt", "pt-br", "ru", "sk", "sl", "sr", "sv", "tr", "ur", and "zh". -:vartype default_language_code: Union[str, "SplitSkillLanguage"] -:ivar text_split_mode: A value indicating which split mode to perform. Known values are: - "pages" and "sentences". -:vartype text_split_mode: Union[str, "TextSplitMode"] -:ivar maximum_page_length: The desired maximum page length. Default is 10000. -:vartype maximum_page_length: int -:ivar page_overlap_length: Only applicable when textSplitMode is set to 'pages'. If specified, +:vartype defaultLanguageCode: Union[str, "SplitSkillLanguage"] +:ivar textSplitMode: A value indicating which split mode to perform. Known values are: "pages" + and "sentences". +:vartype textSplitMode: Union[str, "TextSplitMode"] +:ivar maximumPageLength: The desired maximum page length. Default is 10000. +:vartype maximumPageLength: int +:ivar pageOverlapLength: Only applicable when textSplitMode is set to 'pages'. If specified, n+1th chunk will start with this number of characters/tokens from the end of the nth chunk. -:vartype page_overlap_length: int -:ivar maximum_pages_to_take: Only applicable when textSplitMode is set to 'pages'. If - specified, the SplitSkill will discontinue splitting after processing the first - 'maximumPagesToTake' pages, in order to improve performance when only a few initial pages are - needed from each document. -:vartype maximum_pages_to_take: int +:vartype pageOverlapLength: int +:ivar maximumPagesToTake: Only applicable when textSplitMode is set to 'pages'. If specified, + the SplitSkill will discontinue splitting after processing the first 'maximumPagesToTake' + pages, in order to improve performance when only a few initial pages are needed from each + document. +:vartype maximumPagesToTake: int :ivar unit: Only applies if textSplitMode is set to pages. There are two possible values. The choice of the values will decide the length (maximumPageLength and pageOverlapLength) measurement. The default is 'characters', which means the length will be measured by character. Known values are: "characters" and "azureOpenAITokens". :vartype unit: Union[str, "SplitSkillUnit"] -:ivar azure_open_ai_tokenizer_parameters: Only applies if the unit is set to azureOpenAITokens. - If specified, the splitSkill will use these parameters when performing the tokenization. The +:ivar azureOpenAITokenizerParameters: Only applies if the unit is set to azureOpenAITokens. If + specified, the splitSkill will use these parameters when performing the tokenization. The parameters are a valid 'encoderModelName' and an optional 'allowedSpecialTokens' property. -:vartype azure_open_ai_tokenizer_parameters: "AzureOpenAITokenizerParameters" -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype azureOpenAITokenizerParameters: "AzureOpenAITokenizerParameters" +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.SplitSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.SplitSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.SplitSkill"] """ @@ -6149,9 +6137,9 @@ class SkillNames(TypedDict, total=False): SqlIntegratedChangeTrackingPolicy.__doc__ = """Defines a data change detection policy that captures changes using the Integrated Change Tracking feature of Azure SQL Database. -:ivar odata_type: A URI fragment specifying the type of data change detection policy. Required. - Default value is "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy". -:vartype odata_type: Literal["#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"] +:ivar @odata.type: A URI fragment specifying the type of data change detection policy. + Required. Default value is "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy". +:vartype @odata.type: Literal["#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"] """ @@ -6178,9 +6166,9 @@ class SkillNames(TypedDict, total=False): :ivar rules: A list of stemming rules in the following format: "word => stem", for example: "ran => run". Required. :vartype rules: list[str] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.StemmerOverrideTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StemmerOverrideTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StemmerOverrideTokenFilter"] """ @@ -6211,9 +6199,9 @@ class SkillNames(TypedDict, total=False): "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", and "turkish". :vartype language: Union[str, "StemmerTokenFilterLanguage"] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.StemmerTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StemmerTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StemmerTokenFilter"] """ @@ -6235,9 +6223,9 @@ class SkillNames(TypedDict, total=False): :vartype name: str :ivar stopwords: A list of stopwords. :vartype stopwords: list[str] -:ivar odata_type: A URI fragment specifying the type of analyzer. Required. Default value is +:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is "#Microsoft.Azure.Search.StopAnalyzer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StopAnalyzer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StopAnalyzer"] """ @@ -6265,22 +6253,22 @@ class SkillNames(TypedDict, total=False): :ivar stopwords: The list of stopwords. This property and the stopwords list property cannot both be set. :vartype stopwords: list[str] -:ivar stopwords_list: A predefined list of stopwords to use. This property and the stopwords +:ivar stopwordsList: A predefined list of stopwords to use. This property and the stopwords property cannot both be set. Default is English. Known values are: "arabic", "armenian", "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "english", "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", "sorani", "spanish", "swedish", "thai", and "turkish". -:vartype stopwords_list: Union[str, "StopwordsList"] -:ivar ignore_case: A value indicating whether to ignore case. If true, all words are converted +:vartype stopwordsList: Union[str, "StopwordsList"] +:ivar ignoreCase: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false. -:vartype ignore_case: bool -:ivar remove_trailing_stop_words: A value indicating whether to ignore the last search term if - it's a stop word. Default is true. -:vartype remove_trailing_stop_words: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype ignoreCase: bool +:ivar removeTrailing: A value indicating whether to ignore the last search term if it's a stop + word. Default is true. +:vartype removeTrailing: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.StopwordsTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.StopwordsTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.StopwordsTokenFilter"] """ @@ -6305,7 +6293,7 @@ class SkillNames(TypedDict, total=False): :ivar synonyms: A series of synonym rules in the specified synonym map format. The rules must be separated by newlines. Required. :vartype synonyms: list[str] -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data. Once you have encrypted your data, it will always remain encrypted. The search service will ignore attempts @@ -6313,9 +6301,9 @@ class SkillNames(TypedDict, total=False): encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" -:ivar e_tag: The ETag of the synonym map. -:vartype e_tag: str +:vartype encryptionKey: "SearchResourceEncryptionKey" +:ivar @odata.etag: The ETag of the synonym map. +:vartype @odata.etag: str """ @@ -6343,9 +6331,8 @@ class SkillNames(TypedDict, total=False): separated list of equivalent words. Set the expand option to change how this list is interpreted. Required. :vartype synonyms: list[str] -:ivar ignore_case: A value indicating whether to case-fold input for matching. Default is - false. -:vartype ignore_case: bool +:ivar ignoreCase: A value indicating whether to case-fold input for matching. Default is false. +:vartype ignoreCase: bool :ivar expand: A value indicating whether all words in the list of synonyms (if => notation is not used) will map to one another. If true, all words in the list of synonyms (if => notation is not used) will map to one another. The following list: incredible, unbelievable, fabulous, @@ -6354,9 +6341,9 @@ class SkillNames(TypedDict, total=False): fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. Default is true. :vartype expand: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.SynonymTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.SynonymTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.SynonymTokenFilter"] """ @@ -6364,8 +6351,8 @@ class TagScoringFunction(TypedDict, total=False): """Defines a function that boosts scores of documents with string values matching a given list of tags. - :ivar field_name: The name of the field used as input to the scoring function. Required. - :vartype field_name: str + :ivar fieldName: The name of the field used as input to the scoring function. Required. + :vartype fieldName: str :ivar boost: A multiplier for the raw score. Must be a positive number not equal to 1.0. Required. :vartype boost: float @@ -6373,8 +6360,8 @@ class TagScoringFunction(TypedDict, total=False): scores; defaults to "Linear". Known values are: "linear", "constant", "quadratic", and "logarithmic". :vartype interpolation: Union[str, "ScoringFunctionInterpolation"] - :ivar parameters: Parameter values for the tag scoring function. Required. - :vartype parameters: "TagScoringParameters" + :ivar tag: Parameter values for the tag scoring function. Required. + :vartype tag: "TagScoringParameters" :ivar type: Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case. Required. Default value is "tag". :vartype type: Literal["tag"] @@ -6397,9 +6384,9 @@ class TagScoringFunction(TypedDict, total=False): class TagScoringParameters(TypedDict, total=False): """Provides parameter values to a tag scoring function. - :ivar tags_parameter: The name of the parameter passed in search queries to specify the list of + :ivar tagsParameter: The name of the parameter passed in search queries to specify the list of tags to compare against the target field. Required. - :vartype tags_parameter: str + :vartype tagsParameter: str """ tagsParameter: Required[str] @@ -6440,23 +6427,23 @@ class TagScoringParameters(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar default_to_language_code: The language code to translate documents into for documents - that don't specify the to language explicitly. Required. Known values are: "af", "ar", "bn", - "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", - "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", - "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", - "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", - "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". -:vartype default_to_language_code: Union[str, "TextTranslationSkillLanguage"] -:ivar default_from_language_code: The language code to translate documents from for documents - that don't specify the from language explicitly. Known values are: "af", "ar", "bn", "bs", +:ivar defaultToLanguageCode: The language code to translate documents into for documents that + don't specify the to language explicitly. Required. Known values are: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". -:vartype default_from_language_code: Union[str, "TextTranslationSkillLanguage"] -:ivar suggested_from: The language code to translate documents from when neither the +:vartype defaultToLanguageCode: Union[str, "TextTranslationSkillLanguage"] +:ivar defaultFromLanguageCode: The language code to translate documents from for documents that + don't specify the from language explicitly. Known values are: "af", "ar", "bn", "bs", "bg", + "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", "fi", "fr", + "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", "tlh-Latn", + "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", "pt-PT", + "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", + "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". +:vartype defaultFromLanguageCode: Union[str, "TextTranslationSkillLanguage"] +:ivar suggestedFrom: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is ``en``. Known values are: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", @@ -6464,10 +6451,10 @@ class TagScoringParameters(TypedDict, total=False): "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". -:vartype suggested_from: Union[str, "TextTranslationSkillLanguage"] -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype suggestedFrom: Union[str, "TextTranslationSkillLanguage"] +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.TranslationSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Text.TranslationSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Text.TranslationSkill"] """ @@ -6501,9 +6488,9 @@ class TextWeights(TypedDict, total=False): :vartype name: str :ivar length: The length at which terms will be truncated. Default and maximum is 300. :vartype length: int -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.TruncateTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.TruncateTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.TruncateTokenFilter"] """ @@ -6522,12 +6509,12 @@ class TextWeights(TypedDict, total=False): underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. -:vartype max_token_length: int -:ivar odata_type: A URI fragment specifying the type of tokenizer. Required. Default value is +:ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum + length are split. The maximum token length that can be used is 300 characters. +:vartype maxTokenLength: int +:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is "#Microsoft.Azure.Search.UaxUrlEmailTokenizer". -:vartype odata_type: Literal["#Microsoft.Azure.Search.UaxUrlEmailTokenizer"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.UaxUrlEmailTokenizer"] """ @@ -6547,12 +6534,12 @@ class TextWeights(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar only_on_same_position: A value indicating whether to remove duplicates only at the same +:ivar onlyOnSamePosition: A value indicating whether to remove duplicates only at the same position. Default is false. -:vartype only_on_same_position: bool -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype onlyOnSamePosition: bool +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.UniqueTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.UniqueTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.UniqueTokenFilter"] """ @@ -6617,15 +6604,14 @@ class VectorSearchProfile(TypedDict, total=False): :ivar name: The name to associate with this particular vector search profile. Required. :vartype name: str - :ivar algorithm_configuration_name: The name of the vector search algorithm configuration that - specifies the algorithm and optional parameters. Required. - :vartype algorithm_configuration_name: str - :ivar vectorizer_name: The name of the vectorization being configured for use with vector - search. - :vartype vectorizer_name: str - :ivar compression_name: The name of the compression method configuration that specifies the + :ivar algorithm: The name of the vector search algorithm configuration that specifies the + algorithm and optional parameters. Required. + :vartype algorithm: str + :ivar vectorizer: The name of the vectorization being configured for use with vector search. + :vartype vectorizer: str + :ivar compression: The name of the compression method configuration that specifies the compression method and optional parameters. - :vartype compression_name: str + :vartype compression: str """ name: Required[str] @@ -6672,12 +6658,12 @@ class VectorSearchProfile(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar model_version: The version of the model to use when calling the AI Services Vision +:ivar modelVersion: The version of the model to use when calling the AI Services Vision service. It will default to the latest available when not specified. Required. -:vartype model_version: str -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype modelVersion: str +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Vision.VectorizeSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Vision.VectorizeSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Vision.VectorizeSkill"] """ @@ -6726,32 +6712,32 @@ class WebApiHttpHeaders(TypedDict, total=False): :vartype outputs: list["OutputFieldMappingEntry"] :ivar uri: The url for the Web API. Required. :vartype uri: str -:ivar http_headers: The headers required to make the http request. -:vartype http_headers: "WebApiHttpHeaders" -:ivar http_method: The method for the http request. -:vartype http_method: str +:ivar httpHeaders: The headers required to make the http request. +:vartype httpHeaders: "WebApiHttpHeaders" +:ivar httpMethod: The method for the http request. +:vartype httpMethod: str :ivar timeout: The desired timeout for the request. Default is 30 seconds. :vartype timeout: str -:ivar batch_size: The desired batch size which indicates number of documents. -:vartype batch_size: int -:ivar degree_of_parallelism: If set, the number of parallel calls that can be made to the Web +:ivar batchSize: The desired batch size which indicates number of documents. +:vartype batchSize: int +:ivar degreeOfParallelism: If set, the number of parallel calls that can be made to the Web API. -:vartype degree_of_parallelism: int -:ivar auth_resource_id: Applies to custom skills that connect to external code in an Azure +:vartype degreeOfParallelism: int +:ivar authResourceId: Applies to custom skills that connect to external code in an Azure function or some other application that provides the transformations. This value should be the application ID created for the function or app when it was registered with Azure Active Directory. When specified, the custom skill connects to the function or app using a managed ID (either system or user-assigned) of the search service and the access token of the function or app, using this value as the resource id for creating the scope of the access token. -:vartype auth_resource_id: str -:ivar auth_identity: The user-assigned managed identity used for outbound connections. If an +:vartype authResourceId: str +:ivar authIdentity: The user-assigned managed identity used for outbound connections. If an authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. -:vartype auth_identity: "SearchIndexerDataIdentity" -:ivar odata_type: A URI fragment specifying the type of skill. Required. Default value is +:vartype authIdentity: "SearchIndexerDataIdentity" +:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Custom.WebApiSkill". -:vartype odata_type: Literal["#Microsoft.Skills.Custom.WebApiSkill"] +:vartype @odata.type: Literal["#Microsoft.Skills.Custom.WebApiSkill"] """ @@ -6760,11 +6746,10 @@ class WebApiVectorizer(TypedDict, total=False): Integration of an external vectorizer is achieved using the custom Web API interface of a skillset. - :ivar vectorizer_name: The name to associate with this particular vectorization method. - Required. - :vartype vectorizer_name: str - :ivar web_api_parameters: Specifies the properties of the user-defined vectorizer. - :vartype web_api_parameters: "WebApiVectorizerParameters" + :ivar name: The name to associate with this particular vectorization method. Required. + :vartype name: str + :ivar customWebApiParameters: Specifies the properties of the user-defined vectorizer. + :vartype customWebApiParameters: "WebApiVectorizerParameters" :ivar kind: The name of the kind of vectorization method being configured for use with vector search. Required. Generate embeddings using a custom web endpoint at query time. :vartype kind: Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API] @@ -6782,26 +6767,26 @@ class WebApiVectorizer(TypedDict, total=False): class WebApiVectorizerParameters(TypedDict, total=False): """Specifies the properties for connecting to a user-defined vectorizer. - :ivar url: The URI of the Web API providing the vectorizer. - :vartype url: str - :ivar http_headers: The headers required to make the HTTP request. - :vartype http_headers: dict[str, str] - :ivar http_method: The method for the HTTP request. - :vartype http_method: str + :ivar uri: The URI of the Web API providing the vectorizer. + :vartype uri: str + :ivar httpHeaders: The headers required to make the HTTP request. + :vartype httpHeaders: dict[str, str] + :ivar httpMethod: The method for the HTTP request. + :vartype httpMethod: str :ivar timeout: The desired timeout for the request. Default is 30 seconds. :vartype timeout: str - :ivar auth_resource_id: Applies to custom endpoints that connect to external code in an Azure + :ivar authResourceId: Applies to custom endpoints that connect to external code in an Azure function or some other application that provides the transformations. This value should be the application ID created for the function or app when it was registered with Azure Active Directory. When specified, the vectorization connects to the function or app using a managed ID (either system or user-assigned) of the search service and the access token of the function or app, using this value as the resource id for creating the scope of the access token. - :vartype auth_resource_id: str - :ivar auth_identity: The user-assigned managed identity used for outbound connections. If an + :vartype authResourceId: str + :ivar authIdentity: The user-assigned managed identity used for outbound connections. If an authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared. - :vartype auth_identity: "SearchIndexerDataIdentity" + :vartype authIdentity: "SearchIndexerDataIdentity" """ uri: str @@ -6845,13 +6830,13 @@ class WebApiVectorizerParameters(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -6859,11 +6844,11 @@ class WebApiVectorizerParameters(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: Required. A knowledge source that reads data from the web. :vartype kind: Literal[KnowledgeSourceKind.WEB] -:ivar web_parameters: The parameters for the web knowledge source. -:vartype web_parameters: "WebKnowledgeSourceParameters" +:ivar webParameters: The parameters for the web knowledge source. +:vartype webParameters: "WebKnowledgeSourceParameters" """ @@ -6872,8 +6857,8 @@ class WebKnowledgeSourceDomain(TypedDict, total=False): :ivar address: The address of the domain. Required. :vartype address: str - :ivar include_subpages: Whether or not to include subpages from this domain. - :vartype include_subpages: bool + :ivar includeSubpages: Whether or not to include subpages from this domain. + :vartype includeSubpages: bool """ address: Required[str] @@ -6885,10 +6870,10 @@ class WebKnowledgeSourceDomain(TypedDict, total=False): class WebKnowledgeSourceDomains(TypedDict, total=False): """Domain allow/block configuration for web knowledge source. - :ivar allowed_domains: Domains that are allowed for web results. - :vartype allowed_domains: list["WebKnowledgeSourceDomain"] - :ivar blocked_domains: Domains that are blocked from web results. - :vartype blocked_domains: list["WebKnowledgeSourceDomain"] + :ivar allowedDomains: Domains that are allowed for web results. + :vartype allowedDomains: list["WebKnowledgeSourceDomain"] + :ivar blockedDomains: Domains that are blocked from web results. + :vartype blockedDomains: list["WebKnowledgeSourceDomain"] """ allowedDomains: list["WebKnowledgeSourceDomain"] @@ -6957,39 +6942,39 @@ class WebKnowledgeSourceParameters(TypedDict, total=False): or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. Required. :vartype name: str -:ivar generate_word_parts: A value indicating whether to generate part words. If set, causes +:ivar generateWordParts: A value indicating whether to generate part words. If set, causes parts of words to be generated; for example "AzureSearch" becomes "Azure" "Search". Default is true. -:vartype generate_word_parts: bool -:ivar generate_number_parts: A value indicating whether to generate number subwords. Default is +:vartype generateWordParts: bool +:ivar generateNumberParts: A value indicating whether to generate number subwords. Default is true. -:vartype generate_number_parts: bool -:ivar catenate_words: A value indicating whether maximum runs of word parts will be catenated. +:vartype generateNumberParts: bool +:ivar catenateWords: A value indicating whether maximum runs of word parts will be catenated. For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default is false. -:vartype catenate_words: bool -:ivar catenate_numbers: A value indicating whether maximum runs of number parts will be +:vartype catenateWords: bool +:ivar catenateNumbers: A value indicating whether maximum runs of number parts will be catenated. For example, if this is set to true, "1-2" becomes "12". Default is false. -:vartype catenate_numbers: bool -:ivar catenate_all: A value indicating whether all subword parts will be catenated. For - example, if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. -:vartype catenate_all: bool -:ivar split_on_case_change: A value indicating whether to split words on caseChange. For - example, if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. -:vartype split_on_case_change: bool -:ivar preserve_original: A value indicating whether original words will be preserved and added +:vartype catenateNumbers: bool +:ivar catenateAll: A value indicating whether all subword parts will be catenated. For example, + if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. +:vartype catenateAll: bool +:ivar splitOnCaseChange: A value indicating whether to split words on caseChange. For example, + if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. +:vartype splitOnCaseChange: bool +:ivar preserveOriginal: A value indicating whether original words will be preserved and added to the subword list. Default is false. -:vartype preserve_original: bool -:ivar split_on_numerics: A value indicating whether to split on numbers. For example, if this - is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. -:vartype split_on_numerics: bool -:ivar stem_english_possessive: A value indicating whether to remove trailing "'s" for each +:vartype preserveOriginal: bool +:ivar splitOnNumerics: A value indicating whether to split on numbers. For example, if this is + set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. +:vartype splitOnNumerics: bool +:ivar stemEnglishPossessive: A value indicating whether to remove trailing "'s" for each subword. Default is true. -:vartype stem_english_possessive: bool -:ivar protected_words: A list of tokens to protect from being delimited. -:vartype protected_words: list[str] -:ivar odata_type: A URI fragment specifying the type of token filter. Required. Default value +:vartype stemEnglishPossessive: bool +:ivar protectedWords: A list of tokens to protect from being delimited. +:vartype protectedWords: list[str] +:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value is "#Microsoft.Azure.Search.WordDelimiterTokenFilter". -:vartype odata_type: Literal["#Microsoft.Azure.Search.WordDelimiterTokenFilter"] +:vartype @odata.type: Literal["#Microsoft.Azure.Search.WordDelimiterTokenFilter"] """ @@ -7012,13 +6997,13 @@ class WebKnowledgeSourceParameters(TypedDict, total=False): :vartype name: str :ivar description: Optional user-defined description. :vartype description: str -:ivar results_processing: Controls whether results from this knowledge source are reranked +:ivar resultsProcessing: Controls whether results from this knowledge source are reranked before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". -:vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar e_tag: The ETag of the knowledge source. -:vartype e_tag: str -:ivar encryption_key: A description of an encryption key that you create in Azure Key Vault. +:vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] +:ivar @odata.etag: The ETag of the knowledge source. +:vartype @odata.etag: str +:ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your knowledge source definition, it will always remain encrypted. The @@ -7026,24 +7011,24 @@ class WebKnowledgeSourceParameters(TypedDict, total=False): as needed if you want to rotate your encryption key; Your knowledge source definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. -:vartype encryption_key: "SearchResourceEncryptionKey" +:vartype encryptionKey: "SearchResourceEncryptionKey" :ivar kind: The discriminator value. Required. A knowledge source that reads data from work IQ. :vartype kind: Literal[KnowledgeSourceKind.WORK_IQ] -:ivar work_iq_parameters: The parameters for the WorkIQ knowledge source, including the +:ivar workIQParameters: The parameters for the WorkIQ knowledge source, including the customer-owned Entra app configuration used for on-behalf-of authentication. Required. -:vartype work_iq_parameters: "WorkIQKnowledgeSourceParameters" +:vartype workIQParameters: "WorkIQKnowledgeSourceParameters" """ class WorkIQKnowledgeSourceParameters(TypedDict, total=False): """Parameters for a WorkIQ knowledge source. - :ivar entra_app_authentication: 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. Required. - :vartype entra_app_authentication: "EntraAppAuthentication" + :ivar entraAppAuthentication: 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. + Required. + :vartype entraAppAuthentication: "EntraAppAuthentication" """ entraAppAuthentication: Required["EntraAppAuthentication"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py index 67f5d998a85c..bb73a0e5594f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_client.py @@ -28,7 +28,9 @@ from azure.core.credentials import TokenCredential -class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClientOperationsMixin): +class KnowledgeBaseRetrievalClient( + _KnowledgeBaseRetrievalClientOperationsMixin +): # pylint: disable=docstring-keyword-should-match-keyword-only """KnowledgeBaseRetrievalClient. :param endpoint: The endpoint URL of the search service. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py index a7650bc9a41a..d237ae4721ef 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ from azure.core.credentials import TokenCredential -class KnowledgeBaseRetrievalClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class KnowledgeBaseRetrievalClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for KnowledgeBaseRetrievalClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py index 0f2c5bdfe70f..35d5fc024978 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/model_base.py @@ -158,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -342,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -369,6 +383,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py index 75906e2eb77f..ae08f9d89f74 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_utils/serialization.py @@ -480,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py index faa827b2e674..506e5b92cffc 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_client.py @@ -28,7 +28,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClientOperationsMixin): +class KnowledgeBaseRetrievalClient( + _KnowledgeBaseRetrievalClientOperationsMixin +): # pylint: disable=docstring-keyword-should-match-keyword-only """KnowledgeBaseRetrievalClient. :param endpoint: The endpoint URL of the search service. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py index 06dd82cedb1e..31e873204bf9 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -17,7 +18,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class KnowledgeBaseRetrievalClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class KnowledgeBaseRetrievalClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for KnowledgeBaseRetrievalClient. Note that all parameters used to create this instance are saved as instance diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py index af41417e7b28..3e9d4049cde4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py @@ -27,7 +27,7 @@ from ...indexes import models as _indexes_models3 -class AIServices(_Model): +class AIServices(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for AI Services. :ivar uri: The URI of the AI Services endpoint. Required. @@ -60,7 +60,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssetStore(_Model): +class AssetStore(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for an asset store used to store extracted assets such as images. :ivar connection_string: The connection string for the asset store. Required. @@ -97,7 +97,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeSourceParams(_Model): +class KnowledgeSourceParams(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for knowledge source runtime parameters. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -229,7 +229,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureBlobKnowledgeSourceParams(KnowledgeSourceParams, discriminator="azureBlob"): +class AzureBlobKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="azureBlob" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a azure blob knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -314,7 +316,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.AZURE_BLOB # type: ignore -class CompletedSynchronizationState(_Model): +class CompletedSynchronizationState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the completed state of the last synchronization. :ivar start_time: The start time of the last completed synchronization. Required. @@ -372,7 +374,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FabricDataAgentKnowledgeSourceParams(KnowledgeSourceParams, discriminator="fabricDataAgent"): +class FabricDataAgentKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="fabricDataAgent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a Fabric Data Agent knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -446,7 +450,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.FABRIC_DATA_AGENT # type: ignore -class FabricOntologyKnowledgeSourceParams(KnowledgeSourceParams, discriminator="fabricOntology"): +class FabricOntologyKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="fabricOntology" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a Fabric Ontology knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -520,7 +526,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.FABRIC_ONTOLOGY # type: ignore -class FileKnowledgeSourceParams(KnowledgeSourceParams, discriminator="file"): +class FileKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a File knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -605,7 +613,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.FILE # type: ignore -class FreshnessPolicy(_Model): +class FreshnessPolicy(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Configuration for freshness-aware retrieval. When set, newer documents receive a ranking boost during retrieval. @@ -638,7 +646,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageServingStatistics(_Model): +class ImageServingStatistics(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Statistics about image serving during a retrieval activity. :ivar images_retrieved: The number of images retrieved from the asset store. @@ -699,7 +707,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexedOneLakeKnowledgeSourceParams(KnowledgeSourceParams, discriminator="indexedOneLake"): +class IndexedOneLakeKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="indexedOneLake" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a indexed OneLake knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -783,7 +793,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.INDEXED_ONELAKE # type: ignore -class IndexedSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminator="indexedSharePoint"): +class IndexedSharePointKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="indexedSharePoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a indexed SharePoint knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -867,7 +879,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.INDEXED_SHARE_POINT # type: ignore -class IndexedSqlKnowledgeSourceParams(KnowledgeSourceParams, discriminator="indexedSql"): +class IndexedSqlKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="indexedSql" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for an indexed SQL knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -952,7 +966,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.INDEXED_SQL # type: ignore -class KnowledgeBaseActivityRecord(_Model): +class KnowledgeBaseActivityRecord(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for activity records. Tracks execution details, timing, and errors for knowledge base operations. @@ -1042,7 +1056,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseActivityRecordModel(_Model): +class KnowledgeBaseActivityRecordModel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the model used for a knowledge base LLM activity, including its model name and deployment identifier. @@ -1078,7 +1092,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseActivityStartedEvent(_Model): +class KnowledgeBaseActivityStartedEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Emitted immediately before an individual retrieval activity begins executing. :ivar id: The ID of the activity record, matching the ``id`` on the corresponding @@ -1140,7 +1154,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseAgenticReasoningActivityRecord( KnowledgeBaseActivityRecord, discriminator="agenticReasoning" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents an agentic reasoning activity record. :ivar id: The ID of the activity record. Required. @@ -1215,7 +1229,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.AGENTIC_REASONING # type: ignore -class KnowledgeBaseAnswerCompletedEvent(_Model): +class KnowledgeBaseAnswerCompletedEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Emitted when a fully validated and post-processed synthesized answer is available. :ivar message_index: The zero-based index of the completed message in the final response array. @@ -1249,7 +1263,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseAzureBlobActivityArguments(_Model): +class KnowledgeBaseAzureBlobActivityArguments(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the arguments the azure blob retrieval activity was run with. :ivar search: The search string used to query blob contents. @@ -1277,7 +1291,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseAzureBlobActivityRecord(KnowledgeBaseActivityRecord, discriminator="azureBlob"): +class KnowledgeBaseAzureBlobActivityRecord( + KnowledgeBaseActivityRecord, discriminator="azureBlob" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a azure blob retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -1371,7 +1387,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.AZURE_BLOB # type: ignore -class KnowledgeBaseReference(_Model): +class KnowledgeBaseReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for references. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1436,7 +1452,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseAzureBlobReference(KnowledgeBaseReference, discriminator="azureBlob"): +class KnowledgeBaseAzureBlobReference( + KnowledgeBaseReference, discriminator="azureBlob" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an Azure Blob Storage document reference. :ivar id: The ID of the reference. Required. @@ -1543,7 +1561,9 @@ class KnowledgeBaseErrorDetail(_Model): """The error additional info.""" -class KnowledgeBaseFabricDataAgentActivityArguments(_Model): # pylint: disable=name-too-long +class KnowledgeBaseFabricDataAgentActivityArguments( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents the arguments the Fabric Data Agent retrieval activity was run with. :ivar search: The search string used to query the Fabric Data Agent knowledge source. @@ -1573,7 +1593,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseFabricDataAgentActivityRecord( KnowledgeBaseActivityRecord, discriminator="fabricDataAgent" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents a Fabric Data Agent retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -1658,7 +1678,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.FABRIC_DATA_AGENT # type: ignore -class KnowledgeBaseFabricDataAgentReference(KnowledgeBaseReference, discriminator="fabricDataAgent"): +class KnowledgeBaseFabricDataAgentReference( + KnowledgeBaseReference, discriminator="fabricDataAgent" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a Fabric Data Agent document reference. :ivar id: The ID of the reference. Required. @@ -1712,7 +1734,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.FABRIC_DATA_AGENT # type: ignore -class KnowledgeBaseFabricOntologyActivityArguments(_Model): # pylint: disable=name-too-long +class KnowledgeBaseFabricOntologyActivityArguments( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents the arguments the Fabric Ontology retrieval activity was run with. :ivar search: The search string used to query the Fabric Ontology knowledge source. @@ -1742,7 +1766,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseFabricOntologyActivityRecord( KnowledgeBaseActivityRecord, discriminator="fabricOntology" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents a Fabric Ontology retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -1827,7 +1851,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.FABRIC_ONTOLOGY # type: ignore -class KnowledgeBaseFabricOntologyReference(KnowledgeBaseReference, discriminator="fabricOntology"): +class KnowledgeBaseFabricOntologyReference( + KnowledgeBaseReference, discriminator="fabricOntology" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a Fabric Ontology document reference. :ivar id: The ID of the reference. Required. @@ -1881,7 +1907,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.FABRIC_ONTOLOGY # type: ignore -class KnowledgeBaseFileActivityArguments(_Model): +class KnowledgeBaseFileActivityArguments(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the arguments the File retrieval activity was run with. :ivar search: The search string used to query file contents. @@ -1909,7 +1935,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseFileActivityRecord(KnowledgeBaseActivityRecord, discriminator="file"): +class KnowledgeBaseFileActivityRecord( + KnowledgeBaseActivityRecord, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a File retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -2003,7 +2031,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.FILE # type: ignore -class KnowledgeBaseFileReference(KnowledgeBaseReference, discriminator="file"): +class KnowledgeBaseFileReference( + KnowledgeBaseReference, discriminator="file" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a file document reference. :ivar id: The ID of the reference. Required. @@ -2057,7 +2087,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.FILE # type: ignore -class KnowledgeBaseImageContent(_Model): +class KnowledgeBaseImageContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Image content. :ivar url: The url of the image. Required. @@ -2085,7 +2115,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseIndexedOneLakeActivityArguments(_Model): # pylint: disable=name-too-long +class KnowledgeBaseIndexedOneLakeActivityArguments( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents the arguments the indexed OneLake retrieval activity was run with. :ivar search: The search string used to query indexed OneLake contents. @@ -2115,7 +2147,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseIndexedOneLakeActivityRecord( KnowledgeBaseActivityRecord, discriminator="indexedOneLake" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents a indexed OneLake retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -2209,7 +2241,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.INDEXED_ONELAKE # type: ignore -class KnowledgeBaseIndexedOneLakeReference(KnowledgeBaseReference, discriminator="indexedOneLake"): +class KnowledgeBaseIndexedOneLakeReference( + KnowledgeBaseReference, discriminator="indexedOneLake" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an indexed OneLake document reference. :ivar id: The ID of the reference. Required. @@ -2271,7 +2305,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.INDEXED_ONELAKE # type: ignore -class KnowledgeBaseIndexedSharePointActivityArguments(_Model): # pylint: disable=name-too-long +class KnowledgeBaseIndexedSharePointActivityArguments( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents the arguments the indexed SharePoint retrieval activity was run with. :ivar search: The search string used to query indexed SharePoint contents. @@ -2301,7 +2337,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseIndexedSharePointActivityRecord( KnowledgeBaseActivityRecord, discriminator="indexedSharePoint" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents a indexed SharePoint retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -2396,7 +2432,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.INDEXED_SHARE_POINT # type: ignore -class KnowledgeBaseIndexedSharePointReference(KnowledgeBaseReference, discriminator="indexedSharePoint"): +class KnowledgeBaseIndexedSharePointReference( + KnowledgeBaseReference, discriminator="indexedSharePoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an indexed SharePoint document reference. :ivar id: The ID of the reference. Required. @@ -2458,7 +2496,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.INDEXED_SHARE_POINT # type: ignore -class KnowledgeBaseIndexedSqlActivityArguments(_Model): +class KnowledgeBaseIndexedSqlActivityArguments(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the arguments the indexed SQL retrieval activity was run with. :ivar search: The search string used to query indexed SQL contents. @@ -2486,7 +2524,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseIndexedSqlActivityRecord(KnowledgeBaseActivityRecord, discriminator="indexedSql"): +class KnowledgeBaseIndexedSqlActivityRecord( + KnowledgeBaseActivityRecord, discriminator="indexedSql" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an indexed SQL retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -2580,7 +2620,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.INDEXED_SQL # type: ignore -class KnowledgeBaseIndexedSqlReference(KnowledgeBaseReference, discriminator="indexedSql"): +class KnowledgeBaseIndexedSqlReference( + KnowledgeBaseReference, discriminator="indexedSql" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an Azure SQL document reference. :ivar id: The ID of the reference. Required. @@ -2634,7 +2676,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.INDEXED_SQL # type: ignore -class KnowledgeBaseMcpServerActivityArguments(_Model): +class KnowledgeBaseMcpServerActivityArguments(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the arguments the MCP server retrieval activity was run with. :ivar tool_name: The name of the MCP server tool used for the retrieval activity. @@ -2669,7 +2711,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseMcpServerActivityRecord(KnowledgeBaseActivityRecord, discriminator="mcpServer"): +class KnowledgeBaseMcpServerActivityRecord( + KnowledgeBaseActivityRecord, discriminator="mcpServer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an MCP server retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -2754,7 +2798,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.MCP_SERVER # type: ignore -class KnowledgeBaseMcpServerReference(KnowledgeBaseReference, discriminator="mcpServer"): +class KnowledgeBaseMcpServerReference( + KnowledgeBaseReference, discriminator="mcpServer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an MCP server document reference. :ivar id: The ID of the reference. Required. @@ -2804,7 +2850,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.MCP_SERVER # type: ignore -class KnowledgeBaseMessage(_Model): +class KnowledgeBaseMessage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The natural language message style object. :ivar role: The role of the tool response. @@ -2840,7 +2886,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseMessageContent(_Model): +class KnowledgeBaseMessageContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the type of the message content. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2873,7 +2919,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseMessageImageContent(KnowledgeBaseMessageContent, discriminator="image"): +class KnowledgeBaseMessageImageContent( + KnowledgeBaseMessageContent, discriminator="image" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Image message type. :ivar type: The discriminator value. Required. Image message content kind. @@ -2906,7 +2954,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseMessageContentType.IMAGE # type: ignore -class KnowledgeBaseMessageTextContent(KnowledgeBaseMessageContent, discriminator="text"): +class KnowledgeBaseMessageTextContent( + KnowledgeBaseMessageContent, discriminator="text" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Text message type. :ivar type: The discriminator value. Required. Text message content kind. @@ -2941,7 +2991,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseModelAnswerSynthesisActivityRecord( KnowledgeBaseActivityRecord, discriminator="modelAnswerSynthesis" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents an LLM answer synthesis activity record. :ivar id: The ID of the activity record. Required. @@ -3013,7 +3063,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseModelQueryPlanningActivityRecord( KnowledgeBaseActivityRecord, discriminator="modelQueryPlanning" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents an LLM query planning activity record. :ivar id: The ID of the activity record. Required. @@ -3085,7 +3135,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseModelWebSummarizationActivityRecord( KnowledgeBaseActivityRecord, discriminator="modelWebSummarization" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents an LLM web summarization activity record. :ivar id: The ID of the activity record. Required. @@ -3155,7 +3205,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.MODEL_WEB_SUMMARIZATION # type: ignore -class KnowledgeBaseQueryHintProcessing(_Model): +class KnowledgeBaseQueryHintProcessing(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Details about the expressions generated from query hints for a retrieval activity. :ivar generated_boost: The search clause generated from boost hints for this activity. @@ -3192,7 +3242,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseRemoteSharePointActivityArguments(_Model): # pylint: disable=name-too-long +class KnowledgeBaseRemoteSharePointActivityArguments( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents the arguments the remote SharePoint retrieval activity was run with. :ivar search: The search string used to query the remote SharePoint knowledge source. @@ -3229,7 +3281,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseRemoteSharePointActivityRecord( KnowledgeBaseActivityRecord, discriminator="remoteSharePoint" -): # pylint: disable=name-too-long +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents a remote SharePoint retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -3314,7 +3366,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.REMOTE_SHARE_POINT # type: ignore -class KnowledgeBaseRemoteSharePointReference(KnowledgeBaseReference, discriminator="remoteSharePoint"): +class KnowledgeBaseRemoteSharePointReference( + KnowledgeBaseReference, discriminator="remoteSharePoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a remote SharePoint document reference. :ivar id: The ID of the reference. Required. @@ -3367,7 +3421,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.REMOTE_SHARE_POINT # type: ignore -class KnowledgeBaseResponseCompletedEvent(_Model): +class KnowledgeBaseResponseCompletedEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Emitted after retrieval completes successfully. :ivar status_code: The semantic HTTP status of the completed retrieval. Required. Known values @@ -3406,7 +3460,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseRetrievalRequest(_Model): +class KnowledgeBaseRetrievalRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The input contract for the retrieval request. :ivar messages: A list of chat message style input. @@ -3504,7 +3558,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseRetrievalResponse(_Model): +class KnowledgeBaseRetrievalResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The output contract for the retrieval response. :ivar response: The response messages. @@ -3558,7 +3612,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseRetrievalStartedEvent(_Model): +class KnowledgeBaseRetrievalStartedEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Emitted once retrieval preflight validation completes, before any activity begins. :ivar request_id: A service-generated identifier that correlates all events in this retrieval @@ -3612,7 +3666,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseSearchIndexActivityArguments(_Model): # pylint: disable=name-too-long +class KnowledgeBaseSearchIndexActivityArguments( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """Represents the arguments the search index retrieval activity was run with. :ivar search: The search string used to query the search index. @@ -3676,7 +3732,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseSearchIndexActivityRecord(KnowledgeBaseActivityRecord, discriminator="searchIndex"): +class KnowledgeBaseSearchIndexActivityRecord( + KnowledgeBaseActivityRecord, discriminator="searchIndex" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a search index retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -3770,7 +3828,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.SEARCH_INDEX # type: ignore -class KnowledgeBaseSearchIndexReference(KnowledgeBaseReference, discriminator="searchIndex"): +class KnowledgeBaseSearchIndexReference( + KnowledgeBaseReference, discriminator="searchIndex" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an Azure Search document reference. :ivar id: The ID of the reference. Required. @@ -3832,7 +3892,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.SEARCH_INDEX # type: ignore -class KnowledgeBaseStreamErrorEvent(_Model): +class KnowledgeBaseStreamErrorEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Emitted in place of ``response.completed`` if retrieval fails after the stream starts. :ivar error: The error detail explaining why the retrieval stream failed. @@ -3870,7 +3930,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseWebActivityArguments(_Model): +class KnowledgeBaseWebActivityArguments(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the arguments the web retrieval activity was run with. :ivar search: The search string used to query the web. @@ -3918,7 +3978,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseWebActivityRecord(KnowledgeBaseActivityRecord, discriminator="web"): +class KnowledgeBaseWebActivityRecord( + KnowledgeBaseActivityRecord, discriminator="web" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a web retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -4003,7 +4065,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.WEB # type: ignore -class KnowledgeBaseWebReference(KnowledgeBaseReference, discriminator="web"): +class KnowledgeBaseWebReference( + KnowledgeBaseReference, discriminator="web" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a web document reference. :ivar id: The ID of the reference. Required. @@ -4053,7 +4117,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.WEB # type: ignore -class KnowledgeBaseWorkIQActivityArguments(_Model): +class KnowledgeBaseWorkIQActivityArguments(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the arguments the WorkIQ retrieval activity was run with. :ivar search: The search string used to query the WorkIQ knowledge source. @@ -4081,7 +4145,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeBaseWorkIQActivityRecord(KnowledgeBaseActivityRecord, discriminator="workIQ"): +class KnowledgeBaseWorkIQActivityRecord( + KnowledgeBaseActivityRecord, discriminator="workIQ" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a WorkIQ retrieval activity record. :ivar id: The ID of the activity record. Required. @@ -4166,7 +4232,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseActivityRecordType.WORK_IQ # type: ignore -class KnowledgeBaseWorkIQReference(KnowledgeBaseReference, discriminator="workIQ"): +class KnowledgeBaseWorkIQReference( + KnowledgeBaseReference, discriminator="workIQ" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a WorkIQ document reference. :ivar id: The ID of the reference. Required. @@ -4214,7 +4282,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeBaseReferenceType.WORK_IQ # type: ignore -class KnowledgeRetrievalReasoningEffort(_Model): +class KnowledgeRetrievalReasoningEffort(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Base type for reasoning effort. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4281,7 +4349,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeRetrievalReasoningEffortKind.AUTO # type: ignore -class KnowledgeRetrievalIntent(_Model): +class KnowledgeRetrievalIntent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An intended query to execute without model query planning. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4398,7 +4466,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeRetrievalReasoningEffortKind.MINIMAL # type: ignore -class KnowledgeRetrievalSemanticIntent(KnowledgeRetrievalIntent, discriminator="semantic"): +class KnowledgeRetrievalSemanticIntent( + KnowledgeRetrievalIntent, discriminator="semantic" +): # pylint: disable=docstring-keyword-should-match-keyword-only """A semantic query intent. :ivar type: The discriminator value. Required. A natural language semantic query intent. @@ -4431,7 +4501,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = KnowledgeRetrievalIntentType.SEMANTIC # type: ignore -class KnowledgeSourceVectorizer(_Model): +class KnowledgeSourceVectorizer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the vectorization method to be used for knowledge source embedding model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -4467,7 +4537,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeSourceAzureOpenAIVectorizer(KnowledgeSourceVectorizer, discriminator="azureOpenAI"): +class KnowledgeSourceAzureOpenAIVectorizer( + KnowledgeSourceVectorizer, discriminator="azureOpenAI" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies the Azure OpenAI resource used to vectorize a query string. :ivar kind: The discriminator value. Required. Generate embeddings using an Azure OpenAI @@ -4506,7 +4578,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorSearchVectorizerKind.AZURE_OPEN_AI # type: ignore -class KnowledgeSourceIngestionParameters(_Model): +class KnowledgeSourceIngestionParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Consolidates all general ingestion settings for knowledge sources. :ivar identity: An explicit identity to use for this knowledge source. @@ -4625,7 +4697,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeSourceStatistics(_Model): +class KnowledgeSourceStatistics(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Statistical information about knowledge source synchronization history. :ivar total_synchronization: Total number of synchronizations. Required. @@ -4671,7 +4743,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeSourceStatus(_Model): +class KnowledgeSourceStatus(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the status and synchronization history of a knowledge source. :ivar kind: Identifies the Knowledge Source kind directly from the Status response. Known @@ -4751,7 +4823,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class KnowledgeSourceSynchronizationError(_Model): +class KnowledgeSourceSynchronizationError(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents a document-level indexing error encountered during a knowledge source synchronization run. @@ -4810,7 +4882,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class McpServerKnowledgeSourceParams(KnowledgeSourceParams, discriminator="mcpServer"): +class McpServerKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="mcpServer" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for an MCP server knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -4884,7 +4958,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.MCP_SERVER # type: ignore -class PurviewSensitivityLabelInfo(_Model): +class PurviewSensitivityLabelInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Information about the sensitivity label applied to a document. :ivar display_name: The display name for the sensitivity label. @@ -4943,7 +5017,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RemoteSharePointKnowledgeSourceParams(KnowledgeSourceParams, discriminator="remoteSharePoint"): +class RemoteSharePointKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="remoteSharePoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a remote SharePoint knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -5027,7 +5103,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.REMOTE_SHARE_POINT # type: ignore -class SearchIndexKnowledgeSourceParams(KnowledgeSourceParams, discriminator="searchIndex"): +class SearchIndexKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="searchIndex" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a search index knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -5118,7 +5196,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.SEARCH_INDEX # type: ignore -class ServedImage(_Model): +class ServedImage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Describes a single image that the model selected to be served during a retrieval activity. :ivar image_id: The image label extracted from the source document by Content Understanding @@ -5158,7 +5236,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SynchronizationState(_Model): +class SynchronizationState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents the current state of an ongoing synchronization that spans multiple indexer runs. :ivar start_time: The start time of the current synchronization. Required. @@ -5219,7 +5297,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class WebKnowledgeSourceParams(KnowledgeSourceParams, discriminator="web"): +class WebKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="web" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a web knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. @@ -5311,7 +5391,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = KnowledgeSourceKind.WEB # type: ignore -class WorkIQKnowledgeSourceParams(KnowledgeSourceParams, discriminator="workIQ"): +class WorkIQKnowledgeSourceParams( + KnowledgeSourceParams, discriminator="workIQ" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Specifies runtime parameters for a WorkIQ knowledge source. :ivar knowledge_source_name: The name of the index the params apply to. Required. diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py index da05f523f8b7..fd15823ca599 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py @@ -40,8 +40,8 @@ class AIServices(TypedDict, total=False): :ivar uri: The URI of the AI Services endpoint. Required. :vartype uri: str - :ivar api_key: The API key for accessing AI Services. - :vartype api_key: str + :ivar apiKey: The API key for accessing AI Services. + :vartype apiKey: str """ uri: Required[str] @@ -53,11 +53,11 @@ class AIServices(TypedDict, total=False): class AssetStore(TypedDict, total=False): """Configuration for an asset store used to store extracted assets such as images. - :ivar connection_string: The connection string for the asset store. Required. - :vartype connection_string: str - :ivar container_name: The name of the blob container within the asset store where extracted + :ivar connectionString: The connection string for the asset store. Required. + :vartype connectionString: str + :ivar containerName: The name of the blob container within the asset store where extracted assets (for example, images) are stored. Required. - :vartype container_name: str + :vartype containerName: str """ connectionString: Required[str] @@ -70,46 +70,46 @@ class AssetStore(TypedDict, total=False): class AzureBlobKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a azure blob knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that read and ingest data from Azure Blob Storage to a Search Index. :vartype kind: Literal[KnowledgeSourceKind.AZURE_BLOB] - :ivar query_hint_overrides: 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 + :ivar queryHintOverrides: 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. - :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" """ knowledgeSourceName: Required[str] @@ -150,18 +150,18 @@ class AzureBlobKnowledgeSourceParams(TypedDict, total=False): class CompletedSynchronizationState(TypedDict, total=False): """Represents the completed state of the last synchronization. - :ivar start_time: The start time of the last completed synchronization. Required. - :vartype start_time: str - :ivar end_time: The end time of the last completed synchronization. Required. - :vartype end_time: str - :ivar items_updates_processed: The number of item updates successfully processed in the last + :ivar startTime: The start time of the last completed synchronization. Required. + :vartype startTime: str + :ivar endTime: The end time of the last completed synchronization. Required. + :vartype endTime: str + :ivar itemsUpdatesProcessed: The number of item updates successfully processed in the last synchronization. Required. - :vartype items_updates_processed: int - :ivar items_updates_failed: The number of item updates that failed in the last synchronization. + :vartype itemsUpdatesProcessed: int + :ivar itemsUpdatesFailed: The number of item updates that failed in the last synchronization. Required. - :vartype items_updates_failed: int - :ivar items_skipped: The number of items skipped in the last synchronization. Required. - :vartype items_skipped: int + :vartype itemsUpdatesFailed: int + :ivar itemsSkipped: The number of items skipped in the last synchronization. Required. + :vartype itemsSkipped: int """ startTime: Required[str] @@ -179,39 +179,39 @@ class CompletedSynchronizationState(TypedDict, total=False): class FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a Fabric Data Agent knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that retrieves data from a Fabric Data Agent. :vartype kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] @@ -252,39 +252,39 @@ class FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): class FabricOntologyKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a Fabric Ontology knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that retrieves data from Microsoft Fabric Ontology ontologies. :vartype kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] @@ -325,46 +325,46 @@ class FabricOntologyKnowledgeSourceParams(TypedDict, total=False): class FileKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a File knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that supports direct file upload and indexing. :vartype kind: Literal[KnowledgeSourceKind.FILE] - :ivar query_hint_overrides: 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 + :ivar queryHintOverrides: 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. - :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" """ knowledgeSourceName: Required[str] @@ -406,9 +406,9 @@ class FreshnessPolicy(TypedDict, total=False): """Configuration for freshness-aware retrieval. When set, newer documents receive a ranking boost during retrieval. - :ivar boosting_duration: 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. - :vartype boosting_duration: str + :ivar boostingDuration: 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. + :vartype boostingDuration: str """ boostingDuration: str @@ -419,46 +419,46 @@ class FreshnessPolicy(TypedDict, total=False): class IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a indexed OneLake knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that reads data from indexed OneLake. :vartype kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] - :ivar query_hint_overrides: 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 + :ivar queryHintOverrides: 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. - :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" """ knowledgeSourceName: Required[str] @@ -498,46 +498,46 @@ class IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): class IndexedSharePointKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a indexed SharePoint knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that reads data from indexed SharePoint. :vartype kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] - :ivar query_hint_overrides: 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 + :ivar queryHintOverrides: 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. - :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" """ knowledgeSourceName: Required[str] @@ -577,46 +577,46 @@ class IndexedSharePointKnowledgeSourceParams(TypedDict, total=False): class IndexedSqlKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for an indexed SQL knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that retrieves and ingests data from Azure SQL Database or SQL Managed Instance to a Search Index. :vartype kind: Literal[KnowledgeSourceKind.INDEXED_SQL] - :ivar query_hint_overrides: 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 + :ivar queryHintOverrides: 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. - :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" """ knowledgeSourceName: Required[str] @@ -717,23 +717,23 @@ class KnowledgeBaseRetrievalRequest(TypedDict, total=False): :vartype messages: list["KnowledgeBaseMessage"] :ivar intents: A list of intended queries to execute without model query planning. :vartype intents: list["KnowledgeRetrievalIntent"] - :ivar max_runtime_in_seconds: The maximum runtime in seconds. - :vartype max_runtime_in_seconds: int - :ivar max_output_size: Limits the maximum size of the content in the output. - :vartype max_output_size: int - :ivar max_output_documents: Limits the maximum number of documents in the output. - :vartype max_output_documents: int - :ivar max_output_size_in_tokens: Limits the maximum size of the content in the output. - :vartype max_output_size_in_tokens: int - :ivar retrieval_reasoning_effort: The retrieval reasoning effort configuration. - :vartype retrieval_reasoning_effort: "KnowledgeRetrievalReasoningEffort" - :ivar include_activity: Indicates retrieval results should include activity information. - :vartype include_activity: bool - :ivar output_mode: The output configuration for this retrieval. Known values are: + :ivar maxRuntimeInSeconds: The maximum runtime in seconds. + :vartype maxRuntimeInSeconds: int + :ivar maxOutputSize: Limits the maximum size of the content in the output. + :vartype maxOutputSize: int + :ivar maxOutputDocuments: Limits the maximum number of documents in the output. + :vartype maxOutputDocuments: int + :ivar maxOutputSizeInTokens: Limits the maximum size of the content in the output. + :vartype maxOutputSizeInTokens: int + :ivar retrievalReasoningEffort: The retrieval reasoning effort configuration. + :vartype retrievalReasoningEffort: "KnowledgeRetrievalReasoningEffort" + :ivar includeActivity: Indicates retrieval results should include activity information. + :vartype includeActivity: bool + :ivar outputMode: The output configuration for this retrieval. Known values are: "extractiveData" and "answerSynthesis". - :vartype output_mode: Union[str, "KnowledgeRetrievalOutputMode"] - :ivar knowledge_source_params: A list of runtime parameters for the knowledge sources. - :vartype knowledge_source_params: list["KnowledgeSourceParams"] + :vartype outputMode: Union[str, "KnowledgeRetrievalOutputMode"] + :ivar knowledgeSourceParams: A list of runtime parameters for the knowledge sources. + :vartype knowledgeSourceParams: list["KnowledgeSourceParams"] """ messages: list["KnowledgeBaseMessage"] @@ -831,9 +831,9 @@ class KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): :ivar kind: The discriminator value. Required. Generate embeddings using an Azure OpenAI resource at query time. :vartype kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] - :ivar azure_open_ai_parameters: Contains the parameters specific to Azure OpenAI embedding + :ivar azureOpenAIParameters: Contains the parameters specific to Azure OpenAI embedding vectorization. - :vartype azure_open_ai_parameters: "AzureOpenAIVectorizerParameters" + :vartype azureOpenAIParameters: "AzureOpenAIVectorizerParameters" """ kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] @@ -848,35 +848,35 @@ class KnowledgeSourceIngestionParameters(TypedDict, total=False): :ivar identity: An explicit identity to use for this knowledge source. :vartype identity: "SearchIndexerDataIdentity" - :ivar embedding_model: Optional vectorizer configuration for vectorizing content. - :vartype embedding_model: "KnowledgeSourceVectorizer" - :ivar chat_completion_model: Optional chat completion model for image verbalization or context + :ivar embeddingModel: Optional vectorizer configuration for vectorizing content. + :vartype embeddingModel: "KnowledgeSourceVectorizer" + :ivar chatCompletionModel: Optional chat completion model for image verbalization or context extraction. - :vartype chat_completion_model: "KnowledgeBaseModel" - :ivar disable_image_verbalization: Indicates whether image verbalization should be disabled. + :vartype chatCompletionModel: "KnowledgeBaseModel" + :ivar disableImageVerbalization: Indicates whether image verbalization should be disabled. Default is false. - :vartype disable_image_verbalization: bool - :ivar ingestion_schedule: Optional schedule for data ingestion. - :vartype ingestion_schedule: "IndexingSchedule" - :ivar ingestion_permission_options: Optional list of permission types to ingest together with + :vartype disableImageVerbalization: bool + :ivar ingestionSchedule: Optional schedule for data ingestion. + :vartype ingestionSchedule: "IndexingSchedule" + :ivar ingestionPermissionOptions: Optional list of permission types to ingest together with document content. If specified, it will set the indexer permission options for the data source. - :vartype ingestion_permission_options: list[Union[str, + :vartype ingestionPermissionOptions: list[Union[str, "KnowledgeSourceIngestionPermissionOption"]] - :ivar content_extraction_mode: Optional content extraction mode. Default is 'minimal'. Known + :ivar contentExtractionMode: Optional content extraction mode. Default is 'minimal'. Known values are: "minimal" and "standard". - :vartype content_extraction_mode: Union[str, "KnowledgeSourceContentExtractionMode"] - :ivar ai_services: Optional AI Services configuration for content processing. - :vartype ai_services: "AIServices" - :ivar asset_store: Optional asset store configuration for storing extracted assets such as + :vartype contentExtractionMode: Union[str, "KnowledgeSourceContentExtractionMode"] + :ivar aiServices: Optional AI Services configuration for content processing. + :vartype aiServices: "AIServices" + :ivar assetStore: Optional asset store configuration for storing extracted assets such as images. - :vartype asset_store: "AssetStore" - :ivar freshness_policy: Optional freshness policy for biasing retrieval toward newer documents. - :vartype freshness_policy: "FreshnessPolicy" - :ivar network_access_mode: Optional network access mode for ingestion. Set to 'private' to run + :vartype assetStore: "AssetStore" + :ivar freshnessPolicy: Optional freshness policy for biasing retrieval toward newer documents. + :vartype freshnessPolicy: "FreshnessPolicy" + :ivar networkAccessMode: Optional network access mode for ingestion. Set to 'private' to run ingestion in a private execution environment that can reach data sources and dependencies over a private network. Default is 'public'. This is a create-time setting and cannot be changed after the knowledge source is created. Known values are: "public" and "private". - :vartype network_access_mode: Union[str, "KnowledgeSourceNetworkAccessMode"] + :vartype networkAccessMode: Union[str, "KnowledgeSourceNetworkAccessMode"] """ identity: Optional["SearchIndexerDataIdentity"] @@ -911,14 +911,14 @@ class KnowledgeSourceIngestionParameters(TypedDict, total=False): class KnowledgeSourceStatistics(TypedDict, total=False): """Statistical information about knowledge source synchronization history. - :ivar total_synchronization: Total number of synchronizations. Required. - :vartype total_synchronization: int - :ivar average_synchronization_duration: Average synchronization duration in HH:MM:SS format. + :ivar totalSynchronization: Total number of synchronizations. Required. + :vartype totalSynchronization: int + :ivar averageSynchronizationDuration: Average synchronization duration in HH:MM:SS format. Required. - :vartype average_synchronization_duration: str - :ivar average_items_processed_per_synchronization: Average items processed per synchronization. + :vartype averageSynchronizationDuration: str + :ivar averageItemsProcessedPerSynchronization: Average items processed per synchronization. Required. - :vartype average_items_processed_per_synchronization: int + :vartype averageItemsProcessedPerSynchronization: int """ totalSynchronization: Required[int] @@ -937,18 +937,18 @@ class KnowledgeSourceStatus(TypedDict, total=False): "web", "remoteSharePoint", "workIQ", "file", "mcpServer", "fabricDataAgent", and "fabricOntology". :vartype kind: Union[str, "KnowledgeSourceKind"] - :ivar synchronization_status: The current synchronization status. Required. Known values are: + :ivar synchronizationStatus: The current synchronization status. Required. Known values are: "creating", "active", and "deleting". - :vartype synchronization_status: Union[str, "KnowledgeSourceSynchronizationStatus"] - :ivar synchronization_interval: The synchronization interval (e.g., '1d' for daily). Null if no + :vartype synchronizationStatus: Union[str, "KnowledgeSourceSynchronizationStatus"] + :ivar synchronizationInterval: The synchronization interval (e.g., '1d' for daily). Null if no schedule is configured. - :vartype synchronization_interval: str - :ivar current_synchronization_state: Current synchronization state that spans multiple indexer + :vartype synchronizationInterval: str + :ivar currentSynchronizationState: Current synchronization state that spans multiple indexer runs. - :vartype current_synchronization_state: "SynchronizationState" - :ivar last_synchronization_state: Details of the last completed synchronization. Null on first + :vartype currentSynchronizationState: "SynchronizationState" + :ivar lastSynchronizationState: Details of the last completed synchronization. Null on first sync. - :vartype last_synchronization_state: "CompletedSynchronizationState" + :vartype lastSynchronizationState: "CompletedSynchronizationState" :ivar statistics: Statistical information about the knowledge source synchronization history. Null on first sync. :vartype statistics: "KnowledgeSourceStatistics" @@ -976,19 +976,19 @@ class KnowledgeSourceSynchronizationError(TypedDict, total=False): """Represents a document-level indexing error encountered during a knowledge source synchronization run. - :ivar doc_id: The unique identifier for the failed document or item within the synchronization + :ivar docId: The unique identifier for the failed document or item within the synchronization run. - :vartype doc_id: str - :ivar status_code: HTTP-like status code representing the failure category (e.g., 400). - :vartype status_code: int + :vartype docId: str + :ivar statusCode: HTTP-like status code representing the failure category (e.g., 400). + :vartype statusCode: int :ivar name: Name of the ingestion or processing component reporting the error. :vartype name: str - :ivar error_message: Human-readable, customer-visible error message. Required. - :vartype error_message: str + :ivar errorMessage: Human-readable, customer-visible error message. Required. + :vartype errorMessage: str :ivar details: Additional contextual information about the failure. :vartype details: str - :ivar documentation_link: A link to relevant troubleshooting documentation. - :vartype documentation_link: str + :ivar documentationLink: A link to relevant troubleshooting documentation. + :vartype documentationLink: str """ docId: str @@ -1008,39 +1008,39 @@ class KnowledgeSourceSynchronizationError(TypedDict, total=False): class McpServerKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for an MCP server knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source backed by an MCP (Model Context Protocol) server. :vartype kind: Literal[KnowledgeSourceKind.MCP_SERVER] @@ -1081,46 +1081,46 @@ class McpServerKnowledgeSourceParams(TypedDict, total=False): class RemoteSharePointKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a remote SharePoint knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that reads data from remote SharePoint. :vartype kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] - :ivar filter_expression_add_on: 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. - :vartype filter_expression_add_on: str + :ivar filterExpressionAddOn: 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. + :vartype filterExpressionAddOn: str """ knowledgeSourceName: Required[str] @@ -1161,48 +1161,48 @@ class RemoteSharePointKnowledgeSourceParams(TypedDict, total=False): class SearchIndexKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a search index knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that reads data from a Search Index. :vartype kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] - :ivar filter_add_on: A filter condition applied to the index (e.g., 'State eq VA'). - :vartype filter_add_on: str - :ivar query_hint_overrides: 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 + :ivar filterAddOn: A filter condition applied to the index (e.g., 'State eq VA'). + :vartype filterAddOn: str + :ivar queryHintOverrides: 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. - :vartype query_hint_overrides: "SearchIndexKnowledgeSourceQueryHints" + :vartype queryHintOverrides: "SearchIndexKnowledgeSourceQueryHints" """ knowledgeSourceName: Required[str] @@ -1244,16 +1244,16 @@ class SearchIndexKnowledgeSourceParams(TypedDict, total=False): class SynchronizationState(TypedDict, total=False): """Represents the current state of an ongoing synchronization that spans multiple indexer runs. - :ivar start_time: The start time of the current synchronization. Required. - :vartype start_time: str - :ivar items_updates_processed: The number of item updates successfully processed in the current + :ivar startTime: The start time of the current synchronization. Required. + :vartype startTime: str + :ivar itemsUpdatesProcessed: The number of item updates successfully processed in the current synchronization. Required. - :vartype items_updates_processed: int - :ivar items_updates_failed: The number of item updates that failed in the current + :vartype itemsUpdatesProcessed: int + :ivar itemsUpdatesFailed: The number of item updates that failed in the current synchronization. Required. - :vartype items_updates_failed: int - :ivar items_skipped: The number of items skipped in the current synchronization. Required. - :vartype items_skipped: int + :vartype itemsUpdatesFailed: int + :ivar itemsSkipped: The number of items skipped in the current synchronization. Required. + :vartype itemsSkipped: int :ivar errors: Collection of document-level indexing errors encountered during the current synchronization run. Returned only when errors are present. :vartype errors: list["KnowledgeSourceSynchronizationError"] @@ -1275,39 +1275,39 @@ class SynchronizationState(TypedDict, total=False): class WebKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a web knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that reads data from the web. :vartype kind: Literal[KnowledgeSourceKind.WEB] :ivar language: The language of the web results. @@ -1362,39 +1362,39 @@ class WebKnowledgeSourceParams(TypedDict, total=False): class WorkIQKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a WorkIQ knowledge source. - :ivar knowledge_source_name: The name of the index the params apply to. Required. - :vartype knowledge_source_name: str - :ivar include_references: Indicates whether references should be included for data retrieved + :ivar knowledgeSourceName: The name of the index the params apply to. Required. + :vartype knowledgeSourceName: str + :ivar includeReferences: Indicates whether references should be included for data retrieved from this source. - :vartype include_references: bool - :ivar include_reference_source_data: Indicates whether references should include the structured + :vartype includeReferences: bool + :ivar includeReferenceSourceData: Indicates whether references should include the structured data obtained during retrieval in their payload. - :vartype include_reference_source_data: bool - :ivar always_query_source: Indicates that this knowledge source should bypass source selection + :vartype includeReferenceSourceData: bool + :ivar alwaysQuerySource: Indicates that this knowledge source should bypass source selection and always be queried at retrieval time. - :vartype always_query_source: bool - :ivar never_query_source: Indicates that this knowledge source should be excluded from the + :vartype alwaysQuerySource: bool + :ivar neverQuerySource: 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. - :vartype never_query_source: bool - :ivar fail_on_error: Indicates that the entire retrieval request should fail if retrieval from + :vartype neverQuerySource: bool + :ivar failOnError: Indicates that the entire retrieval request should fail if retrieval from this knowledge source encounters an error. Defaults to false. - :vartype fail_on_error: bool - :ivar reranker_threshold: The reranker threshold all retrieved documents must meet to be + :vartype failOnError: bool + :ivar rerankerThreshold: The reranker threshold all retrieved documents must meet to be included in the response. - :vartype reranker_threshold: float - :ivar results_processing: Overrides the knowledge source's stored resultsProcessing for this + :vartype rerankerThreshold: float + :ivar resultsProcessing: Overrides the knowledge source's stored resultsProcessing for this retrieve call only. When omitted, the stored knowledge source value applies. Known values are: "rerank" and "none". - :vartype results_processing: Union[str, "KnowledgeSourceResultsProcessing"] - :ivar max_output_documents: Limits the maximum number of documents returned from this knowledge + :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] + :ivar maxOutputDocuments: Limits the maximum number of documents returned from this knowledge source. - :vartype max_output_documents: int - :ivar enable_image_serving: 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. - :vartype enable_image_serving: bool + :vartype maxOutputDocuments: int + :ivar enableImageServing: 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. + :vartype enableImageServing: bool :ivar kind: The discriminator value. Required. A knowledge source that reads data from work IQ. :vartype kind: Literal[KnowledgeSourceKind.WORK_IQ] """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/models/_models.py index 511f83418935..84eda0b76d8e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/models/_models.py @@ -128,7 +128,7 @@ class ErrorDetail(_Model): """The error additional info.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). @@ -198,7 +198,7 @@ class FacetResult(_Model): for each faceted field; null if the query did not contain any nested facets.""" -class HybridSearch(_Model): +class HybridSearch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The query parameters to configure hybrid search behaviors. :ivar max_text_recall_size: Determines the maximum number of documents to be retrieved by the @@ -249,7 +249,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexAction(_Model): +class IndexAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represents an index action that operates on a document. :ivar action_type: The operation to perform on a document in an indexing batch. Known values @@ -281,7 +281,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IndexDocumentsBatch(_Model): +class IndexDocumentsBatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Contains a batch of document write actions to send to the index. :ivar actions: The actions in the batch. Required. @@ -607,7 +607,7 @@ class SearchDocumentsResult(_Model): """Type of query rewrite that was used to retrieve documents. \"originalQueryOnly\"""" -class SearchRequest(_Model): +class SearchRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. :ivar include_total_count: A value that specifies whether to fetch the total count of results. @@ -1021,7 +1021,7 @@ class SearchResult(_Model): """Contains debugging information that can be used to further explore your search results.""" -class VectorThreshold(_Model): +class VectorThreshold(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The threshold used for vector queries. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1054,7 +1054,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SearchScoreThreshold(VectorThreshold, discriminator="searchScore"): +class SearchScoreThreshold( + VectorThreshold, discriminator="searchScore" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The results of the vector query will filter based on the '. :ivar value: The threshold will filter based on the '. Required. @@ -1187,7 +1189,7 @@ class TextResult(_Model): """The BM25 or Classic score for the text portion of the query.""" -class VectorQuery(_Model): +class VectorQuery(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The query parameters for vector and hybrid search queries. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1301,7 +1303,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VectorizableImageBinaryQuery(VectorQuery, discriminator="imageBinary"): +class VectorizableImageBinaryQuery( + VectorQuery, discriminator="imageBinary" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The query parameters to use for vector search when a base 64 encoded binary of an image that needs to be vectorized is provided. @@ -1381,7 +1385,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorQueryKind.IMAGE_BINARY # type: ignore -class VectorizableImageUrlQuery(VectorQuery, discriminator="imageUrl"): +class VectorizableImageUrlQuery( + VectorQuery, discriminator="imageUrl" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The query parameters to use for vector search when an url that represents an image value that needs to be vectorized is provided. @@ -1458,7 +1464,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorQueryKind.IMAGE_URL # type: ignore -class VectorizableTextQuery(VectorQuery, discriminator="text"): +class VectorizableTextQuery( + VectorQuery, discriminator="text" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The query parameters to use for vector search when a text value that needs to be vectorized is provided. @@ -1544,7 +1552,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = VectorQueryKind.TEXT # type: ignore -class VectorizedQuery(VectorQuery, discriminator="vector"): +class VectorizedQuery( + VectorQuery, discriminator="vector" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The query parameters to use for vector search when a raw vector value is provided. :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. @@ -1633,7 +1643,9 @@ class VectorsDebugInfo(_Model): method such as RRF.""" -class VectorSimilarityThreshold(VectorThreshold, discriminator="vectorSimilarity"): +class VectorSimilarityThreshold( + VectorThreshold, discriminator="vectorSimilarity" +): # pylint: disable=docstring-keyword-should-match-keyword-only """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 diff --git a/sdk/search/azure-search-documents/azure/search/documents/types.py b/sdk/search/azure-search-documents/azure/search/documents/types.py index c0a3d6b76127..d529419c5477 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/types.py @@ -40,8 +40,8 @@ class AutocompleteItem(TypedDict, total=False): :ivar text: The completed term. Required. :vartype text: str - :ivar query_plus_text: The query along with the completed term. Required. - :vartype query_plus_text: str + :ivar queryPlusText: The query along with the completed term. Required. + :vartype queryPlusText: str """ text: Required[str] @@ -53,8 +53,8 @@ class AutocompleteItem(TypedDict, total=False): class DebugInfo(TypedDict, total=False): """Contains debugging information that can be used to further explore your search results. - :ivar query_rewrites: Contains debugging information specific to query rewrites. - :vartype query_rewrites: "QueryRewritesDebugInfo" + :ivar queryRewrites: Contains debugging information specific to query rewrites. + :vartype queryRewrites: "QueryRewritesDebugInfo" """ queryRewrites: "QueryRewritesDebugInfo" @@ -68,9 +68,9 @@ class DocumentDebugInfo(TypedDict, total=False): :vartype semantic: "SemanticDebugInfo" :ivar vectors: Contains debugging information specific to vector and hybrid search. :vartype vectors: "VectorsDebugInfo" - :ivar inner_hits: Contains debugging information specific to vectors matched within a - collection of complex types. - :vartype inner_hits: dict[str, list["QueryResultDocumentInnerHit"]] + :ivar innerHits: Contains debugging information specific to vectors matched within a collection + of complex types. + :vartype innerHits: dict[str, list["QueryResultDocumentInnerHit"]] """ semantic: "SemanticDebugInfo" @@ -112,27 +112,27 @@ class DocumentDebugInfo(TypedDict, total=False): :ivar cardinality: The resulting total cardinality for the facet when a cardinality metric is requested. :vartype cardinality: int -:ivar facets: The nested facet query results for the search operation, organized as a +:ivar @search.facets: 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. -:vartype facets: dict[str, list["FacetResult"]] +:vartype @search.facets: dict[str, list["FacetResult"]] """ class HybridSearch(TypedDict, total=False): """The query parameters to configure hybrid search behaviors. - :ivar max_text_recall_size: 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. - :vartype max_text_recall_size: int - :ivar count_and_facet_mode: Determines whether the count and facets should includes all - documents that matched the search query, or only the documents that are retrieved within the + :ivar maxTextRecallSize: 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. + :vartype maxTextRecallSize: int + :ivar countAndFacetMode: 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. Known values are: "countRetrievableResults" and "countAllResults". - :vartype count_and_facet_mode: Union[str, "HybridCountAndFacetMode"] + :vartype countAndFacetMode: Union[str, "HybridCountAndFacetMode"] """ maxTextRecallSize: int @@ -157,17 +157,17 @@ class HybridSearch(TypedDict, total=False): ) IndexAction.__doc__ = """Represents an index action that operates on a document. -:ivar action_type: The operation to perform on a document in an indexing batch. Known values +:ivar @search.action: The operation to perform on a document in an indexing batch. Known values are: "upload", "merge", "mergeOrUpload", and "delete". -:vartype action_type: Union[str, "IndexActionType"] +:vartype @search.action: Union[str, "IndexActionType"] """ class IndexDocumentsBatch(TypedDict, total=False): """Contains a batch of document write actions to send to the index. - :ivar actions: The actions in the batch. Required. - :vartype actions: list["IndexAction"] + :ivar value: The actions in the batch. Required. + :vartype value: list["IndexAction"] """ value: Required[list["IndexAction"]] @@ -179,17 +179,17 @@ class IndexingResult(TypedDict, total=False): :ivar key: The key of a document that was in the indexing request. Required. :vartype key: str - :ivar error_message: The error message explaining why the indexing operation failed for the + :ivar errorMessage: The error message explaining why the indexing operation failed for the document identified by the key; null if indexing succeeded. - :vartype error_message: str - :ivar succeeded: A value indicating whether the indexing operation succeeded for the document + :vartype errorMessage: str + :ivar status: A value indicating whether the indexing operation succeeded for the document identified by the key. Required. - :vartype succeeded: bool - :ivar status_code: The status code of the indexing operation. Possible values include: 200 for - a successful update or delete, 201 for successful document creation, 400 for a malformed input + :vartype status: bool + :ivar statusCode: The status code of the indexing operation. Possible values include: 200 for a + successful update or delete, 201 for successful document creation, 400 for a malformed input document, 404 for document not found, 409 for a version conflict, 422 when the index is temporarily unavailable, or 503 for when the service is too busy. Required. - :vartype status_code: int + :vartype statusCode: int """ key: Required[str] @@ -322,8 +322,8 @@ class QueryResultDocumentSubscores(TypedDict, total=False): :vartype text: "TextResult" :ivar vectors: The vector similarity and. :vartype vectors: list[dict[str, "SingleVectorFieldResult"]] - :ivar document_boost: The BM25 or Classic score for the text portion of the query. - :vartype document_boost: float + :ivar documentBoost: The BM25 or Classic score for the text portion of the query. + :vartype documentBoost: float """ text: "TextResult" @@ -352,9 +352,9 @@ class QueryRewritesDebugInfo(TypedDict, total=False): class QueryRewritesValuesDebugInfo(TypedDict, total=False): """Contains debugging information specific to query rewrites. - :ivar input_query: The input text to the generative query rewriting model. There may be cases + :ivar inputQuery: 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. - :vartype input_query: str + :vartype inputQuery: str :ivar rewrites: List of query rewrites. :vartype rewrites: list[str] """ @@ -385,42 +385,43 @@ class QueryRewritesValuesDebugInfo(TypedDict, total=False): ) SearchDocumentsResult.__doc__ = """Response containing search results from an index. -:ivar count: The total count of results found by the search operation, or null if the count was - not requested. If present, the count may be greater than the number of results in this - response. This can happen if you use the $top or $skip parameters, or if the query can't return - all the requested documents in a single response. -:vartype count: int -:ivar coverage: A value indicating the percentage of the index that was included in the query, - or null if minimumCoverage was not specified in the request. -:vartype coverage: float -:ivar facets: The facet query results for the search operation, organized as a collection of - buckets for each faceted field; null if the query did not include any facet expressions. -:vartype facets: dict[str, list["FacetResult"]] -:ivar answers: The answers query results for the search operation; null if the answers query - parameter was not specified or set to 'none'. -:vartype answers: list["QueryAnswerResult"] -:ivar debug_info: Debug information that applies to the search results as a whole. -:vartype debug_info: "DebugInfo" -:ivar next_page_parameters: Continuation JSON payload returned when the query can't return all - the requested results in a single response. You can use this JSON along with. -:vartype next_page_parameters: "SearchRequest" -:ivar results: The sequence of results returned by the query. Required. -:vartype results: list["SearchResult"] -:ivar next_link: Continuation URL returned when the query can't return all the requested +:ivar @odata.count: The total count of results found by the search operation, or null if the + count was not requested. If present, the count may be greater than the number of results in + this response. This can happen if you use the $top or $skip parameters, or if the query can't + return all the requested documents in a single response. +:vartype @odata.count: int +:ivar @search.coverage: A value indicating the percentage of the index that was included in the + query, or null if minimumCoverage was not specified in the request. +:vartype @search.coverage: float +:ivar @search.facets: The facet query results for the search operation, organized as a + collection of buckets for each faceted field; null if the query did not include any facet + expressions. +:vartype @search.facets: dict[str, list["FacetResult"]] +:ivar @search.answers: The answers query results for the search operation; null if the answers + query parameter was not specified or set to 'none'. +:vartype @search.answers: list["QueryAnswerResult"] +:ivar @search.debug: Debug information that applies to the search results as a whole. +:vartype @search.debug: "DebugInfo" +:ivar @search.nextPageParameters: Continuation JSON payload returned when the query can't + return all the requested results in a single response. You can use this JSON along with. +:vartype @search.nextPageParameters: "SearchRequest" +:ivar value: The sequence of results returned by the query. Required. +:vartype value: list["SearchResult"] +:ivar @odata.nextLink: Continuation URL returned when the query can't return all the requested results in a single response. You can use this URL to formulate another GET or POST Search request to get the next part of the search response. Make sure to use the same verb (GET or POST) as the request that produced this response. -:vartype next_link: str -:ivar semantic_partial_response_reason: Reason that a partial response was returned for a +:vartype @odata.nextLink: str +:ivar @search.semanticPartialResponseReason: Reason that a partial response was returned for a semantic ranking request. Known values are: "maxWaitExceeded", "capacityOverloaded", and "transient". -:vartype semantic_partial_response_reason: Union[str, "SemanticErrorReason"] -:ivar semantic_partial_response_type: Type of partial response that was returned for a semantic - ranking request. Known values are: "baseResults" and "rerankedResults". -:vartype semantic_partial_response_type: Union[str, "SemanticSearchResultsType"] -:ivar semantic_query_rewrites_result_type: Type of query rewrite that was used to retrieve +:vartype @search.semanticPartialResponseReason: Union[str, "SemanticErrorReason"] +:ivar @search.semanticPartialResponseType: Type of partial response that was returned for a + semantic ranking request. Known values are: "baseResults" and "rerankedResults". +:vartype @search.semanticPartialResponseType: Union[str, "SemanticSearchResultsType"] +:ivar @search.semanticQueryRewritesResultType: Type of query rewrite that was used to retrieve documents. "originalQueryOnly" -:vartype semantic_query_rewrites_result_type: Union[str, +:vartype @search.semanticQueryRewritesResultType: Union[str, "_enums.SemanticQueryRewritesResultType"] """ @@ -428,78 +429,78 @@ class QueryRewritesValuesDebugInfo(TypedDict, total=False): class SearchRequest(TypedDict, total=False): """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. - :ivar include_total_count: A value that specifies whether to fetch the total count of results. - Default is false. Setting this value to true may have a performance impact. Note that the count - returned is an approximation. - :vartype include_total_count: bool + :ivar count: A value that specifies whether to fetch the total count of results. Default is + false. Setting this value to true may have a performance impact. Note that the count returned + is an approximation. + :vartype count: bool :ivar facets: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. :vartype facets: list[str] :ivar filter: The OData $filter expression to apply to the search query. :vartype filter: str - :ivar highlight_fields: The comma-separated list of field names to use for hit highlights. Only + :ivar highlight: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - :vartype highlight_fields: list[str] - :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :vartype highlight: list[str] + :ivar highlightPostTag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - :vartype highlight_post_tag: str - :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :vartype highlightPostTag: str + :ivar highlightPreTag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - :vartype highlight_pre_tag: str - :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + :vartype highlightPreTag: str + :ivar minimumCoverage: A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - :vartype minimum_coverage: float - :ivar order_by: The comma-separated list of OData $orderby expressions by which to sort the + :vartype minimumCoverage: float + :ivar orderby: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :vartype order_by: list[str] - :ivar query_type: A value that specifies the syntax of the search query. The default is + :vartype orderby: list[str] + :ivar queryType: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Known values are: "simple", "full", and "semantic". - :vartype query_type: Union[str, "QueryType"] - :ivar scoring_statistics: A value that specifies whether we want to calculate scoring - statistics (such as document frequency) globally for more consistent scoring, or locally, for - lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally - before scoring. Using global scoring statistics can increase latency of search queries. Known - values are: "local" and "global". - :vartype scoring_statistics: Union[str, "ScoringStatistics"] - :ivar session_id: A value to be used to create a sticky session, which can help getting more + :vartype queryType: Union[str, "QueryType"] + :ivar scoringStatistics: A value that specifies whether we want to calculate scoring statistics + (such as document frequency) globally for more consistent scoring, or locally, for lower + latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before + scoring. Using global scoring statistics can increase latency of search queries. Known values + are: "local" and "global". + :vartype scoringStatistics: Union[str, "ScoringStatistics"] + :ivar sessionId: A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - :vartype session_id: str - :ivar scoring_parameters: The list of parameter values to be used in scoring functions (for + :vartype sessionId: str + :ivar scoringParameters: The 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 "mylocation--122.2,44.8" (without the quotes). - :vartype scoring_parameters: list[str] - :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching + :vartype scoringParameters: list[str] + :ivar scoringProfile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - :vartype scoring_profile: str + :vartype scoringProfile: str :ivar debug: Enables a debugging tool that can be used to further explore your reranked results. Known values are: "disabled", "semantic", "vector", "queryRewrites", "innerHits", and "all". :vartype debug: Union[str, "QueryDebugMode"] - :ivar search_text: A full-text search query expression; Use "*" or omit this parameter to match - all documents. - :vartype search_text: str - :ivar search_fields: The comma-separated list of field names to which to scope the full-text + :ivar search: A full-text search query expression; Use "*" or omit this parameter to match all + documents. + :vartype search: str + :ivar searchFields: The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. - :vartype search_fields: list[str] - :ivar search_mode: A value that specifies whether any or all of the search terms must be - matched in order to count the document as a match. Known values are: "any" and "all". - :vartype search_mode: Union[str, "SearchMode"] - :ivar query_language: A value that specifies the language of the search query. Known values - are: "none", "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", + :vartype searchFields: list[str] + :ivar searchMode: A value that specifies whether any or all of the search terms must be matched + in order to count the document as a match. Known values are: "any" and "all". + :vartype searchMode: Union[str, "SearchMode"] + :ivar queryLanguage: A value that specifies the language of the search query. Known values are: + "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", @@ -507,10 +508,10 @@ class SearchRequest(TypedDict, total=False): "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", and "ur-pk". - :vartype query_language: Union[str, "QueryLanguage"] - :ivar query_speller: A value that specifies the type of the speller to use to spell-correct + :vartype queryLanguage: Union[str, "QueryLanguage"] + :ivar speller: A value that specifies the type of the speller to use to spell-correct individual search query terms. Known values are: "none" and "lexicon". - :vartype query_speller: Union[str, "QuerySpellerType"] + :vartype speller: Union[str, "QuerySpellerType"] :ivar select: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :vartype select: list[str] @@ -523,40 +524,40 @@ class SearchRequest(TypedDict, total=False): paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. :vartype top: int - :ivar semantic_configuration_name: The name of a semantic configuration that will be used when + :ivar semanticConfiguration: The name of a semantic configuration that will be used when processing documents for queries of type semantic. - :vartype semantic_configuration_name: str - :ivar semantic_error_handling: Allows the user to choose whether a semantic call should fail + :vartype semanticConfiguration: str + :ivar semanticErrorHandling: Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results. Known values are: "partial" and "fail". - :vartype semantic_error_handling: Union[str, "SemanticErrorMode"] - :ivar semantic_max_wait_in_milliseconds: Allows the user to set an upper bound on the amount of + :vartype semanticErrorHandling: Union[str, "SemanticErrorMode"] + :ivar semanticMaxWaitInMilliseconds: Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails. - :vartype semantic_max_wait_in_milliseconds: int - :ivar semantic_query: Allows setting a separate search query that will be solely used for + :vartype semanticMaxWaitInMilliseconds: int + :ivar semanticQuery: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase. - :vartype semantic_query: str + :vartype semanticQuery: str :ivar answers: A value that specifies whether answers should be returned as part of the search response. Known values are: "none" and "extractive". :vartype answers: Union[str, "QueryAnswerType"] :ivar captions: A value that specifies whether captions should be returned as part of the search response. Known values are: "none" and "extractive". :vartype captions: Union[str, "QueryCaptionType"] - :ivar query_rewrites: A value that specifies whether query rewrites should be generated to + :ivar queryRewrites: A value that specifies whether query rewrites should be generated to augment the search query. Known values are: "none" and "generative". - :vartype query_rewrites: Union[str, "QueryRewritesType"] - :ivar semantic_fields: The comma-separated list of field names used for semantic ranking. - :vartype semantic_fields: list[str] - :ivar vector_queries: The query parameters for vector and hybrid search queries. - :vartype vector_queries: list["VectorQuery"] - :ivar vector_filter_mode: Determines whether or not filters are applied before or after the + :vartype queryRewrites: Union[str, "QueryRewritesType"] + :ivar semanticFields: The comma-separated list of field names used for semantic ranking. + :vartype semanticFields: list[str] + :ivar vectorQueries: The query parameters for vector and hybrid search queries. + :vartype vectorQueries: list["VectorQuery"] + :ivar vectorFilterMode: Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter' for new indexes. Known values are: "postFilter", "preFilter", and "strictPostFilter". - :vartype vector_filter_mode: Union[str, "VectorFilterMode"] - :ivar hybrid_search: The query parameters to configure hybrid search behaviors. - :vartype hybrid_search: "HybridSearch" + :vartype vectorFilterMode: Union[str, "VectorFilterMode"] + :ivar hybridSearch: The query parameters to configure hybrid search behaviors. + :vartype hybridSearch: "HybridSearch" """ count: bool @@ -699,28 +700,29 @@ class SearchRequest(TypedDict, total=False): ) SearchResult.__doc__ = """Contains a document found by a search query, plus associated metadata. -:ivar score: The relevance score of the document compared to other documents returned by the - query. Required. -:vartype score: float -:ivar reranker_score: The relevance score computed by the semantic ranker for the top search - results. Search results are sorted by the RerankerScore first and then by the Score. +:ivar @search.score: The relevance score of the document compared to other documents returned + by the query. Required. +:vartype @search.score: float +:ivar @search.rerankerScore: The relevance score computed by the semantic ranker for the top + search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'. -:vartype reranker_score: float -:ivar reranker_boosted_score: The relevance score computed by boosting the Reranker Score. - Search results are sorted by the RerankerScore/RerankerBoostedScore based on +:vartype @search.rerankerScore: float +:ivar @search.rerankerBoostedScore: The relevance score computed by boosting the Reranker + Score. Search results are sorted by the RerankerScore/RerankerBoostedScore based on useScoringProfileBoostedRanking in the Semantic Config. RerankerBoostedScore is only returned for queries of type 'semantic'. -:vartype reranker_boosted_score: float -:ivar highlights: Text fragments from the document that indicate the matching search terms, - organized by each applicable field; null if hit highlighting was not enabled for the query. -:vartype highlights: dict[str, list[str]] -:ivar captions: Captions are the most representative passages from the document relatively to - the search query. They are often used as document summary. Captions are only returned for - queries of type 'semantic'. -:vartype captions: list["QueryCaptionResult"] -:ivar document_debug_info: Contains debugging information that can be used to further explore - your search results. -:vartype document_debug_info: "DocumentDebugInfo" +:vartype @search.rerankerBoostedScore: float +:ivar @search.highlights: Text fragments from the document that indicate the matching search + terms, organized by each applicable field; null if hit highlighting was not enabled for the + query. +:vartype @search.highlights: dict[str, list[str]] +:ivar @search.captions: Captions are the most representative passages from the document + relatively to the search query. They are often used as document summary. Captions are only + returned for queries of type 'semantic'. +:vartype @search.captions: list["QueryCaptionResult"] +:ivar @search.documentDebugInfo: Contains debugging information that can be used to further + explore your search results. +:vartype @search.documentDebugInfo: "DocumentDebugInfo" """ @@ -747,18 +749,18 @@ class SearchScoreThreshold(TypedDict, total=False): class SemanticDebugInfo(TypedDict, total=False): """Contains debugging information specific to semantic ranking requests. - :ivar title_field: The title field that was sent to the semantic enrichment process, as well as + :ivar titleField: The title field that was sent to the semantic enrichment process, as well as how it was used. - :vartype title_field: "QueryResultDocumentSemanticField" - :ivar content_fields: The content fields that were sent to the semantic enrichment process, as + :vartype titleField: "QueryResultDocumentSemanticField" + :ivar contentFields: The content fields that were sent to the semantic enrichment process, as well as how they were used. - :vartype content_fields: list["QueryResultDocumentSemanticField"] - :ivar keyword_fields: The keyword fields that were sent to the semantic enrichment process, as + :vartype contentFields: list["QueryResultDocumentSemanticField"] + :ivar keywordFields: The keyword fields that were sent to the semantic enrichment process, as well as how they were used. - :vartype keyword_fields: list["QueryResultDocumentSemanticField"] - :ivar reranker_input: The raw concatenated strings that were sent to the semantic enrichment + :vartype keywordFields: list["QueryResultDocumentSemanticField"] + :ivar rerankerInput: The raw concatenated strings that were sent to the semantic enrichment process. - :vartype reranker_input: "QueryResultDocumentRerankerInput" + :vartype rerankerInput: "QueryResultDocumentRerankerInput" """ titleField: "QueryResultDocumentSemanticField" @@ -776,12 +778,12 @@ class SemanticDebugInfo(TypedDict, total=False): class SingleVectorFieldResult(TypedDict, total=False): """A single vector field result. Both. - :ivar search_score: The. - :vartype search_score: float - :ivar vector_similarity: The vector similarity score for this document. Note this is the + :ivar searchScore: The. + :vartype searchScore: float + :ivar vectorSimilarity: The vector similarity score for this document. Note this is the canonical definition of similarity metric, not the 'distance' version. For example, cosine similarity instead of cosine distance. - :vartype vector_similarity: float + :vartype vectorSimilarity: float """ searchScore: float @@ -801,16 +803,16 @@ class SingleVectorFieldResult(TypedDict, total=False): ) SuggestResult.__doc__ = """A result containing a document found by a suggestion query, plus associated metadata. -:ivar text: The text of the suggestion result. Required. -:vartype text: str +:ivar @search.text: The text of the suggestion result. Required. +:vartype @search.text: str """ class TextResult(TypedDict, total=False): """The BM25 or Classic score for the text portion of the query. - :ivar search_score: The BM25 or Classic score for the text portion of the query. - :vartype search_score: float + :ivar searchScore: The BM25 or Classic score for the text portion of the query. + :vartype searchScore: float """ searchScore: float @@ -821,8 +823,8 @@ class VectorizableImageBinaryQuery(TypedDict, total=False): """The query parameters to use for vector search when a base 64 encoded binary of an image that needs to be vectorized is provided. - :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. - :vartype k_nearest_neighbors: int + :ivar k: Number of nearest neighbors to return as top hits. + :vartype k: int :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector searched. :vartype fields: str @@ -845,18 +847,18 @@ class VectorizableImageBinaryQuery(TypedDict, total=False): :ivar threshold: The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. :vartype threshold: "VectorThreshold" - :ivar filter_override: 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 + :ivar filterOverride: 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. - :vartype filter_override: str - :ivar per_document_vector_limit: 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, + :vartype filterOverride: str + :ivar perDocumentVectorLimit: 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. - :vartype per_document_vector_limit: int - :ivar base64_image: The base 64 encoded binary of an image to be vectorized to perform a vector + :vartype perDocumentVectorLimit: int + :ivar base64Image: The base 64 encoded binary of an image to be vectorized to perform a vector search query. - :vartype base64_image: str + :vartype base64Image: str :ivar kind: The kind of vector query being performed. Required. Vector query where a base 64 encoded binary of an image that needs to be vectorized is provided. :vartype kind: Literal[VectorQueryKind.IMAGE_BINARY] @@ -904,8 +906,8 @@ class VectorizableImageUrlQuery(TypedDict, total=False): """The query parameters to use for vector search when an url that represents an image value that needs to be vectorized is provided. - :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. - :vartype k_nearest_neighbors: int + :ivar k: Number of nearest neighbors to return as top hits. + :vartype k: int :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector searched. :vartype fields: str @@ -928,15 +930,15 @@ class VectorizableImageUrlQuery(TypedDict, total=False): :ivar threshold: The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. :vartype threshold: "VectorThreshold" - :ivar filter_override: 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 + :ivar filterOverride: 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. - :vartype filter_override: str - :ivar per_document_vector_limit: 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, + :vartype filterOverride: str + :ivar perDocumentVectorLimit: 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. - :vartype per_document_vector_limit: int + :vartype perDocumentVectorLimit: int :ivar url: The URL of an image to be vectorized to perform a vector search query. :vartype url: str :ivar kind: The kind of vector query being performed. Required. Vector query where an url that @@ -986,8 +988,8 @@ class VectorizableTextQuery(TypedDict, total=False): """The query parameters to use for vector search when a text value that needs to be vectorized is provided. - :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. - :vartype k_nearest_neighbors: int + :ivar k: Number of nearest neighbors to return as top hits. + :vartype k: int :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector searched. :vartype fields: str @@ -1010,20 +1012,20 @@ class VectorizableTextQuery(TypedDict, total=False): :ivar threshold: The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. :vartype threshold: "VectorThreshold" - :ivar filter_override: 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 + :ivar filterOverride: 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. - :vartype filter_override: str - :ivar per_document_vector_limit: 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, + :vartype filterOverride: str + :ivar perDocumentVectorLimit: 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. - :vartype per_document_vector_limit: int + :vartype perDocumentVectorLimit: int :ivar text: The text to be vectorized to perform a vector search query. Required. :vartype text: str - :ivar query_rewrites: Can be configured to let a generative model rewrite the query before + :ivar queryRewrites: Can be configured to let a generative model rewrite the query before sending it to be vectorized. Known values are: "none" and "generative". - :vartype query_rewrites: Union[str, "QueryRewritesType"] + :vartype queryRewrites: Union[str, "QueryRewritesType"] :ivar kind: The kind of vector query being performed. Required. Vector query where a text value that needs to be vectorized is provided. :vartype kind: Literal[VectorQueryKind.TEXT] @@ -1073,8 +1075,8 @@ class VectorizableTextQuery(TypedDict, total=False): class VectorizedQuery(TypedDict, total=False): """The query parameters to use for vector search when a raw vector value is provided. - :ivar k_nearest_neighbors: Number of nearest neighbors to return as top hits. - :vartype k_nearest_neighbors: int + :ivar k: Number of nearest neighbors to return as top hits. + :vartype k: int :ivar fields: Vector Fields of type Collection(Edm.Single) to be included in the vector searched. :vartype fields: str @@ -1097,15 +1099,15 @@ class VectorizedQuery(TypedDict, total=False): :ivar threshold: The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. :vartype threshold: "VectorThreshold" - :ivar filter_override: 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 + :ivar filterOverride: 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. - :vartype filter_override: str - :ivar per_document_vector_limit: 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, + :vartype filterOverride: str + :ivar perDocumentVectorLimit: 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. - :vartype per_document_vector_limit: int + :vartype perDocumentVectorLimit: int :ivar vector: The vector representation of a search query. Required. :vartype vector: list[float] :ivar kind: The kind of vector query being performed. Required. Vector query where a raw vector @@ -1196,78 +1198,78 @@ class VectorSimilarityThreshold(TypedDict, total=False): class SearchPostRequest(TypedDict, total=False): """SearchPostRequest. - :ivar include_total_count: A value that specifies whether to fetch the total count of results. - Default is false. Setting this value to true may have a performance impact. Note that the count - returned is an approximation. - :vartype include_total_count: bool + :ivar count: A value that specifies whether to fetch the total count of results. Default is + false. Setting this value to true may have a performance impact. Note that the count returned + is an approximation. + :vartype count: bool :ivar facets: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. :vartype facets: list[str] :ivar filter: The OData $filter expression to apply to the search query. :vartype filter: str - :ivar highlight_fields: The comma-separated list of field names to use for hit highlights. Only + :ivar highlight: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - :vartype highlight_fields: list[str] - :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :vartype highlight: list[str] + :ivar highlightPostTag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - :vartype highlight_post_tag: str - :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :vartype highlightPostTag: str + :ivar highlightPreTag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - :vartype highlight_pre_tag: str - :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + :vartype highlightPreTag: str + :ivar minimumCoverage: A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - :vartype minimum_coverage: float - :ivar order_by: The comma-separated list of OData $orderby expressions by which to sort the + :vartype minimumCoverage: float + :ivar orderby: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :vartype order_by: list[str] - :ivar query_type: A value that specifies the syntax of the search query. The default is + :vartype orderby: list[str] + :ivar queryType: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Known values are: "simple", "full", and "semantic". - :vartype query_type: Union[str, "QueryType"] - :ivar scoring_statistics: A value that specifies whether we want to calculate scoring - statistics (such as document frequency) globally for more consistent scoring, or locally, for - lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally - before scoring. Using global scoring statistics can increase latency of search queries. Known - values are: "local" and "global". - :vartype scoring_statistics: Union[str, "ScoringStatistics"] - :ivar session_id: A value to be used to create a sticky session, which can help getting more + :vartype queryType: Union[str, "QueryType"] + :ivar scoringStatistics: A value that specifies whether we want to calculate scoring statistics + (such as document frequency) globally for more consistent scoring, or locally, for lower + latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before + scoring. Using global scoring statistics can increase latency of search queries. Known values + are: "local" and "global". + :vartype scoringStatistics: Union[str, "ScoringStatistics"] + :ivar sessionId: A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - :vartype session_id: str - :ivar scoring_parameters: The list of parameter values to be used in scoring functions (for + :vartype sessionId: str + :ivar scoringParameters: The 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 "mylocation--122.2,44.8" (without the quotes). - :vartype scoring_parameters: list[str] - :ivar scoring_profile: The name of a scoring profile to evaluate match scores for matching + :vartype scoringParameters: list[str] + :ivar scoringProfile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - :vartype scoring_profile: str + :vartype scoringProfile: str :ivar debug: Enables a debugging tool that can be used to further explore your reranked results. Known values are: "disabled", "semantic", "vector", "queryRewrites", "innerHits", and "all". :vartype debug: Union[str, "QueryDebugMode"] - :ivar search_text: A full-text search query expression; Use "*" or omit this parameter to match - all documents. - :vartype search_text: str - :ivar search_fields: The comma-separated list of field names to which to scope the full-text + :ivar search: A full-text search query expression; Use "*" or omit this parameter to match all + documents. + :vartype search: str + :ivar searchFields: The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. - :vartype search_fields: list[str] - :ivar search_mode: A value that specifies whether any or all of the search terms must be - matched in order to count the document as a match. Known values are: "any" and "all". - :vartype search_mode: Union[str, "SearchMode"] - :ivar query_language: A value that specifies the language of the search query. Known values - are: "none", "en-us", "en-gb", "en-in", "en-ca", "en-au", "fr-fr", "fr-ca", "de-de", "es-es", + :vartype searchFields: list[str] + :ivar searchMode: A value that specifies whether any or all of the search terms must be matched + in order to count the document as a match. Known values are: "any" and "all". + :vartype searchMode: Union[str, "SearchMode"] + :ivar queryLanguage: A value that specifies the language of the search query. Known values are: + "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", @@ -1275,10 +1277,10 @@ class SearchPostRequest(TypedDict, total=False): "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", and "ur-pk". - :vartype query_language: Union[str, "QueryLanguage"] - :ivar query_speller: A value that specifies the type of the speller to use to spell-correct + :vartype queryLanguage: Union[str, "QueryLanguage"] + :ivar speller: A value that specifies the type of the speller to use to spell-correct individual search query terms. Known values are: "none" and "lexicon". - :vartype query_speller: Union[str, "QuerySpellerType"] + :vartype speller: Union[str, "QuerySpellerType"] :ivar select: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :vartype select: list[str] @@ -1291,40 +1293,40 @@ class SearchPostRequest(TypedDict, total=False): paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. :vartype top: int - :ivar semantic_configuration_name: The name of a semantic configuration that will be used when + :ivar semanticConfiguration: The name of a semantic configuration that will be used when processing documents for queries of type semantic. - :vartype semantic_configuration_name: str - :ivar semantic_error_handling: Allows the user to choose whether a semantic call should fail + :vartype semanticConfiguration: str + :ivar semanticErrorHandling: Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results. Known values are: "partial" and "fail". - :vartype semantic_error_handling: Union[str, "SemanticErrorMode"] - :ivar semantic_max_wait_in_milliseconds: Allows the user to set an upper bound on the amount of + :vartype semanticErrorHandling: Union[str, "SemanticErrorMode"] + :ivar semanticMaxWaitInMilliseconds: Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails. - :vartype semantic_max_wait_in_milliseconds: int - :ivar semantic_query: Allows setting a separate search query that will be solely used for + :vartype semanticMaxWaitInMilliseconds: int + :ivar semanticQuery: Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase. - :vartype semantic_query: str + :vartype semanticQuery: str :ivar answers: A value that specifies whether answers should be returned as part of the search response. Known values are: "none" and "extractive". :vartype answers: Union[str, "QueryAnswerType"] :ivar captions: A value that specifies whether captions should be returned as part of the search response. Known values are: "none" and "extractive". :vartype captions: Union[str, "QueryCaptionType"] - :ivar query_rewrites: A value that specifies whether query rewrites should be generated to + :ivar queryRewrites: A value that specifies whether query rewrites should be generated to augment the search query. Known values are: "none" and "generative". - :vartype query_rewrites: Union[str, "QueryRewritesType"] - :ivar semantic_fields: The comma-separated list of field names used for semantic ranking. - :vartype semantic_fields: list[str] - :ivar vector_queries: The query parameters for vector and hybrid search queries. - :vartype vector_queries: list["VectorQuery"] - :ivar vector_filter_mode: Determines whether or not filters are applied before or after the + :vartype queryRewrites: Union[str, "QueryRewritesType"] + :ivar semanticFields: The comma-separated list of field names used for semantic ranking. + :vartype semanticFields: list[str] + :ivar vectorQueries: The query parameters for vector and hybrid search queries. + :vartype vectorQueries: list["VectorQuery"] + :ivar vectorFilterMode: Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter' for new indexes. Known values are: "postFilter", "preFilter", and "strictPostFilter". - :vartype vector_filter_mode: Union[str, "VectorFilterMode"] - :ivar hybrid_search: The query parameters to configure hybrid search behaviors. - :vartype hybrid_search: "HybridSearch" + :vartype vectorFilterMode: Union[str, "VectorFilterMode"] + :ivar hybridSearch: The query parameters to configure hybrid search behaviors. + :vartype hybridSearch: "HybridSearch" """ count: bool @@ -1458,42 +1460,42 @@ class SuggestPostRequest(TypedDict, total=False): :ivar filter: An OData expression that filters the documents considered for suggestions. :vartype filter: str - :ivar use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestion - query. Default is false. When set to true, the query will find suggestions even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and - consume more resources. - :vartype use_fuzzy_matching: bool - :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :ivar fuzzy: A value indicating whether to use fuzzy matching for the suggestion query. Default + is false. When set to true, the query will find suggestions even if there's a substituted or + missing character in the search text. While this provides a better experience in some + scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and consume + more resources. + :vartype fuzzy: bool + :ivar highlightPostTag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :vartype highlight_post_tag: str - :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :vartype highlightPostTag: str + :ivar highlightPreTag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :vartype highlight_pre_tag: str - :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + :vartype highlightPreTag: str + :ivar minimumCoverage: A number between 0 and 100 indicating the percentage of the index that must be covered by a suggestion query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. - :vartype minimum_coverage: float - :ivar order_by: The comma-separated list of OData $orderby expressions by which to sort the + :vartype minimumCoverage: float + :ivar orderby: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :vartype order_by: list[str] - :ivar search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. Required. - :vartype search_text: str - :ivar search_fields: The comma-separated list of field names to search for the specified search + :vartype orderby: list[str] + :ivar search: The search text to use to suggest documents. Must be at least 1 character, and no + more than 100 characters. Required. + :vartype search: str + :ivar searchFields: The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester. - :vartype search_fields: list[str] + :vartype searchFields: list[str] :ivar select: The comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results. :vartype select: list[str] - :ivar suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. Required. - :vartype suggester_name: str + :ivar suggesterName: The name of the suggester as specified in the suggesters collection that's + part of the index definition. Required. + :vartype suggesterName: str :ivar top: The number of suggestions to retrieve. This must be a value between 1 and 100. The default is 5. :vartype top: int @@ -1544,38 +1546,38 @@ class SuggestPostRequest(TypedDict, total=False): class AutocompletePostRequest(TypedDict, total=False): """AutocompletePostRequest. - :ivar search_text: The search text on which to base autocomplete results. Required. - :vartype search_text: str - :ivar autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + :ivar search: The search text on which to base autocomplete results. Required. + :vartype search: str + :ivar autocompleteMode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Known values are: "oneTerm", "twoTerms", and "oneTermWithContext". - :vartype autocomplete_mode: Union[str, "AutocompleteMode"] + :vartype autocompleteMode: Union[str, "AutocompleteMode"] :ivar filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. :vartype filter: str - :ivar use_fuzzy_matching: A value indicating whether to use fuzzy matching for the autocomplete - query. Default is false. When set to true, the query will autocomplete terms even if there's a + :ivar fuzzy: A value indicating whether to use fuzzy matching for the autocomplete query. + Default is false. When set to true, the query will autocomplete terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. - :vartype use_fuzzy_matching: bool - :ivar highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :vartype fuzzy: bool + :ivar highlightPostTag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. - :vartype highlight_post_tag: str - :ivar highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :vartype highlightPostTag: str + :ivar highlightPreTag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. - :vartype highlight_pre_tag: str - :ivar minimum_coverage: A number between 0 and 100 indicating the percentage of the index that + :vartype highlightPreTag: str + :ivar minimumCoverage: A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. - :vartype minimum_coverage: float - :ivar search_fields: The comma-separated list of field names to consider when querying for + :vartype minimumCoverage: float + :ivar searchFields: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. - :vartype search_fields: list[str] - :ivar suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. Required. - :vartype suggester_name: str + :vartype searchFields: list[str] + :ivar suggesterName: The name of the suggester as specified in the suggesters collection that's + part of the index definition. Required. + :vartype suggesterName: str :ivar top: The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5. :vartype top: int From 784c6c40b5eaea6197933c70184e35310403976f Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Tue, 11 Aug 2026 22:57:06 +0000 Subject: [PATCH 11/17] Clean build --- .../skills/azure-search-documents/SKILL.md | 4 + .../references/customizations.md | 15 + .../scripts/apply_generator_workarounds.py | 180 ++ .../azure-search-documents/GENERATOR-BUGS.md | 87 + sdk/search/azure-search-documents/MANIFEST.in | 1 + sdk/search/azure-search-documents/api.md | 1714 ++++++++--------- .../azure-search-documents/api.metadata.yml | 2 +- .../documents/indexes/_operations/_patch.py | 27 +- .../indexes/aio/_operations/_patch.py | 27 +- .../azure/search/documents/indexes/types.py | 12 +- .../search/documents/knowledgebases/_patch.py | 34 +- .../documents/knowledgebases/aio/_patch.py | 34 +- .../search/documents/knowledgebases/types.py | 1 - .../azure/search/documents/models/__init__.py | 2 + .../azure/search/documents/types.py | 2 +- .../doc/azure.search.documents.aio.rst | 7 + .../azure.search.documents.indexes.aio.rst | 7 + .../azure.search.documents.indexes.models.rst | 7 + .../doc/azure.search.documents.indexes.rst | 30 + ...re.search.documents.knowledgebases.aio.rst | 7 + ...search.documents.knowledgebases.models.rst | 7 + .../azure.search.documents.knowledgebases.rst | 27 + .../doc/azure.search.documents.models.rst | 7 + .../doc/azure.search.documents.rst | 32 + 24 files changed, 1336 insertions(+), 937 deletions(-) create mode 100644 sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py create mode 100644 sdk/search/azure-search-documents/GENERATOR-BUGS.md create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.aio.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.indexes.aio.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.indexes.models.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.indexes.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.aio.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.models.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.models.rst create mode 100644 sdk/search/azure-search-documents/doc/azure.search.documents.rst 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 a0982992a6dc..beaa36f33ff9 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 @@ -34,6 +34,10 @@ cd sdk/search/azure-search-documents tsp-client update # or: azsdk_package_generate_code +# Reapply temporary Python emitter workarounds, then verify they are present: +python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py +python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py --check + # If the API version changed, _metadata.json updates automatically; # reconcile the hand-maintained ApiVersion enum in Step 3. ``` 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 dbadf11a7a76..fdcebd021778 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 @@ -2,6 +2,21 @@ File-by-file inventory of every non-empty `_patch.py` in `azure-search-documents`. Use this after running `tsp-client update` to verify each customization still holds. +## Temporary Python emitter workarounds + +Until the issues in `GENERATOR-BUGS.md` are fixed upstream, run the package-owned rewriter after +every regeneration: + +```bash +python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py +python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py --check +``` + +The script is idempotent and applies exact replacements only. It exits with an error before writing +files if the emitter output no longer matches either the known generated or patched form. Remove the +script and these instructions after the emitter produces all four corrected type surfaces and the +package passes MyPy without the rewriter. + --- ## File: `azure/search/documents/_patch.py` diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py new file mode 100644 index 000000000000..351445deb32e --- /dev/null +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py @@ -0,0 +1,180 @@ +#!/usr/bin/env python3 +"""Apply temporary azure-search-documents Python emitter workarounds. Delete when emitter fixes the issues.""" + +from __future__ import annotations + +import argparse +from dataclasses import dataclass +from pathlib import Path + + +PACKAGE_ROOT = Path(__file__).resolve().parents[4] + + +@dataclass(frozen=True) +class Replacement: + path: str + description: str + generated: str + patched: str + + +REPLACEMENTS = ( + Replacement( + "azure/search/documents/models/__init__.py", + "export SemanticQueryRewritesResultType", + """ SemanticFieldState, + SemanticSearchResultsType, +""", + """ SemanticFieldState, + SemanticQueryRewritesResultType, + SemanticSearchResultsType, +""", + ), + Replacement( + "azure/search/documents/models/__init__.py", + "include SemanticQueryRewritesResultType in __all__", + """ "SemanticFieldState", + "SemanticSearchResultsType", +""", + """ "SemanticFieldState", + "SemanticQueryRewritesResultType", + "SemanticSearchResultsType", +""", + ), + Replacement( + "azure/search/documents/types.py", + "use the imported SemanticQueryRewritesResultType enum", + '"@search.semanticQueryRewritesResultType": Union[str, "_enums.SemanticQueryRewritesResultType"],', + '"@search.semanticQueryRewritesResultType": Union[str, "SemanticQueryRewritesResultType"],', + ), + Replacement( + "azure/search/documents/knowledgebases/types.py", + "remove the duplicate KnowledgeSourceKind type-only import", + """ KnowledgeSourceIngestionPermissionOption, + KnowledgeSourceKind, + KnowledgeSourceResultsProcessing, +""", + """ KnowledgeSourceIngestionPermissionOption, + KnowledgeSourceResultsProcessing, +""", + ), + Replacement( + "azure/search/documents/indexes/types.py", + "avoid overriding TypedDict field requiredness", + """class SearchIndexerKnowledgeStoreTableProjectionSelector( + SearchIndexerKnowledgeStoreProjectionSelector +): # pylint: disable=name-too-long + \"\"\"Description for what data to store in Azure Tables. + + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str + :ivar source: Source data to project. + :vartype source: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list[\"InputFieldMappingEntry\"] + :ivar generatedKeyName: Name of generated key to store projection under. Required. + :vartype generatedKeyName: str + :ivar tableName: Name of the Azure table to store projected data in. Required. + :vartype tableName: str + \"\"\" + + generatedKeyName: Required[str] + \"\"\"Name of generated key to store projection under. Required.\"\"\" + tableName: Required[str] + \"\"\"Name of the Azure table to store projected data in. Required.\"\"\" +""", + ( + "class SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False): " + "# pylint: disable=name-too-long\n" + """ \"\"\"Description for what data to store in Azure Tables. + + :ivar referenceKeyName: Name of reference key to different projection. + :vartype referenceKeyName: str + :ivar source: Source data to project. + :vartype source: str + :ivar sourceContext: Source context for complex projections. + :vartype sourceContext: str + :ivar inputs: Nested inputs for complex projections. + :vartype inputs: list[\"InputFieldMappingEntry\"] + :ivar generatedKeyName: Name of generated key to store projection under. Required. + :vartype generatedKeyName: str + :ivar tableName: Name of the Azure table to store projected data in. Required. + :vartype tableName: str + \"\"\" + + referenceKeyName: str + \"\"\"Name of reference key to different projection.\"\"\" + source: str + \"\"\"Source data to project.\"\"\" + sourceContext: str + \"\"\"Source context for complex projections.\"\"\" + inputs: list[\"InputFieldMappingEntry\"] + \"\"\"Nested inputs for complex projections.\"\"\" + generatedKeyName: Required[str] + \"\"\"Name of generated key to store projection under. Required.\"\"\" + tableName: Required[str] + \"\"\"Name of the Azure table to store projected data in. Required.\"\"\" +""" + ), + ), +) + + +def update_sources(*, check: bool) -> int: + sources: dict[Path, str] = {} + pending: list[str] = [] + + for replacement in REPLACEMENTS: + path = PACKAGE_ROOT / replacement.path + source = sources.setdefault(path, path.read_text(encoding="utf-8")) + generated_count = source.count(replacement.generated) + patched_count = source.count(replacement.patched) + + if generated_count == 1 and patched_count == 0: + sources[path] = source.replace(replacement.generated, replacement.patched, 1) + pending.append(replacement.description) + elif generated_count == 0 and patched_count == 1: + continue + else: + raise RuntimeError( + f"Unexpected emitter output in {replacement.path} while attempting to " + f"{replacement.description}; expected exactly one generated or patched snippet" + ) + + if check: + if pending: + print("Generator workarounds are required:") + for description in pending: + print(f"- {description}") + return 1 + print("Generator workarounds are applied.") + return 0 + + for path, source in sources.items(): + path.write_text(source, encoding="utf-8") + + if pending: + print("Applied generator workarounds:") + for description in pending: + print(f"- {description}") + else: + print("Generator workarounds were already applied.") + return 0 + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--check", + action="store_true", + help="verify that all workarounds are applied without changing files", + ) + args = parser.parse_args() + return update_sources(check=args.check) + + +if __name__ == "__main__": + raise SystemExit(main()) \ No newline at end of file diff --git a/sdk/search/azure-search-documents/GENERATOR-BUGS.md b/sdk/search/azure-search-documents/GENERATOR-BUGS.md new file mode 100644 index 000000000000..69ae3d9b119c --- /dev/null +++ b/sdk/search/azure-search-documents/GENERATOR-BUGS.md @@ -0,0 +1,87 @@ +# Python emitter generates invalid type annotations for Azure AI Search + +## Suggested issue title + +Python emitter generates invalid enum imports and TypedDict inheritance for Azure AI Search + +## Environment + +- Package: `azure-search-documents` +- API version: `2026-08-01-preview` +- Python emitter: `@azure-tools/typespec-python` 0.63.3 +- TypeSpec project: `specification/search/data-plane/Search` +- TypeSpec commit: `84400eeb46c48ffe88d81e126449725508c17547` +- Validation: MyPy with Python 3.10 compatibility + +## Summary + +The Python emitter generates four MyPy errors across three `types.py` surfaces. Direct edits to +these files are not viable because SDK regeneration overwrites them. + +## Reproduction + +Generate `azure-search-documents` from the TypeSpec project above, then run: + +```shell +azpysdk --isolate mypy . +``` + +## Actual diagnostics + +```text +azure/search/documents/types.py:16: error: Module "azure.search.documents.models" has no attribute "SemanticQueryRewritesResultType" [attr-defined] +azure/search/documents/types.py:382: error: Name "_enums" is not defined [name-defined] +azure/search/documents/knowledgebases/types.py:28: error: Name "KnowledgeSourceKind" already defined (possibly by an import) [no-redef] +azure/search/documents/indexes/types.py:5443: error: Overwriting TypedDict field "generatedKeyName" while extending [misc] +``` + +## Bug 1: inconsistent enum export and reference + +`SemanticQueryRewritesResultType` is generated in `azure.search.documents.models._enums`, but it is +not exported from `azure.search.documents.models`. The generated `TYPE_CHECKING` import expects the +public export, while `SearchDocumentsResult` refers to the undefined name +`_enums.SemanticQueryRewritesResultType`. + +Expected generation: + +1. Export `SemanticQueryRewritesResultType` from `azure.search.documents.models`. +2. Use a valid direct or public reference in `SearchDocumentsResult`, consistent with the other + generated enum annotations. + +## Bug 2: duplicate enum import + +`azure.search.documents.knowledgebases.types` imports `KnowledgeSourceKind` at runtime from +`indexes.models._enums`, then imports the same name again under `TYPE_CHECKING` from +`indexesmodels`. + +Expected generation: emit only one import for `KnowledgeSourceKind`. The existing runtime import is +sufficient for the generated `Literal` annotations. + +## Bug 3: TypedDict requiredness override + +`SearchIndexerKnowledgeStoreProjectionSelector` declares `generatedKeyName` as optional because the +base `TypedDict` uses `total=False`. `SearchIndexerKnowledgeStoreTableProjectionSelector` inherits +from it and redeclares the same key as `Required[str]`. MyPy does not permit changing a TypedDict +key's requiredness through inheritance. + +Expected generation: preserve `generatedKeyName` as required for table projections without +overwriting an inherited TypedDict field. One valid representation is a standalone table-projection +TypedDict containing the shared selector fields plus required `generatedKeyName` and `tableName`. + +## Expected result + +The generated package passes MyPy without SDK-side edits to generated files, while preserving the +public enum exports and required fields represented by the TypeSpec model. + +## Temporary SDK workaround + +Until the emitter is fixed, the SDK repository applies exact post-generation replacements with: + +```shell +python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py +python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py --check +``` + +The script is idempotent and fails if regenerated output differs from the expected emitter shape. +It repairs only the four diagnostics listed above. Delete the script and its regeneration-guide +references after upgrading to an emitter version that passes MyPy without these replacements. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/MANIFEST.in b/sdk/search/azure-search-documents/MANIFEST.in index 9ae9a22b29e4..28229d044bf6 100644 --- a/sdk/search/azure-search-documents/MANIFEST.in +++ b/sdk/search/azure-search-documents/MANIFEST.in @@ -1,6 +1,7 @@ include *.md include LICENSE include azure/search/documents/py.typed +recursive-include doc *.rst recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py diff --git a/sdk/search/azure-search-documents/api.md b/sdk/search/azure-search-documents/api.md index b40e3032d17a..eabde2ddc129 100644 --- a/sdk/search/azure-search-documents/api.md +++ b/sdk/search/azure-search-documents/api.md @@ -8144,10 +8144,10 @@ namespace azure.search.documents.indexes.types key "description": str key "identity": Optional[SearchIndexerDataIdentity] key "subdomainUrl": Required[str] + @odata.type: Literal[#AIServicesByIdentity] description: str identity: SearchIndexerDataIdentity - odata_type: Literal[#AIServicesByIdentity] - subdomain_url: str + subdomainUrl: str class azure.search.documents.indexes.types.AIServicesAccountKey(TypedDict): @@ -8155,10 +8155,10 @@ namespace azure.search.documents.indexes.types key "description": str key "key": Required[str] key "subdomainUrl": Required[str] + @odata.type: Literal[#AIServicesByKey] description: str key: str - odata_type: Literal[#AIServicesByKey] - subdomain_url: str + subdomainUrl: str class azure.search.documents.indexes.types.AIServicesVisionParameters(TypedDict, total=False): @@ -8166,19 +8166,19 @@ namespace azure.search.documents.indexes.types key "authIdentity": Optional[SearchIndexerDataIdentity] key "modelVersion": Required[Optional[str]] key "resourceUri": Required[str] - api_key: str - auth_identity: SearchIndexerDataIdentity - model_version: str - resource_uri: str + apiKey: str + authIdentity: SearchIndexerDataIdentity + modelVersion: str + resourceUri: str class azure.search.documents.indexes.types.AIServicesVisionVectorizer(TypedDict, total=False): key "aiServicesVisionParameters": ForwardRef('AIServicesVisionParameters', module='types') key "kind": Required[Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION]] key "name": Required[str] - ai_services_vision_parameters: AIServicesVisionParameters + aiServicesVisionParameters: AIServicesVisionParameters kind: Literal[VectorSearchVectorizerKind.AI_SERVICES_VISION] - vectorizer_name: str + name: str class azure.search.documents.indexes.types.AnalyzeResult(TypedDict, total=False): @@ -8191,14 +8191,12 @@ namespace azure.search.documents.indexes.types key "normalizer": Union[str, LexicalNormalizerName] key "text": Required[str] key "tokenizer": Union[str, LexicalTokenizerName] - analyzer_name: Union[str, LexicalAnalyzerName] + analyzer: Union[str, LexicalAnalyzerName] charFilters: list[Union[str, CharFilterName]] - char_filters: list[Union[str, CharFilterName]] - normalizer_name: Union[str, LexicalNormalizerName] + normalizer: Union[str, LexicalNormalizerName] text: str tokenFilters: list[Union[str, TokenFilterName]] - token_filters: list[Union[str, TokenFilterName]] - tokenizer_name: Union[str, LexicalTokenizerName] + tokenizer: Union[str, LexicalTokenizerName] class azure.search.documents.indexes.types.AnalyzedTokenInfo(TypedDict, total=False): @@ -8206,9 +8204,9 @@ namespace azure.search.documents.indexes.types key "position": Required[int] key "startOffset": Required[int] key "token": Required[str] - end_offset: int + endOffset: int position: int - start_offset: int + startOffset: int token: str @@ -8216,16 +8214,16 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#AsciiFoldingTokenFilter"]] key "name": Required[str] key "preserveOriginal": bool + @odata.type: Literal[#AsciiFoldingTokenFilter] name: str - odata_type: Literal[#AsciiFoldingTokenFilter] - preserve_original: bool + preserveOriginal: bool class azure.search.documents.indexes.types.AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): key "applicationId": Required[str] key "applicationSecret": str - application_id: str - application_secret: str + applicationId: str + applicationSecret: str class azure.search.documents.indexes.types.AzureBlobKnowledgeSource(TypedDict): @@ -8236,13 +8234,13 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - azure_blob_parameters: AzureBlobKnowledgeSourceParameters + @odata.etag: str + azureBlobParameters: AzureBlobKnowledgeSourceParameters description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.AZURE_BLOB] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.AzureBlobKnowledgeSourceParameters(TypedDict, total=False): @@ -8253,13 +8251,13 @@ namespace azure.search.documents.indexes.types key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "isADLSGen2": bool key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') - connection_string: str - container_name: str - created_resources: CreatedResources - folder_path: str - ingestion_parameters: KnowledgeSourceIngestionParameters - is_adls_gen2: bool - query_hints: SearchIndexKnowledgeSourceQueryHints + connectionString: str + containerName: str + createdResources: CreatedResources + folderPath: str + ingestionParameters: KnowledgeSourceIngestionParameters + isADLSGen2: bool + queryHints: SearchIndexKnowledgeSourceQueryHints class azure.search.documents.indexes.types.AzureMachineLearningParameters(TypedDict, total=False): @@ -8269,12 +8267,12 @@ namespace azure.search.documents.indexes.types key "resourceId": Optional[str] key "timeout": Optional[str] key "uri": Required[Optional[str]] - authentication_key: str - model_name: Union[str, AIFoundryModelCatalogName] + key: str + modelName: Union[str, AIFoundryModelCatalogName] region: str - resource_id: str - scoring_uri: str + resourceId: str timeout: str + uri: str class azure.search.documents.indexes.types.AzureMachineLearningSkill(TypedDict): @@ -8290,27 +8288,27 @@ namespace azure.search.documents.indexes.types key "resourceId": Optional[str] key "timeout": Optional[str] key "uri": Optional[str] - authentication_key: str + @odata.type: Literal[#AmlSkill] context: str - degree_of_parallelism: int + degreeOfParallelism: int description: str inputs: list[InputFieldMappingEntry] + key: str name: str - odata_type: Literal[#AmlSkill] outputs: list[OutputFieldMappingEntry] region: str - resource_id: str - scoring_uri: str + resourceId: str timeout: str + uri: str class azure.search.documents.indexes.types.AzureMachineLearningVectorizer(TypedDict, total=False): key "amlParameters": ForwardRef('AzureMachineLearningParameters', module='types') key "kind": Required[Literal[VectorSearchVectorizerKind.AML]] key "name": Required[str] - aml_parameters: AzureMachineLearningParameters + amlParameters: AzureMachineLearningParameters kind: Literal[VectorSearchVectorizerKind.AML] - vectorizer_name: str + name: str class azure.search.documents.indexes.types.AzureOpenAIEmbeddingSkill(TypedDict): @@ -8326,34 +8324,33 @@ namespace azure.search.documents.indexes.types key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] key "resourceUri": str - api_key: str - auth_identity: SearchIndexerDataIdentity + @odata.type: Literal[#AzureOpenAIEmbeddingSkill] + apiKey: str + authIdentity: SearchIndexerDataIdentity context: str - deployment_name: str + deploymentId: str description: str dimensions: int inputs: list[InputFieldMappingEntry] - model_name: Union[str, AzureOpenAIModelName] + modelName: Union[str, AzureOpenAIModelName] name: str - odata_type: Literal[#AzureOpenAIEmbeddingSkill] outputs: list[OutputFieldMappingEntry] - resource_url: str + resourceUri: str class azure.search.documents.indexes.types.AzureOpenAITokenizerParameters(TypedDict, total=False): key "encoderModelName": Optional[Union[str, SplitSkillEncoderModelName]] allowedSpecialTokens: list[str] - allowed_special_tokens: list[str] - encoder_model_name: Union[str, SplitSkillEncoderModelName] + encoderModelName: Union[str, SplitSkillEncoderModelName] class azure.search.documents.indexes.types.AzureOpenAIVectorizer(TypedDict, total=False): key "azureOpenAIParameters": ForwardRef('AzureOpenAIVectorizerParameters', module='types') key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] key "name": Required[str] + azureOpenAIParameters: AzureOpenAIVectorizerParameters kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] - parameters: AzureOpenAIVectorizerParameters - vectorizer_name: str + name: str class azure.search.documents.indexes.types.AzureOpenAIVectorizerParameters(TypedDict, total=False): @@ -8362,20 +8359,20 @@ namespace azure.search.documents.indexes.types key "deploymentId": str key "modelName": Union[str, AzureOpenAIModelName] key "resourceUri": str - api_key: str - auth_identity: SearchIndexerDataIdentity - deployment_name: str - model_name: Union[str, AzureOpenAIModelName] - resource_url: str + apiKey: str + authIdentity: SearchIndexerDataIdentity + deploymentId: str + modelName: Union[str, AzureOpenAIModelName] + resourceUri: str class azure.search.documents.indexes.types.BM25SimilarityAlgorithm(TypedDict): key "@odata.type": Required[Literal["#BM25Similarity"]] key "b": Optional[float] key "k1": Optional[float] + @odata.type: Literal[#BM25Similarity] b: float k1: float - odata_type: Literal[#BM25Similarity] class azure.search.documents.indexes.types.BinaryQuantizationCompression(TypedDict, total=False): @@ -8383,10 +8380,10 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "rescoringOptions": Optional[RescoringOptions] key "truncationDimension": Optional[int] - compression_name: str kind: Literal[VectorSearchCompressionKind.BINARY_QUANTIZATION] - rescoring_options: RescoringOptions - truncation_dimension: int + name: str + rescoringOptions: RescoringOptions + truncationDimension: int class azure.search.documents.indexes.types.ChatCompletionCommonModelParameters(TypedDict, total=False): @@ -8397,10 +8394,10 @@ namespace azure.search.documents.indexes.types key "seed": Optional[int] key "stop": Optional[list[str]] key "temperature": Optional[float] - frequency_penalty: float - max_tokens: int - model_name: str - presence_penalty: float + frequencyPenalty: float + maxTokens: int + model: str + presencePenalty: float seed: int stop: list[str] temperature: float @@ -8409,7 +8406,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ChatCompletionResponseFormat(TypedDict, total=False): key "jsonSchemaProperties": Optional[ChatCompletionSchemaProperties] key "type": Union[str, ChatCompletionResponseFormatType] - json_schema_properties: ChatCompletionSchemaProperties + jsonSchemaProperties: ChatCompletionSchemaProperties type: Union[str, ChatCompletionResponseFormatType] @@ -8417,7 +8414,7 @@ namespace azure.search.documents.indexes.types key "additionalProperties": bool key "properties": str key "type": str - additional_properties: bool + additionalProperties: bool properties: str required: list[str] type: str @@ -8448,18 +8445,18 @@ namespace azure.search.documents.indexes.types key "outputs": Required[list[OutputFieldMappingEntry]] key "responseFormat": ForwardRef('ChatCompletionResponseFormat', module='types') key "uri": Required[str] - api_key: str - auth_identity: SearchIndexerDataIdentity - common_model_parameters: ChatCompletionCommonModelParameters + @odata.type: Literal[#ChatCompletionSkill] + apiKey: str + authIdentity: SearchIndexerDataIdentity + commonModelParameters: ChatCompletionCommonModelParameters context: str description: str - extra_parameters: dict[str, Any] - extra_parameters_behavior: Union[str, ChatCompletionExtraParametersBehavior] + extraParameters: dict[str, Any] + extraParametersBehavior: Union[str, ChatCompletionExtraParametersBehavior] inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#ChatCompletionSkill] outputs: list[OutputFieldMappingEntry] - response_format: ChatCompletionResponseFormat + responseFormat: ChatCompletionResponseFormat uri: str @@ -8467,34 +8464,33 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#CjkBigramTokenFilter"]] key "name": Required[str] key "outputUnigrams": bool + @odata.type: Literal[#CjkBigramTokenFilter] ignoreScripts: list[Union[str, CjkBigramTokenFilterScripts]] - ignore_scripts: list[Union[str, CjkBigramTokenFilterScripts]] name: str - odata_type: Literal[#CjkBigramTokenFilter] - output_unigrams: bool + outputUnigrams: bool class azure.search.documents.indexes.types.ClassicSimilarityAlgorithm(TypedDict): key "@odata.type": Required[Literal["#ClassicSimilarity"]] - odata_type: Literal[#ClassicSimilarity] + @odata.type: Literal[#ClassicSimilarity] class azure.search.documents.indexes.types.ClassicTokenizer(TypedDict): key "@odata.type": Required[Literal["#ClassicTokenizer"]] key "maxTokenLength": int key "name": Required[str] - max_token_length: int + @odata.type: Literal[#ClassicTokenizer] + maxTokenLength: int name: str - odata_type: Literal[#ClassicTokenizer] class azure.search.documents.indexes.types.CognitiveServicesAccountKey(TypedDict): key "@odata.type": Required[Literal["#CognitiveServicesByKey"]] key "description": str key "key": Required[str] + @odata.type: Literal[#CognitiveServicesByKey] description: str key: str - odata_type: Literal[#CognitiveServicesByKey] class azure.search.documents.indexes.types.CommonGramTokenFilter(TypedDict): @@ -8503,11 +8499,11 @@ namespace azure.search.documents.indexes.types key "ignoreCase": bool key "name": Required[str] key "queryMode": bool - common_words: list[str] - ignore_case: bool + @odata.type: Literal[#CommonGramTokenFilter] + commonWords: list[str] + ignoreCase: bool name: str - odata_type: Literal[#CommonGramTokenFilter] - use_query_mode: bool + queryMode: bool class azure.search.documents.indexes.types.ConditionalSkill(TypedDict): @@ -8517,11 +8513,11 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#ConditionalSkill] context: str description: str inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#ConditionalSkill] outputs: list[OutputFieldMappingEntry] @@ -8530,8 +8526,8 @@ namespace azure.search.documents.indexes.types key "searchFieldType": Required[str] key "sourceField": Required[str] name: str - search_field_type: str - source_field: str + searchFieldType: str + sourceField: str class azure.search.documents.indexes.types.ContentUnderstandingSkill(TypedDict): @@ -8543,13 +8539,13 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - chunking_properties: ContentUnderstandingSkillChunkingProperties + @odata.type: Literal[#ContentUnderstandingSkill] + chunkingProperties: ContentUnderstandingSkillChunkingProperties context: str description: str - extraction_options: list[Union[str, ContentUnderstandingSkillExtractionOptions]] + extractionOptions: list[Union[str, ContentUnderstandingSkillExtractionOptions]] inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#ContentUnderstandingSkill] outputs: list[OutputFieldMappingEntry] @@ -8558,17 +8554,17 @@ namespace azure.search.documents.indexes.types key "method": Union[str, ContentUnderstandingSkillChunkingMethod] key "overlapLength": Optional[int] key "unit": Optional[Union[str, ContentUnderstandingSkillChunkingUnit]] - maximum_length: int + maximumLength: int method: Union[str, ContentUnderstandingSkillChunkingMethod] - overlap_length: int + overlapLength: int unit: Union[str, ContentUnderstandingSkillChunkingUnit] class azure.search.documents.indexes.types.CorsOptions(TypedDict, total=False): key "allowedOrigins": Required[list[str]] key "maxAgeInSeconds": Optional[int] - allowed_origins: list[str] - max_age_in_seconds: int + allowedOrigins: list[str] + maxAgeInSeconds: int class azure.search.documents.indexes.types.CreatedResources(TypedDict, total=False): @@ -8578,13 +8574,11 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#CustomAnalyzer"]] key "name": Required[str] key "tokenizer": Required[Union[str, LexicalTokenizerName]] + @odata.type: Literal[#CustomAnalyzer] charFilters: list[Union[str, CharFilterName]] - char_filters: list[Union[str, CharFilterName]] name: str - odata_type: Literal[#CustomAnalyzer] tokenFilters: list[Union[str, TokenFilterName]] - token_filters: list[Union[str, TokenFilterName]] - tokenizer_name: Union[str, LexicalTokenizerName] + tokenizer: Union[str, LexicalTokenizerName] class azure.search.documents.indexes.types.CustomEntity(TypedDict, total=False): @@ -8600,14 +8594,14 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "subtype": Optional[str] key "type": Optional[str] - accent_sensitive: bool + accentSensitive: bool aliases: list[CustomEntityAlias] - case_sensitive: bool - default_accent_sensitive: bool - default_case_sensitive: bool - default_fuzzy_edit_distance: int + caseSensitive: bool + defaultAccentSensitive: bool + defaultCaseSensitive: bool + defaultFuzzyEditDistance: int description: str - fuzzy_edit_distance: int + fuzzyEditDistance: int id: str name: str subtype: str @@ -8619,9 +8613,9 @@ namespace azure.search.documents.indexes.types key "caseSensitive": Optional[bool] key "fuzzyEditDistance": Optional[int] key "text": Required[str] - accent_sensitive: bool - case_sensitive: bool - fuzzy_edit_distance: int + accentSensitive: bool + caseSensitive: bool + fuzzyEditDistance: int text: str @@ -8638,41 +8632,39 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#CustomEntityLookupSkill] context: str - default_language_code: Union[str, CustomEntityLookupSkillLanguage] + defaultLanguageCode: Union[str, CustomEntityLookupSkillLanguage] description: str - entities_definition_uri: str - global_default_accent_sensitive: bool - global_default_case_sensitive: bool - global_default_fuzzy_edit_distance: int - inline_entities_definition: list[CustomEntity] + entitiesDefinitionUri: str + globalDefaultAccentSensitive: bool + globalDefaultCaseSensitive: bool + globalDefaultFuzzyEditDistance: int + inlineEntitiesDefinition: list[CustomEntity] inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#CustomEntityLookupSkill] outputs: list[OutputFieldMappingEntry] class azure.search.documents.indexes.types.CustomNormalizer(TypedDict): key "@odata.type": Required[Literal["#CustomNormalizer"]] key "name": Required[str] + @odata.type: Literal[#CustomNormalizer] charFilters: list[Union[str, CharFilterName]] - char_filters: list[Union[str, CharFilterName]] name: str - odata_type: Literal[#CustomNormalizer] tokenFilters: list[Union[str, TokenFilterName]] - token_filters: list[Union[str, TokenFilterName]] class azure.search.documents.indexes.types.DataSourceCredentials(TypedDict, total=False): key "connectionString": str - connection_string: str + connectionString: str class azure.search.documents.indexes.types.DefaultCognitiveServicesAccount(TypedDict): key "@odata.type": Required[Literal["#DefaultCognitiveServices"]] key "description": str + @odata.type: Literal[#DefaultCognitiveServices] description: str - odata_type: Literal[#DefaultCognitiveServices] class azure.search.documents.indexes.types.DictionaryDecompounderTokenFilter(TypedDict): @@ -8683,13 +8675,13 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "onlyLongestMatch": bool key "wordList": Required[list[str]] - max_subword_size: int - min_subword_size: int - min_word_size: int + @odata.type: Literal[#DictionaryDecompounderTokenFilter] + maxSubwordSize: int + minSubwordSize: int + minWordSize: int name: str - odata_type: Literal[#DictionaryDecompounderTokenFilter] - only_longest_match: bool - word_list: list[str] + onlyLongestMatch: bool + wordList: list[str] class azure.search.documents.indexes.types.DistanceScoringFunction(TypedDict, total=False): @@ -8699,17 +8691,17 @@ namespace azure.search.documents.indexes.types key "interpolation": Union[str, ScoringFunctionInterpolation] key "type": Required[Literal["distance"]] boost: float - field_name: str + distance: DistanceScoringParameters + fieldName: str interpolation: Union[str, ScoringFunctionInterpolation] - parameters: DistanceScoringParameters type: Literal[distance] class azure.search.documents.indexes.types.DistanceScoringParameters(TypedDict, total=False): key "boostingDistance": Required[float] key "referencePointParameter": Required[str] - boosting_distance: float - reference_point_parameter: str + boostingDistance: float + referencePointParameter: str class azure.search.documents.indexes.types.DocumentExtractionSkill(TypedDict): @@ -8722,15 +8714,15 @@ namespace azure.search.documents.indexes.types key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] key "parsingMode": Optional[str] + @odata.type: Literal[#DocumentExtractionSkill] configuration: dict[str, Any] context: str - data_to_extract: str + dataToExtract: str description: str inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#DocumentExtractionSkill] outputs: list[OutputFieldMappingEntry] - parsing_mode: str + parsingMode: str class azure.search.documents.indexes.types.DocumentIntelligenceLayoutSkill(TypedDict): @@ -8745,16 +8737,16 @@ namespace azure.search.documents.indexes.types key "outputFormat": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputFormat]] key "outputMode": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputMode]] key "outputs": Required[list[OutputFieldMappingEntry]] - chunking_properties: DocumentIntelligenceLayoutSkillChunkingProperties + @odata.type: Literal[#DocumentIntelligenceLayoutSkill] + chunkingProperties: DocumentIntelligenceLayoutSkillChunkingProperties context: str description: str - extraction_options: list[Union[str, DocumentIntelligenceLayoutSkillExtractionOptions]] + extractionOptions: list[Union[str, DocumentIntelligenceLayoutSkillExtractionOptions]] inputs: list[InputFieldMappingEntry] - markdown_header_depth: Union[str, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth] + markdownHeaderDepth: Union[str, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth] name: str - odata_type: Literal[#DocumentIntelligenceLayoutSkill] - output_format: Union[str, DocumentIntelligenceLayoutSkillOutputFormat] - output_mode: Union[str, DocumentIntelligenceLayoutSkillOutputMode] + outputFormat: Union[str, DocumentIntelligenceLayoutSkillOutputFormat] + outputMode: Union[str, DocumentIntelligenceLayoutSkillOutputMode] outputs: list[OutputFieldMappingEntry] @@ -8762,16 +8754,14 @@ namespace azure.search.documents.indexes.types key "maximumLength": Optional[int] key "overlapLength": Optional[int] key "unit": Optional[Union[str, DocumentIntelligenceLayoutSkillChunkingUnit]] - maximum_length: int - overlap_length: int + maximumLength: int + overlapLength: int unit: Union[str, DocumentIntelligenceLayoutSkillChunkingUnit] class azure.search.documents.indexes.types.DocumentKeysOrIds(TypedDict, total=False): datasourceDocumentIds: list[str] - datasource_document_ids: list[str] documentKeys: list[str] - document_keys: list[str] class azure.search.documents.indexes.types.EdgeNGramTokenFilter(TypedDict): @@ -8780,10 +8770,10 @@ namespace azure.search.documents.indexes.types key "minGram": int key "name": Required[str] key "side": Union[str, EdgeNGramTokenFilterSide] - max_gram: int - min_gram: int + @odata.type: Literal[#EdgeNGramTokenFilter] + maxGram: int + minGram: int name: str - odata_type: Literal[#EdgeNGramTokenFilter] side: Union[str, EdgeNGramTokenFilterSide] @@ -8793,10 +8783,10 @@ namespace azure.search.documents.indexes.types key "minGram": int key "name": Required[str] key "side": Union[str, EdgeNGramTokenFilterSide] - max_gram: int - min_gram: int + @odata.type: Literal[#EdgeNGramTokenFilterV2] + maxGram: int + minGram: int name: str - odata_type: Literal[#EdgeNGramTokenFilterV2] side: Union[str, EdgeNGramTokenFilterSide] @@ -8805,27 +8795,26 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - max_gram: int - min_gram: int + @odata.type: Literal[#EdgeNGramTokenizer] + maxGram: int + minGram: int name: str - odata_type: Literal[#EdgeNGramTokenizer] tokenChars: list[Union[str, TokenCharacterKind]] - token_chars: list[Union[str, TokenCharacterKind]] class azure.search.documents.indexes.types.ElisionTokenFilter(TypedDict): key "@odata.type": Required[Literal["#ElisionTokenFilter"]] key "name": Required[str] + @odata.type: Literal[#ElisionTokenFilter] articles: list[str] name: str - odata_type: Literal[#ElisionTokenFilter] class azure.search.documents.indexes.types.EmbeddingColumnMapping(TypedDict, total=False): key "name": Required[str] key "sourceField": Required[str] name: str - source_field: str + sourceField: str class azure.search.documents.indexes.types.EntityLinkingSkill(TypedDict): @@ -8838,14 +8827,14 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#EntityLinkingSkill] context: str - default_language_code: str + defaultLanguageCode: str description: str inputs: list[InputFieldMappingEntry] - minimum_precision: float - model_version: str + minimumPrecision: float + modelVersion: str name: str - odata_type: Literal[#EntityLinkingSkill] outputs: list[OutputFieldMappingEntry] @@ -8859,15 +8848,15 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#EntityRecognitionSkill] categories: list[Union[str, EntityCategory]] context: str - default_language_code: Union[str, EntityRecognitionSkillLanguage] + defaultLanguageCode: Union[str, EntityRecognitionSkillLanguage] description: str inputs: list[InputFieldMappingEntry] - minimum_precision: float - model_version: str + minimumPrecision: float + modelVersion: str name: str - odata_type: Literal[#EntityRecognitionSkill] outputs: list[OutputFieldMappingEntry] @@ -8875,18 +8864,18 @@ namespace azure.search.documents.indexes.types key "applicationId": Required[str] key "federatedCredentialId": Required[str] key "tenantId": str - application_id: str - federated_credential_id: str - tenant_id: str + applicationId: str + federatedCredentialId: str + tenantId: str class azure.search.documents.indexes.types.ExhaustiveKnnAlgorithmConfiguration(TypedDict, total=False): key "exhaustiveKnnParameters": ForwardRef('ExhaustiveKnnParameters', module='types') key "kind": Required[Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN]] key "name": Required[str] + exhaustiveKnnParameters: ExhaustiveKnnParameters kind: Literal[VectorSearchAlgorithmKind.EXHAUSTIVE_KNN] name: str - parameters: ExhaustiveKnnParameters class azure.search.documents.indexes.types.ExhaustiveKnnParameters(TypedDict, total=False): @@ -8902,20 +8891,20 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - fabric_data_agent_parameters: FabricDataAgentKnowledgeSourceParameters + encryptionKey: SearchResourceEncryptionKey + fabricDataAgentParameters: FabricDataAgentKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): key "dataAgentId": Required[str] key "workspaceId": Required[str] - data_agent_id: str - workspace_id: str + dataAgentId: str + workspaceId: str class azure.search.documents.indexes.types.FabricOntologyKnowledgeSource(TypedDict): @@ -8926,29 +8915,29 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - fabric_ontology_parameters: FabricOntologyKnowledgeSourceParameters + encryptionKey: SearchResourceEncryptionKey + fabricOntologyParameters: FabricOntologyKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.FabricOntologyKnowledgeSourceParameters(TypedDict, total=False): key "ontologyId": Required[str] key "workspaceId": Required[str] - ontology_id: str - workspace_id: str + ontologyId: str + workspaceId: str class azure.search.documents.indexes.types.FieldMapping(TypedDict, total=False): key "mappingFunction": Optional[FieldMappingFunction] key "sourceFieldName": Required[str] key "targetFieldName": str - mapping_function: FieldMappingFunction - source_field_name: str - target_field_name: str + mappingFunction: FieldMappingFunction + sourceFieldName: str + targetFieldName: str class azure.search.documents.indexes.types.FieldMappingFunction(TypedDict, total=False): @@ -8967,28 +8956,28 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.FILE]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - cors_options: CorsOptions + @odata.etag: str + corsOptions: CorsOptions description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - file_parameters: FileKnowledgeSourceParameters + encryptionKey: SearchResourceEncryptionKey + fileParameters: FileKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.FILE] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.FileKnowledgeSourceParameters(TypedDict, total=False): key "createdResources": ForwardRef('CreatedResources', module='types') key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') - created_resources: CreatedResources - ingestion_parameters: KnowledgeSourceIngestionParameters - query_hints: SearchIndexKnowledgeSourceQueryHints + createdResources: CreatedResources + ingestionParameters: KnowledgeSourceIngestionParameters + queryHints: SearchIndexKnowledgeSourceQueryHints class azure.search.documents.indexes.types.FileUploadMetadata(TypedDict, total=False): key "fileName": str - file_name: str + fileName: str metadata: dict[str, str] @@ -8999,40 +8988,40 @@ namespace azure.search.documents.indexes.types key "interpolation": Union[str, ScoringFunctionInterpolation] key "type": Required[Literal["freshness"]] boost: float - field_name: str + fieldName: str + freshness: FreshnessScoringParameters interpolation: Union[str, ScoringFunctionInterpolation] - parameters: FreshnessScoringParameters type: Literal[freshness] class azure.search.documents.indexes.types.FreshnessScoringParameters(TypedDict, total=False): key "boostingDuration": Required[str] - boosting_duration: str + boostingDuration: str class azure.search.documents.indexes.types.GetIndexStatisticsResult(TypedDict, total=False): key "documentCount": Required[int] key "storageSize": Required[int] key "vectorIndexSize": Required[int] - document_count: int - storage_size: int - vector_index_size: int + documentCount: int + storageSize: int + vectorIndexSize: int class azure.search.documents.indexes.types.HighWaterMarkChangeDetectionPolicy(TypedDict): key "@odata.type": Required[Literal["#HighWaterMarkChangeDetectionPolicy"]] key "highWaterMarkColumnName": Required[str] - high_water_mark_column_name: str - odata_type: Literal[#HighWaterMarkChangeDetectionPolicy] + @odata.type: Literal[#HighWaterMarkChangeDetectionPolicy] + highWaterMarkColumnName: str class azure.search.documents.indexes.types.HnswAlgorithmConfiguration(TypedDict, total=False): key "hnswParameters": ForwardRef('HnswParameters', module='types') key "kind": Required[Literal[VectorSearchAlgorithmKind.HNSW]] key "name": Required[str] + hnswParameters: HnswParameters kind: Literal[VectorSearchAlgorithmKind.HNSW] name: str - parameters: HnswParameters class azure.search.documents.indexes.types.HnswParameters(TypedDict, total=False): @@ -9040,8 +9029,8 @@ namespace azure.search.documents.indexes.types key "efSearch": int key "m": int key "metric": Optional[Union[str, VectorSearchAlgorithmMetric]] - ef_construction: int - ef_search: int + efConstruction: int + efSearch: int m: int metric: Union[str, VectorSearchAlgorithmMetric] @@ -9054,16 +9043,15 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#ImageAnalysisSkill] context: str - default_language_code: Union[str, ImageAnalysisSkillLanguage] + defaultLanguageCode: Union[str, ImageAnalysisSkillLanguage] description: str details: list[Union[str, ImageDetail]] inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#ImageAnalysisSkill] outputs: list[OutputFieldMappingEntry] visualFeatures: list[Union[str, VisualFeature]] - visual_features: list[Union[str, VisualFeature]] class azure.search.documents.indexes.types.IndexedOneLakeKnowledgeSource(TypedDict): @@ -9074,13 +9062,13 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - indexed_one_lake_parameters: IndexedOneLakeKnowledgeSourceParameters + encryptionKey: SearchResourceEncryptionKey + indexedOneLakeParameters: IndexedOneLakeKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): @@ -9090,12 +9078,12 @@ namespace azure.search.documents.indexes.types key "lakehouseId": Required[str] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "targetPath": Optional[str] - created_resources: CreatedResources - fabric_workspace_id: str - ingestion_parameters: KnowledgeSourceIngestionParameters - lakehouse_id: str - query_hints: SearchIndexKnowledgeSourceQueryHints - target_path: str + createdResources: CreatedResources + fabricWorkspaceId: str + ingestionParameters: KnowledgeSourceIngestionParameters + lakehouseId: str + queryHints: SearchIndexKnowledgeSourceQueryHints + targetPath: str class azure.search.documents.indexes.types.IndexedSharePointKnowledgeSource(TypedDict): @@ -9106,13 +9094,13 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - indexed_share_point_parameters: IndexedSharePointKnowledgeSourceParameters + encryptionKey: SearchResourceEncryptionKey + indexedSharePointParameters: IndexedSharePointKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): @@ -9122,12 +9110,12 @@ namespace azure.search.documents.indexes.types key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "query": Optional[str] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') - connection_string: str - container_name: Union[str, IndexedSharePointContainerName] - created_resources: CreatedResources - ingestion_parameters: KnowledgeSourceIngestionParameters + connectionString: str + containerName: Union[str, IndexedSharePointContainerName] + createdResources: CreatedResources + ingestionParameters: KnowledgeSourceIngestionParameters query: str - query_hints: SearchIndexKnowledgeSourceQueryHints + queryHints: SearchIndexKnowledgeSourceQueryHints class azure.search.documents.indexes.types.IndexedSqlKnowledgeSource(TypedDict): @@ -9138,13 +9126,13 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - indexed_sql_parameters: IndexedSqlKnowledgeSourceParameters + encryptionKey: SearchResourceEncryptionKey + indexedSqlParameters: IndexedSqlKnowledgeSourceParameters kind: Literal[KnowledgeSourceKind.INDEXED_SQL] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.IndexedSqlKnowledgeSourceParameters(TypedDict, total=False): @@ -9154,16 +9142,14 @@ namespace azure.search.documents.indexes.types key "ingestionParameters": Optional[KnowledgeSourceIngestionParameters] key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "tableOrView": Required[str] - connection_string: str + connectionString: str contentColumns: list[ContentColumnMapping] - content_columns: list[ContentColumnMapping] - created_resources: CreatedResources + createdResources: CreatedResources embeddingColumns: list[EmbeddingColumnMapping] - embedding_columns: list[EmbeddingColumnMapping] - high_water_mark_column_name: str - ingestion_parameters: KnowledgeSourceIngestionParameters - query_hints: SearchIndexKnowledgeSourceQueryHints - table_or_view: str + highWaterMarkColumnName: str + ingestionParameters: KnowledgeSourceIngestionParameters + queryHints: SearchIndexKnowledgeSourceQueryHints + tableOrView: str class azure.search.documents.indexes.types.IndexerResyncBody(TypedDict, total=False): @@ -9176,10 +9162,10 @@ namespace azure.search.documents.indexes.types key "configuration": ForwardRef('IndexingParametersConfiguration', module='types') key "maxFailedItems": Optional[int] key "maxFailedItemsPerBatch": Optional[int] - batch_size: int + batchSize: int configuration: IndexingParametersConfiguration - max_failed_items: int - max_failed_items_per_batch: int + maxFailedItems: int + maxFailedItemsPerBatch: int class azure.search.documents.indexes.types.IndexingParametersConfiguration(TypedDict, total=False): @@ -9201,31 +9187,31 @@ namespace azure.search.documents.indexes.types key "parsingMode": Union[str, BlobIndexerParsingMode] key "pdfTextRotationAlgorithm": Union[str, BlobIndexerPDFTextRotationAlgorithm] key "queryTimeout": str - allow_skillset_to_read_file_data: bool - data_to_extract: Union[str, BlobIndexerDataToExtract] - delimited_text_delimiter: str - delimited_text_headers: str - document_root: str - excluded_file_name_extensions: str - execution_environment: Union[str, IndexerExecutionEnvironment] - fail_on_unprocessable_document: bool - fail_on_unsupported_content_type: bool - first_line_contains_headers: bool - image_action: Union[str, BlobIndexerImageAction] - index_storage_metadata_only_for_oversized_documents: bool - indexed_file_name_extensions: str - markdown_header_depth: Union[str, MarkdownHeaderDepth] - markdown_parsing_submode: Union[str, MarkdownParsingSubmode] - parsing_mode: Union[str, BlobIndexerParsingMode] - pdf_text_rotation_algorithm: Union[str, BlobIndexerPDFTextRotationAlgorithm] - query_timeout: str + allowSkillsetToReadFileData: bool + dataToExtract: Union[str, BlobIndexerDataToExtract] + delimitedTextDelimiter: str + delimitedTextHeaders: str + documentRoot: str + excludedFileNameExtensions: str + executionEnvironment: Union[str, IndexerExecutionEnvironment] + failOnUnprocessableDocument: bool + failOnUnsupportedContentType: bool + firstLineContainsHeaders: bool + imageAction: Union[str, BlobIndexerImageAction] + indexStorageMetadataOnlyForOversizedDocuments: bool + indexedFileNameExtensions: str + markdownHeaderDepth: Union[str, MarkdownHeaderDepth] + markdownParsingSubmode: Union[str, MarkdownParsingSubmode] + parsingMode: Union[str, BlobIndexerParsingMode] + pdfTextRotationAlgorithm: Union[str, BlobIndexerPDFTextRotationAlgorithm] + queryTimeout: str class azure.search.documents.indexes.types.IndexingSchedule(TypedDict, total=False): key "interval": Required[str] key "startTime": str interval: str - start_time: str + startTime: str class azure.search.documents.indexes.types.InputFieldMappingEntry(TypedDict, total=False): @@ -9235,7 +9221,7 @@ namespace azure.search.documents.indexes.types inputs: list[InputFieldMappingEntry] name: str source: str - source_context: str + sourceContext: str class azure.search.documents.indexes.types.KeepTokenFilter(TypedDict): @@ -9243,10 +9229,10 @@ namespace azure.search.documents.indexes.types key "keepWords": Required[list[str]] key "keepWordsCase": bool key "name": Required[str] - keep_words: list[str] - lower_case_keep_words: bool + @odata.type: Literal[#KeepTokenFilter] + keepWords: list[str] + keepWordsCase: bool name: str - odata_type: Literal[#KeepTokenFilter] class azure.search.documents.indexes.types.KeyPhraseExtractionSkill(TypedDict): @@ -9259,14 +9245,14 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#KeyPhraseExtractionSkill] context: str - default_language_code: Union[str, KeyPhraseExtractionSkillLanguage] + defaultLanguageCode: Union[str, KeyPhraseExtractionSkillLanguage] description: str inputs: list[InputFieldMappingEntry] - max_key_phrase_count: int - model_version: str + maxKeyPhraseCount: int + modelVersion: str name: str - odata_type: Literal[#KeyPhraseExtractionSkill] outputs: list[OutputFieldMappingEntry] @@ -9275,28 +9261,28 @@ namespace azure.search.documents.indexes.types key "ignoreCase": bool key "keywords": Required[list[str]] key "name": Required[str] - ignore_case: bool + @odata.type: Literal[#KeywordMarkerTokenFilter] + ignoreCase: bool keywords: list[str] name: str - odata_type: Literal[#KeywordMarkerTokenFilter] class azure.search.documents.indexes.types.KeywordTokenizer(TypedDict): key "@odata.type": Required[Literal["#KeywordTokenizer"]] key "bufferSize": int key "name": Required[str] - buffer_size: int + @odata.type: Literal[#KeywordTokenizer] + bufferSize: int name: str - odata_type: Literal[#KeywordTokenizer] class azure.search.documents.indexes.types.KeywordTokenizerV2(TypedDict): key "@odata.type": Required[Literal["#KeywordTokenizerV2"]] key "maxTokenLength": int key "name": Required[str] - max_token_length: int + @odata.type: Literal[#KeywordTokenizerV2] + maxTokenLength: int name: str - odata_type: Literal[#KeywordTokenizerV2] class azure.search.documents.indexes.types.KnowledgeBase(TypedDict): @@ -9311,32 +9297,32 @@ namespace azure.search.documents.indexes.types key "retrievalInstructions": str key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort', module='types') key "retrieveDefaults": ForwardRef('KnowledgeBaseRetrieveDefaults', module='types') - answer_instructions: str - cors_options: CorsOptions + @odata.etag: str + answerInstructions: str + corsOptions: CorsOptions description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - knowledge_sources: list[KnowledgeSourceReference] + encryptionKey: SearchResourceEncryptionKey + knowledgeSources: list[KnowledgeSourceReference] models: list[KnowledgeBaseModel] name: str - output_mode: Union[str, KnowledgeRetrievalOutputMode] - retrieval_instructions: str - retrieval_reasoning_effort: KnowledgeRetrievalReasoningEffort - retrieve_defaults: KnowledgeBaseRetrieveDefaults + outputMode: Union[str, KnowledgeRetrievalOutputMode] + retrievalInstructions: str + retrievalReasoningEffort: KnowledgeRetrievalReasoningEffort + retrieveDefaults: KnowledgeBaseRetrieveDefaults tags: dict[str, str] class azure.search.documents.indexes.types.KnowledgeBaseAzureOpenAIModel(TypedDict, total=False): key "azureOpenAIParameters": Required[AzureOpenAIVectorizerParameters] key "kind": Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] - azure_open_ai_parameters: AzureOpenAIVectorizerParameters + azureOpenAIParameters: AzureOpenAIVectorizerParameters kind: Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI] class azure.search.documents.indexes.types.KnowledgeBaseModel(TypedDict, total=False): key "azureOpenAIParameters": Required[AzureOpenAIVectorizerParameters] key "kind": Required[Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI]] - azure_open_ai_parameters: AzureOpenAIVectorizerParameters + azureOpenAIParameters: AzureOpenAIVectorizerParameters kind: Literal[KnowledgeBaseModelKind.AZURE_OPEN_AI] @@ -9348,9 +9334,9 @@ namespace azure.search.documents.indexes.types key "maxOutputDocuments": int key "maxOutputSizeInTokens": int key "maxRuntimeInSeconds": int - max_output_documents: int - max_output_size_in_tokens: int - max_runtime_in_seconds: int + maxOutputDocuments: int + maxOutputSizeInTokens: int + maxRuntimeInSeconds: int class azure.search.documents.indexes.types.KnowledgeSourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -9372,8 +9358,8 @@ namespace azure.search.documents.indexes.types key "enableFreshness": bool key "enableImageServing": bool key "name": Required[str] - enable_freshness: bool - enable_image_serving: bool + enableFreshness: bool + enableImageServing: bool name: str @@ -9386,13 +9372,13 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#LanguageDetectionSkill] context: str - default_country_hint: str + defaultCountryHint: str description: str inputs: list[InputFieldMappingEntry] - model_version: str + modelVersion: str name: str - odata_type: Literal[#LanguageDetectionSkill] outputs: list[OutputFieldMappingEntry] @@ -9401,21 +9387,19 @@ namespace azure.search.documents.indexes.types key "max": int key "min": int key "name": Required[str] - max_length: int - min_length: int + @odata.type: Literal[#LengthTokenFilter] + max: int + min: int name: str - odata_type: Literal[#LengthTokenFilter] class azure.search.documents.indexes.types.LexicalNormalizer(TypedDict): key "@odata.type": Required[Literal["#CustomNormalizer"]] key "name": Required[str] + @odata.type: Literal[#CustomNormalizer] charFilters: list[Union[str, CharFilterName]] - char_filters: list[Union[str, CharFilterName]] name: str - odata_type: Literal[#CustomNormalizer] tokenFilters: list[Union[str, TokenFilterName]] - token_filters: list[Union[str, TokenFilterName]] class azure.search.documents.indexes.types.LimitTokenFilter(TypedDict): @@ -9423,19 +9407,19 @@ namespace azure.search.documents.indexes.types key "consumeAllTokens": bool key "maxTokenCount": int key "name": Required[str] - consume_all_tokens: bool - max_token_count: int + @odata.type: Literal[#LimitTokenFilter] + consumeAllTokens: bool + maxTokenCount: int name: str - odata_type: Literal[#LimitTokenFilter] class azure.search.documents.indexes.types.LuceneStandardAnalyzer(TypedDict): key "@odata.type": Required[Literal["#StandardAnalyzer"]] key "maxTokenLength": int key "name": Required[str] - max_token_length: int + @odata.type: Literal[#StandardAnalyzer] + maxTokenLength: int name: str - odata_type: Literal[#StandardAnalyzer] stopwords: list[str] @@ -9443,18 +9427,18 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#StandardTokenizer"]] key "maxTokenLength": int key "name": Required[str] - max_token_length: int + @odata.type: Literal[#StandardTokenizer] + maxTokenLength: int name: str - odata_type: Literal[#StandardTokenizer] class azure.search.documents.indexes.types.LuceneStandardTokenizerV2(TypedDict): key "@odata.type": Required[Literal["#StandardTokenizerV2"]] key "maxTokenLength": int key "name": Required[str] - max_token_length: int + @odata.type: Literal[#StandardTokenizerV2] + maxTokenLength: int name: str - odata_type: Literal[#StandardTokenizerV2] class azure.search.documents.indexes.types.MagnitudeScoringFunction(TypedDict, total=False): @@ -9464,9 +9448,9 @@ namespace azure.search.documents.indexes.types key "magnitude": Required[MagnitudeScoringParameters] key "type": Required[Literal["magnitude"]] boost: float - field_name: str + fieldName: str interpolation: Union[str, ScoringFunctionInterpolation] - parameters: MagnitudeScoringParameters + magnitude: MagnitudeScoringParameters type: Literal[magnitude] @@ -9474,18 +9458,18 @@ namespace azure.search.documents.indexes.types key "boostingRangeEnd": Required[float] key "boostingRangeStart": Required[float] key "constantBoostBeyondRange": bool - boosting_range_end: float - boosting_range_start: float - should_boost_beyond_range_by_constant: bool + boostingRangeEnd: float + boostingRangeStart: float + constantBoostBeyondRange: bool class azure.search.documents.indexes.types.MappingCharFilter(TypedDict): key "@odata.type": Required[Literal["#MappingCharFilter"]] key "mappings": Required[list[str]] key "name": Required[str] + @odata.type: Literal[#MappingCharFilter] mappings: list[str] name: str - odata_type: Literal[#MappingCharFilter] class azure.search.documents.indexes.types.McpServerAuthenticationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -9501,13 +9485,13 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.McpServerFoundryConnectionAuthentication(TypedDict, total=False): key "foundryConnectionParameters": Required[McpServerFoundryConnectionParameters] key "kind": Required[Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION]] - foundry_connection_parameters: McpServerFoundryConnectionParameters + foundryConnectionParameters: McpServerFoundryConnectionParameters kind: Literal[McpServerAuthenticationKind.FOUNDRY_CONNECTION] class azure.search.documents.indexes.types.McpServerFoundryConnectionParameters(TypedDict, total=False): key "connectionId": str - connection_id: str + connectionId: str class azure.search.documents.indexes.types.McpServerHeaders(TypedDict, total=False): @@ -9516,7 +9500,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.McpServerJsonOutputParsing(TypedDict, total=False): key "jsonParameters": Required[McpServerOutputParsingJsonParameters] key "kind": Required[Literal[McpServerOutputParsingKind.JSON]] - json_parameters: McpServerOutputParsingJsonParameters + jsonParameters: McpServerOutputParsingJsonParameters kind: Literal[McpServerOutputParsingKind.JSON] @@ -9528,13 +9512,13 @@ namespace azure.search.documents.indexes.types key "mcpServerParameters": Required[McpServerKnowledgeSourceParameters] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.MCP_SERVER] - mcp_server_parameters: McpServerKnowledgeSourceParameters + mcpServerParameters: McpServerKnowledgeSourceParameters name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.McpServerKnowledgeSourceParameters(TypedDict, total=False): @@ -9542,7 +9526,7 @@ namespace azure.search.documents.indexes.types key "serverURL": Required[str] key "tools": Required[list[McpServerTool]] authentication: McpServerAuthentication - server_url: str + serverURL: str tools: list[McpServerTool] @@ -9554,8 +9538,8 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.McpServerOutputParsingJsonParameters(TypedDict, total=False): key "documentsPath": Required[str] key "includeContext": bool - documents_path: str - include_context: bool + documentsPath: str + includeContext: bool class azure.search.documents.indexes.types.McpServerOutputParsingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -9571,25 +9555,25 @@ namespace azure.search.documents.indexes.types key "maximumPagesToTake": int key "pageOverlapLength": int key "textSplitMode": Union[str, TextSplitMode] - default_language_code: Union[str, SplitSkillLanguage] - maximum_page_length: int - maximum_pages_to_take: int - page_overlap_length: int - text_split_mode: Union[str, TextSplitMode] + defaultLanguageCode: Union[str, SplitSkillLanguage] + maximumPageLength: int + maximumPagesToTake: int + pageOverlapLength: int + textSplitMode: Union[str, TextSplitMode] class azure.search.documents.indexes.types.McpServerSplitOutputParsing(TypedDict, total=False): key "kind": Required[Literal[McpServerOutputParsingKind.SPLIT]] key "splitParameters": ForwardRef('McpServerOutputParsingSplitParameters', module='types') kind: Literal[McpServerOutputParsingKind.SPLIT] - split_parameters: McpServerOutputParsingSplitParameters + splitParameters: McpServerOutputParsingSplitParameters class azure.search.documents.indexes.types.McpServerStoredHeadersAuthentication(TypedDict, total=False): key "kind": Required[Literal[McpServerAuthenticationKind.STORED_HEADERS]] key "storedHeadersParameters": Required[McpServerStoredHeadersParameters] kind: Literal[McpServerAuthenticationKind.STORED_HEADERS] - stored_headers_parameters: McpServerStoredHeadersParameters + storedHeadersParameters: McpServerStoredHeadersParameters class azure.search.documents.indexes.types.McpServerStoredHeadersParameters(TypedDict, total=False): @@ -9602,10 +9586,10 @@ namespace azure.search.documents.indexes.types key "name": str key "outputParsing": ForwardRef('McpServerOutputParsing', module='types') key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - max_output_tokens: int + maxOutputTokens: int name: str - output_parsing: McpServerOutputParsing - results_processing: Union[str, KnowledgeSourceResultsProcessing] + outputParsing: McpServerOutputParsing + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.MergeSkill(TypedDict): @@ -9617,13 +9601,13 @@ namespace azure.search.documents.indexes.types key "insertPreTag": str key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#MergeSkill] context: str description: str inputs: list[InputFieldMappingEntry] - insert_post_tag: str - insert_pre_tag: str + insertPostTag: str + insertPreTag: str name: str - odata_type: Literal[#MergeSkill] outputs: list[OutputFieldMappingEntry] @@ -9633,11 +9617,11 @@ namespace azure.search.documents.indexes.types key "language": Union[str, MicrosoftStemmingTokenizerLanguage] key "maxTokenLength": int key "name": Required[str] - is_search_tokenizer: bool + @odata.type: Literal[#MicrosoftLanguageStemmingTokenizer] + isSearchTokenizer: bool language: Union[str, MicrosoftStemmingTokenizerLanguage] - max_token_length: int + maxTokenLength: int name: str - odata_type: Literal[#MicrosoftLanguageStemmingTokenizer] class azure.search.documents.indexes.types.MicrosoftLanguageTokenizer(TypedDict): @@ -9646,11 +9630,11 @@ namespace azure.search.documents.indexes.types key "language": Union[str, MicrosoftTokenizerLanguage] key "maxTokenLength": int key "name": Required[str] - is_search_tokenizer: bool + @odata.type: Literal[#MicrosoftLanguageTokenizer] + isSearchTokenizer: bool language: Union[str, MicrosoftTokenizerLanguage] - max_token_length: int + maxTokenLength: int name: str - odata_type: Literal[#MicrosoftLanguageTokenizer] class azure.search.documents.indexes.types.NGramTokenFilter(TypedDict): @@ -9658,10 +9642,10 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - max_gram: int - min_gram: int + @odata.type: Literal[#NGramTokenFilter] + maxGram: int + minGram: int name: str - odata_type: Literal[#NGramTokenFilter] class azure.search.documents.indexes.types.NGramTokenFilterV2(TypedDict): @@ -9669,10 +9653,10 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - max_gram: int - min_gram: int + @odata.type: Literal[#NGramTokenFilterV2] + maxGram: int + minGram: int name: str - odata_type: Literal[#NGramTokenFilterV2] class azure.search.documents.indexes.types.NGramTokenizer(TypedDict): @@ -9680,17 +9664,16 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - max_gram: int - min_gram: int + @odata.type: Literal[#NGramTokenizer] + maxGram: int + minGram: int name: str - odata_type: Literal[#NGramTokenizer] tokenChars: list[Union[str, TokenCharacterKind]] - token_chars: list[Union[str, TokenCharacterKind]] class azure.search.documents.indexes.types.NativeBlobSoftDeleteDeletionDetectionPolicy(TypedDict): key "@odata.type": Required[Literal["#NativeBlobSoftDeleteDeletionDetectionPolicy"]] - odata_type: Literal[#NativeBlobSoftDeleteDeletionDetectionPolicy] + @odata.type: Literal[#NativeBlobSoftDeleteDeletionDetectionPolicy] class azure.search.documents.indexes.types.OcrSkill(TypedDict): @@ -9703,22 +9686,22 @@ namespace azure.search.documents.indexes.types key "lineEnding": Union[str, OcrLineEnding] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#OcrSkill] context: str - default_language_code: Union[str, OcrSkillLanguage] + defaultLanguageCode: Union[str, OcrSkillLanguage] description: str + detectOrientation: bool inputs: list[InputFieldMappingEntry] - line_ending: Union[str, OcrLineEnding] + lineEnding: Union[str, OcrLineEnding] name: str - odata_type: Literal[#OcrSkill] outputs: list[OutputFieldMappingEntry] - should_detect_orientation: bool class azure.search.documents.indexes.types.OutputFieldMappingEntry(TypedDict, total=False): key "name": Required[str] key "targetName": str name: str - target_name: str + targetName: str class azure.search.documents.indexes.types.PIIDetectionSkill(TypedDict): @@ -9734,20 +9717,19 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#PIIDetectionSkill] context: str - default_language_code: str + defaultLanguageCode: str description: str domain: str inputs: list[InputFieldMappingEntry] - mask: str - masking_mode: Union[str, PIIDetectionSkillMaskingMode] - minimum_precision: float - model_version: str + maskingCharacter: str + maskingMode: Union[str, PIIDetectionSkillMaskingMode] + minimumPrecision: float + modelVersion: str name: str - odata_type: Literal[#PIIDetectionSkill] outputs: list[OutputFieldMappingEntry] piiCategories: list[str] - pii_categories: list[str] class azure.search.documents.indexes.types.PathHierarchyTokenizerV2(TypedDict): @@ -9758,13 +9740,13 @@ namespace azure.search.documents.indexes.types key "replacement": str key "reverse": bool key "skip": int + @odata.type: Literal[#PathHierarchyTokenizerV2] delimiter: str - max_token_length: int + maxTokenLength: int name: str - number_of_tokens_to_skip: int - odata_type: Literal[#PathHierarchyTokenizerV2] replacement: str - reverse_token_order: bool + reverse: bool + skip: int class azure.search.documents.indexes.types.PatternAnalyzer(TypedDict): @@ -9772,10 +9754,10 @@ namespace azure.search.documents.indexes.types key "lowercase": bool key "name": Required[str] key "pattern": str + @odata.type: Literal[#PatternAnalyzer] flags: list[Union[str, RegexFlags]] - lower_case_terms: bool + lowercase: bool name: str - odata_type: Literal[#PatternAnalyzer] pattern: str stopwords: list[str] @@ -9785,10 +9767,10 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "patterns": Required[list[str]] key "preserveOriginal": bool + @odata.type: Literal[#PatternCaptureTokenFilter] name: str - odata_type: Literal[#PatternCaptureTokenFilter] patterns: list[str] - preserve_original: bool + preserveOriginal: bool class azure.search.documents.indexes.types.PatternReplaceCharFilter(TypedDict): @@ -9796,8 +9778,8 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "pattern": Required[str] key "replacement": Required[str] + @odata.type: Literal[#PatternReplaceCharFilter] name: str - odata_type: Literal[#PatternReplaceCharFilter] pattern: str replacement: str @@ -9807,8 +9789,8 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "pattern": Required[str] key "replacement": Required[str] + @odata.type: Literal[#PatternReplaceTokenFilter] name: str - odata_type: Literal[#PatternReplaceTokenFilter] pattern: str replacement: str @@ -9818,10 +9800,10 @@ namespace azure.search.documents.indexes.types key "group": int key "name": Required[str] key "pattern": str + @odata.type: Literal[#PatternTokenizer] flags: list[Union[str, RegexFlags]] group: int name: str - odata_type: Literal[#PatternTokenizer] pattern: str @@ -9830,10 +9812,10 @@ namespace azure.search.documents.indexes.types key "encoder": Union[str, PhoneticEncoder] key "name": Required[str] key "replace": bool + @odata.type: Literal[#PhoneticTokenFilter] encoder: Union[str, PhoneticEncoder] name: str - odata_type: Literal[#PhoneticTokenFilter] - replace_original_tokens: bool + replace: bool class azure.search.documents.indexes.types.RemoteSharePointKnowledgeSource(TypedDict): @@ -9844,31 +9826,30 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "remoteSharePointParameters": ForwardRef('RemoteSharePointKnowledgeSourceParameters', module='types') key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] name: str - remote_share_point_parameters: RemoteSharePointKnowledgeSourceParameters - results_processing: Union[str, KnowledgeSourceResultsProcessing] + remoteSharePointParameters: RemoteSharePointKnowledgeSourceParameters + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.indexes.types.RemoteSharePointKnowledgeSourceParameters(TypedDict, total=False): key "containerTypeId": str key "filterExpression": str - container_type_id: str - filter_expression: str + containerTypeId: str + filterExpression: str resourceMetadata: list[str] - resource_metadata: list[str] class azure.search.documents.indexes.types.RescoringOptions(TypedDict, total=False): key "defaultOversampling": Optional[float] key "enableRescoring": Optional[bool] key "rescoreStorageMethod": Optional[Union[str, VectorSearchCompressionRescoreStorageMethod]] - default_oversampling: float - enable_rescoring: bool - rescore_storage_method: Union[str, VectorSearchCompressionRescoreStorageMethod] + defaultOversampling: float + enableRescoring: bool + rescoreStorageMethod: Union[str, VectorSearchCompressionRescoreStorageMethod] class azure.search.documents.indexes.types.ScalarQuantizationCompression(TypedDict, total=False): @@ -9877,33 +9858,33 @@ namespace azure.search.documents.indexes.types key "rescoringOptions": Optional[RescoringOptions] key "scalarQuantizationParameters": ForwardRef('ScalarQuantizationParameters', module='types') key "truncationDimension": Optional[int] - compression_name: str kind: Literal[VectorSearchCompressionKind.SCALAR_QUANTIZATION] - parameters: ScalarQuantizationParameters - rescoring_options: RescoringOptions - truncation_dimension: int + name: str + rescoringOptions: RescoringOptions + scalarQuantizationParameters: ScalarQuantizationParameters + truncationDimension: int class azure.search.documents.indexes.types.ScalarQuantizationParameters(TypedDict, total=False): key "quantizedDataType": Optional[Union[str, VectorSearchCompressionTarget]] - quantized_data_type: Union[str, VectorSearchCompressionTarget] + quantizedDataType: Union[str, VectorSearchCompressionTarget] class azure.search.documents.indexes.types.ScoringProfile(TypedDict, total=False): key "functionAggregation": Union[str, ScoringFunctionAggregation] key "name": Required[str] key "text": Optional[TextWeights] - function_aggregation: Union[str, ScoringFunctionAggregation] + functionAggregation: Union[str, ScoringFunctionAggregation] functions: list[ScoringFunction] name: str - text_weights: TextWeights + text: TextWeights class azure.search.documents.indexes.types.SearchAlias(TypedDict): key "@odata.etag": str key "indexes": Required[list[str]] key "name": Required[str] - e_tag: str + @odata.etag: str indexes: list[str] name: str @@ -9930,30 +9911,29 @@ namespace azure.search.documents.indexes.types key "type": Required[Union[str, SearchFieldDataType]] key "vectorEncoding": Optional[Union[str, VectorEncodingFormat]] key "vectorSearchProfile": Optional[str] - analyzer_name: Union[str, LexicalAnalyzerName] + analyzer: Union[str, LexicalAnalyzerName] + dimensions: int facetable: bool fields: list[SearchField] filterable: bool - index_analyzer_name: Union[str, LexicalAnalyzerName] + indexAnalyzer: Union[str, LexicalAnalyzerName] key: bool name: str - normalizer_name: Union[str, LexicalNormalizerName] - permission_filter: Union[str, PermissionFilter] + normalizer: Union[str, LexicalNormalizerName] + permissionFilter: Union[str, PermissionFilter] retrievable: bool - search_analyzer_name: Union[str, LexicalAnalyzerName] + searchAnalyzer: Union[str, LexicalAnalyzerName] searchable: bool - sensitivity_label_id: bool - sensitivity_label_name: bool - sharepoint_site_url: bool + sensitivityLabelId: bool + sensitivityLabelName: bool + sharepointSiteUrl: bool sortable: bool - source_document_id: bool + sourceDocumentId: bool stored: bool synonymMaps: list[str] - synonym_map_names: list[str] type: Union[str, SearchFieldDataType] - vector_encoding_format: Union[str, VectorEncodingFormat] - vector_search_dimensions: int - vector_search_profile_name: str + vectorEncoding: Union[str, VectorEncodingFormat] + vectorSearchProfile: str class azure.search.documents.indexes.types.SearchIndex(TypedDict): @@ -9970,29 +9950,26 @@ namespace azure.search.documents.indexes.types key "sharePointConnectorAppRegistration": ForwardRef('SharePointConnectorAppRegistration', module='types') key "similarity": ForwardRef('SimilarityAlgorithm', module='types') key "vectorSearch": Optional[VectorSearch] + @odata.etag: str analyzers: list[LexicalAnalyzer] charFilters: list[CharFilter] - char_filters: list[CharFilter] - cors_options: CorsOptions - default_scoring_profile: str + corsOptions: CorsOptions + defaultScoringProfile: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey fields: list[SearchField] name: str normalizers: list[LexicalNormalizer] - permission_filter_option: Union[str, SearchIndexPermissionFilterOption] - purview_enabled: bool + permissionFilterOption: Union[str, SearchIndexPermissionFilterOption] + purviewEnabled: bool scoringProfiles: list[ScoringProfile] - scoring_profiles: list[ScoringProfile] - semantic_search: SemanticSearch - share_point_connector_app_registration: SharePointConnectorAppRegistration + semantic: SemanticSearch + sharePointConnectorAppRegistration: SharePointConnectorAppRegistration similarity: SimilarityAlgorithm suggesters: list[SearchSuggester] tokenFilters: list[TokenFilter] - token_filters: list[TokenFilter] tokenizers: list[LexicalTokenizer] - vector_search: VectorSearch + vectorSearch: VectorSearch class azure.search.documents.indexes.types.SearchIndexFieldReference(TypedDict, total=False): @@ -10008,13 +9985,13 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] key "searchIndexParameters": Required[SearchIndexKnowledgeSourceParameters] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] - search_index_parameters: SearchIndexKnowledgeSourceParameters + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] + searchIndexParameters: SearchIndexKnowledgeSourceParameters class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceBoostKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -10028,10 +10005,9 @@ namespace azure.search.documents.indexes.types key "field": Required[str] key "kind": Required[Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE]] boost: float - boost_instructions: str + boostInstructions: str field: str fieldValues: list[str] - field_values: list[str] kind: Literal[SearchIndexKnowledgeSourceBoostKind.FIELD_VALUE] @@ -10040,8 +10016,8 @@ namespace azure.search.documents.indexes.types key "fieldValues": Required[list[str]] key "filterInstructions": str field: str - field_values: list[str] - filter_instructions: str + fieldValues: list[str] + filterInstructions: str class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceMultiWordExpressionBoost(TypedDict, total=False): @@ -10049,9 +10025,8 @@ namespace azure.search.documents.indexes.types key "boostInstructions": str key "kind": Required[Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION]] boost: float - boost_instructions: str + boostInstructions: str fieldValues: list[str] - field_values: list[str] kind: Literal[SearchIndexKnowledgeSourceBoostKind.MULTI_WORD_EXPRESSION] @@ -10060,14 +10035,12 @@ namespace azure.search.documents.indexes.types key "queryHints": ForwardRef('SearchIndexKnowledgeSourceQueryHints', module='types') key "searchIndexName": Required[str] key "semanticConfigurationName": str - base_filter: str - query_hints: SearchIndexKnowledgeSourceQueryHints + baseFilter: str + queryHints: SearchIndexKnowledgeSourceQueryHints searchFields: list[SearchIndexFieldReference] - search_fields: list[SearchIndexFieldReference] - search_index_name: str - semantic_configuration_name: str + searchIndexName: str + semanticConfigurationName: str sourceDataFields: list[SearchIndexFieldReference] - source_data_fields: list[SearchIndexFieldReference] class azure.search.documents.indexes.types.SearchIndexKnowledgeSourceQueryHints(TypedDict, total=False): @@ -10087,21 +10060,19 @@ namespace azure.search.documents.indexes.types key "schedule": Optional[IndexingSchedule] key "skillsetName": str key "targetIndexName": Required[str] + @odata.etag: str cache: SearchIndexerCache - data_source_name: str + dataSourceName: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + disabled: bool + encryptionKey: SearchResourceEncryptionKey fieldMappings: list[FieldMapping] - field_mappings: list[FieldMapping] - is_disabled: bool name: str outputFieldMappings: list[FieldMapping] - output_field_mappings: list[FieldMapping] parameters: IndexingParameters schedule: IndexingSchedule - skillset_name: str - target_index_name: str + skillsetName: str + targetIndexName: str class azure.search.documents.indexes.types.SearchIndexerCache(TypedDict, total=False): @@ -10109,10 +10080,10 @@ namespace azure.search.documents.indexes.types key "id": str key "identity": Optional[SearchIndexerDataIdentity] key "storageConnectionString": str - enable_reprocessing: bool + enableReprocessing: bool id: str identity: SearchIndexerDataIdentity - storage_connection_string: str + storageConnectionString: str class azure.search.documents.indexes.types.SearchIndexerDataContainer(TypedDict, total=False): @@ -10124,7 +10095,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerDataNoneIdentity(TypedDict): key "@odata.type": Required[Literal["#DataNoneIdentity"]] - odata_type: Literal[#DataNoneIdentity] + @odata.type: Literal[#DataNoneIdentity] class azure.search.documents.indexes.types.SearchIndexerDataSourceConnection(TypedDict): @@ -10140,17 +10111,17 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "subType": str key "type": Required[Union[str, SearchIndexerDataSourceType]] + @odata.etag: str container: SearchIndexerDataContainer credentials: DataSourceCredentials - data_change_detection_policy: DataChangeDetectionPolicy - data_deletion_detection_policy: DataDeletionDetectionPolicy + dataChangeDetectionPolicy: DataChangeDetectionPolicy + dataDeletionDetectionPolicy: DataDeletionDetectionPolicy description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey identity: SearchIndexerDataIdentity - indexer_permission_options: list[Union[str, IndexerPermissionOption]] + indexerPermissionOptions: list[Union[str, IndexerPermissionOption]] name: str - sub_type: str + subType: str type: Union[str, SearchIndexerDataSourceType] @@ -10158,9 +10129,9 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#DataUserAssignedIdentity"]] key "federatedIdentityClientId": str key "userAssignedIdentity": Required[str] - federated_identity_client_id: str - odata_type: Literal[#DataUserAssignedIdentity] - resource_id: str + @odata.type: Literal[#DataUserAssignedIdentity] + federatedIdentityClientId: str + userAssignedIdentity: str class azure.search.documents.indexes.types.SearchIndexerIndexProjection(TypedDict, total=False): @@ -10176,14 +10147,14 @@ namespace azure.search.documents.indexes.types key "sourceContext": Required[str] key "targetIndexName": Required[str] mappings: list[InputFieldMappingEntry] - parent_key_field_name: str - source_context: str - target_index_name: str + parentKeyFieldName: str + sourceContext: str + targetIndexName: str class azure.search.documents.indexes.types.SearchIndexerIndexProjectionsParameters(TypedDict, total=False): key "projectionMode": Union[str, IndexProjectionMode] - projection_mode: Union[str, IndexProjectionMode] + projectionMode: Union[str, IndexProjectionMode] class azure.search.documents.indexes.types.SearchIndexerKnowledgeStore(TypedDict, total=False): @@ -10194,7 +10165,7 @@ namespace azure.search.documents.indexes.types identity: SearchIndexerDataIdentity parameters: SearchIndexerKnowledgeStoreParameters projections: list[SearchIndexerKnowledgeStoreProjection] - storage_connection_string: str + storageConnectionString: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreBlobProjectionSelector(SearchIndexerKnowledgeStoreProjectionSelector): @@ -10203,12 +10174,12 @@ namespace azure.search.documents.indexes.types key "source": str key "sourceContext": str key "storageContainer": Required[str] - generated_key_name: str + generatedKeyName: str inputs: list[InputFieldMappingEntry] - reference_key_name: str + referenceKeyName: str source: str - source_context: str - storage_container: str + sourceContext: str + storageContainer: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreFileProjectionSelector(SearchIndexerKnowledgeStoreBlobProjectionSelector): @@ -10217,12 +10188,12 @@ namespace azure.search.documents.indexes.types key "source": str key "sourceContext": str key "storageContainer": Required[str] - generated_key_name: str + generatedKeyName: str inputs: list[InputFieldMappingEntry] - reference_key_name: str + referenceKeyName: str source: str - source_context: str - storage_container: str + sourceContext: str + storageContainer: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreObjectProjectionSelector(SearchIndexerKnowledgeStoreBlobProjectionSelector): @@ -10231,17 +10202,17 @@ namespace azure.search.documents.indexes.types key "source": str key "sourceContext": str key "storageContainer": Required[str] - generated_key_name: str + generatedKeyName: str inputs: list[InputFieldMappingEntry] - reference_key_name: str + referenceKeyName: str source: str - source_context: str - storage_container: str + sourceContext: str + storageContainer: str class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreParameters(TypedDict, total=False): key "synthesizeGeneratedKeyName": bool - synthesize_generated_key_name: bool + synthesizeGeneratedKeyName: bool class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): @@ -10255,25 +10226,25 @@ namespace azure.search.documents.indexes.types key "referenceKeyName": str key "source": str key "sourceContext": str - generated_key_name: str + generatedKeyName: str inputs: list[InputFieldMappingEntry] - reference_key_name: str + referenceKeyName: str source: str - source_context: str + sourceContext: str - class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreTableProjectionSelector(SearchIndexerKnowledgeStoreProjectionSelector): + class azure.search.documents.indexes.types.SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False): key "generatedKeyName": Required[str] key "referenceKeyName": str key "source": str key "sourceContext": str key "tableName": Required[str] - generated_key_name: str + generatedKeyName: str inputs: list[InputFieldMappingEntry] - reference_key_name: str + referenceKeyName: str source: str - source_context: str - table_name: str + sourceContext: str + tableName: str class azure.search.documents.indexes.types.SearchIndexerSkillset(TypedDict): @@ -10285,12 +10256,12 @@ namespace azure.search.documents.indexes.types key "knowledgeStore": ForwardRef('SearchIndexerKnowledgeStore', module='types') key "name": Required[str] key "skills": Required[list[SearchIndexerSkill]] - cognitive_services_account: CognitiveServicesAccount + @odata.etag: str + cognitiveServices: CognitiveServicesAccount description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey - index_projection: SearchIndexerIndexProjection - knowledge_store: SearchIndexerKnowledgeStore + encryptionKey: SearchResourceEncryptionKey + indexProjections: SearchIndexerIndexProjection + knowledgeStore: SearchIndexerKnowledgeStore name: str skills: list[SearchIndexerSkill] @@ -10302,12 +10273,12 @@ namespace azure.search.documents.indexes.types key "keyVaultKeyName": Required[str] key "keyVaultKeyVersion": str key "keyVaultUri": Required[str] - access_credentials: AzureActiveDirectoryApplicationCredentials + accessCredentials: AzureActiveDirectoryApplicationCredentials identity: SearchIndexerDataIdentity - is_service_level_key: bool - key_name: str - key_version: str - vault_uri: str + isServiceLevelKey: bool + keyVaultKeyName: str + keyVaultKeyVersion: str + keyVaultUri: str class azure.search.documents.indexes.types.SearchSuggester(TypedDict, total=False): @@ -10315,8 +10286,8 @@ namespace azure.search.documents.indexes.types key "searchMode": Required[Literal["analyzingInfixMatching"]] key "sourceFields": Required[list[str]] name: str - search_mode: Literal[analyzingInfixMatching] - source_fields: list[str] + searchMode: Literal[analyzingInfixMatching] + sourceFields: list[str] class azure.search.documents.indexes.types.SemanticConfiguration(TypedDict, total=False): @@ -10324,30 +10295,28 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "prioritizedFields": Required[SemanticPrioritizedFields] key "rankingOrder": Optional[Union[str, RankingOrder]] - flighting_opt_in: bool + flightingOptIn: bool name: str - prioritized_fields: SemanticPrioritizedFields - ranking_order: Union[str, RankingOrder] + prioritizedFields: SemanticPrioritizedFields + rankingOrder: Union[str, RankingOrder] class azure.search.documents.indexes.types.SemanticField(TypedDict, total=False): key "fieldName": Required[str] - field_name: str + fieldName: str class azure.search.documents.indexes.types.SemanticPrioritizedFields(TypedDict, total=False): key "titleField": ForwardRef('SemanticField', module='types') - content_fields: list[SemanticField] - keywords_fields: list[SemanticField] prioritizedContentFields: list[SemanticField] prioritizedKeywordsFields: list[SemanticField] - title_field: SemanticField + titleField: SemanticField class azure.search.documents.indexes.types.SemanticSearch(TypedDict, total=False): key "defaultConfiguration": str configurations: list[SemanticConfiguration] - default_configuration_name: str + defaultConfiguration: str class azure.search.documents.indexes.types.SentimentSkillV3(TypedDict): @@ -10360,14 +10329,14 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#SentimentSkill] context: str - default_language_code: Union[str, SentimentSkillLanguage] + defaultLanguageCode: Union[str, SentimentSkillLanguage] description: str - include_opinion_mining: bool + includeOpinionMining: bool inputs: list[InputFieldMappingEntry] - model_version: str + modelVersion: str name: str - odata_type: Literal[#SentimentSkill] outputs: list[OutputFieldMappingEntry] @@ -10378,11 +10347,11 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#ShaperSkill] context: str description: str inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#ShaperSkill] outputs: list[OutputFieldMappingEntry] @@ -10390,9 +10359,9 @@ namespace azure.search.documents.indexes.types key "applicationId": Required[str] key "federatedCredentialId": Required[str] key "tenantId": str - application_id: str - federated_credential_id: str - tenant_id: str + applicationId: str + federatedCredentialId: str + tenantId: str class azure.search.documents.indexes.types.ShingleTokenFilter(TypedDict): @@ -10404,37 +10373,36 @@ namespace azure.search.documents.indexes.types key "outputUnigrams": bool key "outputUnigramsIfNoShingles": bool key "tokenSeparator": str - filter_token: str - max_shingle_size: int - min_shingle_size: int + @odata.type: Literal[#ShingleTokenFilter] + filterToken: str + maxShingleSize: int + minShingleSize: int name: str - odata_type: Literal[#ShingleTokenFilter] - output_unigrams: bool - output_unigrams_if_no_shingles: bool - token_separator: str + outputUnigrams: bool + outputUnigramsIfNoShingles: bool + tokenSeparator: str class azure.search.documents.indexes.types.SkillNames(TypedDict, total=False): skillNames: list[str] - skill_names: list[str] class azure.search.documents.indexes.types.SnowballTokenFilter(TypedDict): key "@odata.type": Required[Literal["#SnowballTokenFilter"]] key "language": Required[Union[str, SnowballTokenFilterLanguage]] key "name": Required[str] + @odata.type: Literal[#SnowballTokenFilter] language: Union[str, SnowballTokenFilterLanguage] name: str - odata_type: Literal[#SnowballTokenFilter] class azure.search.documents.indexes.types.SoftDeleteColumnDeletionDetectionPolicy(TypedDict): key "@odata.type": Required[Literal["#SoftDeleteColumnDeletionDetectionPolicy"]] key "softDeleteColumnName": str key "softDeleteMarkerValue": str - odata_type: Literal[#SoftDeleteColumnDeletionDetectionPolicy] - soft_delete_column_name: str - soft_delete_marker_value: str + @odata.type: Literal[#SoftDeleteColumnDeletionDetectionPolicy] + softDeleteColumnName: str + softDeleteMarkerValue: str class azure.search.documents.indexes.types.SplitSkill(TypedDict): @@ -10451,32 +10419,32 @@ namespace azure.search.documents.indexes.types key "pageOverlapLength": Optional[int] key "textSplitMode": Union[str, TextSplitMode] key "unit": Optional[Union[str, SplitSkillUnit]] - azure_open_ai_tokenizer_parameters: AzureOpenAITokenizerParameters + @odata.type: Literal[#SplitSkill] + azureOpenAITokenizerParameters: AzureOpenAITokenizerParameters context: str - default_language_code: Union[str, SplitSkillLanguage] + defaultLanguageCode: Union[str, SplitSkillLanguage] description: str inputs: list[InputFieldMappingEntry] - maximum_page_length: int - maximum_pages_to_take: int + maximumPageLength: int + maximumPagesToTake: int name: str - odata_type: Literal[#SplitSkill] outputs: list[OutputFieldMappingEntry] - page_overlap_length: int - text_split_mode: Union[str, TextSplitMode] + pageOverlapLength: int + textSplitMode: Union[str, TextSplitMode] unit: Union[str, SplitSkillUnit] class azure.search.documents.indexes.types.SqlIntegratedChangeTrackingPolicy(TypedDict): key "@odata.type": Required[Literal["#SqlIntegratedChangeTrackingPolicy"]] - odata_type: Literal[#SqlIntegratedChangeTrackingPolicy] + @odata.type: Literal[#SqlIntegratedChangeTrackingPolicy] class azure.search.documents.indexes.types.StemmerOverrideTokenFilter(TypedDict): key "@odata.type": Required[Literal["#StemmerOverrideTokenFilter"]] key "name": Required[str] key "rules": Required[list[str]] + @odata.type: Literal[#StemmerOverrideTokenFilter] name: str - odata_type: Literal[#StemmerOverrideTokenFilter] rules: list[str] @@ -10484,16 +10452,16 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#StemmerTokenFilter"]] key "language": Required[Union[str, StemmerTokenFilterLanguage]] key "name": Required[str] + @odata.type: Literal[#StemmerTokenFilter] language: Union[str, StemmerTokenFilterLanguage] name: str - odata_type: Literal[#StemmerTokenFilter] class azure.search.documents.indexes.types.StopAnalyzer(TypedDict): key "@odata.type": Required[Literal["#StopAnalyzer"]] key "name": Required[str] + @odata.type: Literal[#StopAnalyzer] name: str - odata_type: Literal[#StopAnalyzer] stopwords: list[str] @@ -10503,12 +10471,12 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "removeTrailing": bool key "stopwordsList": Union[str, StopwordsList] - ignore_case: bool + @odata.type: Literal[#StopwordsTokenFilter] + ignoreCase: bool name: str - odata_type: Literal[#StopwordsTokenFilter] - remove_trailing_stop_words: bool + removeTrailing: bool stopwords: list[str] - stopwords_list: Union[str, StopwordsList] + stopwordsList: Union[str, StopwordsList] class azure.search.documents.indexes.types.SynonymMap(TypedDict): @@ -10517,8 +10485,8 @@ namespace azure.search.documents.indexes.types key "format": Required[Literal["solr"]] key "name": Required[str] key "synonyms": Required[list[str]] - e_tag: str - encryption_key: SearchResourceEncryptionKey + @odata.etag: str + encryptionKey: SearchResourceEncryptionKey format: Literal[solr] name: str synonyms: list[str] @@ -10530,10 +10498,10 @@ namespace azure.search.documents.indexes.types key "ignoreCase": bool key "name": Required[str] key "synonyms": Required[list[str]] + @odata.type: Literal[#SynonymTokenFilter] expand: bool - ignore_case: bool + ignoreCase: bool name: str - odata_type: Literal[#SynonymTokenFilter] synonyms: list[str] @@ -10544,15 +10512,15 @@ namespace azure.search.documents.indexes.types key "tag": Required[TagScoringParameters] key "type": Required[Literal["tag"]] boost: float - field_name: str + fieldName: str interpolation: Union[str, ScoringFunctionInterpolation] - parameters: TagScoringParameters + tag: TagScoringParameters type: Literal[tag] class azure.search.documents.indexes.types.TagScoringParameters(TypedDict, total=False): key "tagsParameter": Required[str] - tags_parameter: str + tagsParameter: str class azure.search.documents.indexes.types.TextTranslationSkill(TypedDict): @@ -10565,15 +10533,15 @@ namespace azure.search.documents.indexes.types key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] key "suggestedFrom": Optional[Union[str, TextTranslationSkillLanguage]] + @odata.type: Literal[#TranslationSkill] context: str - default_from_language_code: Union[str, TextTranslationSkillLanguage] - default_to_language_code: Union[str, TextTranslationSkillLanguage] + defaultFromLanguageCode: Union[str, TextTranslationSkillLanguage] + defaultToLanguageCode: Union[str, TextTranslationSkillLanguage] description: str inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#TranslationSkill] outputs: list[OutputFieldMappingEntry] - suggested_from: Union[str, TextTranslationSkillLanguage] + suggestedFrom: Union[str, TextTranslationSkillLanguage] class azure.search.documents.indexes.types.TextWeights(TypedDict, total=False): @@ -10585,27 +10553,27 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#TruncateTokenFilter"]] key "length": int key "name": Required[str] + @odata.type: Literal[#TruncateTokenFilter] length: int name: str - odata_type: Literal[#TruncateTokenFilter] class azure.search.documents.indexes.types.UaxUrlEmailTokenizer(TypedDict): key "@odata.type": Required[Literal["#UaxUrlEmailTokenizer"]] key "maxTokenLength": int key "name": Required[str] - max_token_length: int + @odata.type: Literal[#UaxUrlEmailTokenizer] + maxTokenLength: int name: str - odata_type: Literal[#UaxUrlEmailTokenizer] class azure.search.documents.indexes.types.UniqueTokenFilter(TypedDict): key "@odata.type": Required[Literal["#UniqueTokenFilter"]] key "name": Required[str] key "onlyOnSamePosition": bool + @odata.type: Literal[#UniqueTokenFilter] name: str - odata_type: Literal[#UniqueTokenFilter] - only_on_same_position: bool + onlyOnSamePosition: bool class azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest(TypedDict, total=False): @@ -10644,10 +10612,10 @@ namespace azure.search.documents.indexes.types key "compression": str key "name": Required[str] key "vectorizer": str - algorithm_configuration_name: str - compression_name: str + algorithm: str + compression: str name: str - vectorizer_name: str + vectorizer: str class azure.search.documents.indexes.types.VectorSearchVectorizerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -10665,12 +10633,12 @@ namespace azure.search.documents.indexes.types key "modelVersion": Required[Optional[str]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] + @odata.type: Literal[#VectorizeSkill] context: str description: str inputs: list[InputFieldMappingEntry] - model_version: str + modelVersion: str name: str - odata_type: Literal[#VectorizeSkill] outputs: list[OutputFieldMappingEntry] @@ -10692,17 +10660,17 @@ namespace azure.search.documents.indexes.types key "outputs": Required[list[OutputFieldMappingEntry]] key "timeout": str key "uri": Required[str] - auth_identity: SearchIndexerDataIdentity - auth_resource_id: str - batch_size: int + @odata.type: Literal[#WebApiSkill] + authIdentity: SearchIndexerDataIdentity + authResourceId: str + batchSize: int context: str - degree_of_parallelism: int + degreeOfParallelism: int description: str - http_headers: WebApiHttpHeaders - http_method: str + httpHeaders: WebApiHttpHeaders + httpMethod: str inputs: list[InputFieldMappingEntry] name: str - odata_type: Literal[#WebApiSkill] outputs: list[OutputFieldMappingEntry] timeout: str uri: str @@ -10712,9 +10680,9 @@ namespace azure.search.documents.indexes.types key "customWebApiParameters": ForwardRef('WebApiVectorizerParameters', module='types') key "kind": Required[Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API]] key "name": Required[str] + customWebApiParameters: WebApiVectorizerParameters kind: Literal[VectorSearchVectorizerKind.CUSTOM_WEB_API] - vectorizer_name: str - web_api_parameters: WebApiVectorizerParameters + name: str class azure.search.documents.indexes.types.WebApiVectorizerParameters(TypedDict, total=False): @@ -10723,13 +10691,12 @@ namespace azure.search.documents.indexes.types key "httpMethod": str key "timeout": str key "uri": str - auth_identity: SearchIndexerDataIdentity - auth_resource_id: str + authIdentity: SearchIndexerDataIdentity + authResourceId: str httpHeaders: dict[str, str] - http_headers: dict[str, str] - http_method: str + httpMethod: str timeout: str - url: str + uri: str class azure.search.documents.indexes.types.WebKnowledgeSource(TypedDict): @@ -10740,27 +10707,25 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] key "webParameters": ForwardRef('WebKnowledgeSourceParameters', module='types') + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.WEB] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] - web_parameters: WebKnowledgeSourceParameters + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] + webParameters: WebKnowledgeSourceParameters class azure.search.documents.indexes.types.WebKnowledgeSourceDomain(TypedDict, total=False): key "address": Required[str] key "includeSubpages": bool address: str - include_subpages: bool + includeSubpages: bool class azure.search.documents.indexes.types.WebKnowledgeSourceDomains(TypedDict, total=False): allowedDomains: list[WebKnowledgeSourceDomain] - allowed_domains: list[WebKnowledgeSourceDomain] blockedDomains: list[WebKnowledgeSourceDomain] - blocked_domains: list[WebKnowledgeSourceDomain] class azure.search.documents.indexes.types.WebKnowledgeSourceParameters(TypedDict, total=False): @@ -10788,19 +10753,18 @@ namespace azure.search.documents.indexes.types key "splitOnCaseChange": bool key "splitOnNumerics": bool key "stemEnglishPossessive": bool - catenate_all: bool - catenate_numbers: bool - catenate_words: bool - generate_number_parts: bool - generate_word_parts: bool - name: str - odata_type: Literal[#WordDelimiterTokenFilter] - preserve_original: bool + @odata.type: Literal[#WordDelimiterTokenFilter] + catenateAll: bool + catenateNumbers: bool + catenateWords: bool + generateNumberParts: bool + generateWordParts: bool + name: str + preserveOriginal: bool protectedWords: list[str] - protected_words: list[str] - split_on_case_change: bool - split_on_numerics: bool - stem_english_possessive: bool + splitOnCaseChange: bool + splitOnNumerics: bool + stemEnglishPossessive: bool class azure.search.documents.indexes.types.WorkIQKnowledgeSource(TypedDict): @@ -10811,18 +10775,18 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] key "workIQParameters": Required[WorkIQKnowledgeSourceParameters] + @odata.etag: str description: str - e_tag: str - encryption_key: SearchResourceEncryptionKey + encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.WORK_IQ] name: str - results_processing: Union[str, KnowledgeSourceResultsProcessing] - work_iq_parameters: WorkIQKnowledgeSourceParameters + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] + workIQParameters: WorkIQKnowledgeSourceParameters class azure.search.documents.indexes.types.WorkIQKnowledgeSourceParameters(TypedDict, total=False): key "entraAppAuthentication": Required[EntraAppAuthentication] - entra_app_authentication: EntraAppAuthentication + entraAppAuthentication: EntraAppAuthentication namespace azure.search.documents.knowledgebases @@ -10879,6 +10843,7 @@ namespace azure.search.documents.knowledgebases self, retrieval_request: Union[KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], *, + content_type: str = "application/json", query_source_authorization: Optional[str] = ..., query_work_iq_source_authorization: Optional[str] = ..., **kwargs: Any @@ -10984,6 +10949,7 @@ namespace azure.search.documents.knowledgebases.aio self, retrieval_request: Union[KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], *, + content_type: str = "application/json", query_source_authorization: Optional[str] = ..., query_work_iq_source_authorization: Optional[str] = ..., **kwargs: Any @@ -13262,15 +13228,15 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.AIServices(TypedDict, total=False): key "apiKey": str key "uri": Required[str] - api_key: str + apiKey: str uri: str class azure.search.documents.knowledgebases.types.AssetStore(TypedDict, total=False): key "connectionString": Required[str] key "containerName": Required[str] - connection_string: str - container_name: str + connectionString: str + containerName: str class azure.search.documents.knowledgebases.types.AzureBlobKnowledgeSourceParams(TypedDict, total=False): @@ -13285,19 +13251,18 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.AZURE_BLOB] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool queryHintOverrides: SearchIndexKnowledgeSourceQueryHints - query_hint_overrides: SearchIndexKnowledgeSourceQueryHints - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.CompletedSynchronizationState(TypedDict, total=False): @@ -13306,11 +13271,11 @@ namespace azure.search.documents.knowledgebases.types key "itemsUpdatesFailed": Required[int] key "itemsUpdatesProcessed": Required[int] key "startTime": Required[str] - end_time: str - items_skipped: int - items_updates_failed: int - items_updates_processed: int - start_time: str + endTime: str + itemsSkipped: int + itemsUpdatesFailed: int + itemsUpdatesProcessed: int + startTime: str class azure.search.documents.knowledgebases.types.FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): @@ -13325,17 +13290,17 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.FabricOntologyKnowledgeSourceParams(TypedDict, total=False): @@ -13350,17 +13315,17 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.FileKnowledgeSourceParams(TypedDict, total=False): @@ -13375,24 +13340,23 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.FILE] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool queryHintOverrides: SearchIndexKnowledgeSourceQueryHints - query_hint_overrides: SearchIndexKnowledgeSourceQueryHints - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.FreshnessPolicy(TypedDict, total=False): key "boostingDuration": str - boosting_duration: str + boostingDuration: str class azure.search.documents.knowledgebases.types.IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): @@ -13407,19 +13371,18 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.INDEXED_ONELAKE] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool queryHintOverrides: SearchIndexKnowledgeSourceQueryHints - query_hint_overrides: SearchIndexKnowledgeSourceQueryHints - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.IndexedSharePointKnowledgeSourceParams(TypedDict, total=False): @@ -13434,19 +13397,18 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool queryHintOverrides: SearchIndexKnowledgeSourceQueryHints - query_hint_overrides: SearchIndexKnowledgeSourceQueryHints - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.IndexedSqlKnowledgeSourceParams(TypedDict, total=False): @@ -13461,19 +13423,18 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.INDEXED_SQL] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool queryHintOverrides: SearchIndexKnowledgeSourceQueryHints - query_hint_overrides: SearchIndexKnowledgeSourceQueryHints - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.KnowledgeBaseImageContent(TypedDict, total=False): @@ -13515,17 +13476,16 @@ namespace azure.search.documents.knowledgebases.types key "maxRuntimeInSeconds": int key "outputMode": Union[str, KnowledgeRetrievalOutputMode] key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort', module='types') - include_activity: bool + includeActivity: bool intents: list[KnowledgeRetrievalIntent] knowledgeSourceParams: list[KnowledgeSourceParams] - knowledge_source_params: list[KnowledgeSourceParams] - max_output_documents: int - max_output_size: int - max_output_size_in_tokens: int - max_runtime_in_seconds: int + maxOutputDocuments: int + maxOutputSize: int + maxOutputSizeInTokens: int + maxRuntimeInSeconds: int messages: list[KnowledgeBaseMessage] - output_mode: Union[str, KnowledgeRetrievalOutputMode] - retrieval_reasoning_effort: KnowledgeRetrievalReasoningEffort + outputMode: Union[str, KnowledgeRetrievalOutputMode] + retrievalReasoningEffort: KnowledgeRetrievalReasoningEffort class azure.search.documents.knowledgebases.types.KnowledgeRetrievalAutoReasoningEffort(TypedDict, total=False): @@ -13576,7 +13536,6 @@ namespace azure.search.documents.knowledgebases.types class azure.search.documents.knowledgebases.types.KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] azureOpenAIParameters: AzureOpenAIVectorizerParameters - azure_open_ai_parameters: AzureOpenAIVectorizerParameters kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] @@ -13592,17 +13551,17 @@ namespace azure.search.documents.knowledgebases.types key "ingestionPermissionOptions": Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] key "ingestionSchedule": Optional[IndexingSchedule] key "networkAccessMode": Union[str, KnowledgeSourceNetworkAccessMode] - ai_services: AIServices - asset_store: AssetStore - chat_completion_model: KnowledgeBaseModel - content_extraction_mode: Union[str, KnowledgeSourceContentExtractionMode] - disable_image_verbalization: bool - embedding_model: KnowledgeSourceVectorizer - freshness_policy: FreshnessPolicy + aiServices: AIServices + assetStore: AssetStore + chatCompletionModel: KnowledgeBaseModel + contentExtractionMode: Union[str, KnowledgeSourceContentExtractionMode] + disableImageVerbalization: bool + embeddingModel: KnowledgeSourceVectorizer + freshnessPolicy: FreshnessPolicy identity: SearchIndexerDataIdentity - ingestion_permission_options: list[Union[str, KnowledgeSourceIngestionPermissionOption]] - ingestion_schedule: IndexingSchedule - network_access_mode: Union[str, KnowledgeSourceNetworkAccessMode] + ingestionPermissionOptions: list[Union[str, KnowledgeSourceIngestionPermissionOption]] + ingestionSchedule: IndexingSchedule + networkAccessMode: Union[str, KnowledgeSourceNetworkAccessMode] class azure.search.documents.knowledgebases.types.KnowledgeSourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -13624,9 +13583,9 @@ namespace azure.search.documents.knowledgebases.types key "averageItemsProcessedPerSynchronization": Required[int] key "averageSynchronizationDuration": Required[str] key "totalSynchronization": Required[int] - average_items_processed_per_synchronization: int - average_synchronization_duration: str - total_synchronization: int + averageItemsProcessedPerSynchronization: int + averageSynchronizationDuration: str + totalSynchronization: int class azure.search.documents.knowledgebases.types.KnowledgeSourceStatus(TypedDict, total=False): @@ -13636,12 +13595,12 @@ namespace azure.search.documents.knowledgebases.types key "statistics": Optional[KnowledgeSourceStatistics] key "synchronizationInterval": Optional[str] key "synchronizationStatus": Required[Union[str, KnowledgeSourceSynchronizationStatus]] - current_synchronization_state: SynchronizationState + currentSynchronizationState: SynchronizationState kind: Union[str, KnowledgeSourceKind] - last_synchronization_state: CompletedSynchronizationState + lastSynchronizationState: CompletedSynchronizationState statistics: KnowledgeSourceStatistics - synchronization_interval: str - synchronization_status: Union[str, KnowledgeSourceSynchronizationStatus] + synchronizationInterval: str + synchronizationStatus: Union[str, KnowledgeSourceSynchronizationStatus] class azure.search.documents.knowledgebases.types.KnowledgeSourceSynchronizationError(TypedDict, total=False): @@ -13652,17 +13611,16 @@ namespace azure.search.documents.knowledgebases.types key "name": str key "statusCode": int details: str - doc_id: str - documentation_link: str - error_message: str + docId: str + documentationLink: str + errorMessage: str name: str - status_code: int + statusCode: int class azure.search.documents.knowledgebases.types.KnowledgeSourceVectorizer(TypedDict, total=False): key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] azureOpenAIParameters: AzureOpenAIVectorizerParameters - azure_open_ai_parameters: AzureOpenAIVectorizerParameters kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] @@ -13678,17 +13636,17 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.MCP_SERVER] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.RemoteSharePointKnowledgeSourceParams(TypedDict, total=False): @@ -13704,18 +13662,18 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - filter_expression_add_on: str - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + filterExpressionAddOn: str + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.SearchIndexKnowledgeSourceParams(TypedDict, total=False): @@ -13731,20 +13689,19 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - filter_add_on: str - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + filterAddOn: str + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool queryHintOverrides: SearchIndexKnowledgeSourceQueryHints - query_hint_overrides: SearchIndexKnowledgeSourceQueryHints - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.SynchronizationState(TypedDict, total=False): @@ -13753,10 +13710,10 @@ namespace azure.search.documents.knowledgebases.types key "itemsUpdatesProcessed": Required[int] key "startTime": Required[str] errors: list[KnowledgeSourceSynchronizationError] - items_skipped: int - items_updates_failed: int - items_updates_processed: int - start_time: str + itemsSkipped: int + itemsUpdatesFailed: int + itemsUpdatesProcessed: int + startTime: str class azure.search.documents.knowledgebases.types.VectorSearchVectorizerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -13782,21 +13739,21 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool + alwaysQuerySource: bool count: int - enable_image_serving: bool - fail_on_error: bool + enableImageServing: bool + failOnError: bool freshness: str - include_reference_source_data: bool - include_references: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.WEB] - knowledge_source_name: str + knowledgeSourceName: str language: str market: str - max_output_documents: int - never_query_source: bool - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + maxOutputDocuments: int + neverQuerySource: bool + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] class azure.search.documents.knowledgebases.types.WorkIQKnowledgeSourceParams(TypedDict, total=False): @@ -13811,17 +13768,17 @@ namespace azure.search.documents.knowledgebases.types key "neverQuerySource": bool key "rerankerThreshold": float key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - always_query_source: bool - enable_image_serving: bool - fail_on_error: bool - include_reference_source_data: bool - include_references: bool + alwaysQuerySource: bool + enableImageServing: bool + failOnError: bool + includeReferenceSourceData: bool + includeReferences: bool kind: Literal[KnowledgeSourceKind.WORK_IQ] - knowledge_source_name: str - max_output_documents: int - never_query_source: bool - reranker_threshold: float - results_processing: Union[str, KnowledgeSourceResultsProcessing] + knowledgeSourceName: str + maxOutputDocuments: int + neverQuerySource: bool + rerankerThreshold: float + resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] namespace azure.search.documents.models @@ -14192,6 +14149,10 @@ namespace azure.search.documents.models USED = "used" + class azure.search.documents.models.SemanticQueryRewritesResultType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ORIGINAL_QUERY_ONLY = "originalQueryOnly" + + class azure.search.documents.models.SemanticSearchResultsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BASE_RESULTS = "baseResults" RERANKED_RESULTS = "rerankedResults" @@ -14422,7 +14383,7 @@ namespace azure.search.documents.types class azure.search.documents.types.AutocompleteItem(TypedDict, total=False): key "queryPlusText": Required[str] key "text": Required[str] - query_plus_text: str + queryPlusText: str text: str @@ -14436,29 +14397,27 @@ namespace azure.search.documents.types key "search": Required[str] key "suggesterName": Required[str] key "top": int - autocomplete_mode: Union[str, AutocompleteMode] + autocompleteMode: Union[str, AutocompleteMode] filter: str - highlight_post_tag: str - highlight_pre_tag: str - minimum_coverage: float + fuzzy: bool + highlightPostTag: str + highlightPreTag: str + minimumCoverage: float + search: str searchFields: list[str] - search_fields: list[str] - search_text: str - suggester_name: str + suggesterName: str top: int - use_fuzzy_matching: bool class azure.search.documents.types.DebugInfo(TypedDict, total=False): key "queryRewrites": ForwardRef('QueryRewritesDebugInfo', module='types') - query_rewrites: QueryRewritesDebugInfo + queryRewrites: QueryRewritesDebugInfo class azure.search.documents.types.DocumentDebugInfo(TypedDict, total=False): key "semantic": ForwardRef('SemanticDebugInfo', module='types') key "vectors": ForwardRef('VectorsDebugInfo', module='types') innerHits: dict[str, list[QueryResultDocumentInnerHit]] - inner_hits: dict[str, list[QueryResultDocumentInnerHit]] semantic: SemanticDebugInfo vectors: VectorsDebugInfo @@ -14474,7 +14433,6 @@ namespace azure.search.documents.types avg: float cardinality: int count: int - facets: dict[str, list[FacetResult]] max: float min: float sum: float @@ -14483,18 +14441,18 @@ namespace azure.search.documents.types class azure.search.documents.types.HybridSearch(TypedDict, total=False): key "countAndFacetMode": Union[str, HybridCountAndFacetMode] key "maxTextRecallSize": int - count_and_facet_mode: Union[str, HybridCountAndFacetMode] - max_text_recall_size: int + countAndFacetMode: Union[str, HybridCountAndFacetMode] + maxTextRecallSize: int class azure.search.documents.types.IndexAction(TypedDict): key "@search.action": Union[str, IndexActionType] - action_type: Union[str, IndexActionType] + @search.action: Union[str, IndexActionType] class azure.search.documents.types.IndexDocumentsBatch(TypedDict, total=False): key "value": Required[list[IndexAction]] - actions: list[IndexAction] + value: list[IndexAction] class azure.search.documents.types.IndexingResult(TypedDict, total=False): @@ -14502,10 +14460,10 @@ namespace azure.search.documents.types key "key": Required[str] key "status": Required[bool] key "statusCode": Required[int] - error_message: str + errorMessage: str key: str - status_code: int - succeeded: bool + status: bool + statusCode: int class azure.search.documents.types.QueryAnswerResult(TypedDict, total=False): @@ -14551,7 +14509,7 @@ namespace azure.search.documents.types class azure.search.documents.types.QueryResultDocumentSubscores(TypedDict, total=False): key "documentBoost": float key "text": ForwardRef('TextResult', module='types') - document_boost: float + documentBoost: float text: TextResult vectors: list[dict[str, SingleVectorFieldResult]] @@ -14564,7 +14522,7 @@ namespace azure.search.documents.types class azure.search.documents.types.QueryRewritesValuesDebugInfo(TypedDict, total=False): key "inputQuery": str - input_query: str + inputQuery: str rewrites: list[str] @@ -14579,18 +14537,17 @@ namespace azure.search.documents.types key "@search.semanticPartialResponseType": Union[str, SemanticSearchResultsType] key "@search.semanticQueryRewritesResultType": Union[str, SemanticQueryRewritesResultType] key "value": Required[list[SearchResult]] + @odata.count: int + @odata.nextLink: str + @search.answers: list[QueryAnswerResult] + @search.coverage: float + @search.debug: DebugInfo @search.facets: dict[str, list[FacetResult]] - answers: list[QueryAnswerResult] - count: int - coverage: float - debug_info: DebugInfo - facets: dict[str, list[FacetResult]] - next_link: str - next_page_parameters: SearchRequest - results: list[SearchResult] - semantic_partial_response_reason: Union[str, SemanticErrorReason] - semantic_partial_response_type: Union[str, SemanticSearchResultsType] - semantic_query_rewrites_result_type: Union[str, SemanticQueryRewritesResultType] + @search.nextPageParameters: SearchRequest + @search.semanticPartialResponseReason: Union[str, SemanticErrorReason] + @search.semanticPartialResponseType: Union[str, SemanticSearchResultsType] + @search.semanticQueryRewritesResultType: Union[str, SemanticQueryRewritesResultType] + value: list[SearchResult] class azure.search.documents.types.SearchPostRequest(TypedDict, total=False): @@ -14621,43 +14578,37 @@ namespace azure.search.documents.types key "vectorFilterMode": Union[str, VectorFilterMode] answers: Union[str, QueryAnswerType] captions: Union[str, QueryCaptionType] + count: bool debug: Union[str, QueryDebugMode] facets: list[str] filter: str highlight: list[str] - highlight_fields: list[str] - highlight_post_tag: str - highlight_pre_tag: str - hybrid_search: HybridSearch - include_total_count: bool - minimum_coverage: float - order_by: list[str] + highlightPostTag: str + highlightPreTag: str + hybridSearch: HybridSearch + minimumCoverage: float orderby: list[str] - query_language: Union[str, QueryLanguage] - query_rewrites: Union[str, QueryRewritesType] - query_speller: Union[str, QuerySpellerType] - query_type: Union[str, QueryType] + queryLanguage: Union[str, QueryLanguage] + queryRewrites: Union[str, QueryRewritesType] + queryType: Union[str, QueryType] scoringParameters: list[str] - scoring_parameters: list[str] - scoring_profile: str - scoring_statistics: Union[str, ScoringStatistics] + scoringProfile: str + scoringStatistics: Union[str, ScoringStatistics] + search: str searchFields: list[str] - search_fields: list[str] - search_mode: Union[str, SearchMode] - search_text: str + searchMode: Union[str, SearchMode] select: list[str] + semanticConfiguration: str + semanticErrorHandling: Union[str, SemanticErrorMode] semanticFields: list[str] - semantic_configuration_name: str - semantic_error_handling: Union[str, SemanticErrorMode] - semantic_fields: list[str] - semantic_max_wait_in_milliseconds: int - semantic_query: str - session_id: str + semanticMaxWaitInMilliseconds: int + semanticQuery: str + sessionId: str skip: int + speller: Union[str, QuerySpellerType] top: int + vectorFilterMode: Union[str, VectorFilterMode] vectorQueries: list[VectorQuery] - vector_filter_mode: Union[str, VectorFilterMode] - vector_queries: list[VectorQuery] class azure.search.documents.types.SearchRequest(TypedDict, total=False): @@ -14688,43 +14639,37 @@ namespace azure.search.documents.types key "vectorFilterMode": Union[str, VectorFilterMode] answers: Union[str, QueryAnswerType] captions: Union[str, QueryCaptionType] + count: bool debug: Union[str, QueryDebugMode] facets: list[str] filter: str highlight: list[str] - highlight_fields: list[str] - highlight_post_tag: str - highlight_pre_tag: str - hybrid_search: HybridSearch - include_total_count: bool - minimum_coverage: float - order_by: list[str] + highlightPostTag: str + highlightPreTag: str + hybridSearch: HybridSearch + minimumCoverage: float orderby: list[str] - query_language: Union[str, QueryLanguage] - query_rewrites: Union[str, QueryRewritesType] - query_speller: Union[str, QuerySpellerType] - query_type: Union[str, QueryType] + queryLanguage: Union[str, QueryLanguage] + queryRewrites: Union[str, QueryRewritesType] + queryType: Union[str, QueryType] scoringParameters: list[str] - scoring_parameters: list[str] - scoring_profile: str - scoring_statistics: Union[str, ScoringStatistics] + scoringProfile: str + scoringStatistics: Union[str, ScoringStatistics] + search: str searchFields: list[str] - search_fields: list[str] - search_mode: Union[str, SearchMode] - search_text: str + searchMode: Union[str, SearchMode] select: list[str] + semanticConfiguration: str + semanticErrorHandling: Union[str, SemanticErrorMode] semanticFields: list[str] - semantic_configuration_name: str - semantic_error_handling: Union[str, SemanticErrorMode] - semantic_fields: list[str] - semantic_max_wait_in_milliseconds: int - semantic_query: str - session_id: str + semanticMaxWaitInMilliseconds: int + semanticQuery: str + sessionId: str skip: int + speller: Union[str, QuerySpellerType] top: int + vectorFilterMode: Union[str, VectorFilterMode] vectorQueries: list[VectorQuery] - vector_filter_mode: Union[str, VectorFilterMode] - vector_queries: list[VectorQuery] class azure.search.documents.types.SearchResult(TypedDict): @@ -14733,13 +14678,12 @@ namespace azure.search.documents.types key "@search.rerankerBoostedScore": Optional[float] key "@search.rerankerScore": Optional[float] key "@search.score": Required[float] + @search.captions: list[QueryCaptionResult] + @search.documentDebugInfo: DocumentDebugInfo @search.highlights: dict[str, list[str]] - captions: list[QueryCaptionResult] - document_debug_info: DocumentDebugInfo - highlights: dict[str, list[str]] - reranker_boosted_score: float - reranker_score: float - score: float + @search.rerankerBoostedScore: float + @search.rerankerScore: float + @search.score: float class azure.search.documents.types.SearchScoreThreshold(TypedDict, total=False): @@ -14753,18 +14697,16 @@ namespace azure.search.documents.types key "rerankerInput": ForwardRef('QueryResultDocumentRerankerInput', module='types') key "titleField": ForwardRef('QueryResultDocumentSemanticField', module='types') contentFields: list[QueryResultDocumentSemanticField] - content_fields: list[QueryResultDocumentSemanticField] keywordFields: list[QueryResultDocumentSemanticField] - keyword_fields: list[QueryResultDocumentSemanticField] - reranker_input: QueryResultDocumentRerankerInput - title_field: QueryResultDocumentSemanticField + rerankerInput: QueryResultDocumentRerankerInput + titleField: QueryResultDocumentSemanticField class azure.search.documents.types.SingleVectorFieldResult(TypedDict, total=False): key "searchScore": float key "vectorSimilarity": float - search_score: float - vector_similarity: float + searchScore: float + vectorSimilarity: float class azure.search.documents.types.SuggestPostRequest(TypedDict, total=False): @@ -14777,28 +14719,26 @@ namespace azure.search.documents.types key "suggesterName": Required[str] key "top": int filter: str - highlight_post_tag: str - highlight_pre_tag: str - minimum_coverage: float - order_by: list[str] + fuzzy: bool + highlightPostTag: str + highlightPreTag: str + minimumCoverage: float orderby: list[str] + search: str searchFields: list[str] - search_fields: list[str] - search_text: str select: list[str] - suggester_name: str + suggesterName: str top: int - use_fuzzy_matching: bool class azure.search.documents.types.SuggestResult(TypedDict): key "@search.text": Required[str] - text: str + @search.text: str class azure.search.documents.types.TextResult(TypedDict, total=False): key "searchScore": float - search_score: float + searchScore: float class azure.search.documents.types.VectorQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -14831,14 +14771,14 @@ namespace azure.search.documents.types key "perDocumentVectorLimit": int key "threshold": ForwardRef('VectorThreshold', module='types') key "weight": float - base64_image: str + base64Image: str exhaustive: bool fields: str - filter_override: str - k_nearest_neighbors: int + filterOverride: str + k: int kind: Literal[VectorQueryKind.IMAGE_BINARY] oversampling: float - per_document_vector_limit: int + perDocumentVectorLimit: int threshold: VectorThreshold weight: float @@ -14856,11 +14796,11 @@ namespace azure.search.documents.types key "weight": float exhaustive: bool fields: str - filter_override: str - k_nearest_neighbors: int + filterOverride: str + k: int kind: Literal[VectorQueryKind.IMAGE_URL] oversampling: float - per_document_vector_limit: int + perDocumentVectorLimit: int threshold: VectorThreshold url: str weight: float @@ -14880,12 +14820,12 @@ namespace azure.search.documents.types key "weight": float exhaustive: bool fields: str - filter_override: str - k_nearest_neighbors: int + filterOverride: str + k: int kind: Literal[VectorQueryKind.TEXT] oversampling: float - per_document_vector_limit: int - query_rewrites: Union[str, QueryRewritesType] + perDocumentVectorLimit: int + queryRewrites: Union[str, QueryRewritesType] text: str threshold: VectorThreshold weight: float @@ -14904,11 +14844,11 @@ namespace azure.search.documents.types key "weight": float exhaustive: bool fields: str - filter_override: str - k_nearest_neighbors: int + filterOverride: str + k: int kind: Literal[VectorQueryKind.VECTOR] oversampling: float - per_document_vector_limit: int + perDocumentVectorLimit: int threshold: VectorThreshold vector: list[float] weight: float diff --git a/sdk/search/azure-search-documents/api.metadata.yml b/sdk/search/azure-search-documents/api.metadata.yml index 16c9694cfb64..ab79bf02f68d 100644 --- a/sdk/search/azure-search-documents/api.metadata.yml +++ b/sdk/search/azure-search-documents/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: fde5d1711aad8c472cf86241b437322f651b61545669521a96561017fa6eab30 +apiMdSha256: 792b2760567454ab18fb82d9b5f9343bbe148e11b07b6f31d0b98b9a7e8cf332 parserVersion: 0.3.31 pythonVersion: 3.12.1 diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py index 6f83c1652f13..4195399a1e27 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py @@ -15,7 +15,7 @@ from azure.core.paging import ItemPaged from azure.core.tracing.decorator import distributed_trace -from .. import models as _models +from .. import models as _models, types as _types from ..models._models import SearchIndexResponse as _SearchIndexResponse from ._operations import ( _SearchIndexClientOperationsMixin as _SearchIndexClientOperationsMixinGenerated, @@ -521,8 +521,7 @@ def get_synonym_maps(self, *, select: Optional[List[str]] = None, **kwargs: Any) """ result = self._get_synonym_maps(select=select, **kwargs) assert result.synonym_maps is not None # Hint for mypy - # typed_result = [cast(_models.SynonymMap, x) for x in result.synonym_maps] - typed_result = result.synonym_maps + typed_result = [cast(_models.SynonymMap, item) for item in result.synonym_maps] return typed_result @distributed_trace @@ -766,7 +765,10 @@ def resync( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - return self._resync(name=name, indexer_resync=indexer_resync, **kwargs) + typed_indexer_resync = cast( + Union[_models.IndexerResyncBody, _types.IndexerResyncBody, IO[bytes]], indexer_resync + ) + return self._resync(name=name, indexer_resync=typed_indexer_resync, **kwargs) @distributed_trace def reset_documents( @@ -792,7 +794,10 @@ def reset_documents( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - return self._reset_documents(name=name, keys_or_ids=keys_or_ids, overwrite=overwrite, **kwargs) + typed_keys_or_ids = cast( + Optional[Union[_models.DocumentKeysOrIds, _types.DocumentKeysOrIds, IO[bytes]]], keys_or_ids + ) + return self._reset_documents(name=name, keys_or_ids=typed_keys_or_ids, overwrite=overwrite, **kwargs) @distributed_trace def delete_skillset( @@ -882,7 +887,8 @@ def reset_skills( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - return self._reset_skills(name=name, skill_names=skill_names, **kwargs) + typed_skill_names = cast(Union[_models.SkillNames, _types.SkillNames, IO[bytes]], skill_names) + return self._reset_skills(name=name, skill_names=typed_skill_names, **kwargs) @distributed_trace def get_skillsets( @@ -900,8 +906,7 @@ def get_skillsets( """ result = self._get_skillsets(select=select, **kwargs) assert result.skillsets is not None # Hint for mypy - # typed_result = [cast(_models.SearchIndexerSkillset, x) for x in result.skillsets] - typed_result = result.skillsets + typed_result = [cast(_models.SearchIndexerSkillset, item) for item in result.skillsets] return typed_result @distributed_trace @@ -918,8 +923,7 @@ def get_indexers(self, *, select: Optional[List[str]] = None, **kwargs: Any) -> """ result = self._get_indexers(select=select, **kwargs) assert result.indexers is not None # Hint for mypy - # typed_result = [cast(_models.SearchIndexer, x) for x in result.indexers] - typed_result = result.indexers + typed_result = [cast(_models.SearchIndexer, item) for item in result.indexers] return typed_result @distributed_trace @@ -957,8 +961,7 @@ def get_data_source_connections( """ result = self._get_data_source_connections(select=select, **kwargs) assert result.data_sources is not None # Hint for mypy - # typed_result = [cast(_models.SearchIndexerDataSourceConnection, x) for x in result.data_sources] - typed_result = result.data_sources + typed_result = [cast(_models.SearchIndexerDataSourceConnection, item) for item in result.data_sources] return typed_result @distributed_trace diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py index 4aa74a8b0881..96f0ca3714df 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py @@ -16,7 +16,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models as _models +from ... import models as _models, types as _types from ..._operations._patch import _convert_index_response from ._operations import ( _SearchIndexClientOperationsMixin as _SearchIndexClientOperationsMixinGenerated, @@ -501,8 +501,7 @@ async def get_synonym_maps(self, *, select: Optional[List[str]] = None, **kwargs """ result = await self._get_synonym_maps(select=select, **kwargs) assert result.synonym_maps is not None # Hint for mypy - # typed_result = [cast(_models.SynonymMap, x) for x in result.synonym_maps] - typed_result = result.synonym_maps + typed_result = [cast(_models.SynonymMap, item) for item in result.synonym_maps] return typed_result @distributed_trace_async @@ -745,7 +744,10 @@ async def resync( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - return await self._resync(name=name, indexer_resync=indexer_resync, **kwargs) + typed_indexer_resync = cast( + Union[_models.IndexerResyncBody, _types.IndexerResyncBody, IO[bytes]], indexer_resync + ) + return await self._resync(name=name, indexer_resync=typed_indexer_resync, **kwargs) @distributed_trace_async async def reset_documents( @@ -771,7 +773,10 @@ async def reset_documents( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - return await self._reset_documents(name=name, keys_or_ids=keys_or_ids, overwrite=overwrite, **kwargs) + typed_keys_or_ids = cast( + Optional[Union[_models.DocumentKeysOrIds, _types.DocumentKeysOrIds, IO[bytes]]], keys_or_ids + ) + return await self._reset_documents(name=name, keys_or_ids=typed_keys_or_ids, overwrite=overwrite, **kwargs) @distributed_trace_async async def delete_skillset( @@ -861,7 +866,8 @@ async def reset_skills( :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - return await self._reset_skills(name=name, skill_names=skill_names, **kwargs) + typed_skill_names = cast(Union[_models.SkillNames, _types.SkillNames, IO[bytes]], skill_names) + return await self._reset_skills(name=name, skill_names=typed_skill_names, **kwargs) @distributed_trace_async async def get_skillsets( @@ -879,8 +885,7 @@ async def get_skillsets( """ result = await self._get_skillsets(select=select, **kwargs) assert result.skillsets is not None # Hint for mypy - # typed_result = [cast(_models.SearchIndexerSkillset, x) for x in result.skillsets] - typed_result = result.skillsets + typed_result = [cast(_models.SearchIndexerSkillset, item) for item in result.skillsets] return typed_result @distributed_trace_async @@ -897,8 +902,7 @@ async def get_indexers(self, *, select: Optional[List[str]] = None, **kwargs: An """ result = await self._get_indexers(select=select, **kwargs) assert result.indexers is not None # Hint for mypy - # typed_result = [cast(_models.SearchIndexer, x) for x in result.indexers] - typed_result = result.indexers + typed_result = [cast(_models.SearchIndexer, item) for item in result.indexers] return typed_result @distributed_trace_async @@ -927,8 +931,7 @@ async def get_data_source_connections( """ result = await self._get_data_source_connections(select=select, **kwargs) assert result.data_sources is not None # Hint for mypy - # typed_result = [cast(_models.SearchIndexerDataSourceConnection, x) for x in result.data_sources] - typed_result = result.data_sources + typed_result = [cast(_models.SearchIndexerDataSourceConnection, item) for item in result.data_sources] return typed_result @distributed_trace_async diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py index 5d2d6eef45b2..5246b2e209af 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py @@ -5421,9 +5421,7 @@ class SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): """Projections to Azure File storage.""" -class SearchIndexerKnowledgeStoreTableProjectionSelector( - SearchIndexerKnowledgeStoreProjectionSelector -): # pylint: disable=name-too-long +class SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False): # pylint: disable=name-too-long """Description for what data to store in Azure Tables. :ivar referenceKeyName: Name of reference key to different projection. @@ -5440,6 +5438,14 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector( :vartype tableName: str """ + referenceKeyName: str + """Name of reference key to different projection.""" + source: str + """Source data to project.""" + sourceContext: str + """Source context for complex projections.""" + inputs: list["InputFieldMappingEntry"] + """Nested inputs for complex projections.""" generatedKeyName: Required[str] """Name of generated key to store projection under. Required.""" tableName: Required[str] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py index 897f0ae0b8eb..908c2d7305ea 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py @@ -7,13 +7,13 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, IO, Optional, Union +from typing import Any, cast, IO, Optional, Union from azure.core.credentials import AzureKeyCredential, TokenCredential from azure.core.tracing.decorator import distributed_trace from ._client import KnowledgeBaseRetrievalClient as _KnowledgeBaseRetrievalClient -from . import models +from . import models, types from ._stream import KnowledgeBaseRetrievalEvent, KnowledgeBaseRetrievalEventData, KnowledgeBaseRetrievalStream @@ -45,12 +45,13 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre super().__init__(endpoint=endpoint, credential=credential, **kwargs) @distributed_trace - def retrieve_stream( + def retrieve_stream( # type: ignore[override] self, retrieval_request: Union[models.KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], *, query_source_authorization: Optional[str] = None, query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any, ) -> KnowledgeBaseRetrievalStream: """Retrieve relevant data and stream typed server-sent events. @@ -64,6 +65,8 @@ def retrieve_stream( :keyword query_work_iq_source_authorization: User assertion token for a customer-owned Entra app registration configured on a Work IQ knowledge source. Default value is None. :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body parameter content type. Default value is "application/json". + :paramtype content_type: str :return: A stream of typed knowledge base retrieval events. :rtype: ~azure.search.documents.knowledgebases.KnowledgeBaseRetrievalStream :raises ~azure.core.exceptions.HttpResponseError: @@ -79,17 +82,28 @@ def _wrap_stream(pipeline_response, raw_stream, response_headers): callback_context.update(pipeline_response=pipeline_response, response_headers=response_headers) return stream - stream = super().retrieve_stream( + typed_retrieval_request = cast( + Union[models.KnowledgeBaseRetrievalRequest, types.KnowledgeBaseRetrievalRequest, IO[bytes]], retrieval_request, - query_source_authorization=query_source_authorization, - query_work_iq_source_authorization=query_work_iq_source_authorization, - cls=_wrap_stream, - **kwargs, - ) # type: ignore[return-value] + ) + stream = cast( + KnowledgeBaseRetrievalStream, + super().retrieve_stream( + typed_retrieval_request, + query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, + content_type=content_type, + cls=_wrap_stream, + **kwargs, + ), + ) if not custom_cls: return stream try: - return custom_cls(callback_context["pipeline_response"], stream, callback_context["response_headers"]) + return cast( + KnowledgeBaseRetrievalStream, + custom_cls(callback_context["pipeline_response"], stream, callback_context["response_headers"]), + ) except Exception: stream.close() raise diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py index 623944427d31..f30080b31528 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py @@ -7,14 +7,14 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, IO, Optional, Union +from typing import Any, cast, IO, Optional, Union from azure.core.credentials import AzureKeyCredential from azure.core.credentials_async import AsyncTokenCredential from azure.core.tracing.decorator_async import distributed_trace_async from ._client import KnowledgeBaseRetrievalClient as _KnowledgeBaseRetrievalClient -from .. import models +from .. import models, types from .._stream import AsyncKnowledgeBaseRetrievalStream, KnowledgeBaseRetrievalEvent, KnowledgeBaseRetrievalEventData @@ -48,12 +48,13 @@ def __init__( super().__init__(endpoint=endpoint, credential=credential, **kwargs) @distributed_trace_async - async def retrieve_stream( + async def retrieve_stream( # type: ignore[override] self, retrieval_request: Union[models.KnowledgeBaseRetrievalRequest, dict[str, Any], IO[bytes]], *, query_source_authorization: Optional[str] = None, query_work_iq_source_authorization: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any, ) -> AsyncKnowledgeBaseRetrievalStream: """Retrieve relevant data and asynchronously stream typed server-sent events. @@ -67,6 +68,8 @@ async def retrieve_stream( :keyword query_work_iq_source_authorization: User assertion token for a customer-owned Entra app registration configured on a Work IQ knowledge source. Default value is None. :paramtype query_work_iq_source_authorization: str + :keyword content_type: Body parameter content type. Default value is "application/json". + :paramtype content_type: str :return: An asynchronous stream of typed knowledge base retrieval events. :rtype: ~azure.search.documents.knowledgebases.aio.AsyncKnowledgeBaseRetrievalStream :raises ~azure.core.exceptions.HttpResponseError: @@ -82,17 +85,28 @@ def _wrap_stream(pipeline_response, raw_stream, response_headers): callback_context.update(pipeline_response=pipeline_response, response_headers=response_headers) return stream - stream = await super().retrieve_stream( + typed_retrieval_request = cast( + Union[models.KnowledgeBaseRetrievalRequest, types.KnowledgeBaseRetrievalRequest, IO[bytes]], retrieval_request, - query_source_authorization=query_source_authorization, - query_work_iq_source_authorization=query_work_iq_source_authorization, - cls=_wrap_stream, - **kwargs, - ) # type: ignore[return-value] + ) + stream = cast( + AsyncKnowledgeBaseRetrievalStream, + await super().retrieve_stream( + typed_retrieval_request, + query_source_authorization=query_source_authorization, + query_work_iq_source_authorization=query_work_iq_source_authorization, + content_type=content_type, + cls=_wrap_stream, + **kwargs, + ), + ) if not custom_cls: return stream try: - return custom_cls(callback_context["pipeline_response"], stream, callback_context["response_headers"]) + return cast( + AsyncKnowledgeBaseRetrievalStream, + custom_cls(callback_context["pipeline_response"], stream, callback_context["response_headers"]), + ) except Exception: await stream.close() raise diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py index fd15823ca599..1c04ea6672e4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py @@ -28,7 +28,6 @@ from ..indexesmodels import ( KnowledgeSourceContentExtractionMode, KnowledgeSourceIngestionPermissionOption, - KnowledgeSourceKind, KnowledgeSourceResultsProcessing, KnowledgeSourceSynchronizationStatus, ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py index 410fa28d8250..64dc155e8927 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py @@ -66,6 +66,7 @@ SemanticErrorMode, SemanticErrorReason, SemanticFieldState, + SemanticQueryRewritesResultType, SemanticSearchResultsType, VectorFilterMode, VectorQueryKind, @@ -125,6 +126,7 @@ "SemanticErrorMode", "SemanticErrorReason", "SemanticFieldState", + "SemanticQueryRewritesResultType", "SemanticSearchResultsType", "VectorFilterMode", "VectorQueryKind", diff --git a/sdk/search/azure-search-documents/azure/search/documents/types.py b/sdk/search/azure-search-documents/azure/search/documents/types.py index d529419c5477..6dd9e57b8535 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/types.py @@ -379,7 +379,7 @@ class QueryRewritesValuesDebugInfo(TypedDict, total=False): "@odata.nextLink": str, "@search.semanticPartialResponseReason": Union[str, "SemanticErrorReason"], "@search.semanticPartialResponseType": Union[str, "SemanticSearchResultsType"], - "@search.semanticQueryRewritesResultType": Union[str, "_enums.SemanticQueryRewritesResultType"], + "@search.semanticQueryRewritesResultType": Union[str, "SemanticQueryRewritesResultType"], }, total=False, ) diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.aio.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.aio.rst new file mode 100644 index 000000000000..a4707262ef64 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.aio.rst @@ -0,0 +1,7 @@ +azure.search.documents.aio package +================================== + +.. automodule:: azure.search.documents.aio + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.aio.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.aio.rst new file mode 100644 index 000000000000..2324697ab8b0 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.aio.rst @@ -0,0 +1,7 @@ +azure.search.documents.indexes.aio package +========================================== + +.. automodule:: azure.search.documents.indexes.aio + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.models.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.models.rst new file mode 100644 index 000000000000..647284b0da43 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.models.rst @@ -0,0 +1,7 @@ +azure.search.documents.indexes.models package +============================================= + +.. automodule:: azure.search.documents.indexes.models + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.rst new file mode 100644 index 000000000000..179b2a5c2182 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.indexes.rst @@ -0,0 +1,30 @@ +azure.search.documents.indexes package +====================================== + +.. automodule:: azure.search.documents.indexes + :members: + :show-inheritance: + :undoc-members: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + azure.search.documents.indexes.aio + azure.search.documents.indexes.models + +Submodules +---------- + +azure.search.documents.indexes.types module +------------------------------------------- + +.. TEMPORARY: Remove exclude-members after upgrading the Python emitter to a + version that escapes at-prefixed wire names in docstrings. +.. automodule:: azure.search.documents.indexes.types + :members: + :exclude-members: @odata.etag,@odata.type + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.aio.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.aio.rst new file mode 100644 index 000000000000..ce66912f8513 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.aio.rst @@ -0,0 +1,7 @@ +azure.search.documents.knowledgebases.aio package +================================================= + +.. automodule:: azure.search.documents.knowledgebases.aio + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.models.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.models.rst new file mode 100644 index 000000000000..ec2dfb20f695 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.models.rst @@ -0,0 +1,7 @@ +azure.search.documents.knowledgebases.models package +==================================================== + +.. automodule:: azure.search.documents.knowledgebases.models + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.rst new file mode 100644 index 000000000000..b90a8dab3cf1 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.knowledgebases.rst @@ -0,0 +1,27 @@ +azure.search.documents.knowledgebases package +============================================= + +.. automodule:: azure.search.documents.knowledgebases + :members: + :show-inheritance: + :undoc-members: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + azure.search.documents.knowledgebases.aio + azure.search.documents.knowledgebases.models + +Submodules +---------- + +azure.search.documents.knowledgebases.types module +-------------------------------------------------- + +.. automodule:: azure.search.documents.knowledgebases.types + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.models.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.models.rst new file mode 100644 index 000000000000..6333fe0416d8 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.models.rst @@ -0,0 +1,7 @@ +azure.search.documents.models package +===================================== + +.. automodule:: azure.search.documents.models + :members: + :show-inheritance: + :undoc-members: \ No newline at end of file diff --git a/sdk/search/azure-search-documents/doc/azure.search.documents.rst b/sdk/search/azure-search-documents/doc/azure.search.documents.rst new file mode 100644 index 000000000000..9591ab0ed4d3 --- /dev/null +++ b/sdk/search/azure-search-documents/doc/azure.search.documents.rst @@ -0,0 +1,32 @@ +azure.search.documents package +============================== + +.. automodule:: azure.search.documents + :members: + :show-inheritance: + :undoc-members: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + azure.search.documents.aio + azure.search.documents.indexes + azure.search.documents.knowledgebases + azure.search.documents.models + +Submodules +---------- + +azure.search.documents.types module +----------------------------------- + +.. TEMPORARY: Remove exclude-members after upgrading the Python emitter to a + version that escapes at-prefixed wire names in docstrings. +.. automodule:: azure.search.documents.types + :members: + :exclude-members: @odata.count,@odata.nextLink,@search.action,@search.answers,@search.captions,@search.coverage,@search.debug,@search.documentDebugInfo,@search.facets,@search.highlights,@search.nextPageParameters,@search.rerankerBoostedScore,@search.rerankerScore,@search.score,@search.semanticPartialResponseReason,@search.semanticPartialResponseType,@search.semanticQueryRewritesResultType,@search.text + :show-inheritance: + :undoc-members: \ No newline at end of file From b7796368fce002c7394bcf8466e266f72c626182 Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:28:48 +0000 Subject: [PATCH 12/17] Fix linter --- .../scripts/apply_generator_workarounds.py | 20 +++++++++++++++++++ .../indexes/_operations/_operations.py | 2 +- .../indexes/aio/_operations/_operations.py | 2 +- .../search/documents/knowledgebases/_patch.py | 2 -- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py index 351445deb32e..b3a4314ae49d 100644 --- a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py @@ -120,6 +120,26 @@ class Replacement: """ ), ), + Replacement( + "azure/search/documents/indexes/_operations/_operations.py", + "suppress protected access for the generated SearchIndexResponse type", + """list[_models1._models.SearchIndexResponse], + deserialized.get("value", []), + """, + """list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access + deserialized.get("value", []), + """, + ), + Replacement( + "azure/search/documents/indexes/aio/_operations/_operations.py", + "suppress protected access for the generated async SearchIndexResponse type", + """list[_models2._models.SearchIndexResponse], + deserialized.get("value", []), + """, + """list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access + deserialized.get("value", []), + """, + ), ) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py index 0a355a67d36b..4d5ff619a409 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py @@ -2806,7 +2806,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models1._models.SearchIndexResponse], + list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access deserialized.get("value", []), ) if cls: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py index 7fd89e603a2a..d45a0a15330d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py @@ -1101,7 +1101,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models2._models.SearchIndexResponse], + list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access deserialized.get("value", []), ) if cls: diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py index 908c2d7305ea..06505c7c879d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py @@ -124,8 +124,6 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - from . import types - query_parameter_types = ( types.AzureBlobKnowledgeSourceParams, types.FileKnowledgeSourceParams, From 8ffa3ec9844b8a24b8f138616ce15e6dd3b60c5e Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Fri, 21 Aug 2026 22:58:14 +0000 Subject: [PATCH 13/17] Regen with latest commit SHA, finalize SDK, update samples --- .../azure-search-documents/CHANGELOG.md | 2 +- .../apiview-properties.json | 2 +- .../search/documents/_operations/_patch.py | 1 + .../azure/search/documents/_patch.py | 1 + .../documents/aio/_operations/_patch.py | 1 + .../azure/search/documents/aio/_patch.py | 1 + .../indexes/_operations/_operations.py | 497 +++++++----- .../documents/indexes/_operations/_patch.py | 117 ++- .../azure/search/documents/indexes/_patch.py | 1 + .../indexes/aio/_operations/_operations.py | 515 +++++++----- .../indexes/aio/_operations/_patch.py | 113 ++- .../search/documents/indexes/aio/_patch.py | 1 + .../documents/indexes/models/_models.py | 65 -- .../azure/search/documents/indexes/types.py | 559 ++++++------- .../knowledgebases/_operations/_patch.py | 1 - .../search/documents/knowledgebases/_patch.py | 7 +- .../documents/knowledgebases/_stream.py | 1 - .../knowledgebases/aio/_operations/_patch.py | 1 - .../documents/knowledgebases/aio/_patch.py | 1 + .../knowledgebases/models/_models.py | 34 +- .../documents/knowledgebases/models/_patch.py | 1 - .../search/documents/knowledgebases/types.py | 308 +------- .../azure/search/documents/models/__init__.py | 2 - .../azure/search/documents/models/_patch.py | 1 + .../azure/search/documents/types.py | 735 +----------------- .../azure-search-documents/samples/README.md | 12 +- .../samples/sample_index_alias_crud.py | 1 - .../samples/sample_index_alias_crud_async.py | 1 - .../samples/sample_index_crud.py | 1 - .../samples/sample_index_crud_async.py | 1 - ...le_knowledge_base_configuration_preview.py | 14 +- ...wledge_base_configuration_preview_async.py | 12 +- .../samples/sample_knowledge_base_crud.py | 44 +- .../sample_knowledge_base_crud_async.py | 45 +- ...le_knowledge_retrieval_response_preview.py | 48 +- ...wledge_retrieval_response_preview_async.py | 48 +- .../sample_knowledge_service_stats_preview.py | 6 + ...e_knowledge_service_stats_preview_async.py | 6 + .../samples/sample_knowledge_source_crud.py | 131 +++- .../sample_knowledge_source_crud_async.py | 131 +++- ...wledge_source_fabric_data_agent_preview.py | 1 - ..._source_fabric_data_agent_preview_async.py | 1 - ...nowledge_source_fabric_ontology_preview.py | 1 - ...ge_source_fabric_ontology_preview_async.py | 1 - .../sample_knowledge_source_file_preview.py | 29 +- ...ple_knowledge_source_file_preview_async.py | 29 +- ...mple_knowledge_source_freshness_preview.py | 1 - ...nowledge_source_freshness_preview_async.py | 1 - ...ple_knowledge_source_mcp_server_preview.py | 1 - ...owledge_source_mcp_server_preview_async.py | 1 - .../sample_knowledge_source_workiq_preview.py | 28 +- ...e_knowledge_source_workiq_preview_async.py | 28 +- .../sample_query_autocomplete_async.py | 1 - .../samples/sample_query_facets_async.py | 1 - .../samples/sample_query_filter_async.py | 1 - .../samples/sample_query_simple_async.py | 1 - .../samples/sample_query_suggestions_async.py | 1 - .../tests/_search_helpers_async.py | 1 - .../test_search_index_client_aliases_live.py | 1 + ..._search_index_client_aliases_live_async.py | 1 + .../test_search_index_client_indexes_live.py | 1 + ..._search_index_client_indexes_live_async.py | 1 + ...t_search_index_client_synonym_maps_live.py | 1 + ...ch_index_client_synonym_maps_live_async.py | 1 + .../tests/test_search_index_model.py | 1 - .../tests/test_search_indexer_models.py | 1 - .../azure-search-documents/tsp-location.yaml | 2 +- 67 files changed, 1628 insertions(+), 1979 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index d6ed43c73cb0..39a405261ee0 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.0b2 (Unreleased) +## 12.1.0b2 (2026-08-27) ### Features Added diff --git a/sdk/search/azure-search-documents/apiview-properties.json b/sdk/search/azure-search-documents/apiview-properties.json index 7e8a896c0f5e..f71351b7e357 100644 --- a/sdk/search/azure-search-documents/apiview-properties.json +++ b/sdk/search/azure-search-documents/apiview-properties.json @@ -550,5 +550,5 @@ "azure.search.documents.KnowledgeBaseRetrievalClient.retrieve_stream": "Customizations.KnowledgeBaseRetrievalClient.retrieveStream", "azure.search.documents.aio.KnowledgeBaseRetrievalClient.retrieve_stream": "Customizations.KnowledgeBaseRetrievalClient.retrieveStream" }, - "CrossLanguageVersion": "da0aafb66887" + "CrossLanguageVersion": "989eb0de7d67" } \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py index ae52ce7ff051..94dde1147809 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Dict, List, Optional, Union, cast import base64 import itertools diff --git a/sdk/search/azure-search-documents/azure/search/documents/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/_patch.py index 505866a1dbc5..fa5948ba249f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Union, List, Dict, Optional, cast from enum import Enum import time diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py index 54f7153bc1ed..21b39cbd1ec7 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Dict, List, Optional, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncPageIterator, ReturnType diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py index 0a8b10ce0931..cead743f44b8 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Union, List, Dict, Optional, cast import asyncio # pylint: disable=do-not-import-asyncio diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py index 4d5ff619a409..ac779935953d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py @@ -2093,7 +2093,7 @@ def _get_synonym_maps( page_size: Optional[int] = None, search_type: Optional[Union[str, _models1.ListingSearchType]] = None, **kwargs: Any, - ) -> _models1._models.ListSynonymMapsResult: + ) -> ItemPaged["_models1.SynonymMap"]: """Lists all synonym maps available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -2110,10 +2110,15 @@ def _get_synonym_maps( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListSynonymMapsResult. The ListSynonymMapsResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListSynonymMapsResult + :return: An iterator like instance of SynonymMap + :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SynonymMap] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models1.SynonymMap]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2122,57 +2127,80 @@ def _get_synonym_maps( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models1._models.ListSynonymMapsResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_index_get_synonym_maps_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_index_get_synonym_maps_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models2.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models1.SynonymMap], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models1._models.ListSynonymMapsResult, response.json() # pylint: disable=protected-access + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return ItemPaged(get_next, extract_data) @overload def create_synonym_map( @@ -2806,7 +2834,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access + list[_models1._models.SearchIndexResponse], deserialized.get("value", []), ) if cls: @@ -4847,8 +4875,7 @@ def upload_knowledge_source_file_multipart( self, name: str, body: _models1.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any ) -> _models1.KnowledgeSourceFile: """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part - (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part - with the raw file bytes. + (file name and custom metadata) and a 'content' part with the raw file bytes. :param name: The name of the knowledge source. Required. :type name: str @@ -4864,8 +4891,7 @@ def upload_knowledge_source_file_multipart( self, name: str, body: _types_models1.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any ) -> _models1.KnowledgeSourceFile: """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part - (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part - with the raw file bytes. + (file name and custom metadata) and a 'content' part with the raw file bytes. :param name: The name of the knowledge source. Required. :type name: str @@ -4891,8 +4917,7 @@ def upload_knowledge_source_file_multipart( **kwargs: Any, ) -> _models1.KnowledgeSourceFile: """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part - (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part - with the raw file bytes. + (file name and custom metadata) and a 'content' part with the raw file bytes. :param name: The name of the knowledge source. Required. :type name: str @@ -5162,8 +5187,8 @@ def update_knowledge_source_file( self, file_id: str, name: str, body: _models1.UpdateKnowledgeSourceFileRequest, **kwargs: Any ) -> _models1.KnowledgeSourceFile: """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, custom metadata, and optional - extraction override) and a 'content' part with the raw file bytes. + Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a + 'content' part with the raw file bytes. :param file_id: The unique identifier of the file to update. Required. :type file_id: str @@ -5181,8 +5206,8 @@ def update_knowledge_source_file( self, file_id: str, name: str, body: _types_models1.UpdateKnowledgeSourceFileRequest, **kwargs: Any ) -> _models1.KnowledgeSourceFile: """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, custom metadata, and optional - extraction override) and a 'content' part with the raw file bytes. + Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a + 'content' part with the raw file bytes. :param file_id: The unique identifier of the file to update. Required. :type file_id: str @@ -5211,8 +5236,8 @@ def update_knowledge_source_file( **kwargs: Any, ) -> _models1.KnowledgeSourceFile: """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, custom metadata, and optional - extraction override) and a 'content' part with the raw file bytes. + Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a + 'content' part with the raw file bytes. :param file_id: The unique identifier of the file to update. Required. :type file_id: str @@ -5772,7 +5797,7 @@ def _get_data_source_connections( page_size: Optional[int] = None, search_type: Optional[Union[str, _models1.ListingSearchType]] = None, **kwargs: Any, - ) -> _models1._models.ListDataSourcesResult: + ) -> ItemPaged["_models1.SearchIndexerDataSourceConnection"]: """Lists all datasources available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -5789,10 +5814,16 @@ def _get_data_source_connections( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListDataSourcesResult. The ListDataSourcesResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListDataSourcesResult + :return: An iterator like instance of SearchIndexerDataSourceConnection + :rtype: + ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models1.SearchIndexerDataSourceConnection]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5801,57 +5832,80 @@ def _get_data_source_connections( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models1._models.ListDataSourcesResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_indexer_get_data_source_connections_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_indexer_get_data_source_connections_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models2.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models1.SearchIndexerDataSourceConnection], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models1._models.ListDataSourcesResult, response.json() # pylint: disable=protected-access + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return ItemPaged(get_next, extract_data) @overload def create_data_source_connection( @@ -6628,7 +6682,7 @@ def _get_indexers( page_size: Optional[int] = None, search_type: Optional[Union[str, _models1.ListingSearchType]] = None, **kwargs: Any, - ) -> _models1._models.ListIndexersResult: + ) -> ItemPaged["_models1.SearchIndexer"]: """Lists all indexers available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -6645,10 +6699,15 @@ def _get_indexers( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListIndexersResult. The ListIndexersResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListIndexersResult + :return: An iterator like instance of SearchIndexer + :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchIndexer] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models1.SearchIndexer]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6657,57 +6716,80 @@ def _get_indexers( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models1._models.ListIndexersResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_indexer_get_indexers_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_indexer_get_indexers_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models2.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models1.SearchIndexer], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models1._models.ListIndexersResult, response.json() # pylint: disable=protected-access + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return ItemPaged(get_next, extract_data) @overload def create_indexer( @@ -7206,7 +7288,7 @@ def _get_skillsets( page_size: Optional[int] = None, search_type: Optional[Union[str, _models1.ListingSearchType]] = None, **kwargs: Any, - ) -> _models1._models.ListSkillsetsResult: + ) -> ItemPaged["_models1.SearchIndexerSkillset"]: """List all skillsets in a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -7223,10 +7305,16 @@ def _get_skillsets( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListSkillsetsResult. The ListSkillsetsResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListSkillsetsResult + :return: An iterator like instance of SearchIndexerSkillset + :rtype: + ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchIndexerSkillset] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models1.SearchIndexerSkillset]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7235,57 +7323,80 @@ def _get_skillsets( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models1._models.ListSkillsetsResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_indexer_get_skillsets_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_indexer_get_skillsets_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models2.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models1.SearchIndexerSkillset], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, iter(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models1._models.ListSkillsetsResult, response.json() # pylint: disable=protected-access + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models2.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return ItemPaged(get_next, extract_data) @overload def create_skillset( diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py index 4195399a1e27..5d7ad3c802a7 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from collections.abc import MutableMapping # pylint: disable=import-error from typing import Any, cast, IO, List, Sequence, Union, Optional, TYPE_CHECKING @@ -508,21 +509,41 @@ def list_index_names( return cast(ItemPaged[str], names) @distributed_trace - def get_synonym_maps(self, *, select: Optional[List[str]] = None, **kwargs: Any) -> List[_models.SynonymMap]: + def get_synonym_maps( + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, + ) -> List[_models.SynonymMap]: """Lists all synonym maps available for a search service. :keyword select: Selects which top-level properties of the synonym maps to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of synonym maps :rtype: list[~azure.search.documents.indexes.models.SynonymMap] :raises ~azure.core.exceptions.HttpResponseError: """ - result = self._get_synonym_maps(select=select, **kwargs) - assert result.synonym_maps is not None # Hint for mypy - typed_result = [cast(_models.SynonymMap, item) for item in result.synonym_maps] - return typed_result + return list( + self._get_synonym_maps( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + ) @distributed_trace def get_synonym_map_names(self, **kwargs: Any) -> List[str]: @@ -892,7 +913,13 @@ def reset_skills( @distributed_trace def get_skillsets( - self, *, select: Optional[List[str]] = None, **kwargs: Any + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, ) -> List[_models.SearchIndexerSkillset]: """Lists all skillsets available for a search service. @@ -900,31 +927,63 @@ def get_skillsets( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of all the SearchIndexerSkillsets. :rtype: list[~azure.search.documents.indexes.models.SearchIndexerSkillset] :raises ~azure.core.exceptions.HttpResponseError: """ - result = self._get_skillsets(select=select, **kwargs) - assert result.skillsets is not None # Hint for mypy - typed_result = [cast(_models.SearchIndexerSkillset, item) for item in result.skillsets] - return typed_result + return list( + self._get_skillsets( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + ) @distributed_trace - def get_indexers(self, *, select: Optional[List[str]] = None, **kwargs: Any) -> List[_models.SearchIndexer]: + def get_indexers( + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, + ) -> List[_models.SearchIndexer]: """Lists all indexers available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of all the SearchIndexers. :rtype: list[~azure.search.documents.indexes.models.SearchIndexer] :raises ~azure.core.exceptions.HttpResponseError: """ - result = self._get_indexers(select=select, **kwargs) - assert result.indexers is not None # Hint for mypy - typed_result = [cast(_models.SearchIndexer, item) for item in result.indexers] - return typed_result + return list( + self._get_indexers( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + ) @distributed_trace def get_indexer_names(self, **kwargs: Any) -> Sequence[str]: @@ -947,7 +1006,13 @@ def get_indexer_names(self, **kwargs: Any) -> Sequence[str]: @distributed_trace def get_data_source_connections( - self, *, select: Optional[List[str]] = None, **kwargs: Any + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, ) -> List[_models.SearchIndexerDataSourceConnection]: """Lists all data source connections available for a search service. @@ -955,14 +1020,26 @@ def get_data_source_connections( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of all the data source connections. :rtype: list[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection] :raises ~azure.core.exceptions.HttpResponseError: """ - result = self._get_data_source_connections(select=select, **kwargs) - assert result.data_sources is not None # Hint for mypy - typed_result = [cast(_models.SearchIndexerDataSourceConnection, item) for item in result.data_sources] - return typed_result + return list( + self._get_data_source_connections( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + ) @distributed_trace def get_data_source_connection_names(self, **kwargs: Any) -> Sequence[str]: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py index 41a0f266124f..e55ff2517b1d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Optional, Union from azure.core.credentials import AzureKeyCredential, TokenCredential diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py index d45a0a15330d..dc8d5aa77210 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py @@ -374,12 +374,12 @@ async def get_synonym_map(self, name: str, **kwargs: Any) -> _models2.SynonymMap return deserialized # type: ignore - @distributed_trace_async + @distributed_trace @api_version_validation( params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) - async def _get_synonym_maps( + def _get_synonym_maps( self, *, select: Optional[list[str]] = None, @@ -387,7 +387,7 @@ async def _get_synonym_maps( page_size: Optional[int] = None, search_type: Optional[Union[str, _models2.ListingSearchType]] = None, **kwargs: Any - ) -> _models2._models.ListSynonymMapsResult: + ) -> AsyncItemPaged["_models2.SynonymMap"]: """Lists all synonym maps available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -404,10 +404,16 @@ async def _get_synonym_maps( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListSynonymMapsResult. The ListSynonymMapsResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListSynonymMapsResult + :return: An iterator like instance of SynonymMap + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SynonymMap] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models2.SynonymMap]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -416,57 +422,80 @@ async def _get_synonym_maps( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models2._models.ListSynonymMapsResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_index_get_synonym_maps_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_index_get_synonym_maps_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models3.ErrorResponse, - response, + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models2.SynonymMap], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models2._models.ListSynonymMapsResult, response.json() # pylint: disable=protected-access + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @overload async def create_synonym_map( @@ -1101,7 +1130,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access + list[_models2._models.SearchIndexResponse], deserialized.get("value", []), ) if cls: @@ -3147,8 +3176,7 @@ async def upload_knowledge_source_file_multipart( self, name: str, body: _models2.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any ) -> _models2.KnowledgeSourceFile: """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part - (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part - with the raw file bytes. + (file name and custom metadata) and a 'content' part with the raw file bytes. :param name: The name of the knowledge source. Required. :type name: str @@ -3164,8 +3192,7 @@ async def upload_knowledge_source_file_multipart( self, name: str, body: _types_models2.UploadKnowledgeSourceFileMultipartRequest, **kwargs: Any ) -> _models2.KnowledgeSourceFile: """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part - (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part - with the raw file bytes. + (file name and custom metadata) and a 'content' part with the raw file bytes. :param name: The name of the knowledge source. Required. :type name: str @@ -3191,8 +3218,7 @@ async def upload_knowledge_source_file_multipart( **kwargs: Any ) -> _models2.KnowledgeSourceFile: """Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part - (file name, custom metadata, and optional parsing/extraction overrides) and a 'content' part - with the raw file bytes. + (file name and custom metadata) and a 'content' part with the raw file bytes. :param name: The name of the knowledge source. Required. :type name: str @@ -3460,8 +3486,8 @@ async def update_knowledge_source_file( self, file_id: str, name: str, body: _models2.UpdateKnowledgeSourceFileRequest, **kwargs: Any ) -> _models2.KnowledgeSourceFile: """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, custom metadata, and optional - extraction override) and a 'content' part with the raw file bytes. + Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a + 'content' part with the raw file bytes. :param file_id: The unique identifier of the file to update. Required. :type file_id: str @@ -3479,8 +3505,8 @@ async def update_knowledge_source_file( self, file_id: str, name: str, body: _types_models2.UpdateKnowledgeSourceFileRequest, **kwargs: Any ) -> _models2.KnowledgeSourceFile: """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, custom metadata, and optional - extraction override) and a 'content' part with the raw file bytes. + Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a + 'content' part with the raw file bytes. :param file_id: The unique identifier of the file to update. Required. :type file_id: str @@ -3509,8 +3535,8 @@ async def update_knowledge_source_file( **kwargs: Any ) -> _models2.KnowledgeSourceFile: """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, custom metadata, and optional - extraction override) and a 'content' part with the raw file bytes. + Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a + 'content' part with the raw file bytes. :param file_id: The unique identifier of the file to update. Required. :type file_id: str @@ -4057,12 +4083,12 @@ async def get_data_source_connection(self, name: str, **kwargs: Any) -> _models2 return deserialized # type: ignore - @distributed_trace_async + @distributed_trace @api_version_validation( params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) - async def _get_data_source_connections( + def _get_data_source_connections( self, *, select: Optional[list[str]] = None, @@ -4070,7 +4096,7 @@ async def _get_data_source_connections( page_size: Optional[int] = None, search_type: Optional[Union[str, _models2.ListingSearchType]] = None, **kwargs: Any - ) -> _models2._models.ListDataSourcesResult: + ) -> AsyncItemPaged["_models2.SearchIndexerDataSourceConnection"]: """Lists all datasources available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -4087,10 +4113,16 @@ async def _get_data_source_connections( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListDataSourcesResult. The ListDataSourcesResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListDataSourcesResult + :return: An iterator like instance of SearchIndexerDataSourceConnection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models2.SearchIndexerDataSourceConnection]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4099,57 +4131,80 @@ async def _get_data_source_connections( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models2._models.ListDataSourcesResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_indexer_get_data_source_connections_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_indexer_get_data_source_connections_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models3.ErrorResponse, - response, + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models2.SearchIndexerDataSourceConnection], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models2._models.ListDataSourcesResult, response.json() # pylint: disable=protected-access + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @overload async def create_data_source_connection( @@ -4913,12 +4968,12 @@ async def get_indexer(self, name: str, **kwargs: Any) -> _models2.SearchIndexer: return deserialized # type: ignore - @distributed_trace_async + @distributed_trace @api_version_validation( params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) - async def _get_indexers( + def _get_indexers( self, *, select: Optional[list[str]] = None, @@ -4926,7 +4981,7 @@ async def _get_indexers( page_size: Optional[int] = None, search_type: Optional[Union[str, _models2.ListingSearchType]] = None, **kwargs: Any - ) -> _models2._models.ListIndexersResult: + ) -> AsyncItemPaged["_models2.SearchIndexer"]: """Lists all indexers available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -4943,10 +4998,16 @@ async def _get_indexers( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListIndexersResult. The ListIndexersResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListIndexersResult + :return: An iterator like instance of SearchIndexer + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SearchIndexer] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models2.SearchIndexer]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4955,57 +5016,80 @@ async def _get_indexers( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models2._models.ListIndexersResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_indexer_get_indexers_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_indexer_get_indexers_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models3.ErrorResponse, - response, + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models2.SearchIndexer], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models2._models.ListIndexersResult, response.json() # pylint: disable=protected-access + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @overload async def create_indexer( @@ -5491,12 +5575,12 @@ async def get_skillset(self, name: str, **kwargs: Any) -> _models2.SearchIndexer return deserialized # type: ignore - @distributed_trace_async + @distributed_trace @api_version_validation( params_added_on={"2026-08-01-preview": ["search", "page_size", "search_type"]}, api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview", "2026-08-01-preview"], ) - async def _get_skillsets( + def _get_skillsets( self, *, select: Optional[list[str]] = None, @@ -5504,7 +5588,7 @@ async def _get_skillsets( page_size: Optional[int] = None, search_type: Optional[Union[str, _models2.ListingSearchType]] = None, **kwargs: Any - ) -> _models2._models.ListSkillsetsResult: + ) -> AsyncItemPaged["_models2.SearchIndexerSkillset"]: """List all skillsets in a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated @@ -5521,10 +5605,16 @@ async def _get_skillsets( :keyword search_type: Specifies how the search parameter is interpreted. Currently only 'prefix' is supported. "prefix" Default value is None. :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType - :return: ListSkillsetsResult. The ListSkillsetsResult is compatible with MutableMapping - :rtype: ~azure.search.documents.indexes.models._models.ListSkillsetsResult + :return: An iterator like instance of SearchIndexerSkillset + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.SearchIndexerSkillset] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[list[_models2.SearchIndexerSkillset]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5533,57 +5623,80 @@ async def _get_skillsets( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models2._models.ListSkillsetsResult] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_search_indexer_get_skillsets_request( - select=select, - search=search, - page_size=page_size, - search_type=search_type, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_search_indexer_get_skillsets_request( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.endpoint", self._config.endpoint, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models3.ErrorResponse, - response, + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + list[_models2.SearchIndexerSkillset], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("@odata.nextLink") or None, AsyncList(list_of_elem) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize( - _models2._models.ListSkillsetsResult, response.json() # pylint: disable=protected-access + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models3.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - return deserialized # type: ignore + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @overload async def create_skillset( diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py index 96f0ca3714df..5f1ce9d55257 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from collections.abc import MutableMapping # pylint: disable=import-error from typing import Any, cast, IO, List, Sequence, Union, Optional, TYPE_CHECKING @@ -488,21 +489,40 @@ def list_index_names( return cast(AsyncItemPaged[str], names) @distributed_trace_async - async def get_synonym_maps(self, *, select: Optional[List[str]] = None, **kwargs: Any) -> List[_models.SynonymMap]: + async def get_synonym_maps( + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, + ) -> List[_models.SynonymMap]: """Lists all synonym maps available for a search service. :keyword select: Selects which top-level properties of the synonym maps to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of synonym maps :rtype: list[~azure.search.documents.indexes.models.SynonymMap] :raises ~azure.core.exceptions.HttpResponseError: """ - result = await self._get_synonym_maps(select=select, **kwargs) - assert result.synonym_maps is not None # Hint for mypy - typed_result = [cast(_models.SynonymMap, item) for item in result.synonym_maps] - return typed_result + result = self._get_synonym_maps( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + return [item async for item in result] @distributed_trace_async async def get_synonym_map_names(self, **kwargs: Any) -> List[str]: @@ -871,7 +891,13 @@ async def reset_skills( @distributed_trace_async async def get_skillsets( - self, *, select: Optional[List[str]] = None, **kwargs: Any + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, ) -> List[_models.SearchIndexerSkillset]: """Lists all skillsets available for a search service. @@ -879,31 +905,61 @@ async def get_skillsets( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of all the SearchIndexerSkillsets. :rtype: list[~azure.search.documents.indexes.models.SearchIndexerSkillset] :raises ~azure.core.exceptions.HttpResponseError: """ - result = await self._get_skillsets(select=select, **kwargs) - assert result.skillsets is not None # Hint for mypy - typed_result = [cast(_models.SearchIndexerSkillset, item) for item in result.skillsets] - return typed_result + result = self._get_skillsets( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + return [item async for item in result] @distributed_trace_async - async def get_indexers(self, *, select: Optional[List[str]] = None, **kwargs: Any) -> List[_models.SearchIndexer]: + async def get_indexers( + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, + ) -> List[_models.SearchIndexer]: """Lists all indexers available for a search service. :keyword select: Selects which top-level properties to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of all the SearchIndexers. :rtype: list[~azure.search.documents.indexes.models.SearchIndexer] :raises ~azure.core.exceptions.HttpResponseError: """ - result = await self._get_indexers(select=select, **kwargs) - assert result.indexers is not None # Hint for mypy - typed_result = [cast(_models.SearchIndexer, item) for item in result.indexers] - return typed_result + result = self._get_indexers( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + return [item async for item in result] @distributed_trace_async async def get_indexer_names(self, **kwargs) -> Sequence[str]: @@ -917,7 +973,13 @@ async def get_indexer_names(self, **kwargs) -> Sequence[str]: @distributed_trace_async async def get_data_source_connections( - self, *, select: Optional[List[str]] = None, **kwargs: Any + self, + *, + select: Optional[List[str]] = None, + search: Optional[str] = None, + page_size: Optional[int] = None, + search_type: Optional[Union[str, _models.ListingSearchType]] = None, + **kwargs: Any, ) -> List[_models.SearchIndexerDataSourceConnection]: """Lists all data source connections available for a search service. @@ -925,14 +987,25 @@ async def get_data_source_connections( list of JSON property names, or '*' for all properties. The default is all properties. Default value is None. :paramtype select: list[str] + :keyword search: A string used to narrow down the listing. Default value is None. + :paramtype search: str + :keyword page_size: The maximum number of items to return in a single page. Default value is None. + :paramtype page_size: int + :keyword search_type: Specifies how the search parameter is interpreted. Currently only + 'prefix' is supported. Default value is None. + :paramtype search_type: str or ~azure.search.documents.indexes.models.ListingSearchType :return: List of all the data source connections. :rtype: list[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection] :raises ~azure.core.exceptions.HttpResponseError: """ - result = await self._get_data_source_connections(select=select, **kwargs) - assert result.data_sources is not None # Hint for mypy - typed_result = [cast(_models.SearchIndexerDataSourceConnection, item) for item in result.data_sources] - return typed_result + result = self._get_data_source_connections( + select=select, + search=search, + page_size=page_size, + search_type=search_type, + **kwargs, + ) + return [item async for item in result] @distributed_trace_async async def get_data_source_connection_names(self, **kwargs) -> Sequence[str]: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py index b728c5352f78..c4be3b19643e 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Union from azure.core.credentials import AzureKeyCredential diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py index 1d56a5e7f99a..5978ea825f03 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py @@ -6852,71 +6852,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.odata_type = "#Microsoft.Azure.Search.LimitTokenFilter" # type: ignore -class ListDataSourcesResult(_Model): - """Response from a List Datasources request. If successful, it includes the full definitions of - all datasources. - - :ivar data_sources: The datasources in the Search service. Required. - :vartype data_sources: - list[~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection] - :ivar odata_next_link: The URL that can be used to fetch the next set of results. - :vartype odata_next_link: str - """ - - data_sources: list["_models.SearchIndexerDataSourceConnection"] = rest_field(name="value", visibility=["read"]) - """The datasources in the Search service. Required.""" - odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) - """The URL that can be used to fetch the next set of results.""" - - -class ListIndexersResult(_Model): - """Response from a List Indexers request. If successful, it includes the full definitions of all - indexers. - - :ivar indexers: The indexers in the Search service. Required. - :vartype indexers: list[~azure.search.documents.indexes.models.SearchIndexer] - :ivar odata_next_link: The URL that can be used to fetch the next set of results. - :vartype odata_next_link: str - """ - - indexers: list["_models.SearchIndexer"] = rest_field(name="value", visibility=["read"]) - """The indexers in the Search service. Required.""" - odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) - """The URL that can be used to fetch the next set of results.""" - - -class ListSkillsetsResult(_Model): - """Response from a list skillset request. If successful, it includes the full definitions of all - skillsets. - - :ivar skillsets: The skillsets defined in the Search service. Required. - :vartype skillsets: list[~azure.search.documents.indexes.models.SearchIndexerSkillset] - :ivar odata_next_link: The URL that can be used to fetch the next set of results. - :vartype odata_next_link: str - """ - - skillsets: list["_models.SearchIndexerSkillset"] = rest_field(name="value", visibility=["read"]) - """The skillsets defined in the Search service. Required.""" - odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) - """The URL that can be used to fetch the next set of results.""" - - -class ListSynonymMapsResult(_Model): - """Response from a List SynonymMaps request. If successful, it includes the full definitions of - all synonym maps. - - :ivar synonym_maps: The synonym maps in the Search service. Required. - :vartype synonym_maps: list[~azure.search.documents.indexes.models.SynonymMap] - :ivar odata_next_link: The URL that can be used to fetch the next set of results. - :vartype odata_next_link: str - """ - - synonym_maps: list["_models.SynonymMap"] = rest_field(name="value", visibility=["read"]) - """The synonym maps in the Search service. Required.""" - odata_next_link: Optional[str] = rest_field(name="@odata.nextLink", visibility=["read"]) - """The URL that can be used to fetch the next set of results.""" - - class LuceneStandardAnalyzer( LexicalAnalyzer, discriminator="#Microsoft.Azure.Search.StandardAnalyzer" ): # pylint: disable=docstring-keyword-should-match-keyword-only diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py index 5246b2e209af..3406fb112a00 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py @@ -117,9 +117,9 @@ :ivar subdomainUrl: The subdomain/Azure AI Services endpoint url for the corresponding AI Service. Required. :vartype subdomainUrl: str -:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to - a skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByIdentity". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.AIServicesByIdentity"] +:ivar ``@odata.type``: A URI fragment specifying the type of Azure AI service resource attached + to a skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByIdentity". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.AIServicesByIdentity"] """ @@ -144,9 +144,9 @@ :ivar subdomainUrl: The subdomain/Azure AI Services endpoint url for the corresponding AI Service. Required. :vartype subdomainUrl: str -:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to - a skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByKey". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.AIServicesByKey"] +:ivar ``@odata.type``: A URI fragment specifying the type of Azure AI service resource attached + to a skillset. Required. Default value is "#Microsoft.Azure.Search.AIServicesByKey". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.AIServicesByKey"] """ @@ -205,46 +205,6 @@ class AIServicesVisionVectorizer(TypedDict, total=False): Services Vision Vectorize API.""" -class AnalyzedTokenInfo(TypedDict, total=False): - """Information about a token returned by an analyzer. - - :ivar token: The token returned by the analyzer. Required. - :vartype token: str - :ivar startOffset: The index of the first character of the token in the input text. Required. - :vartype startOffset: int - :ivar endOffset: The index of the last character of the token in the input text. Required. - :vartype endOffset: int - :ivar position: The position of the token in the input text relative to other tokens. The first - token in the input text has position 0, the next has position 1, and so on. Depending on the - analyzer used, some tokens might have the same position, for example if they are synonyms of - each other. Required. - :vartype position: int - """ - - token: Required[str] - """The token returned by the analyzer. Required.""" - startOffset: Required[int] - """The index of the first character of the token in the input text. Required.""" - endOffset: Required[int] - """The index of the last character of the token in the input text. Required.""" - position: Required[int] - """The position of the token in the input text relative to other tokens. The first token in the - input text has position 0, the next has position 1, and so on. Depending on the analyzer used, - some tokens might have the same position, for example if they are synonyms of each other. - Required.""" - - -class AnalyzeResult(TypedDict, total=False): - """The result of testing an analyzer on text. - - :ivar tokens: The list of tokens returned by the analyzer specified in the request. Required. - :vartype tokens: list["AnalyzedTokenInfo"] - """ - - tokens: Required[list["AnalyzedTokenInfo"]] - """The list of tokens returned by the analyzer specified in the request. Required.""" - - class AnalyzeTextOptions(TypedDict, total=False): """Specifies some text and analysis components used to break that text into tokens. @@ -350,9 +310,9 @@ class AnalyzeTextOptions(TypedDict, total=False): :ivar preserveOriginal: A value indicating whether the original token will be kept. Default is false. :vartype preserveOriginal: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.AsciiFoldingTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.AsciiFoldingTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.AsciiFoldingTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.AsciiFoldingTokenFilter"] """ @@ -399,8 +359,8 @@ class AzureActiveDirectoryApplicationCredentials(TypedDict, total=False): # pyl before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -563,9 +523,9 @@ class AzureMachineLearningParameters(TypedDict, total=False): set, a default value of 5 is used. The degreeOfParallelism can be set to a maximum of 10 and a minimum of 1. :vartype degreeOfParallelism: int -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Custom.AmlSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Custom.AmlSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Custom.AmlSkill"] """ @@ -647,9 +607,9 @@ class AzureMachineLearningVectorizer(TypedDict, total=False): :ivar dimensions: The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. :vartype dimensions: int -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"] """ @@ -794,9 +754,9 @@ class BinaryQuantizationCompression(TypedDict, total=False): default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document. :vartype b: float -:ivar @odata.type: The discriminator for derived types. Required. Default value is +:ivar ``@odata.type``: The discriminator for derived types. Required. Default value is "#Microsoft.Azure.Search.BM25Similarity". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.BM25Similarity"] +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.BM25Similarity"] """ @@ -971,9 +931,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar responseFormat: Determines how the LLM should format its response. Defaults to 'text' response type. :vartype responseFormat: "ChatCompletionResponseFormat" -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Custom.ChatCompletionSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Custom.ChatCompletionSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Custom.ChatCompletionSkill"] """ @@ -999,9 +959,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar outputUnigrams: A value indicating whether to output both unigrams and bigrams (if true), or just bigrams (if false). Default is false. :vartype outputUnigrams: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.CjkBigramTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.CjkBigramTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.CjkBigramTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.CjkBigramTokenFilter"] """ @@ -1016,9 +976,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): This variation of TF-IDF introduces static document length normalization as well as coordinating factors that penalize documents that only partially match the searched queries. -:ivar @odata.type: The discriminator for derived types. Required. Default value is +:ivar ``@odata.type``: The discriminator for derived types. Required. Default value is "#Microsoft.Azure.Search.ClassicSimilarity". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.ClassicSimilarity"] +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.ClassicSimilarity"] """ @@ -1041,9 +1001,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. :vartype maxTokenLength: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.ClassicTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.ClassicTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.ClassicTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.ClassicTokenizer"] """ @@ -1063,9 +1023,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar key: The key used to provision the Azure AI service resource attached to a skillset. Required. :vartype key: str -:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to - a skillset. Required. Default value is "#Microsoft.Azure.Search.CognitiveServicesByKey". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.CognitiveServicesByKey"] +:ivar ``@odata.type``: A URI fragment specifying the type of Azure AI service resource attached + to a skillset. Required. Default value is "#Microsoft.Azure.Search.CognitiveServicesByKey". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.CognitiveServicesByKey"] """ @@ -1096,9 +1056,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): query mode, the token filter generates bigrams and then removes common words and single terms followed by a common word. Default is false. :vartype queryMode: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.CommonGramTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.CommonGramTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.CommonGramTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.CommonGramTokenFilter"] """ @@ -1133,9 +1093,9 @@ class ChatCompletionSchemaProperties(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.ConditionalSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Util.ConditionalSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Util.ConditionalSkill"] """ @@ -1197,9 +1157,9 @@ class ContentColumnMapping(TypedDict, total=False): :vartype extractionOptions: list[Union[str, "ContentUnderstandingSkillExtractionOptions"]] :ivar chunkingProperties: Controls the cardinality for chunking the content. :vartype chunkingProperties: "ContentUnderstandingSkillChunkingProperties" -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.ContentUnderstandingSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Util.ContentUnderstandingSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Util.ContentUnderstandingSkill"] """ @@ -1290,9 +1250,9 @@ class CreatedResources(TypedDict, total=False): processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. :vartype charFilters: list[Union[str, "CharFilterName"]] -:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is - "#Microsoft.Azure.Search.CustomAnalyzer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.CustomAnalyzer"] +:ivar ``@odata.type``: A URI fragment specifying the type of analyzer. Required. Default value + is "#Microsoft.Azure.Search.CustomAnalyzer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.CustomAnalyzer"] """ @@ -1467,9 +1427,9 @@ class CustomEntityAlias(TypedDict, total=False): :ivar globalDefaultFuzzyEditDistance: A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in CustomEntity, this value will be the default value. :vartype globalDefaultFuzzyEditDistance: int -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.CustomEntityLookupSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.CustomEntityLookupSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.CustomEntityLookupSkill"] """ @@ -1499,9 +1459,9 @@ class CustomEntityAlias(TypedDict, total=False): processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. :vartype charFilters: list[Union[str, "CharFilterName"]] -:ivar @odata.type: A URI fragment specifying the type of normalizer. Required. Default value is - "#Microsoft.Azure.Search.CustomNormalizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.CustomNormalizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of normalizer. Required. Default + value is "#Microsoft.Azure.Search.CustomNormalizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.CustomNormalizer"] """ @@ -1532,9 +1492,9 @@ class DataSourceCredentials(TypedDict, total=False): :ivar description: Description of the Azure AI service resource attached to a skillset. :vartype description: str -:ivar @odata.type: A URI fragment specifying the type of Azure AI service resource attached to - a skillset. Required. Default value is "#Microsoft.Azure.Search.DefaultCognitiveServices". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.DefaultCognitiveServices"] +:ivar ``@odata.type``: A URI fragment specifying the type of Azure AI service resource attached + to a skillset. Required. Default value is "#Microsoft.Azure.Search.DefaultCognitiveServices". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.DefaultCognitiveServices"] """ @@ -1572,9 +1532,9 @@ class DataSourceCredentials(TypedDict, total=False): :ivar onlyLongestMatch: A value indicating whether to add only the longest matching subword to the output. Default is false. :vartype onlyLongestMatch: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"] """ @@ -1668,9 +1628,9 @@ class DistanceScoringParameters(TypedDict, total=False): :vartype dataToExtract: str :ivar configuration: A dictionary of configurations for the skill. :vartype configuration: dict[str, Any] -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.DocumentExtractionSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Util.DocumentExtractionSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Util.DocumentExtractionSkill"] """ @@ -1725,9 +1685,9 @@ class DistanceScoringParameters(TypedDict, total=False): "DocumentIntelligenceLayoutSkillExtractionOptions"]] :ivar chunkingProperties: Controls the cardinality for chunking the content. :vartype chunkingProperties: "DocumentIntelligenceLayoutSkillChunkingProperties" -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill"] """ @@ -1790,9 +1750,9 @@ class DocumentKeysOrIds(TypedDict, total=False): :ivar side: Specifies which side of the input the n-gram should be generated from. Default is "front". Known values are: "front" and "back". :vartype side: Union[str, "EdgeNGramTokenFilterSide"] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.EdgeNGramTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.EdgeNGramTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilter"] """ @@ -1822,9 +1782,9 @@ class DocumentKeysOrIds(TypedDict, total=False): :ivar side: Specifies which side of the input the n-gram should be generated from. Default is "front". Known values are: "front" and "back". :vartype side: Union[str, "EdgeNGramTokenFilterSide"] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.EdgeNGramTokenFilterV2"] """ @@ -1853,9 +1813,9 @@ class DocumentKeysOrIds(TypedDict, total=False): :vartype maxGram: int :ivar tokenChars: Character classes to keep in the tokens. :vartype tokenChars: list[Union[str, "TokenCharacterKind"]] -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.EdgeNGramTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.EdgeNGramTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.EdgeNGramTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.EdgeNGramTokenizer"] """ @@ -1877,9 +1837,9 @@ class DocumentKeysOrIds(TypedDict, total=False): :vartype name: str :ivar articles: The set of articles to remove. :vartype articles: list[str] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.ElisionTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.ElisionTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.ElisionTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.ElisionTokenFilter"] """ @@ -1941,9 +1901,9 @@ class EmbeddingColumnMapping(TypedDict, total=False): will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. :vartype modelVersion: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.V3.EntityLinkingSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.V3.EntityLinkingSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.V3.EntityLinkingSkill"] """ @@ -1995,9 +1955,9 @@ class EmbeddingColumnMapping(TypedDict, total=False): will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. :vartype modelVersion: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.V3.EntityRecognitionSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.V3.EntityRecognitionSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.V3.EntityRecognitionSkill"] """ @@ -2085,8 +2045,8 @@ class ExhaustiveKnnParameters(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -2143,8 +2103,8 @@ class FabricDataAgentKnowledgeSourceParameters(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -2239,8 +2199,8 @@ class FieldMappingFunction(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -2349,27 +2309,6 @@ class FreshnessScoringParameters(TypedDict, total=False): """The expiration period after which boosting will stop for a particular document. Required.""" -class GetIndexStatisticsResult(TypedDict, total=False): - """Statistics for a given index. Statistics are collected periodically and are not guaranteed to - always be up-to-date. - - :ivar documentCount: The number of documents in the index. Required. - :vartype documentCount: int - :ivar storageSize: The amount of storage in bytes consumed by the index. Required. - :vartype storageSize: int - :ivar vectorIndexSize: The amount of memory in bytes consumed by vectors in the index. - Required. - :vartype vectorIndexSize: int - """ - - documentCount: Required[int] - """The number of documents in the index. Required.""" - storageSize: Required[int] - """The amount of storage in bytes consumed by the index. Required.""" - vectorIndexSize: Required[int] - """The amount of memory in bytes consumed by vectors in the index. Required.""" - - HighWaterMarkChangeDetectionPolicy = TypedDict( "HighWaterMarkChangeDetectionPolicy", { @@ -2383,9 +2322,9 @@ class GetIndexStatisticsResult(TypedDict, total=False): :ivar highWaterMarkColumnName: The name of the high water mark column. Required. :vartype highWaterMarkColumnName: str -:ivar @odata.type: A URI fragment specifying the type of data change detection policy. +:ivar ``@odata.type``: A URI fragment specifying the type of data change detection policy. Required. Default value is "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"] +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy"] """ @@ -2497,9 +2436,9 @@ class HnswParameters(TypedDict, total=False): :vartype visualFeatures: list[Union[str, "VisualFeature"]] :ivar details: A string indicating which domain-specific details to return. :vartype details: list[Union[str, "ImageDetail"]] -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Vision.ImageAnalysisSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Vision.ImageAnalysisSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Vision.ImageAnalysisSkill"] """ @@ -2526,8 +2465,8 @@ class HnswParameters(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -2601,8 +2540,8 @@ class IndexedOneLakeKnowledgeSourceParameters(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -2683,8 +2622,8 @@ class IndexedSharePointKnowledgeSourceParameters(TypedDict, total=False): # pyl before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -2996,9 +2935,9 @@ class InputFieldMappingEntry(TypedDict, total=False): :ivar keepWordsCase: A value indicating whether to lower case all words first. Default is false. :vartype keepWordsCase: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.KeepTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeepTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.KeepTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.KeepTokenFilter"] """ @@ -3046,9 +2985,9 @@ class InputFieldMappingEntry(TypedDict, total=False): will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. :vartype modelVersion: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.KeyPhraseExtractionSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.KeyPhraseExtractionSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.KeyPhraseExtractionSkill"] """ @@ -3073,9 +3012,9 @@ class InputFieldMappingEntry(TypedDict, total=False): :ivar ignoreCase: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false. :vartype ignoreCase: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.KeywordMarkerTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeywordMarkerTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.KeywordMarkerTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.KeywordMarkerTokenFilter"] """ @@ -3096,9 +3035,9 @@ class InputFieldMappingEntry(TypedDict, total=False): :vartype name: str :ivar bufferSize: The read buffer size in bytes. Default is 256. :vartype bufferSize: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.KeywordTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeywordTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.KeywordTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.KeywordTokenizer"] """ @@ -3120,9 +3059,9 @@ class InputFieldMappingEntry(TypedDict, total=False): :ivar maxTokenLength: The maximum token length. Default is 256. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. :vartype maxTokenLength: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.KeywordTokenizerV2". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.KeywordTokenizerV2"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.KeywordTokenizerV2". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.KeywordTokenizerV2"] """ @@ -3158,8 +3097,8 @@ class InputFieldMappingEntry(TypedDict, total=False): :ivar outputMode: The output mode for the knowledge base. Known values are: "extractiveData" and "answerSynthesis". :vartype outputMode: Union[str, "KnowledgeRetrievalOutputMode"] -:ivar @odata.etag: The ETag of the knowledge base. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge base. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. :vartype encryptionKey: "SearchResourceEncryptionKey" :ivar description: The description of the knowledge base. @@ -3287,9 +3226,9 @@ class KnowledgeSourceReference(TypedDict, total=False): will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. :vartype modelVersion: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.LanguageDetectionSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.LanguageDetectionSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.LanguageDetectionSkill"] """ @@ -3315,9 +3254,9 @@ class KnowledgeSourceReference(TypedDict, total=False): :vartype min: int :ivar max: The maximum length in characters. Default and maximum is 300. :vartype max: int -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.LengthTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.LengthTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.LengthTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.LengthTokenFilter"] """ @@ -3343,9 +3282,9 @@ class KnowledgeSourceReference(TypedDict, total=False): :ivar consumeAllTokens: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false. :vartype consumeAllTokens: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.LimitTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.LimitTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.LimitTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.LimitTokenFilter"] """ @@ -3371,9 +3310,9 @@ class KnowledgeSourceReference(TypedDict, total=False): :vartype maxTokenLength: int :ivar stopwords: A list of stopwords. :vartype stopwords: list[str] -:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is - "#Microsoft.Azure.Search.StandardAnalyzer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StandardAnalyzer"] +:ivar ``@odata.type``: A URI fragment specifying the type of analyzer. Required. Default value + is "#Microsoft.Azure.Search.StandardAnalyzer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StandardAnalyzer"] """ @@ -3396,9 +3335,9 @@ class KnowledgeSourceReference(TypedDict, total=False): :ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum length are split. :vartype maxTokenLength: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.StandardTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StandardTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.StandardTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StandardTokenizer"] """ @@ -3421,9 +3360,9 @@ class KnowledgeSourceReference(TypedDict, total=False): :ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. :vartype maxTokenLength: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.StandardTokenizerV2". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StandardTokenizerV2"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.StandardTokenizerV2". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StandardTokenizerV2"] """ @@ -3502,9 +3441,9 @@ class MagnitudeScoringParameters(TypedDict, total=False): :ivar mappings: A list of mappings of the following format: "a=>b" (all occurrences of the character "a" will be replaced with character "b"). Required. :vartype mappings: list[str] -:ivar @odata.type: A URI fragment specifying the type of char filter. Required. Default value - is "#Microsoft.Azure.Search.MappingCharFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.MappingCharFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of char filter. Required. Default + value is "#Microsoft.Azure.Search.MappingCharFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.MappingCharFilter"] """ @@ -3593,8 +3532,8 @@ class McpServerJsonOutputParsing(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -3800,9 +3739,9 @@ class McpServerTool(TypedDict, total=False): :ivar insertPostTag: The tag indicates the end of the merged text. By default, the tag is an empty space. :vartype insertPostTag: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.MergeSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.MergeSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.MergeSkill"] """ @@ -3839,9 +3778,9 @@ class McpServerTool(TypedDict, total=False): "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", "swedish", "tamil", "telugu", "turkish", "ukrainian", and "urdu". :vartype language: Union[str, "MicrosoftStemmingTokenizerLanguage"] -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer"] """ @@ -3878,9 +3817,9 @@ class McpServerTool(TypedDict, total=False): "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", "telugu", "thai", "ukrainian", "urdu", and "vietnamese". :vartype language: Union[str, "MicrosoftTokenizerLanguage"] -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.MicrosoftLanguageTokenizer"] """ @@ -3894,10 +3833,10 @@ class McpServerTool(TypedDict, total=False): NativeBlobSoftDeleteDeletionDetectionPolicy.__doc__ = """Defines a data deletion detection policy utilizing Azure Blob Storage's native soft delete feature for deletion detection. -:ivar @odata.type: A URI fragment specifying the type of data deletion detection policy. +:ivar ``@odata.type``: A URI fragment specifying the type of data deletion detection policy. Required. Default value is "#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy". -:vartype @odata.type: +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy"] """ @@ -3922,9 +3861,9 @@ class McpServerTool(TypedDict, total=False): :vartype minGram: int :ivar maxGram: The maximum n-gram length. Default is 2. :vartype maxGram: int -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.NGramTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.NGramTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.NGramTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.NGramTokenFilter"] """ @@ -3949,9 +3888,9 @@ class McpServerTool(TypedDict, total=False): :vartype minGram: int :ivar maxGram: The maximum n-gram length. Default is 2. Maximum is 300. :vartype maxGram: int -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.NGramTokenFilterV2". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.NGramTokenFilterV2"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.NGramTokenFilterV2". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.NGramTokenFilterV2"] """ @@ -3980,9 +3919,9 @@ class McpServerTool(TypedDict, total=False): :vartype maxGram: int :ivar tokenChars: Character classes to keep in the tokens. :vartype tokenChars: list[Union[str, "TokenCharacterKind"]] -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.NGramTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.NGramTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.NGramTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.NGramTokenizer"] """ @@ -4041,9 +3980,9 @@ class McpServerTool(TypedDict, total=False): recognized by the OCR skill. The default value is "space". Known values are: "space", "carriageReturn", "lineFeed", and "carriageReturnLineFeed". :vartype lineEnding: Union[str, "OcrLineEnding"] -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Vision.OcrSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Vision.OcrSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Vision.OcrSkill"] """ @@ -4092,9 +4031,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype reverse: bool :ivar skip: The number of initial tokens to skip. Default is 0. :vartype skip: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.PathHierarchyTokenizerV2". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PathHierarchyTokenizerV2"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.PathHierarchyTokenizerV2". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PathHierarchyTokenizerV2"] """ @@ -4127,9 +4066,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype flags: list[Union[str, "RegexFlags"]] :ivar stopwords: A list of stopwords. :vartype stopwords: list[str] -:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is - "#Microsoft.Azure.Search.PatternAnalyzer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternAnalyzer"] +:ivar ``@odata.type``: A URI fragment specifying the type of analyzer. Required. Default value + is "#Microsoft.Azure.Search.PatternAnalyzer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PatternAnalyzer"] """ @@ -4155,9 +4094,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :ivar preserveOriginal: A value indicating whether to return the original token even if one of the patterns matches. Default is true. :vartype preserveOriginal: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.PatternCaptureTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternCaptureTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.PatternCaptureTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PatternCaptureTokenFilter"] """ @@ -4185,9 +4124,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype pattern: str :ivar replacement: The replacement text. Required. :vartype replacement: str -:ivar @odata.type: A URI fragment specifying the type of char filter. Required. Default value - is "#Microsoft.Azure.Search.PatternReplaceCharFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternReplaceCharFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of char filter. Required. Default + value is "#Microsoft.Azure.Search.PatternReplaceCharFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PatternReplaceCharFilter"] """ @@ -4215,9 +4154,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :vartype pattern: str :ivar replacement: The replacement text. Required. :vartype replacement: str -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.PatternReplaceTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternReplaceTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.PatternReplaceTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PatternReplaceTokenFilter"] """ @@ -4249,9 +4188,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. :vartype group: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.PatternTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PatternTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.PatternTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PatternTokenizer"] """ @@ -4278,9 +4217,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :ivar replace: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true. :vartype replace: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.PhoneticTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.PhoneticTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.PhoneticTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.PhoneticTokenFilter"] """ @@ -4343,9 +4282,9 @@ class OutputFieldMappingEntry(TypedDict, total=False): :ivar domain: If specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'phi', 'none'. Default is 'none'. :vartype domain: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.PIIDetectionSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.PIIDetectionSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.PIIDetectionSkill"] """ @@ -4372,8 +4311,8 @@ class OutputFieldMappingEntry(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -4549,8 +4488,8 @@ class ScoringProfile(TypedDict, total=False): :ivar indexes: The name of the index this alias maps to. Only one index name may be specified. Required. :vartype indexes: list[str] -:ivar @odata.etag: The ETag of the alias. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the alias. +:vartype ``@odata.etag``: str """ @@ -4985,8 +4924,8 @@ class SearchField(TypedDict, total=False): for the index, enabling document-level permissions from SharePoint. If provided, the applicationId and federatedCredentialId properties are required. :vartype sharePointConnectorAppRegistration: "SharePointConnectorAppRegistration" -:ivar @odata.etag: The ETag of the index. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the index. +:vartype ``@odata.etag``: str """ @@ -5033,8 +4972,8 @@ class SearchField(TypedDict, total=False): :vartype outputFieldMappings: list["FieldMapping"] :ivar disabled: A value indicating whether the indexer is disabled. Default is false. :vartype disabled: bool -:ivar @odata.etag: The ETag of the indexer. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the indexer. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your indexer definition (as well as indexer execution status) when you want full assurance that no one, not @@ -5112,9 +5051,9 @@ class SearchIndexerDataContainer(TypedDict, total=False): ) SearchIndexerDataNoneIdentity.__doc__ = """Clears the identity property of a datasource. -:ivar @odata.type: The discriminator for derived types. Required. Default value is +:ivar ``@odata.type``: The discriminator for derived types. Required. Default value is "#Microsoft.Azure.Search.DataNoneIdentity". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.DataNoneIdentity"] +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.DataNoneIdentity"] """ @@ -5163,8 +5102,8 @@ class SearchIndexerDataContainer(TypedDict, total=False): :vartype dataChangeDetectionPolicy: "DataChangeDetectionPolicy" :ivar dataDeletionDetectionPolicy: The data deletion detection policy for the datasource. :vartype dataDeletionDetectionPolicy: "DataDeletionDetectionPolicy" -:ivar @odata.etag: The ETag of the data source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the data source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your datasource definition when you want full assurance that no one, not even Microsoft, can decrypt your data @@ -5193,9 +5132,9 @@ class SearchIndexerDataContainer(TypedDict, total=False): "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" that should have been assigned to the search service. Required. :vartype userAssignedIdentity: str -:ivar @odata.type: A URI fragment specifying the type of identity. Required. Default value is - "#Microsoft.Azure.Search.DataUserAssignedIdentity". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.DataUserAssignedIdentity"] +:ivar ``@odata.type``: A URI fragment specifying the type of identity. Required. Default value + is "#Microsoft.Azure.Search.DataUserAssignedIdentity". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.DataUserAssignedIdentity"] :ivar federatedIdentityClientId: Multi-tenant User-Assigned Managed Identity Support: The client id of the multi-tentant App that has been configured to federate with the user-assigned managed identity. @@ -5421,7 +5360,9 @@ class SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): """Projections to Azure File storage.""" -class SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False): # pylint: disable=name-too-long +class SearchIndexerKnowledgeStoreTableProjectionSelector( + SearchIndexerKnowledgeStoreProjectionSelector +): # pylint: disable=name-too-long """Description for what data to store in Azure Tables. :ivar referenceKeyName: Name of reference key to different projection. @@ -5438,14 +5379,6 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False) :vartype tableName: str """ - referenceKeyName: str - """Name of reference key to different projection.""" - source: str - """Source data to project.""" - sourceContext: str - """Source context for complex projections.""" - inputs: list["InputFieldMappingEntry"] - """Nested inputs for complex projections.""" generatedKeyName: Required[str] """Name of generated key to store projection under. Required.""" tableName: Required[str] @@ -5481,8 +5414,8 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False) :vartype knowledgeStore: "SearchIndexerKnowledgeStore" :ivar indexProjections: Definition of additional projections to secondary search index(es). :vartype indexProjections: "SearchIndexerIndexProjection" -:ivar @odata.etag: The ETag of the skillset. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the skillset. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your skillset definition when you want full assurance that no one, not even Microsoft, can decrypt your @@ -5529,8 +5462,8 @@ class SearchIndexFieldReference(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -5889,9 +5822,9 @@ class SemanticSearch(TypedDict, total=False): will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. :vartype modelVersion: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.V3.SentimentSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.V3.SentimentSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.V3.SentimentSkill"] """ @@ -5926,9 +5859,9 @@ class SemanticSearch(TypedDict, total=False): :ivar outputs: The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. Required. :vartype outputs: list["OutputFieldMappingEntry"] -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Util.ShaperSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Util.ShaperSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Util.ShaperSkill"] """ @@ -5995,9 +5928,9 @@ class SharePointConnectorAppRegistration(TypedDict, total=False): :ivar filterToken: The string to insert for each position at which there is no token. Default is an underscore ("_"). :vartype filterToken: str -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.ShingleTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.ShingleTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.ShingleTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.ShingleTokenFilter"] """ @@ -6033,9 +5966,9 @@ class SkillNames(TypedDict, total=False): "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", "spanish", "swedish", and "turkish". :vartype language: Union[str, "SnowballTokenFilterLanguage"] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.SnowballTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.SnowballTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.SnowballTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.SnowballTokenFilter"] """ @@ -6056,9 +5989,9 @@ class SkillNames(TypedDict, total=False): :vartype softDeleteColumnName: str :ivar softDeleteMarkerValue: The marker value that identifies an item as deleted. :vartype softDeleteMarkerValue: str -:ivar @odata.type: A URI fragment specifying the type of data deletion detection policy. +:ivar ``@odata.type``: A URI fragment specifying the type of data deletion detection policy. Required. Default value is "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy". -:vartype @odata.type: +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"] """ @@ -6127,9 +6060,9 @@ class SkillNames(TypedDict, total=False): specified, the splitSkill will use these parameters when performing the tokenization. The parameters are a valid 'encoderModelName' and an optional 'allowedSpecialTokens' property. :vartype azureOpenAITokenizerParameters: "AzureOpenAITokenizerParameters" -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.SplitSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.SplitSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.SplitSkill"] """ @@ -6143,9 +6076,9 @@ class SkillNames(TypedDict, total=False): SqlIntegratedChangeTrackingPolicy.__doc__ = """Defines a data change detection policy that captures changes using the Integrated Change Tracking feature of Azure SQL Database. -:ivar @odata.type: A URI fragment specifying the type of data change detection policy. +:ivar ``@odata.type``: A URI fragment specifying the type of data change detection policy. Required. Default value is "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"] +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy"] """ @@ -6172,9 +6105,9 @@ class SkillNames(TypedDict, total=False): :ivar rules: A list of stemming rules in the following format: "word => stem", for example: "ran => run". Required. :vartype rules: list[str] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.StemmerOverrideTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StemmerOverrideTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.StemmerOverrideTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StemmerOverrideTokenFilter"] """ @@ -6205,9 +6138,9 @@ class SkillNames(TypedDict, total=False): "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", and "turkish". :vartype language: Union[str, "StemmerTokenFilterLanguage"] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.StemmerTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StemmerTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.StemmerTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StemmerTokenFilter"] """ @@ -6229,9 +6162,9 @@ class SkillNames(TypedDict, total=False): :vartype name: str :ivar stopwords: A list of stopwords. :vartype stopwords: list[str] -:ivar @odata.type: A URI fragment specifying the type of analyzer. Required. Default value is - "#Microsoft.Azure.Search.StopAnalyzer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StopAnalyzer"] +:ivar ``@odata.type``: A URI fragment specifying the type of analyzer. Required. Default value + is "#Microsoft.Azure.Search.StopAnalyzer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StopAnalyzer"] """ @@ -6272,9 +6205,9 @@ class SkillNames(TypedDict, total=False): :ivar removeTrailing: A value indicating whether to ignore the last search term if it's a stop word. Default is true. :vartype removeTrailing: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.StopwordsTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.StopwordsTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.StopwordsTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.StopwordsTokenFilter"] """ @@ -6308,8 +6241,8 @@ class SkillNames(TypedDict, total=False): available for free search services, and is only available for paid services created on or after January 1, 2019. :vartype encryptionKey: "SearchResourceEncryptionKey" -:ivar @odata.etag: The ETag of the synonym map. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the synonym map. +:vartype ``@odata.etag``: str """ @@ -6347,9 +6280,9 @@ class SkillNames(TypedDict, total=False): fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. Default is true. :vartype expand: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.SynonymTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.SynonymTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.SynonymTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.SynonymTokenFilter"] """ @@ -6458,9 +6391,9 @@ class TagScoringParameters(TypedDict, total=False): "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", and "pa". :vartype suggestedFrom: Union[str, "TextTranslationSkillLanguage"] -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Text.TranslationSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Text.TranslationSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Text.TranslationSkill"] """ @@ -6494,9 +6427,9 @@ class TextWeights(TypedDict, total=False): :vartype name: str :ivar length: The length at which terms will be truncated. Default and maximum is 300. :vartype length: int -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.TruncateTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.TruncateTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.TruncateTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.TruncateTokenFilter"] """ @@ -6518,9 +6451,9 @@ class TextWeights(TypedDict, total=False): :ivar maxTokenLength: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. :vartype maxTokenLength: int -:ivar @odata.type: A URI fragment specifying the type of tokenizer. Required. Default value is - "#Microsoft.Azure.Search.UaxUrlEmailTokenizer". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.UaxUrlEmailTokenizer"] +:ivar ``@odata.type``: A URI fragment specifying the type of tokenizer. Required. Default value + is "#Microsoft.Azure.Search.UaxUrlEmailTokenizer". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.UaxUrlEmailTokenizer"] """ @@ -6543,9 +6476,9 @@ class TextWeights(TypedDict, total=False): :ivar onlyOnSamePosition: A value indicating whether to remove duplicates only at the same position. Default is false. :vartype onlyOnSamePosition: bool -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.UniqueTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.UniqueTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.UniqueTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.UniqueTokenFilter"] """ @@ -6667,9 +6600,9 @@ class VectorSearchProfile(TypedDict, total=False): :ivar modelVersion: The version of the model to use when calling the AI Services Vision service. It will default to the latest available when not specified. Required. :vartype modelVersion: str -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Vision.VectorizeSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Vision.VectorizeSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Vision.VectorizeSkill"] """ @@ -6741,9 +6674,9 @@ class WebApiHttpHeaders(TypedDict, total=False): 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. :vartype authIdentity: "SearchIndexerDataIdentity" -:ivar @odata.type: A URI fragment specifying the type of skill. Required. Default value is +:ivar ``@odata.type``: A URI fragment specifying the type of skill. Required. Default value is "#Microsoft.Skills.Custom.WebApiSkill". -:vartype @odata.type: Literal["#Microsoft.Skills.Custom.WebApiSkill"] +:vartype ``@odata.type``: Literal["#Microsoft.Skills.Custom.WebApiSkill"] """ @@ -6840,8 +6773,8 @@ class WebApiVectorizerParameters(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once @@ -6978,9 +6911,9 @@ class WebKnowledgeSourceParameters(TypedDict, total=False): :vartype stemEnglishPossessive: bool :ivar protectedWords: A list of tokens to protect from being delimited. :vartype protectedWords: list[str] -:ivar @odata.type: A URI fragment specifying the type of token filter. Required. Default value - is "#Microsoft.Azure.Search.WordDelimiterTokenFilter". -:vartype @odata.type: Literal["#Microsoft.Azure.Search.WordDelimiterTokenFilter"] +:ivar ``@odata.type``: A URI fragment specifying the type of token filter. Required. Default + value is "#Microsoft.Azure.Search.WordDelimiterTokenFilter". +:vartype ``@odata.type``: Literal["#Microsoft.Azure.Search.WordDelimiterTokenFilter"] """ @@ -7007,8 +6940,8 @@ class WebKnowledgeSourceParameters(TypedDict, total=False): before they are included in the final result set. Defaults to 'rerank' when not specified. Known values are: "rerank" and "none". :vartype resultsProcessing: Union[str, "KnowledgeSourceResultsProcessing"] -:ivar @odata.etag: The ETag of the knowledge source. -:vartype @odata.etag: str +:ivar ``@odata.etag``: The ETag of the knowledge source. +:vartype ``@odata.etag``: str :ivar encryptionKey: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your knowledge source definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py index 06505c7c879d..0576879940f2 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, cast, IO, Optional, Union from azure.core.credentials import AzureKeyCredential, TokenCredential @@ -136,9 +137,3 @@ def patch_sdk(): parameter_type.__annotations__["queryHintOverrides"] = ( "azure.search.documents.indexes.types.SearchIndexKnowledgeSourceQueryHints" ) - types.KnowledgeSourceAzureOpenAIVectorizer.__annotations__["azureOpenAIParameters"] = ( - "azure.search.documents.indexes.types.AzureOpenAIVectorizerParameters" - ) - types.KnowledgeSourceIngestionParameters.__annotations__["ingestionSchedule"] = Optional[ - "azure.search.documents.indexes.types.IndexingSchedule" - ] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py index dd18091df38c..382d6dee11c7 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py @@ -15,7 +15,6 @@ from . import models from ._utils.model_base import _deserialize - _TERMINAL_EVENTS = {"error", "response.completed"} KnowledgeBaseRetrievalEventData = Union[ diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py index f30080b31528..ff76fdfac44b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/aio/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, cast, IO, Optional, Union from azure.core.credentials import AzureKeyCredential diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py index 3e9d4049cde4..226200b8c9ff 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_models.py @@ -1060,14 +1060,14 @@ class KnowledgeBaseActivityRecordModel(_Model): # pylint: disable=docstring-key """Represents the model used for a knowledge base LLM activity, including its model name and deployment identifier. - :ivar model_name: The name of the model used for the activity. + :ivar model_name: The name of the model used for the activity. Required. :vartype model_name: str :ivar deployment_id: The deployment identifier of the model used for the activity. :vartype deployment_id: str """ - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the model used for the activity.""" + model_name: str = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the model used for the activity. Required.""" deployment_id: Optional[str] = rest_field( name="deploymentId", visibility=["read", "create", "update", "delete", "query"] ) @@ -1077,7 +1077,7 @@ class KnowledgeBaseActivityRecordModel(_Model): # pylint: disable=docstring-key def __init__( self, *, - model_name: Optional[str] = None, + model_name: str, deployment_id: Optional[str] = None, ) -> None: ... @@ -3895,17 +3895,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class KnowledgeBaseStreamErrorEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Emitted in place of ``response.completed`` if retrieval fails after the stream starts. - :ivar error: The error detail explaining why the retrieval stream failed. + :ivar error: The error detail explaining why the retrieval stream failed. Required. :vartype error: ~azure.search.documents.knowledgebases.models.KnowledgeBaseErrorDetail :ivar activity: Activity records that completed before the retrieval failed. :vartype activity: list[~azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecord] """ - error: Optional["_models.KnowledgeBaseErrorDetail"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The error detail explaining why the retrieval stream failed.""" + error: "_models.KnowledgeBaseErrorDetail" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error detail explaining why the retrieval stream failed. Required.""" activity: Optional[list["_models.KnowledgeBaseActivityRecord"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -3915,7 +3913,7 @@ class KnowledgeBaseStreamErrorEvent(_Model): # pylint: disable=docstring-keywor def __init__( self, *, - error: Optional["_models.KnowledgeBaseErrorDetail"] = None, + error: "_models.KnowledgeBaseErrorDetail", activity: Optional[list["_models.KnowledgeBaseActivityRecord"]] = None, ) -> None: ... @@ -5202,27 +5200,27 @@ class ServedImage(_Model): # pylint: disable=docstring-keyword-should-match-key :ivar image_id: The image label extracted from the source document by Content Understanding enrichment. Corresponds to the figure numbering in the original document. :vartype image_id: str - :ivar image_path: The relative path to the image within the asset store. + :ivar image_path: The relative path to the image within the asset store. Required. :vartype image_path: str - :ivar size_bytes: The size in bytes of this image as sent to the model. + :ivar size_bytes: The size in bytes of this image as sent to the model. Required. :vartype size_bytes: int """ image_id: Optional[str] = rest_field(name="imageId", visibility=["read", "create", "update", "delete", "query"]) """The image label extracted from the source document by Content Understanding enrichment. Corresponds to the figure numbering in the original document.""" - image_path: Optional[str] = rest_field(name="imagePath", visibility=["read", "create", "update", "delete", "query"]) - """The relative path to the image within the asset store.""" - size_bytes: Optional[int] = rest_field(name="sizeBytes", visibility=["read", "create", "update", "delete", "query"]) - """The size in bytes of this image as sent to the model.""" + image_path: str = rest_field(name="imagePath", visibility=["read", "create", "update", "delete", "query"]) + """The relative path to the image within the asset store. Required.""" + size_bytes: int = rest_field(name="sizeBytes", visibility=["read", "create", "update", "delete", "query"]) + """The size in bytes of this image as sent to the model. Required.""" @overload def __init__( self, *, + image_path: str, + size_bytes: int, image_id: Optional[str] = None, - image_path: Optional[str] = None, - size_bytes: Optional[int] = None, ) -> None: ... @overload diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py index 1c04ea6672e4..f5acb7257fd8 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py @@ -7,10 +7,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Literal, Optional, TYPE_CHECKING, Union +from typing import Literal, TYPE_CHECKING, Union from typing_extensions import Required, TypedDict -from ..indexes.models._enums import KnowledgeSourceKind, VectorSearchVectorizerKind +from ..indexes.models._enums import KnowledgeSourceKind from .models._enums import ( KnowledgeBaseMessageContentType, KnowledgeRetrievalIntentType, @@ -18,52 +18,9 @@ ) if TYPE_CHECKING: - from ..indexes.types import ( - AzureOpenAIVectorizerParameters, - IndexingSchedule, - KnowledgeBaseModel, - SearchIndexKnowledgeSourceQueryHints, - SearchIndexerDataIdentity, - ) - from ..indexesmodels import ( - KnowledgeSourceContentExtractionMode, - KnowledgeSourceIngestionPermissionOption, - KnowledgeSourceResultsProcessing, - KnowledgeSourceSynchronizationStatus, - ) - from .models import KnowledgeRetrievalOutputMode, KnowledgeSourceNetworkAccessMode - - -class AIServices(TypedDict, total=False): - """Parameters for AI Services. - - :ivar uri: The URI of the AI Services endpoint. Required. - :vartype uri: str - :ivar apiKey: The API key for accessing AI Services. - :vartype apiKey: str - """ - - uri: Required[str] - """The URI of the AI Services endpoint. Required.""" - apiKey: str - """The API key for accessing AI Services.""" - - -class AssetStore(TypedDict, total=False): - """Configuration for an asset store used to store extracted assets such as images. - - :ivar connectionString: The connection string for the asset store. Required. - :vartype connectionString: str - :ivar containerName: The name of the blob container within the asset store where extracted - assets (for example, images) are stored. Required. - :vartype containerName: str - """ - - connectionString: Required[str] - """The connection string for the asset store. Required.""" - containerName: Required[str] - """The name of the blob container within the asset store where extracted assets (for example, - images) are stored. Required.""" + from ..indexes.types import SearchIndexKnowledgeSourceQueryHints + from ..indexesmodels import KnowledgeSourceResultsProcessing + from .models import KnowledgeRetrievalOutputMode class AzureBlobKnowledgeSourceParams(TypedDict, total=False): @@ -146,35 +103,6 @@ class AzureBlobKnowledgeSourceParams(TypedDict, total=False): replaces the complete set of query hints configured on the knowledge source.""" -class CompletedSynchronizationState(TypedDict, total=False): - """Represents the completed state of the last synchronization. - - :ivar startTime: The start time of the last completed synchronization. Required. - :vartype startTime: str - :ivar endTime: The end time of the last completed synchronization. Required. - :vartype endTime: str - :ivar itemsUpdatesProcessed: The number of item updates successfully processed in the last - synchronization. Required. - :vartype itemsUpdatesProcessed: int - :ivar itemsUpdatesFailed: The number of item updates that failed in the last synchronization. - Required. - :vartype itemsUpdatesFailed: int - :ivar itemsSkipped: The number of items skipped in the last synchronization. Required. - :vartype itemsSkipped: int - """ - - startTime: Required[str] - """The start time of the last completed synchronization. Required.""" - endTime: Required[str] - """The end time of the last completed synchronization. Required.""" - itemsUpdatesProcessed: Required[int] - """The number of item updates successfully processed in the last synchronization. Required.""" - itemsUpdatesFailed: Required[int] - """The number of item updates that failed in the last synchronization. Required.""" - itemsSkipped: Required[int] - """The number of items skipped in the last synchronization. Required.""" - - class FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a Fabric Data Agent knowledge source. @@ -401,20 +329,6 @@ class FileKnowledgeSourceParams(TypedDict, total=False): replaces the complete set of query hints configured on the knowledge source.""" -class FreshnessPolicy(TypedDict, total=False): - """Configuration for freshness-aware retrieval. When set, newer documents receive a ranking boost - during retrieval. - - :ivar boostingDuration: 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. - :vartype boostingDuration: str - """ - - boostingDuration: str - """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.""" - - class IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a indexed OneLake knowledge source. @@ -824,186 +738,6 @@ class KnowledgeRetrievalSemanticIntent(TypedDict, total=False): """The semantic query to execute. Required.""" -class KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): - """Specifies the Azure OpenAI resource used to vectorize a query string. - - :ivar kind: The discriminator value. Required. Generate embeddings using an Azure OpenAI - resource at query time. - :vartype kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] - :ivar azureOpenAIParameters: Contains the parameters specific to Azure OpenAI embedding - vectorization. - :vartype azureOpenAIParameters: "AzureOpenAIVectorizerParameters" - """ - - kind: Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] - """The discriminator value. Required. Generate embeddings using an Azure OpenAI resource at query - time.""" - azureOpenAIParameters: "AzureOpenAIVectorizerParameters" - """Contains the parameters specific to Azure OpenAI embedding vectorization.""" - - -class KnowledgeSourceIngestionParameters(TypedDict, total=False): - """Consolidates all general ingestion settings for knowledge sources. - - :ivar identity: An explicit identity to use for this knowledge source. - :vartype identity: "SearchIndexerDataIdentity" - :ivar embeddingModel: Optional vectorizer configuration for vectorizing content. - :vartype embeddingModel: "KnowledgeSourceVectorizer" - :ivar chatCompletionModel: Optional chat completion model for image verbalization or context - extraction. - :vartype chatCompletionModel: "KnowledgeBaseModel" - :ivar disableImageVerbalization: Indicates whether image verbalization should be disabled. - Default is false. - :vartype disableImageVerbalization: bool - :ivar ingestionSchedule: Optional schedule for data ingestion. - :vartype ingestionSchedule: "IndexingSchedule" - :ivar ingestionPermissionOptions: Optional list of permission types to ingest together with - document content. If specified, it will set the indexer permission options for the data source. - :vartype ingestionPermissionOptions: list[Union[str, - "KnowledgeSourceIngestionPermissionOption"]] - :ivar contentExtractionMode: Optional content extraction mode. Default is 'minimal'. Known - values are: "minimal" and "standard". - :vartype contentExtractionMode: Union[str, "KnowledgeSourceContentExtractionMode"] - :ivar aiServices: Optional AI Services configuration for content processing. - :vartype aiServices: "AIServices" - :ivar assetStore: Optional asset store configuration for storing extracted assets such as - images. - :vartype assetStore: "AssetStore" - :ivar freshnessPolicy: Optional freshness policy for biasing retrieval toward newer documents. - :vartype freshnessPolicy: "FreshnessPolicy" - :ivar networkAccessMode: Optional network access mode for ingestion. Set to 'private' to run - ingestion in a private execution environment that can reach data sources and dependencies over - a private network. Default is 'public'. This is a create-time setting and cannot be changed - after the knowledge source is created. Known values are: "public" and "private". - :vartype networkAccessMode: Union[str, "KnowledgeSourceNetworkAccessMode"] - """ - - identity: Optional["SearchIndexerDataIdentity"] - """An explicit identity to use for this knowledge source.""" - embeddingModel: Optional["KnowledgeSourceVectorizer"] - """Optional vectorizer configuration for vectorizing content.""" - chatCompletionModel: Optional["KnowledgeBaseModel"] - """Optional chat completion model for image verbalization or context extraction.""" - disableImageVerbalization: bool - """Indicates whether image verbalization should be disabled. Default is false.""" - ingestionSchedule: Optional["IndexingSchedule"] - """Optional schedule for data ingestion.""" - ingestionPermissionOptions: Optional[list[Union[str, "KnowledgeSourceIngestionPermissionOption"]]] - """Optional list of permission types to ingest together with document content. If specified, it - will set the indexer permission options for the data source.""" - contentExtractionMode: Optional[Union[str, "KnowledgeSourceContentExtractionMode"]] - """Optional content extraction mode. Default is 'minimal'. Known values are: \"minimal\" and - \"standard\".""" - aiServices: Optional["AIServices"] - """Optional AI Services configuration for content processing.""" - assetStore: "AssetStore" - """Optional asset store configuration for storing extracted assets such as images.""" - freshnessPolicy: "FreshnessPolicy" - """Optional freshness policy for biasing retrieval toward newer documents.""" - networkAccessMode: Union[str, "KnowledgeSourceNetworkAccessMode"] - """Optional network access mode for ingestion. Set to 'private' to run ingestion in a private - execution environment that can reach data sources and dependencies over a private network. - Default is 'public'. This is a create-time setting and cannot be changed after the knowledge - source is created. Known values are: \"public\" and \"private\".""" - - -class KnowledgeSourceStatistics(TypedDict, total=False): - """Statistical information about knowledge source synchronization history. - - :ivar totalSynchronization: Total number of synchronizations. Required. - :vartype totalSynchronization: int - :ivar averageSynchronizationDuration: Average synchronization duration in HH:MM:SS format. - Required. - :vartype averageSynchronizationDuration: str - :ivar averageItemsProcessedPerSynchronization: Average items processed per synchronization. - Required. - :vartype averageItemsProcessedPerSynchronization: int - """ - - totalSynchronization: Required[int] - """Total number of synchronizations. Required.""" - averageSynchronizationDuration: Required[str] - """Average synchronization duration in HH:MM:SS format. Required.""" - averageItemsProcessedPerSynchronization: Required[int] - """Average items processed per synchronization. Required.""" - - -class KnowledgeSourceStatus(TypedDict, total=False): - """Represents the status and synchronization history of a knowledge source. - - :ivar kind: Identifies the Knowledge Source kind directly from the Status response. Known - values are: "searchIndex", "azureBlob", "indexedSharePoint", "indexedOneLake", "indexedSql", - "web", "remoteSharePoint", "workIQ", "file", "mcpServer", "fabricDataAgent", and - "fabricOntology". - :vartype kind: Union[str, "KnowledgeSourceKind"] - :ivar synchronizationStatus: The current synchronization status. Required. Known values are: - "creating", "active", and "deleting". - :vartype synchronizationStatus: Union[str, "KnowledgeSourceSynchronizationStatus"] - :ivar synchronizationInterval: The synchronization interval (e.g., '1d' for daily). Null if no - schedule is configured. - :vartype synchronizationInterval: str - :ivar currentSynchronizationState: Current synchronization state that spans multiple indexer - runs. - :vartype currentSynchronizationState: "SynchronizationState" - :ivar lastSynchronizationState: Details of the last completed synchronization. Null on first - sync. - :vartype lastSynchronizationState: "CompletedSynchronizationState" - :ivar statistics: Statistical information about the knowledge source synchronization history. - Null on first sync. - :vartype statistics: "KnowledgeSourceStatistics" - """ - - kind: Union[str, "KnowledgeSourceKind"] - """Identifies the Knowledge Source kind directly from the Status response. Known values are: - \"searchIndex\", \"azureBlob\", \"indexedSharePoint\", \"indexedOneLake\", \"indexedSql\", - \"web\", \"remoteSharePoint\", \"workIQ\", \"file\", \"mcpServer\", \"fabricDataAgent\", and - \"fabricOntology\".""" - synchronizationStatus: Required[Union[str, "KnowledgeSourceSynchronizationStatus"]] - """The current synchronization status. Required. Known values are: \"creating\", \"active\", and - \"deleting\".""" - synchronizationInterval: Optional[str] - """The synchronization interval (e.g., '1d' for daily). Null if no schedule is configured.""" - currentSynchronizationState: Optional["SynchronizationState"] - """Current synchronization state that spans multiple indexer runs.""" - lastSynchronizationState: Optional["CompletedSynchronizationState"] - """Details of the last completed synchronization. Null on first sync.""" - statistics: Optional["KnowledgeSourceStatistics"] - """Statistical information about the knowledge source synchronization history. Null on first sync.""" - - -class KnowledgeSourceSynchronizationError(TypedDict, total=False): - """Represents a document-level indexing error encountered during a knowledge source - synchronization run. - - :ivar docId: The unique identifier for the failed document or item within the synchronization - run. - :vartype docId: str - :ivar statusCode: HTTP-like status code representing the failure category (e.g., 400). - :vartype statusCode: int - :ivar name: Name of the ingestion or processing component reporting the error. - :vartype name: str - :ivar errorMessage: Human-readable, customer-visible error message. Required. - :vartype errorMessage: str - :ivar details: Additional contextual information about the failure. - :vartype details: str - :ivar documentationLink: A link to relevant troubleshooting documentation. - :vartype documentationLink: str - """ - - docId: str - """The unique identifier for the failed document or item within the synchronization run.""" - statusCode: int - """HTTP-like status code representing the failure category (e.g., 400).""" - name: str - """Name of the ingestion or processing component reporting the error.""" - errorMessage: Required[str] - """Human-readable, customer-visible error message. Required.""" - details: str - """Additional contextual information about the failure.""" - documentationLink: str - """A link to relevant troubleshooting documentation.""" - - class McpServerKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for an MCP server knowledge source. @@ -1240,37 +974,6 @@ class SearchIndexKnowledgeSourceParams(TypedDict, total=False): replaces the complete set of query hints configured on the knowledge source.""" -class SynchronizationState(TypedDict, total=False): - """Represents the current state of an ongoing synchronization that spans multiple indexer runs. - - :ivar startTime: The start time of the current synchronization. Required. - :vartype startTime: str - :ivar itemsUpdatesProcessed: The number of item updates successfully processed in the current - synchronization. Required. - :vartype itemsUpdatesProcessed: int - :ivar itemsUpdatesFailed: The number of item updates that failed in the current - synchronization. Required. - :vartype itemsUpdatesFailed: int - :ivar itemsSkipped: The number of items skipped in the current synchronization. Required. - :vartype itemsSkipped: int - :ivar errors: Collection of document-level indexing errors encountered during the current - synchronization run. Returned only when errors are present. - :vartype errors: list["KnowledgeSourceSynchronizationError"] - """ - - startTime: Required[str] - """The start time of the current synchronization. Required.""" - itemsUpdatesProcessed: Required[int] - """The number of item updates successfully processed in the current synchronization. Required.""" - itemsUpdatesFailed: Required[int] - """The number of item updates that failed in the current synchronization. Required.""" - itemsSkipped: Required[int] - """The number of items skipped in the current synchronization. Required.""" - errors: list["KnowledgeSourceSynchronizationError"] - """Collection of document-level indexing errors encountered during the current synchronization - run. Returned only when errors are present.""" - - class WebKnowledgeSourceParams(TypedDict, total=False): """Specifies runtime parameters for a web knowledge source. @@ -1451,4 +1154,3 @@ class WorkIQKnowledgeSourceParams(TypedDict, total=False): KnowledgeRetrievalMinimalReasoningEffort, ] KnowledgeRetrievalIntent = Union[KnowledgeRetrievalSemanticIntent] -KnowledgeSourceVectorizer = Union[KnowledgeSourceAzureOpenAIVectorizer] diff --git a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py index 64dc155e8927..410fa28d8250 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py @@ -66,7 +66,6 @@ SemanticErrorMode, SemanticErrorReason, SemanticFieldState, - SemanticQueryRewritesResultType, SemanticSearchResultsType, VectorFilterMode, VectorQueryKind, @@ -126,7 +125,6 @@ "SemanticErrorMode", "SemanticErrorReason", "SemanticFieldState", - "SemanticQueryRewritesResultType", "SemanticSearchResultsType", "VectorFilterMode", "VectorQueryKind", diff --git a/sdk/search/azure-search-documents/azure/search/documents/models/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/models/_patch.py index ec5d6fa0da16..c60a96e989c9 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/models/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/models/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from typing import Any, Dict, List, Tuple, Union, cast, Optional from azure.core.exceptions import HttpResponseError diff --git a/sdk/search/azure-search-documents/azure/search/documents/types.py b/sdk/search/azure-search-documents/azure/search/documents/types.py index 6dd9e57b8535..a7722aa2dda5 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/types.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Literal, Optional, TYPE_CHECKING, Union +from typing import Literal, TYPE_CHECKING, Union from typing_extensions import Required, TypedDict from .models._enums import VectorQueryKind, VectorThresholdKind @@ -27,98 +26,10 @@ ScoringStatistics, SearchMode, SemanticErrorMode, - SemanticErrorReason, - SemanticFieldState, - SemanticQueryRewritesResultType, - SemanticSearchResultsType, VectorFilterMode, ) -class AutocompleteItem(TypedDict, total=False): - """The result of Autocomplete requests. - - :ivar text: The completed term. Required. - :vartype text: str - :ivar queryPlusText: The query along with the completed term. Required. - :vartype queryPlusText: str - """ - - text: Required[str] - """The completed term. Required.""" - queryPlusText: Required[str] - """The query along with the completed term. Required.""" - - -class DebugInfo(TypedDict, total=False): - """Contains debugging information that can be used to further explore your search results. - - :ivar queryRewrites: Contains debugging information specific to query rewrites. - :vartype queryRewrites: "QueryRewritesDebugInfo" - """ - - queryRewrites: "QueryRewritesDebugInfo" - """Contains debugging information specific to query rewrites.""" - - -class DocumentDebugInfo(TypedDict, total=False): - """Contains debugging information that can be used to further explore your search results. - - :ivar semantic: Contains debugging information specific to semantic ranking requests. - :vartype semantic: "SemanticDebugInfo" - :ivar vectors: Contains debugging information specific to vector and hybrid search. - :vartype vectors: "VectorsDebugInfo" - :ivar innerHits: Contains debugging information specific to vectors matched within a collection - of complex types. - :vartype innerHits: dict[str, list["QueryResultDocumentInnerHit"]] - """ - - semantic: "SemanticDebugInfo" - """Contains debugging information specific to semantic ranking requests.""" - vectors: "VectorsDebugInfo" - """Contains debugging information specific to vector and hybrid search.""" - innerHits: dict[str, list["QueryResultDocumentInnerHit"]] - """Contains debugging information specific to vectors matched within a collection of complex - types.""" - - -FacetResult = TypedDict( - "FacetResult", - { - "count": int, - "avg": float, - "min": float, - "max": float, - "sum": float, - "cardinality": int, - "@search.facets": dict[str, list["FacetResult"]], - }, - total=False, -) -FacetResult.__doc__ = """A single bucket of a facet query result. Reports the number of documents with a field value -falling within a particular range or having a particular value or interval. - -:ivar count: The approximate count of documents falling within the bucket described by this - facet. -:vartype count: int -:ivar avg: The resulting total avg for the facet when a avg metric is requested. -:vartype avg: float -:ivar min: The resulting total min for the facet when a min metric is requested. -:vartype min: float -:ivar max: The resulting total max for the facet when a max metric is requested. -:vartype max: float -:ivar sum: The resulting total sum for the facet when a sum metric is requested. -:vartype sum: float -:ivar cardinality: The resulting total cardinality for the facet when a cardinality metric is - requested. -:vartype cardinality: int -:ivar @search.facets: 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. -:vartype @search.facets: dict[str, list["FacetResult"]] -""" - - class HybridSearch(TypedDict, total=False): """The query parameters to configure hybrid search behaviors. @@ -157,9 +68,9 @@ class HybridSearch(TypedDict, total=False): ) IndexAction.__doc__ = """Represents an index action that operates on a document. -:ivar @search.action: The operation to perform on a document in an indexing batch. Known values - are: "upload", "merge", "mergeOrUpload", and "delete". -:vartype @search.action: Union[str, "IndexActionType"] +:ivar ``@search.action``: The operation to perform on a document in an indexing batch. Known + values are: "upload", "merge", "mergeOrUpload", and "delete". +:vartype ``@search.action``: Union[str, "IndexActionType"] """ @@ -174,558 +85,6 @@ class IndexDocumentsBatch(TypedDict, total=False): """The actions in the batch. Required.""" -class IndexingResult(TypedDict, total=False): - """Status of an indexing operation for a single document. - - :ivar key: The key of a document that was in the indexing request. Required. - :vartype key: str - :ivar errorMessage: The error message explaining why the indexing operation failed for the - document identified by the key; null if indexing succeeded. - :vartype errorMessage: str - :ivar status: A value indicating whether the indexing operation succeeded for the document - identified by the key. Required. - :vartype status: bool - :ivar statusCode: The status code of the indexing operation. Possible values include: 200 for a - successful update or delete, 201 for successful document creation, 400 for a malformed input - document, 404 for document not found, 409 for a version conflict, 422 when the index is - temporarily unavailable, or 503 for when the service is too busy. Required. - :vartype statusCode: int - """ - - key: Required[str] - """The key of a document that was in the indexing request. Required.""" - errorMessage: str - """The error message explaining why the indexing operation failed for the document identified by - the key; null if indexing succeeded.""" - status: Required[bool] - """A value indicating whether the indexing operation succeeded for the document identified by the - key. Required.""" - statusCode: Required[int] - """The status code of the indexing operation. Possible values include: 200 for a successful update - or delete, 201 for successful document creation, 400 for a malformed input document, 404 for - document not found, 409 for a version conflict, 422 when the index is temporarily unavailable, - or 503 for when the service is too busy. Required.""" - - -class QueryAnswerResult(TypedDict, total=False): - """An answer is a text passage extracted from the contents of the most relevant documents that - matched the query. Answers are extracted from the top search results. Answer candidates are - scored and the top answers are selected. - - :ivar score: The score value represents how relevant the answer is to the query relative to - other answers returned for the query. - :vartype score: float - :ivar key: The key of the document the answer was extracted from. - :vartype key: str - :ivar text: The text passage extracted from the document contents as the answer. - :vartype text: str - :ivar highlights: Same text passage as in the Text property with highlighted text phrases most - relevant to the query. - :vartype highlights: str - """ - - score: float - """The score value represents how relevant the answer is to the query relative to other answers - returned for the query.""" - key: str - """The key of the document the answer was extracted from.""" - text: str - """The text passage extracted from the document contents as the answer.""" - highlights: Optional[str] - """Same text passage as in the Text property with highlighted text phrases most relevant to the - query.""" - - -class QueryCaptionResult(TypedDict, total=False): - """Captions are the most representative passages from the document relatively to the search query. - They are often used as document summary. Captions are only returned for queries of type - ``semantic``. - - :ivar text: A representative text passage extracted from the document most relevant to the - search query. - :vartype text: str - :ivar highlights: Same text passage as in the Text property with highlighted phrases most - relevant to the query. - :vartype highlights: str - """ - - text: str - """A representative text passage extracted from the document most relevant to the search query.""" - highlights: Optional[str] - """Same text passage as in the Text property with highlighted phrases most relevant to the query.""" - - -class QueryResultDocumentInnerHit(TypedDict, total=False): - """Detailed scoring information for an individual element of a complex collection. - - :ivar ordinal: Position of this specific matching element within it's original collection. - Position starts at 0. - :vartype ordinal: int - :ivar vectors: Detailed scoring information for an individual element of a complex collection - that matched a vector query. - :vartype vectors: list[dict[str, "SingleVectorFieldResult"]] - """ - - ordinal: int - """Position of this specific matching element within it's original collection. Position starts at - 0.""" - vectors: list[dict[str, "SingleVectorFieldResult"]] - """Detailed scoring information for an individual element of a complex collection that matched a - vector query.""" - - -class QueryResultDocumentRerankerInput(TypedDict, total=False): - """The raw concatenated strings that were sent to the semantic enrichment process. - - :ivar title: The raw string for the title field that was used for semantic enrichment. - :vartype title: str - :ivar content: The raw concatenated strings for the content fields that were used for semantic - enrichment. - :vartype content: str - :ivar keywords: The raw concatenated strings for the keyword fields that were used for semantic - enrichment. - :vartype keywords: str - """ - - title: str - """The raw string for the title field that was used for semantic enrichment.""" - content: str - """The raw concatenated strings for the content fields that were used for semantic enrichment.""" - keywords: str - """The raw concatenated strings for the keyword fields that were used for semantic enrichment.""" - - -class QueryResultDocumentSemanticField(TypedDict, total=False): - """Description of fields that were sent to the semantic enrichment process, as well as how they - were used. - - :ivar name: The name of the field that was sent to the semantic enrichment process. - :vartype name: str - :ivar state: The way the field was used for the semantic enrichment process (fully used, - partially used, or unused). Known values are: "used", "unused", and "partial". - :vartype state: Union[str, "SemanticFieldState"] - """ - - name: str - """The name of the field that was sent to the semantic enrichment process.""" - state: Union[str, "SemanticFieldState"] - """The way the field was used for the semantic enrichment process (fully used, partially used, or - unused). Known values are: \"used\", \"unused\", and \"partial\".""" - - -class QueryResultDocumentSubscores(TypedDict, total=False): - """The breakdown of subscores between the text and vector query components of the search query for - this document. Each vector query is shown as a separate object in the same order they were - received. - - :ivar text: The BM25 or Classic score for the text portion of the query. - :vartype text: "TextResult" - :ivar vectors: The vector similarity and. - :vartype vectors: list[dict[str, "SingleVectorFieldResult"]] - :ivar documentBoost: The BM25 or Classic score for the text portion of the query. - :vartype documentBoost: float - """ - - text: "TextResult" - """The BM25 or Classic score for the text portion of the query.""" - vectors: list[dict[str, "SingleVectorFieldResult"]] - """The vector similarity and.""" - documentBoost: float - """The BM25 or Classic score for the text portion of the query.""" - - -class QueryRewritesDebugInfo(TypedDict, total=False): - """Contains debugging information specific to query rewrites. - - :ivar text: List of query rewrites generated for the text query. - :vartype text: "QueryRewritesValuesDebugInfo" - :ivar vectors: List of query rewrites generated for the vectorizable text queries. - :vartype vectors: list["QueryRewritesValuesDebugInfo"] - """ - - text: "QueryRewritesValuesDebugInfo" - """List of query rewrites generated for the text query.""" - vectors: list["QueryRewritesValuesDebugInfo"] - """List of query rewrites generated for the vectorizable text queries.""" - - -class QueryRewritesValuesDebugInfo(TypedDict, total=False): - """Contains debugging information specific to query rewrites. - - :ivar inputQuery: 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. - :vartype inputQuery: str - :ivar rewrites: List of query rewrites. - :vartype rewrites: list[str] - """ - - inputQuery: str - """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.""" - rewrites: list[str] - """List of query rewrites.""" - - -SearchDocumentsResult = TypedDict( - "SearchDocumentsResult", - { - "@odata.count": int, - "@search.coverage": float, - "@search.facets": dict[str, list["FacetResult"]], - "@search.answers": Optional[list["QueryAnswerResult"]], - "@search.debug": Optional["DebugInfo"], - "@search.nextPageParameters": "SearchRequest", - "value": Required[list["SearchResult"]], - "@odata.nextLink": str, - "@search.semanticPartialResponseReason": Union[str, "SemanticErrorReason"], - "@search.semanticPartialResponseType": Union[str, "SemanticSearchResultsType"], - "@search.semanticQueryRewritesResultType": Union[str, "SemanticQueryRewritesResultType"], - }, - total=False, -) -SearchDocumentsResult.__doc__ = """Response containing search results from an index. - -:ivar @odata.count: The total count of results found by the search operation, or null if the - count was not requested. If present, the count may be greater than the number of results in - this response. This can happen if you use the $top or $skip parameters, or if the query can't - return all the requested documents in a single response. -:vartype @odata.count: int -:ivar @search.coverage: A value indicating the percentage of the index that was included in the - query, or null if minimumCoverage was not specified in the request. -:vartype @search.coverage: float -:ivar @search.facets: The facet query results for the search operation, organized as a - collection of buckets for each faceted field; null if the query did not include any facet - expressions. -:vartype @search.facets: dict[str, list["FacetResult"]] -:ivar @search.answers: The answers query results for the search operation; null if the answers - query parameter was not specified or set to 'none'. -:vartype @search.answers: list["QueryAnswerResult"] -:ivar @search.debug: Debug information that applies to the search results as a whole. -:vartype @search.debug: "DebugInfo" -:ivar @search.nextPageParameters: Continuation JSON payload returned when the query can't - return all the requested results in a single response. You can use this JSON along with. -:vartype @search.nextPageParameters: "SearchRequest" -:ivar value: The sequence of results returned by the query. Required. -:vartype value: list["SearchResult"] -:ivar @odata.nextLink: Continuation URL returned when the query can't return all the requested - results in a single response. You can use this URL to formulate another GET or POST Search - request to get the next part of the search response. Make sure to use the same verb (GET or - POST) as the request that produced this response. -:vartype @odata.nextLink: str -:ivar @search.semanticPartialResponseReason: Reason that a partial response was returned for a - semantic ranking request. Known values are: "maxWaitExceeded", "capacityOverloaded", and - "transient". -:vartype @search.semanticPartialResponseReason: Union[str, "SemanticErrorReason"] -:ivar @search.semanticPartialResponseType: Type of partial response that was returned for a - semantic ranking request. Known values are: "baseResults" and "rerankedResults". -:vartype @search.semanticPartialResponseType: Union[str, "SemanticSearchResultsType"] -:ivar @search.semanticQueryRewritesResultType: Type of query rewrite that was used to retrieve - documents. "originalQueryOnly" -:vartype @search.semanticQueryRewritesResultType: Union[str, - "_enums.SemanticQueryRewritesResultType"] -""" - - -class SearchRequest(TypedDict, total=False): - """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. - - :ivar count: A value that specifies whether to fetch the total count of results. Default is - false. Setting this value to true may have a performance impact. Note that the count returned - is an approximation. - :vartype count: bool - :ivar facets: The list of facet expressions to apply to the search query. Each facet expression - contains a field name, optionally followed by a comma-separated list of name:value pairs. - :vartype facets: list[str] - :ivar filter: The OData $filter expression to apply to the search query. - :vartype filter: str - :ivar highlight: The comma-separated list of field names to use for hit highlights. Only - searchable fields can be used for hit highlighting. - :vartype highlight: list[str] - :ivar highlightPostTag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. Default is </em>. - :vartype highlightPostTag: str - :ivar highlightPreTag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. Default is <em>. - :vartype highlightPreTag: str - :ivar minimumCoverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 100. - :vartype minimumCoverage: float - :ivar orderby: The comma-separated list of OData $orderby expressions by which to sort the - results. Each expression can be either a field name or a call to either the geo.distance() or - the search.score() functions. Each expression can be followed by asc to indicate ascending, or - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no $orderby is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :vartype orderby: list[str] - :ivar queryType: A value that specifies the syntax of the search query. The default is - 'simple'. Use 'full' if your query uses the Lucene query syntax. Known values are: "simple", - "full", and "semantic". - :vartype queryType: Union[str, "QueryType"] - :ivar scoringStatistics: A value that specifies whether we want to calculate scoring statistics - (such as document frequency) globally for more consistent scoring, or locally, for lower - latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before - scoring. Using global scoring statistics can increase latency of search queries. Known values - are: "local" and "global". - :vartype scoringStatistics: Union[str, "ScoringStatistics"] - :ivar sessionId: A value to be used to create a sticky session, which can help getting more - consistent results. As long as the same sessionId is used, a best-effort attempt will be made - to target the same replica set. Be wary that reusing the same sessionID values repeatedly can - interfere with the load balancing of the requests across replicas and adversely affect the - performance of the search service. The value used as sessionId cannot start with a '_' - character. - :vartype sessionId: str - :ivar scoringParameters: The 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 - "mylocation--122.2,44.8" (without the quotes). - :vartype scoringParameters: list[str] - :ivar scoringProfile: The name of a scoring profile to evaluate match scores for matching - documents in order to sort the results. - :vartype scoringProfile: str - :ivar debug: Enables a debugging tool that can be used to further explore your reranked - results. Known values are: "disabled", "semantic", "vector", "queryRewrites", "innerHits", and - "all". - :vartype debug: Union[str, "QueryDebugMode"] - :ivar search: A full-text search query expression; Use "*" or omit this parameter to match all - documents. - :vartype search: str - :ivar searchFields: The comma-separated list of field names to which to scope the full-text - search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the - field names of each fielded search expression take precedence over any field names listed in - this parameter. - :vartype searchFields: list[str] - :ivar searchMode: A value that specifies whether any or all of the search terms must be matched - in order to count the document as a match. Known values are: "any" and "all". - :vartype searchMode: Union[str, "SearchMode"] - :ivar queryLanguage: A value that specifies the language of the search query. Known values are: - "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", and "ur-pk". - :vartype queryLanguage: Union[str, "QueryLanguage"] - :ivar speller: A value that specifies the type of the speller to use to spell-correct - individual search query terms. Known values are: "none" and "lexicon". - :vartype speller: Union[str, "QuerySpellerType"] - :ivar select: The comma-separated list of fields to retrieve. If unspecified, all fields marked - as retrievable in the schema are included. - :vartype select: list[str] - :ivar skip: The number of search results to skip. This value cannot be greater than 100,000. If - you need to scan documents in sequence, but cannot use skip due to this limitation, consider - using orderby on a totally-ordered key and filter with a range query instead. - :vartype skip: int - :ivar top: The number of search results to retrieve. This can be used in conjunction with $skip - to implement client-side paging of search results. If results are truncated due to server-side - paging, the response will include a continuation token that can be used to issue another Search - request for the next page of results. - :vartype top: int - :ivar semanticConfiguration: The name of a semantic configuration that will be used when - processing documents for queries of type semantic. - :vartype semanticConfiguration: str - :ivar semanticErrorHandling: Allows the user to choose whether a semantic call should fail - completely (default / current behavior), or to return partial results. Known values are: - "partial" and "fail". - :vartype semanticErrorHandling: Union[str, "SemanticErrorMode"] - :ivar semanticMaxWaitInMilliseconds: Allows the user to set an upper bound on the amount of - time it takes for semantic enrichment to finish processing before the request fails. - :vartype semanticMaxWaitInMilliseconds: int - :ivar semanticQuery: Allows setting a separate search query that will be solely used for - semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there - is a need to use different queries between the base retrieval and ranking phase, and the L2 - semantic phase. - :vartype semanticQuery: str - :ivar answers: A value that specifies whether answers should be returned as part of the search - response. Known values are: "none" and "extractive". - :vartype answers: Union[str, "QueryAnswerType"] - :ivar captions: A value that specifies whether captions should be returned as part of the - search response. Known values are: "none" and "extractive". - :vartype captions: Union[str, "QueryCaptionType"] - :ivar queryRewrites: A value that specifies whether query rewrites should be generated to - augment the search query. Known values are: "none" and "generative". - :vartype queryRewrites: Union[str, "QueryRewritesType"] - :ivar semanticFields: The comma-separated list of field names used for semantic ranking. - :vartype semanticFields: list[str] - :ivar vectorQueries: The query parameters for vector and hybrid search queries. - :vartype vectorQueries: list["VectorQuery"] - :ivar vectorFilterMode: Determines whether or not filters are applied before or after the - vector search is performed. Default is 'preFilter' for new indexes. Known values are: - "postFilter", "preFilter", and "strictPostFilter". - :vartype vectorFilterMode: Union[str, "VectorFilterMode"] - :ivar hybridSearch: The query parameters to configure hybrid search behaviors. - :vartype hybridSearch: "HybridSearch" - """ - - count: bool - """A value that specifies whether to fetch the total count of results. Default is false. Setting - this value to true may have a performance impact. Note that the count returned is an - approximation.""" - facets: list[str] - """The list of facet expressions to apply to the search query. Each facet expression contains a - field name, optionally followed by a comma-separated list of name:value pairs.""" - filter: str - """The OData $filter expression to apply to the search query.""" - highlight: list[str] - """The comma-separated list of field names to use for hit highlights. Only searchable fields can - be used for hit highlighting.""" - highlightPostTag: str - """A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is - </em>.""" - highlightPreTag: str - """A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is - <em>.""" - minimumCoverage: float - """A number between 0 and 100 indicating the percentage of the index that must be covered by a - search query in order for the query to be reported as a success. This parameter can be useful - for ensuring search availability even for services with only one replica. The default is 100.""" - orderby: list[str] - """The comma-separated list of OData $orderby expressions by which to sort the results. Each - expression can be either a field name or a call to either the geo.distance() or the - search.score() functions. Each expression can be followed by asc to indicate ascending, or desc - to indicate descending. The default is ascending order. Ties will be broken by the match scores - of documents. If no $orderby is specified, the default sort order is descending by document - match score. There can be at most 32 $orderby clauses.""" - queryType: Union[str, "QueryType"] - """A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if - your query uses the Lucene query syntax. Known values are: \"simple\", \"full\", and - \"semantic\".""" - scoringStatistics: Union[str, "ScoringStatistics"] - """A value that specifies whether we want to calculate scoring statistics (such as document - frequency) globally for more consistent scoring, or locally, for lower latency. The default is - 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global - scoring statistics can increase latency of search queries. Known values are: \"local\" and - \"global\".""" - sessionId: str - """A value to be used to create a sticky session, which can help getting more consistent results. - As long as the same sessionId is used, a best-effort attempt will be made to target the same - replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the - load balancing of the requests across replicas and adversely affect the performance of the - search service. The value used as sessionId cannot start with a '_' character.""" - scoringParameters: list[str] - """The 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 - \"mylocation--122.2,44.8\" (without the quotes).""" - scoringProfile: str - """The name of a scoring profile to evaluate match scores for matching documents in order to sort - the results.""" - debug: Union[str, "QueryDebugMode"] - """Enables a debugging tool that can be used to further explore your reranked results. Known - values are: \"disabled\", \"semantic\", \"vector\", \"queryRewrites\", \"innerHits\", and - \"all\".""" - search: str - """A full-text search query expression; Use \"*\" or omit this parameter to match all documents.""" - searchFields: list[str] - """The comma-separated list of field names to which to scope the full-text search. When using - fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each - fielded search expression take precedence over any field names listed in this parameter.""" - searchMode: Union[str, "SearchMode"] - """A value that specifies whether any or all of the search terms must be matched in order to count - the document as a match. Known values are: \"any\" and \"all\".""" - queryLanguage: Union[str, "QueryLanguage"] - """A value that specifies the language of the search query. Known values are: \"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\", and \"ur-pk\".""" - speller: Union[str, "QuerySpellerType"] - """A value that specifies the type of the speller to use to spell-correct individual search query - terms. Known values are: \"none\" and \"lexicon\".""" - select: list[str] - """The comma-separated list of fields to retrieve. If unspecified, all fields marked as - retrievable in the schema are included.""" - skip: int - """The number of search results to skip. This value cannot be greater than 100,000. If you need to - scan documents in sequence, but cannot use skip due to this limitation, consider using orderby - on a totally-ordered key and filter with a range query instead.""" - top: int - """The number of search results to retrieve. This can be used in conjunction with $skip to - implement client-side paging of search results. If results are truncated due to server-side - paging, the response will include a continuation token that can be used to issue another Search - request for the next page of results.""" - semanticConfiguration: str - """The name of a semantic configuration that will be used when processing documents for queries of - type semantic.""" - semanticErrorHandling: Union[str, "SemanticErrorMode"] - """Allows the user to choose whether a semantic call should fail completely (default / current - behavior), or to return partial results. Known values are: \"partial\" and \"fail\".""" - semanticMaxWaitInMilliseconds: int - """Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to - finish processing before the request fails.""" - semanticQuery: str - """Allows setting a separate search query that will be solely used for semantic reranking, - semantic captions and semantic answers. Is useful for scenarios where there is a need to use - different queries between the base retrieval and ranking phase, and the L2 semantic phase.""" - answers: Union[str, "QueryAnswerType"] - """A value that specifies whether answers should be returned as part of the search response. Known - values are: \"none\" and \"extractive\".""" - captions: Union[str, "QueryCaptionType"] - """A value that specifies whether captions should be returned as part of the search response. - Known values are: \"none\" and \"extractive\".""" - queryRewrites: Union[str, "QueryRewritesType"] - """A value that specifies whether query rewrites should be generated to augment the search query. - Known values are: \"none\" and \"generative\".""" - semanticFields: list[str] - """The comma-separated list of field names used for semantic ranking.""" - vectorQueries: list["VectorQuery"] - """The query parameters for vector and hybrid search queries.""" - vectorFilterMode: Union[str, "VectorFilterMode"] - """Determines whether or not filters are applied before or after the vector search is performed. - Default is 'preFilter' for new indexes. Known values are: \"postFilter\", \"preFilter\", and - \"strictPostFilter\".""" - hybridSearch: "HybridSearch" - """The query parameters to configure hybrid search behaviors.""" - - -SearchResult = TypedDict( - "SearchResult", - { - "@search.score": Required[float], - "@search.rerankerScore": Optional[float], - "@search.rerankerBoostedScore": Optional[float], - "@search.highlights": dict[str, list[str]], - "@search.captions": Optional[list["QueryCaptionResult"]], - "@search.documentDebugInfo": Optional["DocumentDebugInfo"], - }, - total=False, -) -SearchResult.__doc__ = """Contains a document found by a search query, plus associated metadata. - -:ivar @search.score: The relevance score of the document compared to other documents returned - by the query. Required. -:vartype @search.score: float -:ivar @search.rerankerScore: The relevance score computed by the semantic ranker for the top - search results. Search results are sorted by the RerankerScore first and then by the Score. - RerankerScore is only returned for queries of type 'semantic'. -:vartype @search.rerankerScore: float -:ivar @search.rerankerBoostedScore: The relevance score computed by boosting the Reranker - Score. Search results are sorted by the RerankerScore/RerankerBoostedScore based on - useScoringProfileBoostedRanking in the Semantic Config. RerankerBoostedScore is only returned - for queries of type 'semantic'. -:vartype @search.rerankerBoostedScore: float -:ivar @search.highlights: Text fragments from the document that indicate the matching search - terms, organized by each applicable field; null if hit highlighting was not enabled for the - query. -:vartype @search.highlights: dict[str, list[str]] -:ivar @search.captions: Captions are the most representative passages from the document - relatively to the search query. They are often used as document summary. Captions are only - returned for queries of type 'semantic'. -:vartype @search.captions: list["QueryCaptionResult"] -:ivar @search.documentDebugInfo: Contains debugging information that can be used to further - explore your search results. -:vartype @search.documentDebugInfo: "DocumentDebugInfo" -""" - - class SearchScoreThreshold(TypedDict, total=False): """The results of the vector query will filter based on the '. @@ -746,79 +105,6 @@ class SearchScoreThreshold(TypedDict, total=False): of the search response. The threshold direction will be chosen for higher @search.score.""" -class SemanticDebugInfo(TypedDict, total=False): - """Contains debugging information specific to semantic ranking requests. - - :ivar titleField: The title field that was sent to the semantic enrichment process, as well as - how it was used. - :vartype titleField: "QueryResultDocumentSemanticField" - :ivar contentFields: The content fields that were sent to the semantic enrichment process, as - well as how they were used. - :vartype contentFields: list["QueryResultDocumentSemanticField"] - :ivar keywordFields: The keyword fields that were sent to the semantic enrichment process, as - well as how they were used. - :vartype keywordFields: list["QueryResultDocumentSemanticField"] - :ivar rerankerInput: The raw concatenated strings that were sent to the semantic enrichment - process. - :vartype rerankerInput: "QueryResultDocumentRerankerInput" - """ - - titleField: "QueryResultDocumentSemanticField" - """The title field that was sent to the semantic enrichment process, as well as how it was used.""" - contentFields: list["QueryResultDocumentSemanticField"] - """The content fields that were sent to the semantic enrichment process, as well as how they were - used.""" - keywordFields: list["QueryResultDocumentSemanticField"] - """The keyword fields that were sent to the semantic enrichment process, as well as how they were - used.""" - rerankerInput: "QueryResultDocumentRerankerInput" - """The raw concatenated strings that were sent to the semantic enrichment process.""" - - -class SingleVectorFieldResult(TypedDict, total=False): - """A single vector field result. Both. - - :ivar searchScore: The. - :vartype searchScore: float - :ivar vectorSimilarity: The vector similarity score for this document. Note this is the - canonical definition of similarity metric, not the 'distance' version. For example, cosine - similarity instead of cosine distance. - :vartype vectorSimilarity: float - """ - - searchScore: float - """The.""" - vectorSimilarity: float - """The vector similarity score for this document. Note this is the canonical definition of - similarity metric, not the 'distance' version. For example, cosine similarity instead of cosine - distance.""" - - -SuggestResult = TypedDict( - "SuggestResult", - { - "@search.text": Required[str], - }, - total=False, -) -SuggestResult.__doc__ = """A result containing a document found by a suggestion query, plus associated metadata. - -:ivar @search.text: The text of the suggestion result. Required. -:vartype @search.text: str -""" - - -class TextResult(TypedDict, total=False): - """The BM25 or Classic score for the text portion of the query. - - :ivar searchScore: The BM25 or Classic score for the text portion of the query. - :vartype searchScore: float - """ - - searchScore: float - """The BM25 or Classic score for the text portion of the query.""" - - class VectorizableImageBinaryQuery(TypedDict, total=False): """The query parameters to use for vector search when a base 64 encoded binary of an image that needs to be vectorized is provided. @@ -1153,19 +439,6 @@ class VectorizedQuery(TypedDict, total=False): provided.""" -class VectorsDebugInfo(TypedDict, total=False): - """ "Contains debugging information specific to vector and hybrid search."). - - :ivar subscores: The breakdown of subscores of the document prior to the chosen result set - fusion/combination method such as RRF. - :vartype subscores: "QueryResultDocumentSubscores" - """ - - subscores: "QueryResultDocumentSubscores" - """The breakdown of subscores of the document prior to the chosen result set fusion/combination - method such as RRF.""" - - class VectorSimilarityThreshold(TypedDict, total=False): """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 diff --git a/sdk/search/azure-search-documents/samples/README.md b/sdk/search/azure-search-documents/samples/README.md index 65f1b69a088a..7c7681fd6ade 100644 --- a/sdk/search/azure-search-documents/samples/README.md +++ b/sdk/search/azure-search-documents/samples/README.md @@ -71,16 +71,18 @@ The following samples target an `azure-search-documents` build whose default API Knowledge base and retrieval: -* Knowledge base preview configuration (CORS, tags, retrieval defaults, and query hints): [sample_knowledge_base_configuration_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py)) -* Retrieve responses and typed server-sent events: [sample_knowledge_retrieval_response_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py)) -* Service stats with knowledge base / source counters: [sample_knowledge_service_stats_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py)) +* Knowledge base CRUD with tags metadata and cursor pagination: [sample_knowledge_base_crud.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud_async.py)) +* Knowledge base preview configuration with reasoning precedence, retrieval defaults, CORS, tags, and query hints: [sample_knowledge_base_configuration_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py)) +* Retrieve responses with Search-owned citation URLs, results processing, and typed server-sent events: [sample_knowledge_retrieval_response_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py)) +* Service stats with knowledge base / source counters and the per-index vector-size limit: [sample_knowledge_service_stats_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py)) * Source attach-time defaults (`enable_freshness`, `enable_image_serving`): [sample_knowledge_source_freshness_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview_async.py)) Knowledge source kinds: -* File knowledge source with multipart upload and update: [sample_knowledge_source_file_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py)) +* Knowledge source CRUD with query hints, private Blob ingestion, analyzer verification, and cursor pagination: [sample_knowledge_source_crud.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud_async.py)) +* File knowledge source lifecycle with relative-path metadata, multipart update, prefix paging, deletion, and service-selected modes: [sample_knowledge_source_file_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py)) * MCP server knowledge source: [sample_knowledge_source_mcp_server_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview_async.py)) -* Work IQ knowledge source with customer-owned Entra app authentication: [sample_knowledge_source_workiq_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py)) +* Work IQ knowledge source with customer-owned Entra app authentication, optional tenant behavior, and separate authorization channels: [sample_knowledge_source_workiq_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py)) * Fabric ontology knowledge source: [sample_knowledge_source_fabric_ontology_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview_async.py)) * Fabric data agent knowledge source: [sample_knowledge_source_fabric_data_agent_preview.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview_async.py)) diff --git a/sdk/search/azure-search-documents/samples/sample_index_alias_crud.py b/sdk/search/azure-search-documents/samples/sample_index_alias_crud.py index 43f26b5c2dfa..59d2c8ddfe15 100644 --- a/sdk/search/azure-search-documents/samples/sample_index_alias_crud.py +++ b/sdk/search/azure-search-documents/samples/sample_index_alias_crud.py @@ -19,7 +19,6 @@ 3) AZURE_SEARCH_INDEX_NAME - target search index name (e.g., "hotels-sample-index") """ - import os service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] diff --git a/sdk/search/azure-search-documents/samples/sample_index_alias_crud_async.py b/sdk/search/azure-search-documents/samples/sample_index_alias_crud_async.py index 543cca24c8e2..831b5252e5dc 100644 --- a/sdk/search/azure-search-documents/samples/sample_index_alias_crud_async.py +++ b/sdk/search/azure-search-documents/samples/sample_index_alias_crud_async.py @@ -19,7 +19,6 @@ 3) AZURE_SEARCH_INDEX_NAME - target search index name (e.g., "hotels-sample-index") """ - import asyncio import os diff --git a/sdk/search/azure-search-documents/samples/sample_index_crud.py b/sdk/search/azure-search-documents/samples/sample_index_crud.py index 185825439f64..a4bed32ee5ec 100644 --- a/sdk/search/azure-search-documents/samples/sample_index_crud.py +++ b/sdk/search/azure-search-documents/samples/sample_index_crud.py @@ -18,7 +18,6 @@ 2) AZURE_SEARCH_API_KEY - the admin key for your search service """ - import os from typing import List diff --git a/sdk/search/azure-search-documents/samples/sample_index_crud_async.py b/sdk/search/azure-search-documents/samples/sample_index_crud_async.py index 7680852f2abf..8ff4bad51b55 100644 --- a/sdk/search/azure-search-documents/samples/sample_index_crud_async.py +++ b/sdk/search/azure-search-documents/samples/sample_index_crud_async.py @@ -18,7 +18,6 @@ 2) AZURE_SEARCH_API_KEY - the admin key for your search service """ - import os import asyncio from typing import List diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py index b120635543c1..d0bd6e1653c1 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview.py @@ -30,7 +30,6 @@ setup_hotel_index, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -65,6 +64,7 @@ def main(): KnowledgeBaseMessageTextContent, KnowledgeBaseRetrievalRequest, KnowledgeRetrievalAutoReasoningEffort, + KnowledgeRetrievalLowReasoningEffort, ) index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) @@ -119,13 +119,17 @@ def main(): retrieve_defaults=KnowledgeBaseRetrieveDefaults( max_runtime_in_seconds=60, max_output_documents=20, - max_output_size_in_tokens=4000, + max_output_size_in_tokens=5000, ), ) created_knowledge_base = index_client.create_or_update_knowledge_base(knowledge_base) print(f"Created: knowledge base '{created_knowledge_base.name}'") retrieved_knowledge_base = index_client.get_knowledge_base(knowledge_base_name) print(f"Retrieved: knowledge base '{retrieved_knowledge_base.name}'") + assert retrieved_knowledge_base.retrieval_reasoning_effort is not None + assert retrieved_knowledge_base.retrieve_defaults is not None + assert retrieved_knowledge_base.retrieval_reasoning_effort.kind == "auto" + assert retrieved_knowledge_base.retrieve_defaults.max_output_size_in_tokens == 5000 retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name @@ -133,6 +137,10 @@ def main(): try: request = KnowledgeBaseRetrievalRequest( include_activity=True, + retrieval_reasoning_effort=KnowledgeRetrievalLowReasoningEffort(), + max_runtime_in_seconds=30, + max_output_documents=5, + max_output_size=5000, messages=[ KnowledgeBaseMessage( role="user", @@ -140,6 +148,8 @@ def main(): ) ], ) + assert request.retrieval_reasoning_effort is not None + assert request.retrieval_reasoning_effort.kind == "low" retrieval_result = retrieval_client.retrieve(request) finally: retrieval_client.close() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py index e2f0aa8eef57..564d3acf9d9a 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py @@ -31,7 +31,6 @@ setup_hotel_index_async, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -64,6 +63,7 @@ async def main(): KnowledgeBaseMessageTextContent, KnowledgeBaseRetrievalRequest, KnowledgeRetrievalAutoReasoningEffort, + KnowledgeRetrievalLowReasoningEffort, ) index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) @@ -127,6 +127,10 @@ async def main(): print(f"Created: knowledge base '{created_knowledge_base.name}'") retrieved_knowledge_base = await index_client.get_knowledge_base(knowledge_base_name) print(f"Retrieved: knowledge base '{retrieved_knowledge_base.name}'") + assert retrieved_knowledge_base.retrieval_reasoning_effort is not None + assert retrieved_knowledge_base.retrieve_defaults is not None + assert retrieved_knowledge_base.retrieval_reasoning_effort.kind == "auto" + assert retrieved_knowledge_base.retrieve_defaults.max_output_size_in_tokens == 4000 retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name @@ -134,6 +138,10 @@ async def main(): try: request = KnowledgeBaseRetrievalRequest( include_activity=True, + retrieval_reasoning_effort=KnowledgeRetrievalLowReasoningEffort(), + max_runtime_in_seconds=30, + max_output_documents=5, + max_output_size=5000, messages=[ KnowledgeBaseMessage( role="user", @@ -141,6 +149,8 @@ async def main(): ) ], ) + assert request.retrieval_reasoning_effort is not None + assert request.retrieval_reasoning_effort.kind == "low" retrieval_result = await retrieval_client.retrieve(request) finally: await retrieval_client.close() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud.py index f4fc34b99410..6c3ca9cb9d65 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud.py @@ -25,7 +25,6 @@ 2) AZURE_SEARCH_API_KEY - the admin key for your search service """ - import os service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] @@ -48,9 +47,11 @@ def create_knowledge_base(): knowledge_base = KnowledgeBase( name=knowledge_base_name, knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], + tags={"environment": "sample", "owner": "search-team"}, ) result = index_client.create_or_update_knowledge_base(knowledge_base=knowledge_base) + assert result.tags == {"environment": "sample", "owner": "search-team"} print(f"Created: knowledge base '{result.name}'") # [END create_knowledge_base] @@ -63,6 +64,7 @@ def get_knowledge_base(): index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) result = index_client.get_knowledge_base(knowledge_base_name) + assert result.tags == {"environment": "sample", "owner": "search-team"} print(f"Retrieved: knowledge base '{result.name}'") # [END get_knowledge_base] @@ -71,20 +73,12 @@ def update_knowledge_base(): # [START update_knowledge_base] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient - from azure.search.documents.indexes.models import ( - KnowledgeBase, - KnowledgeSourceReference, - ) - index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - - knowledge_base = KnowledgeBase( - name=knowledge_base_name, - description="Updated knowledge base", - knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], - ) - + knowledge_base = index_client.get_knowledge_base(knowledge_base_name) + knowledge_base.tags = {"environment": "sample", "owner": "retrieval-team"} result = index_client.create_or_update_knowledge_base(knowledge_base=knowledge_base) + assert result.tags == {"environment": "sample", "owner": "retrieval-team"} + print("Tags are metadata labels; this sample does not use them for billing attribution.") print(f"Updated: knowledge base '{result.name}'") # [END update_knowledge_base] @@ -93,11 +87,29 @@ def list_knowledge_bases(): # [START list_knowledge_bases] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient + from azure.search.documents.indexes.models import KnowledgeBase, KnowledgeSourceReference index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - - for kb in index_client.list_knowledge_bases(): - print(f"Listed: knowledge base '{kb.name}'") + companion_name = f"{knowledge_base_name}-page" + companion = KnowledgeBase( + name=companion_name, + knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], + ) + index_client.create_or_update_knowledge_base(companion) + try: + knowledge_bases = list( + index_client.list_knowledge_bases( + search=knowledge_base_name, + page_size=1, + search_type="prefix", + ) + ) + knowledge_base_names = [knowledge_base.name for knowledge_base in knowledge_bases] + assert set(knowledge_base_names) == {knowledge_base_name, companion_name} + assert len(knowledge_base_names) == len(set(knowledge_base_names)) + print(f"Paged through {len(knowledge_bases)} knowledge bases without duplicates") + finally: + index_client.delete_knowledge_base(companion_name) # [END list_knowledge_bases] diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud_async.py index 8dfe8e09f5fc..caf8330e79af 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_crud_async.py @@ -25,7 +25,6 @@ 2) AZURE_SEARCH_API_KEY - the admin key for your search service """ - import asyncio import os @@ -49,10 +48,12 @@ async def create_knowledge_base_async(): knowledge_base = KnowledgeBase( name=knowledge_base_name, knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], + tags={"environment": "sample", "owner": "search-team"}, ) async with index_client: result = await index_client.create_or_update_knowledge_base(knowledge_base=knowledge_base) + assert result.tags == {"environment": "sample", "owner": "search-team"} print(f"Created: knowledge base '{result.name}'") # [END create_knowledge_base_async] @@ -66,6 +67,7 @@ async def get_knowledge_base_async(): async with index_client: result = await index_client.get_knowledge_base(knowledge_base_name) + assert result.tags == {"environment": "sample", "owner": "search-team"} print(f"Retrieved: knowledge base '{result.name}'") # [END get_knowledge_base_async] @@ -74,21 +76,13 @@ async def update_knowledge_base_async(): # [START update_knowledge_base_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient - from azure.search.documents.indexes.models import ( - KnowledgeBase, - KnowledgeSourceReference, - ) - index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - - knowledge_base = KnowledgeBase( - name=knowledge_base_name, - description="Updated knowledge base", - knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], - ) - async with index_client: + knowledge_base = await index_client.get_knowledge_base(knowledge_base_name) + knowledge_base.tags = {"environment": "sample", "owner": "retrieval-team"} result = await index_client.create_or_update_knowledge_base(knowledge_base=knowledge_base) + assert result.tags == {"environment": "sample", "owner": "retrieval-team"} + print("Tags are metadata labels; this sample does not use them for billing attribution.") print(f"Updated: knowledge base '{result.name}'") # [END update_knowledge_base_async] @@ -97,12 +91,31 @@ async def list_knowledge_bases_async(): # [START list_knowledge_bases_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient + from azure.search.documents.indexes.models import KnowledgeBase, KnowledgeSourceReference index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - + companion_name = f"{knowledge_base_name}-page" + companion = KnowledgeBase( + name=companion_name, + knowledge_sources=[KnowledgeSourceReference(name=knowledge_source_name)], + ) async with index_client: - async for kb in index_client.list_knowledge_bases(): - print(f"Listed: knowledge base '{kb.name}'") + await index_client.create_or_update_knowledge_base(companion) + try: + knowledge_bases = [ + knowledge_base + async for knowledge_base in index_client.list_knowledge_bases( + search=knowledge_base_name, + page_size=1, + search_type="prefix", + ) + ] + knowledge_base_names = [knowledge_base.name for knowledge_base in knowledge_bases] + assert set(knowledge_base_names) == {knowledge_base_name, companion_name} + assert len(knowledge_base_names) == len(set(knowledge_base_names)) + print(f"Paged through {len(knowledge_bases)} knowledge bases without duplicates") + finally: + await index_client.delete_knowledge_base(companion_name) # [END list_knowledge_bases_async] diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py index 293f522754a0..de810b01eeb2 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview.py @@ -22,6 +22,7 @@ """ import os +from urllib.parse import urlparse from sample_utils import ( cleanup_resources, @@ -30,7 +31,6 @@ setup_hotel_index, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -60,7 +60,9 @@ def main(): KnowledgeBaseMessage, KnowledgeBaseMessageTextContent, KnowledgeBaseResponseCompletedEvent, + KnowledgeBaseRetrievalStartedEvent, KnowledgeBaseRetrievalRequest, + KnowledgeBaseSearchIndexReference, KnowledgeBaseStreamErrorEvent, KnowledgeRetrievalLowReasoningEffort, KnowledgeRetrievalSemanticIntent, @@ -71,6 +73,7 @@ def main(): knowledge_source = SearchIndexKnowledgeSource( name=knowledge_source_name, description="Hotel knowledge source for retrieval response preview", + results_processing="rerank", search_index_parameters=SearchIndexKnowledgeSourceParameters( search_index_name=index_name, source_data_fields=[ @@ -120,15 +123,26 @@ def main(): semantic_result = retrieval_client.retrieve(semantic_request) print_retrieval_summary(semantic_result) + stream_event_types = [] + stream_request_id = None with retrieval_client.retrieve_stream(semantic_request) as stream: for event in stream: - if event.event_type == "response.completed" and isinstance( + stream_event_types.append(event.event_type) + if event.event_type == "retrieval.started" and isinstance( + event.data, KnowledgeBaseRetrievalStartedEvent + ): + stream_request_id = event.data.request_id + elif event.event_type == "response.completed" and isinstance( event.data, KnowledgeBaseResponseCompletedEvent ): + assert event.data.status_code in {200, 206} print_retrieval_summary(event.data.response) elif event.event_type == "error" and isinstance(event.data, KnowledgeBaseStreamErrorEvent): error_message = event.data.error.message if event.data.error else "Retrieval failed" - print(f"Streaming retrieval error: {error_message}") + raise RuntimeError(f"Streaming retrieval error: {error_message}") + assert stream_event_types[0] == "retrieval.started" + assert stream_event_types[-1] == "response.completed" + assert stream_request_id message_request = KnowledgeBaseRetrievalRequest( include_activity=True, @@ -143,12 +157,40 @@ def main(): knowledge_source_name=knowledge_source_name, include_references=True, include_reference_source_data=True, + results_processing="rerank", max_output_documents=50, ) ], ) message_result = retrieval_client.retrieve(message_request) print_retrieval_summary(message_result) + search_references = [ + reference + for reference in message_result.references or [] + if isinstance(reference, KnowledgeBaseSearchIndexReference) + ] + assert search_references + search_host = urlparse(service_endpoint).netloc + for reference in search_references: + assert reference.citation_url is not None + citation = urlparse(reference.citation_url) + assert citation.scheme == "https" + assert citation.netloc == search_host + + no_rerank_request = KnowledgeBaseRetrievalRequest( + include_activity=True, + intents=[KnowledgeRetrievalSemanticIntent(search="Which hotels include parking?")], + knowledge_source_params=[ + SearchIndexKnowledgeSourceParams( + knowledge_source_name=knowledge_source_name, + include_references=True, + results_processing="none", + max_output_documents=50, + ) + ], + ) + no_rerank_result = retrieval_client.retrieve(no_rerank_request) + assert all(reference.reranker_score is None for reference in no_rerank_result.references or []) finally: retrieval_client.close() # [END sample_knowledge_retrieval_response_preview] diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py index 57986c3a05eb..2765eb425a3b 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_retrieval_response_preview_async.py @@ -23,6 +23,7 @@ import asyncio import os +from urllib.parse import urlparse from sample_utils import ( cleanup_resources_async, @@ -31,7 +32,6 @@ setup_hotel_index_async, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -59,7 +59,9 @@ async def main(): KnowledgeBaseMessage, KnowledgeBaseMessageTextContent, KnowledgeBaseResponseCompletedEvent, + KnowledgeBaseRetrievalStartedEvent, KnowledgeBaseRetrievalRequest, + KnowledgeBaseSearchIndexReference, KnowledgeBaseStreamErrorEvent, KnowledgeRetrievalLowReasoningEffort, KnowledgeRetrievalSemanticIntent, @@ -72,6 +74,7 @@ async def main(): knowledge_source = SearchIndexKnowledgeSource( name=knowledge_source_name, description="Hotel knowledge source for retrieval response preview", + results_processing="rerank", search_index_parameters=SearchIndexKnowledgeSourceParameters( search_index_name=index_name, source_data_fields=[ @@ -121,16 +124,27 @@ async def main(): semantic_result = await retrieval_client.retrieve(semantic_request) print_retrieval_summary(semantic_result) + stream_event_types = [] + stream_request_id = None stream = await retrieval_client.retrieve_stream(semantic_request) async with stream: async for event in stream: - if event.event_type == "response.completed" and isinstance( + stream_event_types.append(event.event_type) + if event.event_type == "retrieval.started" and isinstance( + event.data, KnowledgeBaseRetrievalStartedEvent + ): + stream_request_id = event.data.request_id + elif event.event_type == "response.completed" and isinstance( event.data, KnowledgeBaseResponseCompletedEvent ): + assert event.data.status_code in {200, 206} print_retrieval_summary(event.data.response) elif event.event_type == "error" and isinstance(event.data, KnowledgeBaseStreamErrorEvent): error_message = event.data.error.message if event.data.error else "Retrieval failed" - print(f"Streaming retrieval error: {error_message}") + raise RuntimeError(f"Streaming retrieval error: {error_message}") + assert stream_event_types[0] == "retrieval.started" + assert stream_event_types[-1] == "response.completed" + assert stream_request_id message_request = KnowledgeBaseRetrievalRequest( include_activity=True, @@ -145,12 +159,40 @@ async def main(): knowledge_source_name=knowledge_source_name, include_references=True, include_reference_source_data=True, + results_processing="rerank", max_output_documents=50, ) ], ) message_result = await retrieval_client.retrieve(message_request) print_retrieval_summary(message_result) + search_references = [ + reference + for reference in message_result.references or [] + if isinstance(reference, KnowledgeBaseSearchIndexReference) + ] + assert search_references + search_host = urlparse(service_endpoint).netloc + for reference in search_references: + assert reference.citation_url is not None + citation = urlparse(reference.citation_url) + assert citation.scheme == "https" + assert citation.netloc == search_host + + no_rerank_request = KnowledgeBaseRetrievalRequest( + include_activity=True, + intents=[KnowledgeRetrievalSemanticIntent(search="Which hotels include parking?")], + knowledge_source_params=[ + SearchIndexKnowledgeSourceParams( + knowledge_source_name=knowledge_source_name, + include_references=True, + results_processing="none", + max_output_documents=50, + ) + ], + ) + no_rerank_result = await retrieval_client.retrieve(no_rerank_request) + assert all(reference.reranker_score is None for reference in no_rerank_result.references or []) finally: await retrieval_client.close() # [END sample_knowledge_retrieval_response_preview_async] diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py index f7315e8fd2c2..6200132e0017 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview.py @@ -32,6 +32,12 @@ def main(): stats = index_client.get_service_statistics() print(f"Knowledge bases: {stats.counters.knowledge_base_counter.usage}") print(f"Knowledge sources: {stats.counters.knowledge_source_counter.usage}") + vector_limit = stats.limits.max_vector_index_size_per_index_in_bytes + if vector_limit is None: + print("Maximum vector index size per index: not reported by this service tier") + else: + print(f"Maximum vector index size per index: {vector_limit} bytes") + print("This is a per-index limit, not current usage or a per-partition quota.") # [END sample_knowledge_service_stats_preview] diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py index 4e7e27e554ce..37d5c8818762 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_service_stats_preview_async.py @@ -34,6 +34,12 @@ async def main(): stats = await index_client.get_service_statistics() print(f"Knowledge bases: {stats.counters.knowledge_base_counter.usage}") print(f"Knowledge sources: {stats.counters.knowledge_source_counter.usage}") + vector_limit = stats.limits.max_vector_index_size_per_index_in_bytes + if vector_limit is None: + print("Maximum vector index size per index: not reported by this service tier") + else: + print(f"Maximum vector index size per index: {vector_limit} bytes") + print("This is a per-index limit, not current usage or a per-partition quota.") # [END sample_knowledge_service_stats_preview_async] diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud.py index 709a7ae751a4..fec5727e2d9e 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud.py @@ -17,14 +17,25 @@ USAGE: python sample_knowledge_source_crud.py - Set the following environment variables before running the sample: + Set the following environment variables before running the standard CRUD scenarios: 1) AZURE_SEARCH_SERVICE_ENDPOINT - base URL of your Azure AI Search service (e.g., https://.search.windows.net) 2) AZURE_SEARCH_API_KEY - the admin key for your search service 3) AZURE_SEARCH_INDEX_NAME - target search index name. The index must have a semantic configuration (e.g., "hotels-sample-index"). -""" + The private Blob ingestion scenario runs only when all of these optional variables are set: + 4) AZURE_STORAGE_RESOURCE_ID_CONNECTION_STRING - ResourceId connection string for private Blob ingestion + 5) AZURE_STORAGE_CONTAINER - Blob container with supported and fallback language fixtures + 6) AZURE_SEARCH_USER_ASSIGNED_IDENTITY - user-assigned identity assigned to the Search service + 7) AZURE_AI_SERVICES_ENDPOINT - AI Services endpoint used for language detection + 8) AZURE_AI_SERVICES_API_KEY - AI Services API key + 9) AZURE_SEARCH_EXPECTED_ANALYZER - analyzer expected for the supported-language fixture + 10) AZURE_SEARCH_EXPECTED_FALLBACK_ANALYZER - analyzer expected for the fallback fixture + + The storage and AI Services shared private links must already be approved. Shared private-link + resources are control-plane resources and are not configured by this data-plane sample. +""" import os @@ -32,6 +43,16 @@ index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] knowledge_source_name = "hotels-sample-knowledge-source" +private_blob_source_name = "hotels-private-blob-knowledge-source" +private_blob_environment_variables = ( + "AZURE_STORAGE_RESOURCE_ID_CONNECTION_STRING", + "AZURE_STORAGE_CONTAINER", + "AZURE_SEARCH_USER_ASSIGNED_IDENTITY", + "AZURE_AI_SERVICES_ENDPOINT", + "AZURE_AI_SERVICES_API_KEY", + "AZURE_SEARCH_EXPECTED_ANALYZER", + "AZURE_SEARCH_EXPECTED_FALLBACK_ANALYZER", +) def create_knowledge_source(): @@ -76,7 +97,9 @@ def update_knowledge_source(): from azure.search.documents.indexes.models import ( SearchIndexFieldReference, SearchIndexKnowledgeSource, + SearchIndexKnowledgeSourceFilterHint, SearchIndexKnowledgeSourceParameters, + SearchIndexKnowledgeSourceQueryHints, ) index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) @@ -90,6 +113,15 @@ def update_knowledge_source(): SearchIndexFieldReference(name="HotelId"), SearchIndexFieldReference(name="HotelName"), ], + query_hints=SearchIndexKnowledgeSourceQueryHints( + filters=[ + SearchIndexKnowledgeSourceFilterHint( + field="Category", + field_values=["Luxury", "Boutique"], + filter_instructions="Use Category when the user asks for a hotel type.", + ) + ] + ), ), ) @@ -102,14 +134,102 @@ def list_knowledge_sources(): # [START list_knowledge_sources] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient + from azure.search.documents.indexes.models import SearchIndexKnowledgeSource, SearchIndexKnowledgeSourceParameters index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - - for ks in index_client.list_knowledge_sources(): - print(f"Listed: knowledge source '{ks.name}'") + companion_name = f"{knowledge_source_name}-page" + companion = SearchIndexKnowledgeSource( + name=companion_name, + search_index_parameters=SearchIndexKnowledgeSourceParameters(search_index_name=index_name), + ) + index_client.create_or_update_knowledge_source(companion) + try: + sources = list( + index_client.list_knowledge_sources( + search=knowledge_source_name, + page_size=1, + search_type="prefix", + ) + ) + source_names = [source.name for source in sources] + assert set(source_names) == {knowledge_source_name, companion_name} + assert len(source_names) == len(set(source_names)) + print(f"Paged through {len(sources)} knowledge sources without duplicates") + finally: + index_client.delete_knowledge_source(companion_name) # [END list_knowledge_sources] +def create_private_blob_knowledge_source(): # pylint: disable=too-many-locals + missing_variables = [name for name in private_blob_environment_variables if not os.environ.get(name)] + if missing_variables: + print( + "Skipping private Blob knowledge source scenario; set these optional variables: " + + ", ".join(missing_variables) + ) + return + + # [START create_private_blob_knowledge_source] + from azure.core.credentials import AzureKeyCredential + from azure.search.documents.indexes import SearchIndexClient, SearchIndexerClient + from azure.search.documents.indexes.models import ( + AzureBlobKnowledgeSource, + AzureBlobKnowledgeSourceParameters, + SearchIndexerDataUserAssignedIdentity, + ) + from azure.search.documents.knowledgebases.models import AIServices, KnowledgeSourceIngestionParameters + + credential = AzureKeyCredential(key) + index_client = SearchIndexClient(service_endpoint, credential) + indexer_client = SearchIndexerClient(service_endpoint, credential) + private_source = AzureBlobKnowledgeSource( + name=private_blob_source_name, + azure_blob_parameters=AzureBlobKnowledgeSourceParameters( + connection_string=os.environ["AZURE_STORAGE_RESOURCE_ID_CONNECTION_STRING"], + container_name=os.environ["AZURE_STORAGE_CONTAINER"], + ingestion_parameters=KnowledgeSourceIngestionParameters( + identity=SearchIndexerDataUserAssignedIdentity( + resource_id=os.environ["AZURE_SEARCH_USER_ASSIGNED_IDENTITY"] + ), + content_extraction_mode="minimal", + ai_services=AIServices( + uri=os.environ["AZURE_AI_SERVICES_ENDPOINT"], + api_key=os.environ["AZURE_AI_SERVICES_API_KEY"], + ), + network_access_mode="private", + ), + ), + ) + try: + created = index_client.create_or_update_knowledge_source(private_source) + assert isinstance(created, AzureBlobKnowledgeSource) + assert created.azure_blob_parameters.ingestion_parameters is not None + assert created.azure_blob_parameters.ingestion_parameters.network_access_mode == "private" + resources = created.azure_blob_parameters.created_resources + assert resources is not None + data_source_name = resources.get("datasource") + indexer_name = resources.get("indexer") + generated_index_name = resources.get("index") + assert data_source_name and indexer_name and generated_index_name + + assert indexer_client.get_data_source_connection(data_source_name).name == data_source_name + assert indexer_client.get_indexer_status(indexer_name).status is not None + generated_index = index_client.get_index(generated_index_name) + analyzers = { + str(field.analyzer_name) + for field in generated_index.fields + if field.analyzer_name is not None + } + assert os.environ["AZURE_SEARCH_EXPECTED_ANALYZER"] in analyzers + assert os.environ["AZURE_SEARCH_EXPECTED_FALLBACK_ANALYZER"] in analyzers + print(f"Verified generated resources and analyzers: {sorted(analyzers)}") + finally: + index_client.delete_knowledge_source(private_blob_source_name) + indexer_client.close() + index_client.close() + # [END create_private_blob_knowledge_source] + + def delete_knowledge_source(): # [START delete_knowledge_source] from azure.core.credentials import AzureKeyCredential @@ -127,4 +247,5 @@ def delete_knowledge_source(): get_knowledge_source() update_knowledge_source() list_knowledge_sources() + create_private_blob_knowledge_source() delete_knowledge_source() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud_async.py index e32a0e020a9d..fcf8e32d5fcd 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_crud_async.py @@ -17,14 +17,25 @@ USAGE: python sample_knowledge_source_crud_async.py - Set the following environment variables before running the sample: + Set the following environment variables before running the standard CRUD scenarios: 1) AZURE_SEARCH_SERVICE_ENDPOINT - base URL of your Azure AI Search service (e.g., https://.search.windows.net) 2) AZURE_SEARCH_API_KEY - the admin key for your search service 3) AZURE_SEARCH_INDEX_NAME - target search index name. The index must have a semantic configuration (e.g., "hotels-sample-index"). -""" + The private Blob ingestion scenario runs only when all of these optional variables are set: + 4) AZURE_STORAGE_RESOURCE_ID_CONNECTION_STRING - ResourceId connection string for private Blob ingestion + 5) AZURE_STORAGE_CONTAINER - Blob container with supported and fallback language fixtures + 6) AZURE_SEARCH_USER_ASSIGNED_IDENTITY - user-assigned identity assigned to the Search service + 7) AZURE_AI_SERVICES_ENDPOINT - AI Services endpoint used for language detection + 8) AZURE_AI_SERVICES_API_KEY - AI Services API key + 9) AZURE_SEARCH_EXPECTED_ANALYZER - analyzer expected for the supported-language fixture + 10) AZURE_SEARCH_EXPECTED_FALLBACK_ANALYZER - analyzer expected for the fallback fixture + + The storage and AI Services shared private links must already be approved. Shared private-link + resources are control-plane resources and are not configured by this data-plane sample. +""" import asyncio import os @@ -33,6 +44,16 @@ index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] knowledge_source_name = "hotels-sample-knowledge-source" +private_blob_source_name = "hotels-private-blob-knowledge-source" +private_blob_environment_variables = ( + "AZURE_STORAGE_RESOURCE_ID_CONNECTION_STRING", + "AZURE_STORAGE_CONTAINER", + "AZURE_SEARCH_USER_ASSIGNED_IDENTITY", + "AZURE_AI_SERVICES_ENDPOINT", + "AZURE_AI_SERVICES_API_KEY", + "AZURE_SEARCH_EXPECTED_ANALYZER", + "AZURE_SEARCH_EXPECTED_FALLBACK_ANALYZER", +) async def create_knowledge_source_async(): @@ -79,7 +100,9 @@ async def update_knowledge_source_async(): from azure.search.documents.indexes.models import ( SearchIndexFieldReference, SearchIndexKnowledgeSource, + SearchIndexKnowledgeSourceFilterHint, SearchIndexKnowledgeSourceParameters, + SearchIndexKnowledgeSourceQueryHints, ) index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) @@ -93,6 +116,15 @@ async def update_knowledge_source_async(): SearchIndexFieldReference(name="HotelId"), SearchIndexFieldReference(name="HotelName"), ], + query_hints=SearchIndexKnowledgeSourceQueryHints( + filters=[ + SearchIndexKnowledgeSourceFilterHint( + field="Category", + field_values=["Luxury", "Boutique"], + filter_instructions="Use Category when the user asks for a hotel type.", + ) + ] + ), ), ) @@ -106,15 +138,103 @@ async def list_knowledge_sources_async(): # [START list_knowledge_sources_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient + from azure.search.documents.indexes.models import SearchIndexKnowledgeSource, SearchIndexKnowledgeSourceParameters index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) - + companion_name = f"{knowledge_source_name}-page" + companion = SearchIndexKnowledgeSource( + name=companion_name, + search_index_parameters=SearchIndexKnowledgeSourceParameters(search_index_name=index_name), + ) async with index_client: - async for ks in index_client.list_knowledge_sources(): - print(f"Listed: knowledge source '{ks.name}'") + await index_client.create_or_update_knowledge_source(companion) + try: + sources = [ + source + async for source in index_client.list_knowledge_sources( + search=knowledge_source_name, + page_size=1, + search_type="prefix", + ) + ] + source_names = [source.name for source in sources] + assert set(source_names) == {knowledge_source_name, companion_name} + assert len(source_names) == len(set(source_names)) + print(f"Paged through {len(sources)} knowledge sources without duplicates") + finally: + await index_client.delete_knowledge_source(companion_name) # [END list_knowledge_sources_async] +async def create_private_blob_knowledge_source_async(): # pylint: disable=too-many-locals + missing_variables = [name for name in private_blob_environment_variables if not os.environ.get(name)] + if missing_variables: + print( + "Skipping private Blob knowledge source scenario; set these optional variables: " + + ", ".join(missing_variables) + ) + return + + # [START create_private_blob_knowledge_source_async] + from azure.core.credentials import AzureKeyCredential + from azure.search.documents.indexes.aio import SearchIndexClient, SearchIndexerClient + from azure.search.documents.indexes.models import ( + AzureBlobKnowledgeSource, + AzureBlobKnowledgeSourceParameters, + SearchIndexerDataUserAssignedIdentity, + ) + from azure.search.documents.knowledgebases.models import AIServices, KnowledgeSourceIngestionParameters + + credential = AzureKeyCredential(key) + index_client = SearchIndexClient(service_endpoint, credential) + indexer_client = SearchIndexerClient(service_endpoint, credential) + private_source = AzureBlobKnowledgeSource( + name=private_blob_source_name, + azure_blob_parameters=AzureBlobKnowledgeSourceParameters( + connection_string=os.environ["AZURE_STORAGE_RESOURCE_ID_CONNECTION_STRING"], + container_name=os.environ["AZURE_STORAGE_CONTAINER"], + ingestion_parameters=KnowledgeSourceIngestionParameters( + identity=SearchIndexerDataUserAssignedIdentity( + resource_id=os.environ["AZURE_SEARCH_USER_ASSIGNED_IDENTITY"] + ), + content_extraction_mode="minimal", + ai_services=AIServices( + uri=os.environ["AZURE_AI_SERVICES_ENDPOINT"], + api_key=os.environ["AZURE_AI_SERVICES_API_KEY"], + ), + network_access_mode="private", + ), + ), + ) + async with index_client, indexer_client: + try: + created = await index_client.create_or_update_knowledge_source(private_source) + assert isinstance(created, AzureBlobKnowledgeSource) + assert created.azure_blob_parameters.ingestion_parameters is not None + assert created.azure_blob_parameters.ingestion_parameters.network_access_mode == "private" + resources = created.azure_blob_parameters.created_resources + assert resources is not None + data_source_name = resources.get("datasource") + indexer_name = resources.get("indexer") + generated_index_name = resources.get("index") + assert data_source_name and indexer_name and generated_index_name + + assert (await indexer_client.get_data_source_connection(data_source_name)).name == data_source_name + assert (await indexer_client.get_indexer_status(indexer_name)).status is not None + generated_index = await index_client.get_index(generated_index_name) + analyzers = { + str(field.analyzer_name) + for field in generated_index.fields + if field.analyzer_name is not None + } + assert os.environ["AZURE_SEARCH_EXPECTED_ANALYZER"] in analyzers + assert os.environ["AZURE_SEARCH_EXPECTED_FALLBACK_ANALYZER"] in analyzers + print(f"Verified generated resources and analyzers: {sorted(analyzers)}") + finally: + await index_client.delete_knowledge_source(private_blob_source_name) + # [END create_private_blob_knowledge_source_async] + + async def delete_knowledge_source_async(): # [START delete_knowledge_source_async] from azure.core.credentials import AzureKeyCredential @@ -133,4 +253,5 @@ async def delete_knowledge_source_async(): asyncio.run(get_knowledge_source_async()) asyncio.run(update_knowledge_source_async()) asyncio.run(list_knowledge_sources_async()) + asyncio.run(create_private_blob_knowledge_source_async()) asyncio.run(delete_knowledge_source_async()) diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview.py index eded6470ceed..af38d7304d7c 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview.py @@ -32,7 +32,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview_async.py index dc0574cba0da..d10b7650d3bb 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_data_agent_preview_async.py @@ -33,7 +33,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview.py index 1ba4a0b1cf35..1234fe46623d 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview.py @@ -32,7 +32,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview_async.py index 34cd9ab49f5e..1f0b5f583fa8 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_fabric_ontology_preview_async.py @@ -33,7 +33,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py index 7b4fcd1f50fb..e3401f6e6d11 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview.py @@ -28,7 +28,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -37,7 +36,7 @@ upload_file_name = "hotels.txt" -def main(): +def main(): # pylint: disable=too-many-locals # [START sample_knowledge_source_file_preview] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient @@ -110,6 +109,18 @@ def main(): print(f"Uploaded: file '{uploaded_file.file_name}'") assert uploaded_file.file_id is not None + annex_file = index_client.upload_knowledge_source_file_multipart( + name=knowledge_source_name, + body=UploadKnowledgeSourceFileMultipartRequest( + metadata=FileUploadMetadata( + file_name="hotels/annex.txt", + metadata={"category": "hotel", "city": "Portland"}, + ), + content=("annex.txt", b"Harbor Hotel Annex has meeting rooms.", "text/plain"), + ), + ) + assert annex_file.file_id is not None + updated_file = index_client.update_knowledge_source_file( file_id=uploaded_file.file_id, name=knowledge_source_name, @@ -123,17 +134,23 @@ def main(): ), ) print(f"Updated: file '{updated_file.file_name}'") + assert updated_file.metadata == {"category": "hotel", "city": "Seattle"} + assert updated_file.parsing_mode is not None + assert updated_file.extraction_mode in {"minimal", "standard"} files = list( index_client.list_knowledge_source_files( knowledge_source_name, prefix="hotels/", search="hotels", - page_size=10, + page_size=1, search_type="prefix", ) ) - print(f"Files: {len(files)}") + file_ids = [file.file_id for file in files] + assert set(file_ids) == {uploaded_file.file_id, annex_file.file_id} + assert len(file_ids) == len(set(file_ids)) + print(f"Paged through {len(files)} files without duplicates") retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name @@ -154,6 +171,10 @@ def main(): print_retrieval_summary(retrieval_result) finally: retrieval_client.close() + + index_client.delete_knowledge_source_file(knowledge_source_name, uploaded_file.file_id) + index_client.delete_knowledge_source_file(knowledge_source_name, annex_file.file_id) + print("Deleted both uploaded files") # [END sample_knowledge_source_file_preview] finally: cleanup_resources( diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py index 8f5331cd9105..f5fd14d16f9d 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_file_preview_async.py @@ -29,7 +29,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -38,7 +37,7 @@ upload_file_name = "hotels.txt" -async def main(): +async def main(): # pylint: disable=too-many-locals # [START sample_knowledge_source_file_preview_async] from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes.aio import SearchIndexClient @@ -112,6 +111,18 @@ async def main(): print(f"Uploaded: file '{uploaded_file.file_name}'") assert uploaded_file.file_id is not None + annex_file = await index_client.upload_knowledge_source_file_multipart( + name=knowledge_source_name, + body=UploadKnowledgeSourceFileMultipartRequest( + metadata=FileUploadMetadata( + file_name="hotels/annex.txt", + metadata={"category": "hotel", "city": "Portland"}, + ), + content=("annex.txt", b"Harbor Hotel Annex has meeting rooms.", "text/plain"), + ), + ) + assert annex_file.file_id is not None + updated_file = await index_client.update_knowledge_source_file( file_id=uploaded_file.file_id, name=knowledge_source_name, @@ -125,6 +136,9 @@ async def main(): ), ) print(f"Updated: file '{updated_file.file_name}'") + assert updated_file.metadata == {"category": "hotel", "city": "Seattle"} + assert updated_file.parsing_mode is not None + assert updated_file.extraction_mode in {"minimal", "standard"} files = [ file @@ -132,11 +146,14 @@ async def main(): knowledge_source_name, prefix="hotels/", search="hotels", - page_size=10, + page_size=1, search_type="prefix", ) ] - print(f"Files: {len(files)}") + file_ids = [file.file_id for file in files] + assert set(file_ids) == {uploaded_file.file_id, annex_file.file_id} + assert len(file_ids) == len(set(file_ids)) + print(f"Paged through {len(files)} files without duplicates") retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name @@ -157,6 +174,10 @@ async def main(): print_retrieval_summary(retrieval_result) finally: await retrieval_client.close() + + await index_client.delete_knowledge_source_file(knowledge_source_name, uploaded_file.file_id) + await index_client.delete_knowledge_source_file(knowledge_source_name, annex_file.file_id) + print("Deleted both uploaded files") # [END sample_knowledge_source_file_preview_async] finally: await cleanup_resources_async( diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview.py index 959f4fb989ea..91e19d6e8533 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview.py @@ -26,7 +26,6 @@ setup_hotel_index, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview_async.py index 23bd233179cc..6ed44fe3a34b 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_freshness_preview_async.py @@ -27,7 +27,6 @@ setup_hotel_index_async, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview.py index d9fd53c7eb6c..487f403d38fe 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview.py @@ -31,7 +31,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview_async.py index 75bdac090f00..4fa4eeb10c25 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_mcp_server_preview_async.py @@ -32,7 +32,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py index 9456b78d3da3..f977ba54f5e2 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview.py @@ -7,7 +7,9 @@ """ DESCRIPTION: - Demonstrates preview Work IQ knowledge source setup and retrieval. + Demonstrates preview Work IQ knowledge source setup and retrieval. The federated credential + must trust the managed identity used by the Search service, and the Entra app must have the + WorkIQAgent.Ask delegated permission before this sample runs. USAGE: python sample_knowledge_source_workiq_preview.py @@ -29,7 +31,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -58,21 +59,31 @@ def main(): index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) try: + tenant_id = os.getenv("AZURE_WORKIQ_TENANT_ID") + entra_authentication = EntraAppAuthentication( + application_id=os.environ["AZURE_WORKIQ_APPLICATION_ID"], + federated_credential_id=os.environ["AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID"], + tenant_id=tenant_id, + ) + if tenant_id is None: + assert entra_authentication.tenant_id is None + print("Tenant omitted: Search uses the Search service tenant.") + knowledge_source = WorkIQKnowledgeSource( name=knowledge_source_name, description="Hotel Work IQ knowledge source", work_iq_parameters=WorkIQKnowledgeSourceParameters( - entra_app_authentication=EntraAppAuthentication( - application_id=os.environ["AZURE_WORKIQ_APPLICATION_ID"], - federated_credential_id=os.environ["AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID"], - tenant_id=os.getenv("AZURE_WORKIQ_TENANT_ID"), - ) + entra_app_authentication=entra_authentication, ), ) created_knowledge_source = index_client.create_or_update_knowledge_source(knowledge_source) print(f"Created: knowledge source '{created_knowledge_source.name}'") retrieved_knowledge_source = index_client.get_knowledge_source(knowledge_source_name) + assert isinstance(retrieved_knowledge_source, WorkIQKnowledgeSource) + assert retrieved_knowledge_source.work_iq_parameters.entra_app_authentication.application_id == ( + os.environ["AZURE_WORKIQ_APPLICATION_ID"] + ) print(f"Retrieved: knowledge source '{retrieved_knowledge_source.name}'") knowledge_base = KnowledgeBase( @@ -100,9 +111,10 @@ def main(): ) ], ) + work_iq_user_assertion = os.environ["AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION"] retrieval_result = retrieval_client.retrieve( request, - query_work_iq_source_authorization=os.environ["AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION"], + query_work_iq_source_authorization=work_iq_user_assertion, ) finally: retrieval_client.close() diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py index a533fc3dadf9..1ac458ed8d28 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_source_workiq_preview_async.py @@ -7,7 +7,9 @@ """ DESCRIPTION: - Demonstrates preview Work IQ knowledge source setup and retrieval using async clients. + Demonstrates preview Work IQ knowledge source setup and retrieval using async clients. The + federated credential must trust the managed identity used by the Search service, and the Entra + app must have the WorkIQAgent.Ask delegated permission before this sample runs. USAGE: python sample_knowledge_source_workiq_preview_async.py @@ -30,7 +32,6 @@ print_retrieval_summary, ) - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] key = os.environ["AZURE_SEARCH_API_KEY"] run_tag = get_sample_run_tag() @@ -60,21 +61,31 @@ async def main(): index_client = SearchIndexClient(service_endpoint, AzureKeyCredential(key)) async with index_client: try: + tenant_id = os.getenv("AZURE_WORKIQ_TENANT_ID") + entra_authentication = EntraAppAuthentication( + application_id=os.environ["AZURE_WORKIQ_APPLICATION_ID"], + federated_credential_id=os.environ["AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID"], + tenant_id=tenant_id, + ) + if tenant_id is None: + assert entra_authentication.tenant_id is None + print("Tenant omitted: Search uses the Search service tenant.") + knowledge_source = WorkIQKnowledgeSource( name=knowledge_source_name, description="Hotel Work IQ knowledge source", work_iq_parameters=WorkIQKnowledgeSourceParameters( - entra_app_authentication=EntraAppAuthentication( - application_id=os.environ["AZURE_WORKIQ_APPLICATION_ID"], - federated_credential_id=os.environ["AZURE_WORKIQ_FEDERATED_CREDENTIAL_ID"], - tenant_id=os.getenv("AZURE_WORKIQ_TENANT_ID"), - ) + entra_app_authentication=entra_authentication, ), ) created_knowledge_source = await index_client.create_or_update_knowledge_source(knowledge_source) print(f"Created: knowledge source '{created_knowledge_source.name}'") retrieved_knowledge_source = await index_client.get_knowledge_source(knowledge_source_name) + assert isinstance(retrieved_knowledge_source, WorkIQKnowledgeSource) + assert retrieved_knowledge_source.work_iq_parameters.entra_app_authentication.application_id == ( + os.environ["AZURE_WORKIQ_APPLICATION_ID"] + ) print(f"Retrieved: knowledge source '{retrieved_knowledge_source.name}'") knowledge_base = KnowledgeBase( @@ -102,9 +113,10 @@ async def main(): ) ], ) + work_iq_user_assertion = os.environ["AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION"] retrieval_result = await retrieval_client.retrieve( request, - query_work_iq_source_authorization=os.environ["AZURE_SEARCH_QUERY_WORK_IQ_SOURCE_AUTHORIZATION"], + query_work_iq_source_authorization=work_iq_user_assertion, ) finally: await retrieval_client.close() diff --git a/sdk/search/azure-search-documents/samples/sample_query_autocomplete_async.py b/sdk/search/azure-search-documents/samples/sample_query_autocomplete_async.py index 454d19538e74..8235906e7d78 100644 --- a/sdk/search/azure-search-documents/samples/sample_query_autocomplete_async.py +++ b/sdk/search/azure-search-documents/samples/sample_query_autocomplete_async.py @@ -22,7 +22,6 @@ import os import asyncio - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] diff --git a/sdk/search/azure-search-documents/samples/sample_query_facets_async.py b/sdk/search/azure-search-documents/samples/sample_query_facets_async.py index 39a98cc94f0b..7baa17ae97be 100644 --- a/sdk/search/azure-search-documents/samples/sample_query_facets_async.py +++ b/sdk/search/azure-search-documents/samples/sample_query_facets_async.py @@ -22,7 +22,6 @@ import os import asyncio - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] diff --git a/sdk/search/azure-search-documents/samples/sample_query_filter_async.py b/sdk/search/azure-search-documents/samples/sample_query_filter_async.py index 4083b2446be1..6e48d0b0b599 100644 --- a/sdk/search/azure-search-documents/samples/sample_query_filter_async.py +++ b/sdk/search/azure-search-documents/samples/sample_query_filter_async.py @@ -22,7 +22,6 @@ import os import asyncio - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] diff --git a/sdk/search/azure-search-documents/samples/sample_query_simple_async.py b/sdk/search/azure-search-documents/samples/sample_query_simple_async.py index 8bc4efba8373..be949499ed27 100644 --- a/sdk/search/azure-search-documents/samples/sample_query_simple_async.py +++ b/sdk/search/azure-search-documents/samples/sample_query_simple_async.py @@ -20,7 +20,6 @@ import os import asyncio - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] diff --git a/sdk/search/azure-search-documents/samples/sample_query_suggestions_async.py b/sdk/search/azure-search-documents/samples/sample_query_suggestions_async.py index cc70c799b77c..7a67ed9141aa 100644 --- a/sdk/search/azure-search-documents/samples/sample_query_suggestions_async.py +++ b/sdk/search/azure-search-documents/samples/sample_query_suggestions_async.py @@ -20,7 +20,6 @@ import os import asyncio - service_endpoint = os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"] index_name = os.environ["AZURE_SEARCH_INDEX_NAME"] key = os.environ["AZURE_SEARCH_API_KEY"] diff --git a/sdk/search/azure-search-documents/tests/_search_helpers_async.py b/sdk/search/azure-search-documents/tests/_search_helpers_async.py index 96de51e55e44..30d627650b90 100644 --- a/sdk/search/azure-search-documents/tests/_search_helpers_async.py +++ b/sdk/search/azure-search-documents/tests/_search_helpers_async.py @@ -36,7 +36,6 @@ build_knowledge_source, ) - # --------------------------------------------------------------------------- # Shared operations # --------------------------------------------------------------------------- diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live.py b/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live.py index 839697b1ad19..0e012cd2f1bc 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Live tests for ``SearchIndexClient`` alias operations.""" + from __future__ import annotations import pytest diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live_async.py index 79f21e605558..3df5c1e77113 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live_async.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_aliases_live_async.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Async live tests for ``SearchIndexClient`` alias operations.""" + from __future__ import annotations import pytest diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live.py b/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live.py index f5b118b02e0f..b1bbb5e7684a 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Live tests for ``SearchIndexClient`` index operations.""" + from __future__ import annotations from datetime import timedelta diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live_async.py index e1de9580fe7a..89877443eabf 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live_async.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_indexes_live_async.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Async live tests for ``SearchIndexClient`` index operations.""" + from __future__ import annotations from datetime import timedelta diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live.py b/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live.py index 0e81944c6f8b..c2f153d9b9b0 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Live tests for ``SearchIndexClient`` synonym map operations.""" + from __future__ import annotations import pytest diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live_async.py index 1d6744a6a503..7a2cc5cc9b0c 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live_async.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_synonym_maps_live_async.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Async live tests for ``SearchIndexClient`` synonym map operations.""" + from __future__ import annotations import pytest diff --git a/sdk/search/azure-search-documents/tests/test_search_index_model.py b/sdk/search/azure-search-documents/tests/test_search_index_model.py index 2281186ae7bc..56fa6ae6c16b 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_model.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_model.py @@ -14,7 +14,6 @@ SimpleField, ) - INDEX_NAME = "hotels" diff --git a/sdk/search/azure-search-documents/tests/test_search_indexer_models.py b/sdk/search/azure-search-documents/tests/test_search_indexer_models.py index 7ea6774019d5..9dcb2075336b 100644 --- a/sdk/search/azure-search-documents/tests/test_search_indexer_models.py +++ b/sdk/search/azure-search-documents/tests/test_search_indexer_models.py @@ -29,7 +29,6 @@ from _capabilities import require_capability - DATA_SOURCE_NAME = "hotel-data-source" CONNECTION_STRING = ( "ResourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/search/" diff --git a/sdk/search/azure-search-documents/tsp-location.yaml b/sdk/search/azure-search-documents/tsp-location.yaml index aabc59c494f9..372652855f81 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: 84400eeb46c48ffe88d81e126449725508c17547 +commit: c195a3fe73b28cd90bf8a302944b2c0ec3d80def repo: Azure/azure-rest-api-specs From 1564a405f0203f11a0b77f7b3525e76ef023425c Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Mon, 24 Aug 2026 18:08:30 +0000 Subject: [PATCH 14/17] Final regen --- .../Set-LiveTestEnvironment.sample.ps1 | 12 +- .../scripts/apply_generator_workarounds.py | 36 +- .../azure-search-documents/CHANGELOG.md | 12 +- sdk/search/azure-search-documents/GAPS.md | 98 +++ sdk/search/azure-search-documents/api.md | 653 ++++-------------- .../azure-search-documents/api.metadata.yml | 2 +- .../indexes/_operations/_operations.py | 2 +- .../documents/indexes/_operations/_patch.py | 28 +- .../indexes/aio/_operations/_operations.py | 2 +- .../indexes/aio/_operations/_patch.py | 28 +- .../azure/search/documents/indexes/types.py | 15 +- .../documents/knowledgebases/_stream.py | 4 + .../azure/search/documents/models/__init__.py | 2 + .../tests/_capabilities.py | 44 +- .../azure-search-documents/tests/conftest.py | 5 + .../tests/search_service_preparer.py | 6 + .../tests/test_capabilities.py | 22 + .../tests/test_generator_workarounds.py | 24 + .../test_knowledge_base_retrieval_client.py | 3 + ...t_knowledge_base_retrieval_client_async.py | 43 ++ .../tests/test_search_index_client.py | 52 ++ .../tests/test_search_index_client_async.py | 53 ++ ...ndex_client_knowledge_source_files_live.py | 156 +++++ ...lient_knowledge_source_files_live_async.py | 157 +++++ 24 files changed, 912 insertions(+), 547 deletions(-) create mode 100644 sdk/search/azure-search-documents/GAPS.md create mode 100644 sdk/search/azure-search-documents/tests/test_capabilities.py create mode 100644 sdk/search/azure-search-documents/tests/test_generator_workarounds.py create mode 100644 sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py create mode 100644 sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/Set-LiveTestEnvironment.sample.ps1 b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/Set-LiveTestEnvironment.sample.ps1 index dd60dba1196d..06dac78340c7 100644 --- a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/Set-LiveTestEnvironment.sample.ps1 +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/Set-LiveTestEnvironment.sample.ps1 @@ -12,9 +12,19 @@ $env:SEARCH_SERVICE_ENDPOINT = "https://.search.windows.net $env:SEARCH_SERVICE_NAME = "" $env:SEARCH_STORAGE_CONNECTION_STRING = "" $env:SEARCH_STORAGE_CONTAINER_NAME = "" +$env:SEARCH_AZURE_OPENAI_ENDPOINT = "https://.openai.azure.com" +$env:SEARCH_AZURE_OPENAI_EMBEDDING_DEPLOYMENT = "" +$env:SEARCH_AZURE_OPENAI_EMBEDDING_MODEL = "" # Uncomment when recording live tests. # $env:AZURE_TEST_RUN_LIVE = "true" -# Uncomment if you need to authenticate before live tests. +# Option 1: authenticate with Azure CLI and uncomment the auth selector. # az login --tenant "" +# $env:AZURE_TEST_USE_CLI_AUTH = "true" + +# Option 2: configure a test service principal. Keep these values only in the +# untracked Set-LiveTestEnvironment.ps1 file. +# $env:AZURE_TENANT_ID = "" +# $env:AZURE_CLIENT_ID = "" +# $env:AZURE_CLIENT_SECRET = "" diff --git a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py index b3a4314ae49d..5cba52dd0f8b 100644 --- a/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py +++ b/sdk/search/azure-search-documents/.github/skills/azure-search-documents/scripts/apply_generator_workarounds.py @@ -17,6 +17,7 @@ class Replacement: description: str generated: str patched: str + applies_when: str | None = None REPLACEMENTS = ( @@ -47,6 +48,7 @@ class Replacement: "use the imported SemanticQueryRewritesResultType enum", '"@search.semanticQueryRewritesResultType": Union[str, "_enums.SemanticQueryRewritesResultType"],', '"@search.semanticQueryRewritesResultType": Union[str, "SemanticQueryRewritesResultType"],', + applies_when="@search.semanticQueryRewritesResultType", ), Replacement( "azure/search/documents/knowledgebases/types.py", @@ -58,6 +60,7 @@ class Replacement: """ KnowledgeSourceIngestionPermissionOption, KnowledgeSourceResultsProcessing, """, + applies_when="KnowledgeSourceIngestionPermissionOption", ), Replacement( "azure/search/documents/indexes/types.py", @@ -120,25 +123,32 @@ class Replacement: """ ), ), + Replacement( + "azure/search/documents/indexes/types.py", + "import KnowledgeSourceIngestionParameters from the public models namespace", + " from ..knowledgebases.types import KnowledgeRetrievalReasoningEffort, KnowledgeSourceIngestionParameters\n", + " from ..knowledgebases.models import KnowledgeSourceIngestionParameters\n" + " from ..knowledgebases.types import KnowledgeRetrievalReasoningEffort\n", + ), Replacement( "azure/search/documents/indexes/_operations/_operations.py", "suppress protected access for the generated SearchIndexResponse type", - """list[_models1._models.SearchIndexResponse], - deserialized.get("value", []), - """, - """list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access - deserialized.get("value", []), - """, + " list[_models1._models.SearchIndexResponse],\n" + ' deserialized.get("value", []),\n' + " )", + " list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access\n" + ' deserialized.get("value", []),\n' + " )", ), Replacement( "azure/search/documents/indexes/aio/_operations/_operations.py", "suppress protected access for the generated async SearchIndexResponse type", - """list[_models2._models.SearchIndexResponse], - deserialized.get("value", []), - """, - """list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access - deserialized.get("value", []), - """, + " list[_models2._models.SearchIndexResponse],\n" + ' deserialized.get("value", []),\n' + " )", + " list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access\n" + ' deserialized.get("value", []),\n' + " )", ), ) @@ -158,6 +168,8 @@ def update_sources(*, check: bool) -> int: pending.append(replacement.description) elif generated_count == 0 and patched_count == 1: continue + elif replacement.applies_when is not None and replacement.applies_when not in source: + continue else: raise RuntimeError( f"Unexpected emitter output in {replacement.path} while attempting to " diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 39a405261ee0..2f7d81c14c58 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -36,8 +36,8 @@ - Knowledge base `tags` and persisted `retrieve_defaults`. - Per-source `never_query_source`, `results_processing`, and `query_hint_overrides`. - `KnowledgeRetrievalAutoReasoningEffort` for automatic reasoning-effort selection. - - Activity start/completion timestamps, model metadata, logical reasoning effort, query-hint - processing details, and served-image metadata. + - Activity start/completion timestamps, model metadata, query-hint processing details, and + served-image metadata. - Citation URLs on index-backed knowledge base references. - Private ingestion networking through `KnowledgeSourceNetworkAccessMode`. - Added Work IQ configuration through `EntraAppAuthentication` and @@ -70,10 +70,16 @@ ### Bugs Fixed +- Normalized `SearchIndexClient.update_knowledge_source_file` and its asynchronous equivalent to + use the name-first signature `(name, file_id, body)`, consistent with the other File knowledge + source operations. +- Published the synchronous and asynchronous knowledge base retrieval stream classes from their + respective public namespaces. + ### Other Changes - Updated `tsp-location.yaml` to target spec commit - `84400eeb46c48ffe88d81e126449725508c17547` (`2026-08-01-preview`). + `c195a3fe73b28cd90bf8a302944b2c0ec3d80def` (`2026-08-01-preview`). - Added Python 3.14 support. ## 12.1.0b1 (2026-05-28) diff --git a/sdk/search/azure-search-documents/GAPS.md b/sdk/search/azure-search-documents/GAPS.md new file mode 100644 index 000000000000..2616a10bd675 --- /dev/null +++ b/sdk/search/azure-search-documents/GAPS.md @@ -0,0 +1,98 @@ +# Azure Search Documents 2026-08-01-preview Gap Disposition + +This report verifies the Python SDK against Azure/azure-rest-api-specs commit +`c195a3fe73b28cd90bf8a302944b2c0ec3d80def` and the package-specific regeneration, +testing, and release guidance. + +## Resolved locally + +| Finding | Resolution | +|---|---| +| File update argument order | Added sync and async `_patch.py` wrappers exposing `update_knowledge_source_file(name, file_id, body)` and forwarding to generated code by keyword. Focused tests verify both signatures and delegation. | +| Stream class namespace | Set `KnowledgeBaseRetrievalStream.__module__` to `azure.search.documents.knowledgebases` and `AsyncKnowledgeBaseRetrievalStream.__module__` to `azure.search.documents.knowledgebases.aio`. | +| File operation coverage | Added sync and async tests for the customized File update operation. Registered both update and multipart upload operations in the preview capability surface. | +| Listing capability and wrapper coverage | Registered `search`, `page_size`, and `search_type` on all August list surfaces, plus File-list `prefix`. Added sync and async forwarding tests for the four SDK-owned list wrappers. | +| Streaming asymmetry | Added async deserialization coverage for all known event types and mirrored both authorization-header forwarding assertions in sync and async tests. | +| Stale preview capabilities | Removed `WorkIQAttribution`, `McpServerTool.inclusion_mode`, and removed inclusion-mode enum members. Added `KnowledgeBaseWorkIQReference.search_sensitivity_label_info` and current August operation/parameter capabilities. All registered capabilities now resolve. | +| Generator workaround drift | Added a package test that executes `apply_generator_workarounds.py --check`. Updated the script to skip obsolete issue shapes only when the affected generated feature is absent, while retaining fail-fast behavior for unknown output. | +| Generated ingestion-parameter import | Corrected the generated `indexes.types` type-only import to resolve `KnowledgeSourceIngestionParameters` from the public `knowledgebases.models` namespace. Added the exact repair to the package-owned post-generation workaround. | +| APIView artifact refresh | Regenerated `api.md` and `api.metadata.yml` from the fresh token. The artifact now shows `update_knowledge_source_file(name, file_id, body)` and both stream classes in their public namespaces. | +| Release notes | Updated the pinned TypeSpec commit, removed the post-cut logical-reasoning claim, and recorded the SDK-owned signature and namespace fixes. | + +## Findings rejected + +### Generated `types` modules are not missing from `__all__` + +The three `types` modules are explicitly importable and documented. Azure SDK package `__all__` +lists public symbols for wildcard imports, not submodule objects. Adding `types` would diverge from +repository-wide generated package conventions without improving explicit imports or APIView. + +### Generated base-client API-version prose is not the exported client contract + +Generated base clients describe `api_version=None`, meaning “use the operation default.” The +exported clients are package `_patch.py` subclasses whose docstrings name +`ApiVersion.V2026_08_01_PREVIEW`, and every configuration resolves an omitted value to +`"2026-08-01-preview"`. Editing generated base files would be overwritten and is prohibited by the +package customization guide. + +### Shared event exports in the async namespace are intentional convenience exports + +`KnowledgeBaseRetrievalEvent` and `KnowledgeBaseRetrievalEventData` are transport-neutral event +types used by both stream implementations. Keeping them available from the async namespace avoids +forcing async users to import the synchronous package. Their canonical module remains +`azure.search.documents.knowledgebases`; removing the async aliases would be an unnecessary preview +breaking change. + +## Remaining gaps + +### Multipart File service recording + +The new multipart upload and update service behavior does not yet have a recorded live pytest using +a File knowledge source. Public surface, request models, samples, capability registration, and the +SDK-owned update wrapper are covered locally, but a Test Proxy recording requires provisioned File +knowledge-source resources. Before declaring live-sample coverage complete, record matching sync and +async tests for multipart upload/update and push the updated `assets.json` tag. This does not block +unit, MyPy, Pylint, Sphinx, or existing playback validation. + +### Changelog verifier integration + +The package `CHANGELOG.md` is updated for `12.1.0b2`, but `azpysdk changelog verify` cannot use the +repository-pinned Chronus installation because the launcher hardcodes `.github/package.json` and +`.github/node_modules/.bin/chronus`; the actual pinned project and lockfile are under +`.github/chronus`. Invoking that pinned Chronus binary directly reports that +`azure-search-documents` has no pending changeset. The package release guide still documents direct +`CHANGELOG.md` maintenance, and adding a `feature` changeset would request a new minor version rather +than the planned beta patch. The repository changelog-tool owner should reconcile the launcher path +and release workflow before Chronus verification is treated as a package blocker. + +## APIView export environment disposition + +`azpysdk apistub .` successfully generates a fresh `azure-search-documents_python.json` token. The +token contains the corrected public `update_knowledge_source_file(name, file_id, body)` signature and +the public stream namespaces. + +The system-installed PowerShell 7.6.4 runtime aborted with a stack overflow on every command tested, +including `1+1`, `Write-Output`, and two-byte JSON parsing. Package integrity verification reported +no modified installed files. Side-by-side Microsoft PowerShell 7.6.3 and 7.5.9 packages passed the +same runtime smoke tests, identifying 7.6.4 as the regression boundary. The APIView failure also +reproduced for the released `azure-search-documents==12.1.0b1` wheel, proving it was not caused by +this SDK surface. PowerShell 7.5.9 completed the supported `azpysdk apistub .` workflow. No API +artifact was hand-edited. + +## Local release validation + +The following checks pass on the final local package: + +- Tests: 336 passed, with no failures, skips, or warnings. +- MyPy: 74 source files and 64 sample files pass. +- Pylint: no warnings or errors. +- Sphinx: strict build passes with no warnings. +- Black: formatting passes with no changes. +- VerifyTypes: passes with 99.5% completeness; remaining partial types are existing dynamic + patch/mixin annotations and are nonblocking. +- Import-all, sdist verification, wheel verification, and Bandit all pass. + +The aggregate Azure SDK MCP check could not start its server, so equivalent local `azpysdk` checks +were run individually. APIView token, Markdown, and metadata generation pass with PowerShell 7.5.9; +the system PowerShell 7.6.4 installation remains unusable and should be downgraded or repaired before +future APIView regeneration. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/api.md b/sdk/search/azure-search-documents/api.md index eabde2ddc129..07882a1711a0 100644 --- a/sdk/search/azure-search-documents/api.md +++ b/sdk/search/azure-search-documents/api.md @@ -864,6 +864,9 @@ namespace azure.search.documents.indexes def get_synonym_maps( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SynonymMap]: ... @@ -957,21 +960,12 @@ namespace azure.search.documents.indexes **kwargs: Any ) -> HttpResponse: ... - @overload + @distributed_trace def update_knowledge_source_file( self, - file_id: str, name: str, - body: UpdateKnowledgeSourceFileRequest, - **kwargs: Any - ) -> KnowledgeSourceFile: ... - - @overload - def update_knowledge_source_file( - self, file_id: str, - name: str, - body: UpdateKnowledgeSourceFileRequest, + body: Union[UpdateKnowledgeSourceFileRequest, UpdateKnowledgeSourceFileRequest], **kwargs: Any ) -> KnowledgeSourceFile: ... @@ -1171,6 +1165,9 @@ namespace azure.search.documents.indexes def get_data_source_connections( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SearchIndexerDataSourceConnection]: ... @@ -1196,6 +1193,9 @@ namespace azure.search.documents.indexes def get_indexers( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SearchIndexer]: ... @@ -1214,6 +1214,9 @@ namespace azure.search.documents.indexes def get_skillsets( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SearchIndexerSkillset]: ... @@ -1590,6 +1593,9 @@ namespace azure.search.documents.indexes.aio async def get_synonym_maps( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SynonymMap]: ... @@ -1683,21 +1689,12 @@ namespace azure.search.documents.indexes.aio **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: ... - @overload + @distributed_trace_async async def update_knowledge_source_file( self, - file_id: str, name: str, - body: UpdateKnowledgeSourceFileRequest, - **kwargs: Any - ) -> KnowledgeSourceFile: ... - - @overload - async def update_knowledge_source_file( - self, file_id: str, - name: str, - body: UpdateKnowledgeSourceFileRequest, + body: Union[UpdateKnowledgeSourceFileRequest, UpdateKnowledgeSourceFileRequest], **kwargs: Any ) -> KnowledgeSourceFile: ... @@ -1897,6 +1894,9 @@ namespace azure.search.documents.indexes.aio async def get_data_source_connections( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SearchIndexerDataSourceConnection]: ... @@ -1922,6 +1922,9 @@ namespace azure.search.documents.indexes.aio async def get_indexers( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SearchIndexer]: ... @@ -1940,6 +1943,9 @@ namespace azure.search.documents.indexes.aio async def get_skillsets( self, *, + page_size: Optional[int] = ..., + search: Optional[str] = ..., + search_type: Optional[Union[str, ListingSearchType]] = ..., select: Optional[List[str]] = ..., **kwargs: Any ) -> List[SearchIndexerSkillset]: ... @@ -8144,7 +8150,7 @@ namespace azure.search.documents.indexes.types key "description": str key "identity": Optional[SearchIndexerDataIdentity] key "subdomainUrl": Required[str] - @odata.type: Literal[#AIServicesByIdentity] + ``@odata.type``: Literal[#AIServicesByIdentity] description: str identity: SearchIndexerDataIdentity subdomainUrl: str @@ -8155,7 +8161,7 @@ namespace azure.search.documents.indexes.types key "description": str key "key": Required[str] key "subdomainUrl": Required[str] - @odata.type: Literal[#AIServicesByKey] + ``@odata.type``: Literal[#AIServicesByKey] description: str key: str subdomainUrl: str @@ -8181,11 +8187,6 @@ namespace azure.search.documents.indexes.types name: str - class azure.search.documents.indexes.types.AnalyzeResult(TypedDict, total=False): - key "tokens": Required[list[AnalyzedTokenInfo]] - tokens: list[AnalyzedTokenInfo] - - class azure.search.documents.indexes.types.AnalyzeTextOptions(TypedDict, total=False): key "analyzer": Union[str, LexicalAnalyzerName] key "normalizer": Union[str, LexicalNormalizerName] @@ -8199,22 +8200,11 @@ namespace azure.search.documents.indexes.types tokenizer: Union[str, LexicalTokenizerName] - class azure.search.documents.indexes.types.AnalyzedTokenInfo(TypedDict, total=False): - key "endOffset": Required[int] - key "position": Required[int] - key "startOffset": Required[int] - key "token": Required[str] - endOffset: int - position: int - startOffset: int - token: str - - class azure.search.documents.indexes.types.AsciiFoldingTokenFilter(TypedDict): key "@odata.type": Required[Literal["#AsciiFoldingTokenFilter"]] key "name": Required[str] key "preserveOriginal": bool - @odata.type: Literal[#AsciiFoldingTokenFilter] + ``@odata.type``: Literal[#AsciiFoldingTokenFilter] name: str preserveOriginal: bool @@ -8234,7 +8224,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.AZURE_BLOB]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str azureBlobParameters: AzureBlobKnowledgeSourceParameters description: str encryptionKey: SearchResourceEncryptionKey @@ -8288,7 +8278,7 @@ namespace azure.search.documents.indexes.types key "resourceId": Optional[str] key "timeout": Optional[str] key "uri": Optional[str] - @odata.type: Literal[#AmlSkill] + ``@odata.type``: Literal[#AmlSkill] context: str degreeOfParallelism: int description: str @@ -8324,7 +8314,7 @@ namespace azure.search.documents.indexes.types key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] key "resourceUri": str - @odata.type: Literal[#AzureOpenAIEmbeddingSkill] + ``@odata.type``: Literal[#AzureOpenAIEmbeddingSkill] apiKey: str authIdentity: SearchIndexerDataIdentity context: str @@ -8370,7 +8360,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#BM25Similarity"]] key "b": Optional[float] key "k1": Optional[float] - @odata.type: Literal[#BM25Similarity] + ``@odata.type``: Literal[#BM25Similarity] b: float k1: float @@ -8445,7 +8435,7 @@ namespace azure.search.documents.indexes.types key "outputs": Required[list[OutputFieldMappingEntry]] key "responseFormat": ForwardRef('ChatCompletionResponseFormat', module='types') key "uri": Required[str] - @odata.type: Literal[#ChatCompletionSkill] + ``@odata.type``: Literal[#ChatCompletionSkill] apiKey: str authIdentity: SearchIndexerDataIdentity commonModelParameters: ChatCompletionCommonModelParameters @@ -8464,7 +8454,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#CjkBigramTokenFilter"]] key "name": Required[str] key "outputUnigrams": bool - @odata.type: Literal[#CjkBigramTokenFilter] + ``@odata.type``: Literal[#CjkBigramTokenFilter] ignoreScripts: list[Union[str, CjkBigramTokenFilterScripts]] name: str outputUnigrams: bool @@ -8472,14 +8462,14 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ClassicSimilarityAlgorithm(TypedDict): key "@odata.type": Required[Literal["#ClassicSimilarity"]] - @odata.type: Literal[#ClassicSimilarity] + ``@odata.type``: Literal[#ClassicSimilarity] class azure.search.documents.indexes.types.ClassicTokenizer(TypedDict): key "@odata.type": Required[Literal["#ClassicTokenizer"]] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#ClassicTokenizer] + ``@odata.type``: Literal[#ClassicTokenizer] maxTokenLength: int name: str @@ -8488,7 +8478,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#CognitiveServicesByKey"]] key "description": str key "key": Required[str] - @odata.type: Literal[#CognitiveServicesByKey] + ``@odata.type``: Literal[#CognitiveServicesByKey] description: str key: str @@ -8499,7 +8489,7 @@ namespace azure.search.documents.indexes.types key "ignoreCase": bool key "name": Required[str] key "queryMode": bool - @odata.type: Literal[#CommonGramTokenFilter] + ``@odata.type``: Literal[#CommonGramTokenFilter] commonWords: list[str] ignoreCase: bool name: str @@ -8513,7 +8503,7 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#ConditionalSkill] + ``@odata.type``: Literal[#ConditionalSkill] context: str description: str inputs: list[InputFieldMappingEntry] @@ -8539,7 +8529,7 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#ContentUnderstandingSkill] + ``@odata.type``: Literal[#ContentUnderstandingSkill] chunkingProperties: ContentUnderstandingSkillChunkingProperties context: str description: str @@ -8574,7 +8564,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#CustomAnalyzer"]] key "name": Required[str] key "tokenizer": Required[Union[str, LexicalTokenizerName]] - @odata.type: Literal[#CustomAnalyzer] + ``@odata.type``: Literal[#CustomAnalyzer] charFilters: list[Union[str, CharFilterName]] name: str tokenFilters: list[Union[str, TokenFilterName]] @@ -8632,7 +8622,7 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#CustomEntityLookupSkill] + ``@odata.type``: Literal[#CustomEntityLookupSkill] context: str defaultLanguageCode: Union[str, CustomEntityLookupSkillLanguage] description: str @@ -8649,7 +8639,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.CustomNormalizer(TypedDict): key "@odata.type": Required[Literal["#CustomNormalizer"]] key "name": Required[str] - @odata.type: Literal[#CustomNormalizer] + ``@odata.type``: Literal[#CustomNormalizer] charFilters: list[Union[str, CharFilterName]] name: str tokenFilters: list[Union[str, TokenFilterName]] @@ -8663,7 +8653,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.DefaultCognitiveServicesAccount(TypedDict): key "@odata.type": Required[Literal["#DefaultCognitiveServices"]] key "description": str - @odata.type: Literal[#DefaultCognitiveServices] + ``@odata.type``: Literal[#DefaultCognitiveServices] description: str @@ -8675,7 +8665,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "onlyLongestMatch": bool key "wordList": Required[list[str]] - @odata.type: Literal[#DictionaryDecompounderTokenFilter] + ``@odata.type``: Literal[#DictionaryDecompounderTokenFilter] maxSubwordSize: int minSubwordSize: int minWordSize: int @@ -8714,7 +8704,7 @@ namespace azure.search.documents.indexes.types key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] key "parsingMode": Optional[str] - @odata.type: Literal[#DocumentExtractionSkill] + ``@odata.type``: Literal[#DocumentExtractionSkill] configuration: dict[str, Any] context: str dataToExtract: str @@ -8737,7 +8727,7 @@ namespace azure.search.documents.indexes.types key "outputFormat": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputFormat]] key "outputMode": Optional[Union[str, DocumentIntelligenceLayoutSkillOutputMode]] key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#DocumentIntelligenceLayoutSkill] + ``@odata.type``: Literal[#DocumentIntelligenceLayoutSkill] chunkingProperties: DocumentIntelligenceLayoutSkillChunkingProperties context: str description: str @@ -8770,7 +8760,7 @@ namespace azure.search.documents.indexes.types key "minGram": int key "name": Required[str] key "side": Union[str, EdgeNGramTokenFilterSide] - @odata.type: Literal[#EdgeNGramTokenFilter] + ``@odata.type``: Literal[#EdgeNGramTokenFilter] maxGram: int minGram: int name: str @@ -8783,7 +8773,7 @@ namespace azure.search.documents.indexes.types key "minGram": int key "name": Required[str] key "side": Union[str, EdgeNGramTokenFilterSide] - @odata.type: Literal[#EdgeNGramTokenFilterV2] + ``@odata.type``: Literal[#EdgeNGramTokenFilterV2] maxGram: int minGram: int name: str @@ -8795,7 +8785,7 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - @odata.type: Literal[#EdgeNGramTokenizer] + ``@odata.type``: Literal[#EdgeNGramTokenizer] maxGram: int minGram: int name: str @@ -8805,7 +8795,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.ElisionTokenFilter(TypedDict): key "@odata.type": Required[Literal["#ElisionTokenFilter"]] key "name": Required[str] - @odata.type: Literal[#ElisionTokenFilter] + ``@odata.type``: Literal[#ElisionTokenFilter] articles: list[str] name: str @@ -8827,7 +8817,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#EntityLinkingSkill] + ``@odata.type``: Literal[#EntityLinkingSkill] context: str defaultLanguageCode: str description: str @@ -8848,7 +8838,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#EntityRecognitionSkill] + ``@odata.type``: Literal[#EntityRecognitionSkill] categories: list[Union[str, EntityCategory]] context: str defaultLanguageCode: Union[str, EntityRecognitionSkillLanguage] @@ -8891,7 +8881,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_DATA_AGENT]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey fabricDataAgentParameters: FabricDataAgentKnowledgeSourceParameters @@ -8915,7 +8905,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.FABRIC_ONTOLOGY]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey fabricOntologyParameters: FabricOntologyKnowledgeSourceParameters @@ -8956,7 +8946,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.FILE]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str corsOptions: CorsOptions description: str encryptionKey: SearchResourceEncryptionKey @@ -8999,19 +8989,10 @@ namespace azure.search.documents.indexes.types boostingDuration: str - class azure.search.documents.indexes.types.GetIndexStatisticsResult(TypedDict, total=False): - key "documentCount": Required[int] - key "storageSize": Required[int] - key "vectorIndexSize": Required[int] - documentCount: int - storageSize: int - vectorIndexSize: int - - class azure.search.documents.indexes.types.HighWaterMarkChangeDetectionPolicy(TypedDict): key "@odata.type": Required[Literal["#HighWaterMarkChangeDetectionPolicy"]] key "highWaterMarkColumnName": Required[str] - @odata.type: Literal[#HighWaterMarkChangeDetectionPolicy] + ``@odata.type``: Literal[#HighWaterMarkChangeDetectionPolicy] highWaterMarkColumnName: str @@ -9043,7 +9024,7 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#ImageAnalysisSkill] + ``@odata.type``: Literal[#ImageAnalysisSkill] context: str defaultLanguageCode: Union[str, ImageAnalysisSkillLanguage] description: str @@ -9062,7 +9043,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_ONELAKE]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey indexedOneLakeParameters: IndexedOneLakeKnowledgeSourceParameters @@ -9094,7 +9075,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SHARE_POINT]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey indexedSharePointParameters: IndexedSharePointKnowledgeSourceParameters @@ -9126,7 +9107,7 @@ namespace azure.search.documents.indexes.types key "kind": Required[Literal[KnowledgeSourceKind.INDEXED_SQL]] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey indexedSqlParameters: IndexedSqlKnowledgeSourceParameters @@ -9229,7 +9210,7 @@ namespace azure.search.documents.indexes.types key "keepWords": Required[list[str]] key "keepWordsCase": bool key "name": Required[str] - @odata.type: Literal[#KeepTokenFilter] + ``@odata.type``: Literal[#KeepTokenFilter] keepWords: list[str] keepWordsCase: bool name: str @@ -9245,7 +9226,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#KeyPhraseExtractionSkill] + ``@odata.type``: Literal[#KeyPhraseExtractionSkill] context: str defaultLanguageCode: Union[str, KeyPhraseExtractionSkillLanguage] description: str @@ -9261,7 +9242,7 @@ namespace azure.search.documents.indexes.types key "ignoreCase": bool key "keywords": Required[list[str]] key "name": Required[str] - @odata.type: Literal[#KeywordMarkerTokenFilter] + ``@odata.type``: Literal[#KeywordMarkerTokenFilter] ignoreCase: bool keywords: list[str] name: str @@ -9271,7 +9252,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#KeywordTokenizer"]] key "bufferSize": int key "name": Required[str] - @odata.type: Literal[#KeywordTokenizer] + ``@odata.type``: Literal[#KeywordTokenizer] bufferSize: int name: str @@ -9280,7 +9261,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#KeywordTokenizerV2"]] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#KeywordTokenizerV2] + ``@odata.type``: Literal[#KeywordTokenizerV2] maxTokenLength: int name: str @@ -9297,7 +9278,7 @@ namespace azure.search.documents.indexes.types key "retrievalInstructions": str key "retrievalReasoningEffort": ForwardRef('KnowledgeRetrievalReasoningEffort', module='types') key "retrieveDefaults": ForwardRef('KnowledgeBaseRetrieveDefaults', module='types') - @odata.etag: str + ``@odata.etag``: str answerInstructions: str corsOptions: CorsOptions description: str @@ -9372,7 +9353,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#LanguageDetectionSkill] + ``@odata.type``: Literal[#LanguageDetectionSkill] context: str defaultCountryHint: str description: str @@ -9387,7 +9368,7 @@ namespace azure.search.documents.indexes.types key "max": int key "min": int key "name": Required[str] - @odata.type: Literal[#LengthTokenFilter] + ``@odata.type``: Literal[#LengthTokenFilter] max: int min: int name: str @@ -9396,7 +9377,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.LexicalNormalizer(TypedDict): key "@odata.type": Required[Literal["#CustomNormalizer"]] key "name": Required[str] - @odata.type: Literal[#CustomNormalizer] + ``@odata.type``: Literal[#CustomNormalizer] charFilters: list[Union[str, CharFilterName]] name: str tokenFilters: list[Union[str, TokenFilterName]] @@ -9407,7 +9388,7 @@ namespace azure.search.documents.indexes.types key "consumeAllTokens": bool key "maxTokenCount": int key "name": Required[str] - @odata.type: Literal[#LimitTokenFilter] + ``@odata.type``: Literal[#LimitTokenFilter] consumeAllTokens: bool maxTokenCount: int name: str @@ -9417,7 +9398,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#StandardAnalyzer"]] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#StandardAnalyzer] + ``@odata.type``: Literal[#StandardAnalyzer] maxTokenLength: int name: str stopwords: list[str] @@ -9427,7 +9408,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#StandardTokenizer"]] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#StandardTokenizer] + ``@odata.type``: Literal[#StandardTokenizer] maxTokenLength: int name: str @@ -9436,7 +9417,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#StandardTokenizerV2"]] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#StandardTokenizerV2] + ``@odata.type``: Literal[#StandardTokenizerV2] maxTokenLength: int name: str @@ -9467,7 +9448,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#MappingCharFilter"]] key "mappings": Required[list[str]] key "name": Required[str] - @odata.type: Literal[#MappingCharFilter] + ``@odata.type``: Literal[#MappingCharFilter] mappings: list[str] name: str @@ -9512,7 +9493,7 @@ namespace azure.search.documents.indexes.types key "mcpServerParameters": Required[McpServerKnowledgeSourceParameters] key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.MCP_SERVER] @@ -9601,7 +9582,7 @@ namespace azure.search.documents.indexes.types key "insertPreTag": str key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#MergeSkill] + ``@odata.type``: Literal[#MergeSkill] context: str description: str inputs: list[InputFieldMappingEntry] @@ -9617,7 +9598,7 @@ namespace azure.search.documents.indexes.types key "language": Union[str, MicrosoftStemmingTokenizerLanguage] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#MicrosoftLanguageStemmingTokenizer] + ``@odata.type``: Literal[#MicrosoftLanguageStemmingTokenizer] isSearchTokenizer: bool language: Union[str, MicrosoftStemmingTokenizerLanguage] maxTokenLength: int @@ -9630,7 +9611,7 @@ namespace azure.search.documents.indexes.types key "language": Union[str, MicrosoftTokenizerLanguage] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#MicrosoftLanguageTokenizer] + ``@odata.type``: Literal[#MicrosoftLanguageTokenizer] isSearchTokenizer: bool language: Union[str, MicrosoftTokenizerLanguage] maxTokenLength: int @@ -9642,7 +9623,7 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - @odata.type: Literal[#NGramTokenFilter] + ``@odata.type``: Literal[#NGramTokenFilter] maxGram: int minGram: int name: str @@ -9653,7 +9634,7 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - @odata.type: Literal[#NGramTokenFilterV2] + ``@odata.type``: Literal[#NGramTokenFilterV2] maxGram: int minGram: int name: str @@ -9664,7 +9645,7 @@ namespace azure.search.documents.indexes.types key "maxGram": int key "minGram": int key "name": Required[str] - @odata.type: Literal[#NGramTokenizer] + ``@odata.type``: Literal[#NGramTokenizer] maxGram: int minGram: int name: str @@ -9673,7 +9654,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.NativeBlobSoftDeleteDeletionDetectionPolicy(TypedDict): key "@odata.type": Required[Literal["#NativeBlobSoftDeleteDeletionDetectionPolicy"]] - @odata.type: Literal[#NativeBlobSoftDeleteDeletionDetectionPolicy] + ``@odata.type``: Literal[#NativeBlobSoftDeleteDeletionDetectionPolicy] class azure.search.documents.indexes.types.OcrSkill(TypedDict): @@ -9686,7 +9667,7 @@ namespace azure.search.documents.indexes.types key "lineEnding": Union[str, OcrLineEnding] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#OcrSkill] + ``@odata.type``: Literal[#OcrSkill] context: str defaultLanguageCode: Union[str, OcrSkillLanguage] description: str @@ -9717,7 +9698,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#PIIDetectionSkill] + ``@odata.type``: Literal[#PIIDetectionSkill] context: str defaultLanguageCode: str description: str @@ -9740,7 +9721,7 @@ namespace azure.search.documents.indexes.types key "replacement": str key "reverse": bool key "skip": int - @odata.type: Literal[#PathHierarchyTokenizerV2] + ``@odata.type``: Literal[#PathHierarchyTokenizerV2] delimiter: str maxTokenLength: int name: str @@ -9754,7 +9735,7 @@ namespace azure.search.documents.indexes.types key "lowercase": bool key "name": Required[str] key "pattern": str - @odata.type: Literal[#PatternAnalyzer] + ``@odata.type``: Literal[#PatternAnalyzer] flags: list[Union[str, RegexFlags]] lowercase: bool name: str @@ -9767,7 +9748,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "patterns": Required[list[str]] key "preserveOriginal": bool - @odata.type: Literal[#PatternCaptureTokenFilter] + ``@odata.type``: Literal[#PatternCaptureTokenFilter] name: str patterns: list[str] preserveOriginal: bool @@ -9778,7 +9759,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "pattern": Required[str] key "replacement": Required[str] - @odata.type: Literal[#PatternReplaceCharFilter] + ``@odata.type``: Literal[#PatternReplaceCharFilter] name: str pattern: str replacement: str @@ -9789,7 +9770,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "pattern": Required[str] key "replacement": Required[str] - @odata.type: Literal[#PatternReplaceTokenFilter] + ``@odata.type``: Literal[#PatternReplaceTokenFilter] name: str pattern: str replacement: str @@ -9800,7 +9781,7 @@ namespace azure.search.documents.indexes.types key "group": int key "name": Required[str] key "pattern": str - @odata.type: Literal[#PatternTokenizer] + ``@odata.type``: Literal[#PatternTokenizer] flags: list[Union[str, RegexFlags]] group: int name: str @@ -9812,7 +9793,7 @@ namespace azure.search.documents.indexes.types key "encoder": Union[str, PhoneticEncoder] key "name": Required[str] key "replace": bool - @odata.type: Literal[#PhoneticTokenFilter] + ``@odata.type``: Literal[#PhoneticTokenFilter] encoder: Union[str, PhoneticEncoder] name: str replace: bool @@ -9826,7 +9807,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "remoteSharePointParameters": ForwardRef('RemoteSharePointKnowledgeSourceParameters', module='types') key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.REMOTE_SHARE_POINT] @@ -9884,7 +9865,7 @@ namespace azure.search.documents.indexes.types key "@odata.etag": str key "indexes": Required[list[str]] key "name": Required[str] - @odata.etag: str + ``@odata.etag``: str indexes: list[str] name: str @@ -9950,7 +9931,7 @@ namespace azure.search.documents.indexes.types key "sharePointConnectorAppRegistration": ForwardRef('SharePointConnectorAppRegistration', module='types') key "similarity": ForwardRef('SimilarityAlgorithm', module='types') key "vectorSearch": Optional[VectorSearch] - @odata.etag: str + ``@odata.etag``: str analyzers: list[LexicalAnalyzer] charFilters: list[CharFilter] corsOptions: CorsOptions @@ -9985,7 +9966,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] key "searchIndexParameters": Required[SearchIndexKnowledgeSourceParameters] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.SEARCH_INDEX] @@ -10060,7 +10041,7 @@ namespace azure.search.documents.indexes.types key "schedule": Optional[IndexingSchedule] key "skillsetName": str key "targetIndexName": Required[str] - @odata.etag: str + ``@odata.etag``: str cache: SearchIndexerCache dataSourceName: str description: str @@ -10095,7 +10076,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SearchIndexerDataNoneIdentity(TypedDict): key "@odata.type": Required[Literal["#DataNoneIdentity"]] - @odata.type: Literal[#DataNoneIdentity] + ``@odata.type``: Literal[#DataNoneIdentity] class azure.search.documents.indexes.types.SearchIndexerDataSourceConnection(TypedDict): @@ -10111,7 +10092,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "subType": str key "type": Required[Union[str, SearchIndexerDataSourceType]] - @odata.etag: str + ``@odata.etag``: str container: SearchIndexerDataContainer credentials: DataSourceCredentials dataChangeDetectionPolicy: DataChangeDetectionPolicy @@ -10129,7 +10110,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#DataUserAssignedIdentity"]] key "federatedIdentityClientId": str key "userAssignedIdentity": Required[str] - @odata.type: Literal[#DataUserAssignedIdentity] + ``@odata.type``: Literal[#DataUserAssignedIdentity] federatedIdentityClientId: str userAssignedIdentity: str @@ -10256,7 +10237,7 @@ namespace azure.search.documents.indexes.types key "knowledgeStore": ForwardRef('SearchIndexerKnowledgeStore', module='types') key "name": Required[str] key "skills": Required[list[SearchIndexerSkill]] - @odata.etag: str + ``@odata.etag``: str cognitiveServices: CognitiveServicesAccount description: str encryptionKey: SearchResourceEncryptionKey @@ -10329,7 +10310,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Optional[str] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#SentimentSkill] + ``@odata.type``: Literal[#SentimentSkill] context: str defaultLanguageCode: Union[str, SentimentSkillLanguage] description: str @@ -10347,7 +10328,7 @@ namespace azure.search.documents.indexes.types key "inputs": Required[list[InputFieldMappingEntry]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#ShaperSkill] + ``@odata.type``: Literal[#ShaperSkill] context: str description: str inputs: list[InputFieldMappingEntry] @@ -10373,7 +10354,7 @@ namespace azure.search.documents.indexes.types key "outputUnigrams": bool key "outputUnigramsIfNoShingles": bool key "tokenSeparator": str - @odata.type: Literal[#ShingleTokenFilter] + ``@odata.type``: Literal[#ShingleTokenFilter] filterToken: str maxShingleSize: int minShingleSize: int @@ -10391,7 +10372,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#SnowballTokenFilter"]] key "language": Required[Union[str, SnowballTokenFilterLanguage]] key "name": Required[str] - @odata.type: Literal[#SnowballTokenFilter] + ``@odata.type``: Literal[#SnowballTokenFilter] language: Union[str, SnowballTokenFilterLanguage] name: str @@ -10400,7 +10381,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#SoftDeleteColumnDeletionDetectionPolicy"]] key "softDeleteColumnName": str key "softDeleteMarkerValue": str - @odata.type: Literal[#SoftDeleteColumnDeletionDetectionPolicy] + ``@odata.type``: Literal[#SoftDeleteColumnDeletionDetectionPolicy] softDeleteColumnName: str softDeleteMarkerValue: str @@ -10419,7 +10400,7 @@ namespace azure.search.documents.indexes.types key "pageOverlapLength": Optional[int] key "textSplitMode": Union[str, TextSplitMode] key "unit": Optional[Union[str, SplitSkillUnit]] - @odata.type: Literal[#SplitSkill] + ``@odata.type``: Literal[#SplitSkill] azureOpenAITokenizerParameters: AzureOpenAITokenizerParameters context: str defaultLanguageCode: Union[str, SplitSkillLanguage] @@ -10436,14 +10417,14 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.SqlIntegratedChangeTrackingPolicy(TypedDict): key "@odata.type": Required[Literal["#SqlIntegratedChangeTrackingPolicy"]] - @odata.type: Literal[#SqlIntegratedChangeTrackingPolicy] + ``@odata.type``: Literal[#SqlIntegratedChangeTrackingPolicy] class azure.search.documents.indexes.types.StemmerOverrideTokenFilter(TypedDict): key "@odata.type": Required[Literal["#StemmerOverrideTokenFilter"]] key "name": Required[str] key "rules": Required[list[str]] - @odata.type: Literal[#StemmerOverrideTokenFilter] + ``@odata.type``: Literal[#StemmerOverrideTokenFilter] name: str rules: list[str] @@ -10452,7 +10433,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#StemmerTokenFilter"]] key "language": Required[Union[str, StemmerTokenFilterLanguage]] key "name": Required[str] - @odata.type: Literal[#StemmerTokenFilter] + ``@odata.type``: Literal[#StemmerTokenFilter] language: Union[str, StemmerTokenFilterLanguage] name: str @@ -10460,7 +10441,7 @@ namespace azure.search.documents.indexes.types class azure.search.documents.indexes.types.StopAnalyzer(TypedDict): key "@odata.type": Required[Literal["#StopAnalyzer"]] key "name": Required[str] - @odata.type: Literal[#StopAnalyzer] + ``@odata.type``: Literal[#StopAnalyzer] name: str stopwords: list[str] @@ -10471,7 +10452,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "removeTrailing": bool key "stopwordsList": Union[str, StopwordsList] - @odata.type: Literal[#StopwordsTokenFilter] + ``@odata.type``: Literal[#StopwordsTokenFilter] ignoreCase: bool name: str removeTrailing: bool @@ -10485,7 +10466,7 @@ namespace azure.search.documents.indexes.types key "format": Required[Literal["solr"]] key "name": Required[str] key "synonyms": Required[list[str]] - @odata.etag: str + ``@odata.etag``: str encryptionKey: SearchResourceEncryptionKey format: Literal[solr] name: str @@ -10498,7 +10479,7 @@ namespace azure.search.documents.indexes.types key "ignoreCase": bool key "name": Required[str] key "synonyms": Required[list[str]] - @odata.type: Literal[#SynonymTokenFilter] + ``@odata.type``: Literal[#SynonymTokenFilter] expand: bool ignoreCase: bool name: str @@ -10533,7 +10514,7 @@ namespace azure.search.documents.indexes.types key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] key "suggestedFrom": Optional[Union[str, TextTranslationSkillLanguage]] - @odata.type: Literal[#TranslationSkill] + ``@odata.type``: Literal[#TranslationSkill] context: str defaultFromLanguageCode: Union[str, TextTranslationSkillLanguage] defaultToLanguageCode: Union[str, TextTranslationSkillLanguage] @@ -10553,7 +10534,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#TruncateTokenFilter"]] key "length": int key "name": Required[str] - @odata.type: Literal[#TruncateTokenFilter] + ``@odata.type``: Literal[#TruncateTokenFilter] length: int name: str @@ -10562,7 +10543,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#UaxUrlEmailTokenizer"]] key "maxTokenLength": int key "name": Required[str] - @odata.type: Literal[#UaxUrlEmailTokenizer] + ``@odata.type``: Literal[#UaxUrlEmailTokenizer] maxTokenLength: int name: str @@ -10571,7 +10552,7 @@ namespace azure.search.documents.indexes.types key "@odata.type": Required[Literal["#UniqueTokenFilter"]] key "name": Required[str] key "onlyOnSamePosition": bool - @odata.type: Literal[#UniqueTokenFilter] + ``@odata.type``: Literal[#UniqueTokenFilter] name: str onlyOnSamePosition: bool @@ -10633,7 +10614,7 @@ namespace azure.search.documents.indexes.types key "modelVersion": Required[Optional[str]] key "name": str key "outputs": Required[list[OutputFieldMappingEntry]] - @odata.type: Literal[#VectorizeSkill] + ``@odata.type``: Literal[#VectorizeSkill] context: str description: str inputs: list[InputFieldMappingEntry] @@ -10660,7 +10641,7 @@ namespace azure.search.documents.indexes.types key "outputs": Required[list[OutputFieldMappingEntry]] key "timeout": str key "uri": Required[str] - @odata.type: Literal[#WebApiSkill] + ``@odata.type``: Literal[#WebApiSkill] authIdentity: SearchIndexerDataIdentity authResourceId: str batchSize: int @@ -10707,7 +10688,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] key "webParameters": ForwardRef('WebKnowledgeSourceParameters', module='types') - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.WEB] @@ -10753,7 +10734,7 @@ namespace azure.search.documents.indexes.types key "splitOnCaseChange": bool key "splitOnNumerics": bool key "stemEnglishPossessive": bool - @odata.type: Literal[#WordDelimiterTokenFilter] + ``@odata.type``: Literal[#WordDelimiterTokenFilter] catenateAll: bool catenateNumbers: bool catenateWords: bool @@ -10775,7 +10756,7 @@ namespace azure.search.documents.indexes.types key "name": Required[str] key "resultsProcessing": Union[str, KnowledgeSourceResultsProcessing] key "workIQParameters": Required[WorkIQKnowledgeSourceParameters] - @odata.etag: str + ``@odata.etag``: str description: str encryptionKey: SearchResourceEncryptionKey kind: Literal[KnowledgeSourceKind.WORK_IQ] @@ -11338,14 +11319,14 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseActivityRecordModel(_Model): deployment_id: Optional[str] - model_name: Optional[str] + model_name: str @overload def __init__( self, *, deployment_id: Optional[str] = ..., - model_name: Optional[str] = ... + model_name: str ) -> None: ... @overload @@ -12545,14 +12526,14 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.KnowledgeBaseStreamErrorEvent(_Model): activity: Optional[list[KnowledgeBaseActivityRecord]] - error: Optional[KnowledgeBaseErrorDetail] + error: KnowledgeBaseErrorDetail @overload def __init__( self, *, activity: Optional[list[KnowledgeBaseActivityRecord]] = ..., - error: Optional[KnowledgeBaseErrorDetail] = ... + error: KnowledgeBaseErrorDetail ) -> None: ... @overload @@ -13111,16 +13092,16 @@ namespace azure.search.documents.knowledgebases.models class azure.search.documents.knowledgebases.models.ServedImage(_Model): image_id: Optional[str] - image_path: Optional[str] - size_bytes: Optional[int] + image_path: str + size_bytes: int @overload def __init__( self, *, image_id: Optional[str] = ..., - image_path: Optional[str] = ..., - size_bytes: Optional[int] = ... + image_path: str, + size_bytes: int ) -> None: ... @overload @@ -13225,20 +13206,6 @@ namespace azure.search.documents.knowledgebases.models namespace azure.search.documents.knowledgebases.types - class azure.search.documents.knowledgebases.types.AIServices(TypedDict, total=False): - key "apiKey": str - key "uri": Required[str] - apiKey: str - uri: str - - - class azure.search.documents.knowledgebases.types.AssetStore(TypedDict, total=False): - key "connectionString": Required[str] - key "containerName": Required[str] - connectionString: str - containerName: str - - class azure.search.documents.knowledgebases.types.AzureBlobKnowledgeSourceParams(TypedDict, total=False): key "alwaysQuerySource": bool key "enableImageServing": bool @@ -13265,19 +13232,6 @@ namespace azure.search.documents.knowledgebases.types resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] - class azure.search.documents.knowledgebases.types.CompletedSynchronizationState(TypedDict, total=False): - key "endTime": Required[str] - key "itemsSkipped": Required[int] - key "itemsUpdatesFailed": Required[int] - key "itemsUpdatesProcessed": Required[int] - key "startTime": Required[str] - endTime: str - itemsSkipped: int - itemsUpdatesFailed: int - itemsUpdatesProcessed: int - startTime: str - - class azure.search.documents.knowledgebases.types.FabricDataAgentKnowledgeSourceParams(TypedDict, total=False): key "alwaysQuerySource": bool key "enableImageServing": bool @@ -13354,11 +13308,6 @@ namespace azure.search.documents.knowledgebases.types resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] - class azure.search.documents.knowledgebases.types.FreshnessPolicy(TypedDict, total=False): - key "boostingDuration": str - boostingDuration: str - - class azure.search.documents.knowledgebases.types.IndexedOneLakeKnowledgeSourceParams(TypedDict, total=False): key "alwaysQuerySource": bool key "enableImageServing": bool @@ -13533,37 +13482,6 @@ namespace azure.search.documents.knowledgebases.types type: Literal[KnowledgeRetrievalIntentType.SEMANTIC] - class azure.search.documents.knowledgebases.types.KnowledgeSourceAzureOpenAIVectorizer(TypedDict, total=False): - key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] - azureOpenAIParameters: AzureOpenAIVectorizerParameters - kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] - - - class azure.search.documents.knowledgebases.types.KnowledgeSourceIngestionParameters(TypedDict, total=False): - key "aiServices": Optional[AIServices] - key "assetStore": ForwardRef('AssetStore', module='types') - key "chatCompletionModel": Optional[KnowledgeBaseModel] - key "contentExtractionMode": Optional[Union[str, KnowledgeSourceContentExtractionMode]] - key "disableImageVerbalization": bool - key "embeddingModel": Optional[KnowledgeSourceVectorizer] - key "freshnessPolicy": ForwardRef('FreshnessPolicy', module='types') - key "identity": Optional[SearchIndexerDataIdentity] - key "ingestionPermissionOptions": Optional[list[Union[str, KnowledgeSourceIngestionPermissionOption]]] - key "ingestionSchedule": Optional[IndexingSchedule] - key "networkAccessMode": Union[str, KnowledgeSourceNetworkAccessMode] - aiServices: AIServices - assetStore: AssetStore - chatCompletionModel: KnowledgeBaseModel - contentExtractionMode: Union[str, KnowledgeSourceContentExtractionMode] - disableImageVerbalization: bool - embeddingModel: KnowledgeSourceVectorizer - freshnessPolicy: FreshnessPolicy - identity: SearchIndexerDataIdentity - ingestionPermissionOptions: list[Union[str, KnowledgeSourceIngestionPermissionOption]] - ingestionSchedule: IndexingSchedule - networkAccessMode: Union[str, KnowledgeSourceNetworkAccessMode] - - class azure.search.documents.knowledgebases.types.KnowledgeSourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_BLOB = "azureBlob" FABRIC_DATA_AGENT = "fabricDataAgent" @@ -13579,51 +13497,6 @@ namespace azure.search.documents.knowledgebases.types WORK_IQ = "workIQ" - class azure.search.documents.knowledgebases.types.KnowledgeSourceStatistics(TypedDict, total=False): - key "averageItemsProcessedPerSynchronization": Required[int] - key "averageSynchronizationDuration": Required[str] - key "totalSynchronization": Required[int] - averageItemsProcessedPerSynchronization: int - averageSynchronizationDuration: str - totalSynchronization: int - - - class azure.search.documents.knowledgebases.types.KnowledgeSourceStatus(TypedDict, total=False): - key "currentSynchronizationState": Optional[SynchronizationState] - key "kind": Union[str, KnowledgeSourceKind] - key "lastSynchronizationState": Optional[CompletedSynchronizationState] - key "statistics": Optional[KnowledgeSourceStatistics] - key "synchronizationInterval": Optional[str] - key "synchronizationStatus": Required[Union[str, KnowledgeSourceSynchronizationStatus]] - currentSynchronizationState: SynchronizationState - kind: Union[str, KnowledgeSourceKind] - lastSynchronizationState: CompletedSynchronizationState - statistics: KnowledgeSourceStatistics - synchronizationInterval: str - synchronizationStatus: Union[str, KnowledgeSourceSynchronizationStatus] - - - class azure.search.documents.knowledgebases.types.KnowledgeSourceSynchronizationError(TypedDict, total=False): - key "details": str - key "docId": str - key "documentationLink": str - key "errorMessage": Required[str] - key "name": str - key "statusCode": int - details: str - docId: str - documentationLink: str - errorMessage: str - name: str - statusCode: int - - - class azure.search.documents.knowledgebases.types.KnowledgeSourceVectorizer(TypedDict, total=False): - key "kind": Required[Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI]] - azureOpenAIParameters: AzureOpenAIVectorizerParameters - kind: Literal[VectorSearchVectorizerKind.AZURE_OPEN_AI] - - class azure.search.documents.knowledgebases.types.McpServerKnowledgeSourceParams(TypedDict, total=False): key "alwaysQuerySource": bool key "enableImageServing": bool @@ -13704,25 +13577,6 @@ namespace azure.search.documents.knowledgebases.types resultsProcessing: Union[str, KnowledgeSourceResultsProcessing] - class azure.search.documents.knowledgebases.types.SynchronizationState(TypedDict, total=False): - key "itemsSkipped": Required[int] - key "itemsUpdatesFailed": Required[int] - key "itemsUpdatesProcessed": Required[int] - key "startTime": Required[str] - errors: list[KnowledgeSourceSynchronizationError] - itemsSkipped: int - itemsUpdatesFailed: int - itemsUpdatesProcessed: int - startTime: str - - - class azure.search.documents.knowledgebases.types.VectorSearchVectorizerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AI_SERVICES_VISION = "aiServicesVision" - AML = "aml" - AZURE_OPEN_AI = "azureOpenAI" - CUSTOM_WEB_API = "customWebApi" - - class azure.search.documents.knowledgebases.types.WebKnowledgeSourceParams(TypedDict, total=False): key "alwaysQuerySource": bool key "count": int @@ -14380,13 +14234,6 @@ namespace azure.search.documents.models namespace azure.search.documents.types - class azure.search.documents.types.AutocompleteItem(TypedDict, total=False): - key "queryPlusText": Required[str] - key "text": Required[str] - queryPlusText: str - text: str - - class azure.search.documents.types.AutocompletePostRequest(TypedDict, total=False): key "autocompleteMode": Union[str, AutocompleteMode] key "filter": str @@ -14409,35 +14256,6 @@ namespace azure.search.documents.types top: int - class azure.search.documents.types.DebugInfo(TypedDict, total=False): - key "queryRewrites": ForwardRef('QueryRewritesDebugInfo', module='types') - queryRewrites: QueryRewritesDebugInfo - - - class azure.search.documents.types.DocumentDebugInfo(TypedDict, total=False): - key "semantic": ForwardRef('SemanticDebugInfo', module='types') - key "vectors": ForwardRef('VectorsDebugInfo', module='types') - innerHits: dict[str, list[QueryResultDocumentInnerHit]] - semantic: SemanticDebugInfo - vectors: VectorsDebugInfo - - - class azure.search.documents.types.FacetResult(TypedDict): - key "avg": float - key "cardinality": int - key "count": int - key "max": float - key "min": float - key "sum": float - @search.facets: dict[str, list[FacetResult]] - avg: float - cardinality: int - count: int - max: float - min: float - sum: float - - class azure.search.documents.types.HybridSearch(TypedDict, total=False): key "countAndFacetMode": Union[str, HybridCountAndFacetMode] key "maxTextRecallSize": int @@ -14447,7 +14265,7 @@ namespace azure.search.documents.types class azure.search.documents.types.IndexAction(TypedDict): key "@search.action": Union[str, IndexActionType] - @search.action: Union[str, IndexActionType] + ``@search.action``: Union[str, IndexActionType] class azure.search.documents.types.IndexDocumentsBatch(TypedDict, total=False): @@ -14455,101 +14273,6 @@ namespace azure.search.documents.types value: list[IndexAction] - class azure.search.documents.types.IndexingResult(TypedDict, total=False): - key "errorMessage": str - key "key": Required[str] - key "status": Required[bool] - key "statusCode": Required[int] - errorMessage: str - key: str - status: bool - statusCode: int - - - class azure.search.documents.types.QueryAnswerResult(TypedDict, total=False): - key "highlights": Optional[str] - key "key": str - key "score": float - key "text": str - highlights: str - key: str - score: float - text: str - - - class azure.search.documents.types.QueryCaptionResult(TypedDict, total=False): - key "highlights": Optional[str] - key "text": str - highlights: str - text: str - - - class azure.search.documents.types.QueryResultDocumentInnerHit(TypedDict, total=False): - key "ordinal": int - ordinal: int - vectors: list[dict[str, SingleVectorFieldResult]] - - - class azure.search.documents.types.QueryResultDocumentRerankerInput(TypedDict, total=False): - key "content": str - key "keywords": str - key "title": str - content: str - keywords: str - title: str - - - class azure.search.documents.types.QueryResultDocumentSemanticField(TypedDict, total=False): - key "name": str - key "state": Union[str, SemanticFieldState] - name: str - state: Union[str, SemanticFieldState] - - - class azure.search.documents.types.QueryResultDocumentSubscores(TypedDict, total=False): - key "documentBoost": float - key "text": ForwardRef('TextResult', module='types') - documentBoost: float - text: TextResult - vectors: list[dict[str, SingleVectorFieldResult]] - - - class azure.search.documents.types.QueryRewritesDebugInfo(TypedDict, total=False): - key "text": ForwardRef('QueryRewritesValuesDebugInfo', module='types') - text: QueryRewritesValuesDebugInfo - vectors: list[QueryRewritesValuesDebugInfo] - - - class azure.search.documents.types.QueryRewritesValuesDebugInfo(TypedDict, total=False): - key "inputQuery": str - inputQuery: str - rewrites: list[str] - - - class azure.search.documents.types.SearchDocumentsResult(TypedDict): - key "@odata.count": int - key "@odata.nextLink": str - key "@search.answers": Optional[list[QueryAnswerResult]] - key "@search.coverage": float - key "@search.debug": Optional[DebugInfo] - key "@search.nextPageParameters": ForwardRef('SearchRequest', module='types') - key "@search.semanticPartialResponseReason": Union[str, SemanticErrorReason] - key "@search.semanticPartialResponseType": Union[str, SemanticSearchResultsType] - key "@search.semanticQueryRewritesResultType": Union[str, SemanticQueryRewritesResultType] - key "value": Required[list[SearchResult]] - @odata.count: int - @odata.nextLink: str - @search.answers: list[QueryAnswerResult] - @search.coverage: float - @search.debug: DebugInfo - @search.facets: dict[str, list[FacetResult]] - @search.nextPageParameters: SearchRequest - @search.semanticPartialResponseReason: Union[str, SemanticErrorReason] - @search.semanticPartialResponseType: Union[str, SemanticSearchResultsType] - @search.semanticQueryRewritesResultType: Union[str, SemanticQueryRewritesResultType] - value: list[SearchResult] - - class azure.search.documents.types.SearchPostRequest(TypedDict, total=False): key "answers": Union[str, QueryAnswerType] key "captions": Union[str, QueryCaptionType] @@ -14611,81 +14334,6 @@ namespace azure.search.documents.types vectorQueries: list[VectorQuery] - class azure.search.documents.types.SearchRequest(TypedDict, total=False): - key "answers": Union[str, QueryAnswerType] - key "captions": Union[str, QueryCaptionType] - key "count": bool - key "debug": Union[str, QueryDebugMode] - key "filter": str - key "highlightPostTag": str - key "highlightPreTag": str - key "hybridSearch": ForwardRef('HybridSearch', module='types') - key "minimumCoverage": float - key "queryLanguage": Union[str, QueryLanguage] - key "queryRewrites": Union[str, QueryRewritesType] - key "queryType": Union[str, QueryType] - key "scoringProfile": str - key "scoringStatistics": Union[str, ScoringStatistics] - key "search": str - key "searchMode": Union[str, SearchMode] - key "semanticConfiguration": str - key "semanticErrorHandling": Union[str, SemanticErrorMode] - key "semanticMaxWaitInMilliseconds": int - key "semanticQuery": str - key "sessionId": str - key "skip": int - key "speller": Union[str, QuerySpellerType] - key "top": int - key "vectorFilterMode": Union[str, VectorFilterMode] - answers: Union[str, QueryAnswerType] - captions: Union[str, QueryCaptionType] - count: bool - debug: Union[str, QueryDebugMode] - facets: list[str] - filter: str - highlight: list[str] - highlightPostTag: str - highlightPreTag: str - hybridSearch: HybridSearch - minimumCoverage: float - orderby: list[str] - queryLanguage: Union[str, QueryLanguage] - queryRewrites: Union[str, QueryRewritesType] - queryType: Union[str, QueryType] - scoringParameters: list[str] - scoringProfile: str - scoringStatistics: Union[str, ScoringStatistics] - search: str - searchFields: list[str] - searchMode: Union[str, SearchMode] - select: list[str] - semanticConfiguration: str - semanticErrorHandling: Union[str, SemanticErrorMode] - semanticFields: list[str] - semanticMaxWaitInMilliseconds: int - semanticQuery: str - sessionId: str - skip: int - speller: Union[str, QuerySpellerType] - top: int - vectorFilterMode: Union[str, VectorFilterMode] - vectorQueries: list[VectorQuery] - - - class azure.search.documents.types.SearchResult(TypedDict): - key "@search.captions": Optional[list[QueryCaptionResult]] - key "@search.documentDebugInfo": Optional[DocumentDebugInfo] - key "@search.rerankerBoostedScore": Optional[float] - key "@search.rerankerScore": Optional[float] - key "@search.score": Required[float] - @search.captions: list[QueryCaptionResult] - @search.documentDebugInfo: DocumentDebugInfo - @search.highlights: dict[str, list[str]] - @search.rerankerBoostedScore: float - @search.rerankerScore: float - @search.score: float - - class azure.search.documents.types.SearchScoreThreshold(TypedDict, total=False): key "kind": Required[Literal[VectorThresholdKind.SEARCH_SCORE]] key "value": Required[float] @@ -14693,22 +14341,6 @@ namespace azure.search.documents.types value: float - class azure.search.documents.types.SemanticDebugInfo(TypedDict, total=False): - key "rerankerInput": ForwardRef('QueryResultDocumentRerankerInput', module='types') - key "titleField": ForwardRef('QueryResultDocumentSemanticField', module='types') - contentFields: list[QueryResultDocumentSemanticField] - keywordFields: list[QueryResultDocumentSemanticField] - rerankerInput: QueryResultDocumentRerankerInput - titleField: QueryResultDocumentSemanticField - - - class azure.search.documents.types.SingleVectorFieldResult(TypedDict, total=False): - key "searchScore": float - key "vectorSimilarity": float - searchScore: float - vectorSimilarity: float - - class azure.search.documents.types.SuggestPostRequest(TypedDict, total=False): key "filter": str key "fuzzy": bool @@ -14731,16 +14363,6 @@ namespace azure.search.documents.types top: int - class azure.search.documents.types.SuggestResult(TypedDict): - key "@search.text": Required[str] - @search.text: str - - - class azure.search.documents.types.TextResult(TypedDict, total=False): - key "searchScore": float - searchScore: float - - class azure.search.documents.types.VectorQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): IMAGE_BINARY = "imageBinary" IMAGE_URL = "imageUrl" @@ -14854,9 +14476,4 @@ namespace azure.search.documents.types weight: float - class azure.search.documents.types.VectorsDebugInfo(TypedDict, total=False): - key "subscores": ForwardRef('QueryResultDocumentSubscores', module='types') - subscores: QueryResultDocumentSubscores - - ``` \ No newline at end of file diff --git a/sdk/search/azure-search-documents/api.metadata.yml b/sdk/search/azure-search-documents/api.metadata.yml index ab79bf02f68d..5400e54cde2a 100644 --- a/sdk/search/azure-search-documents/api.metadata.yml +++ b/sdk/search/azure-search-documents/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 792b2760567454ab18fb82d9b5f9343bbe148e11b07b6f31d0b98b9a7e8cf332 +apiMdSha256: 084e314c75fadd638286314c23b600310d948b8748f479b39b840db568f7b0f4 parserVersion: 0.3.31 pythonVersion: 3.12.1 diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py index ac779935953d..79ba61ac3ec1 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_operations.py @@ -2834,7 +2834,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models1._models.SearchIndexResponse], + list[_models1._models.SearchIndexResponse], # pylint: disable=protected-access deserialized.get("value", []), ) if cls: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py index 5d7ad3c802a7..06449fb21c60 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py @@ -60,7 +60,9 @@ def _convert_index_response(response: _SearchIndexResponse) -> _models.SearchInd ) -class _SearchIndexClientOperationsMixin(_SearchIndexClientOperationsMixinGenerated): +class _SearchIndexClientOperationsMixin( + _SearchIndexClientOperationsMixinGenerated +): # pylint: disable=too-many-public-methods """Custom operations mixin for SearchIndexClient.""" @distributed_trace @@ -433,6 +435,30 @@ def delete_knowledge_source_file( """ self._delete_knowledge_source_file(name=name, file_id=file_id, **kwargs) + @distributed_trace + # pylint: disable-next=arguments-renamed + def update_knowledge_source_file( # type: ignore[override] + self, + name: str, + file_id: str, + body: Union[_models.UpdateKnowledgeSourceFileRequest, _types.UpdateKnowledgeSourceFileRequest], + **kwargs: Any, + ) -> _models.KnowledgeSourceFile: + """Updates an existing file in a File knowledge source in place. + + :param name: The name of the File knowledge source. Required. + :type name: str + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param body: The multipart body containing replacement metadata and content. Required. + :type body: ~azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest or + ~azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest + :return: The updated knowledge source file. + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + return super().update_knowledge_source_file(name=name, file_id=file_id, body=body, **kwargs) + @distributed_trace def list_indexes( self, diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py index dc8d5aa77210..3cc1796a3c8f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py @@ -1130,7 +1130,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - list[_models2._models.SearchIndexResponse], + list[_models2._models.SearchIndexResponse], # pylint: disable=protected-access deserialized.get("value", []), ) if cls: diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py index 5f1ce9d55257..2d44b7849154 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py @@ -30,7 +30,9 @@ import azure.search.documents.aio -class _SearchIndexClientOperationsMixin(_SearchIndexClientOperationsMixinGenerated): +class _SearchIndexClientOperationsMixin( + _SearchIndexClientOperationsMixinGenerated +): # pylint: disable=too-many-public-methods """Custom operations mixin for SearchIndexClient (async).""" @distributed_trace_async @@ -413,6 +415,30 @@ async def delete_knowledge_source_file( """ await self._delete_knowledge_source_file(name=name, file_id=file_id, **kwargs) + @distributed_trace_async + # pylint: disable-next=arguments-renamed + async def update_knowledge_source_file( # type: ignore[override] + self, + name: str, + file_id: str, + body: Union[_models.UpdateKnowledgeSourceFileRequest, _types.UpdateKnowledgeSourceFileRequest], + **kwargs: Any, + ) -> _models.KnowledgeSourceFile: + """Updates an existing file in a File knowledge source in place. + + :param name: The name of the File knowledge source. Required. + :type name: str + :param file_id: The unique identifier of the file to update. Required. + :type file_id: str + :param body: The multipart body containing replacement metadata and content. Required. + :type body: ~azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest or + ~azure.search.documents.indexes.types.UpdateKnowledgeSourceFileRequest + :return: The updated knowledge source file. + :rtype: ~azure.search.documents.indexes.models.KnowledgeSourceFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + return await super().update_knowledge_source_file(name=name, file_id=file_id, body=body, **kwargs) + @distributed_trace def list_indexes( self, diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py index 3406fb112a00..6b60af3660d6 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py @@ -23,7 +23,8 @@ ) if TYPE_CHECKING: - from ..knowledgebases.types import KnowledgeRetrievalReasoningEffort, KnowledgeSourceIngestionParameters + from ..knowledgebases.models import KnowledgeSourceIngestionParameters + from ..knowledgebases.types import KnowledgeRetrievalReasoningEffort from ..knowledgebasesmodels import KnowledgeRetrievalOutputMode from .models import ( AIFoundryModelCatalogName, @@ -5360,9 +5361,7 @@ class SearchIndexerKnowledgeStoreProjection(TypedDict, total=False): """Projections to Azure File storage.""" -class SearchIndexerKnowledgeStoreTableProjectionSelector( - SearchIndexerKnowledgeStoreProjectionSelector -): # pylint: disable=name-too-long +class SearchIndexerKnowledgeStoreTableProjectionSelector(TypedDict, total=False): # pylint: disable=name-too-long """Description for what data to store in Azure Tables. :ivar referenceKeyName: Name of reference key to different projection. @@ -5379,6 +5378,14 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector( :vartype tableName: str """ + referenceKeyName: str + """Name of reference key to different projection.""" + source: str + """Source data to project.""" + sourceContext: str + """Source context for complex projections.""" + inputs: list["InputFieldMappingEntry"] + """Nested inputs for complex projections.""" generatedKeyName: Required[str] """Name of generated key to store projection under. Required.""" tableName: Required[str] diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py index 382d6dee11c7..10e20086d7bb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py @@ -302,6 +302,10 @@ async def __aexit__( await self.close() +KnowledgeBaseRetrievalStream.__module__ = "azure.search.documents.knowledgebases" +AsyncKnowledgeBaseRetrievalStream.__module__ = "azure.search.documents.knowledgebases.aio" + + __all__ = [ "AsyncKnowledgeBaseRetrievalStream", "KnowledgeBaseRetrievalEvent", diff --git a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py index 410fa28d8250..64dc155e8927 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/models/__init__.py @@ -66,6 +66,7 @@ SemanticErrorMode, SemanticErrorReason, SemanticFieldState, + SemanticQueryRewritesResultType, SemanticSearchResultsType, VectorFilterMode, VectorQueryKind, @@ -125,6 +126,7 @@ "SemanticErrorMode", "SemanticErrorReason", "SemanticFieldState", + "SemanticQueryRewritesResultType", "SemanticSearchResultsType", "VectorFilterMode", "VectorQueryKind", diff --git a/sdk/search/azure-search-documents/tests/_capabilities.py b/sdk/search/azure-search-documents/tests/_capabilities.py index 14e08b209eab..f557ee71d72d 100644 --- a/sdk/search/azure-search-documents/tests/_capabilities.py +++ b/sdk/search/azure-search-documents/tests/_capabilities.py @@ -114,7 +114,6 @@ def _model_capabilities() -> Mapping[str, Mapping[str, Any]]: f"{_KBM}.KnowledgeBaseModelAnswerSynthesisActivityRecord", f"{_KBM}.KnowledgeBaseModelWebSummarizationActivityRecord", f"{_KBM}.KnowledgeBaseWorkIQReference", - f"{_KBM}.WorkIQAttribution", f"{_KBM}.PurviewSensitivityLabelInfo", # Permission filter and option types f"{_IM}.SearchIndexPermissionFilterOption", @@ -157,7 +156,6 @@ def _model_capabilities() -> Mapping[str, Mapping[str, Any]]: (f"{_IM}.IndexerExecutionResult", "status_detail"), (f"{_IM}.IndexerExecutionResult", "mode"), (f"{_IM}.SearchIndexerKnowledgeStore", "parameters"), - (f"{_IM}.McpServerTool", "inclusion_mode"), (f"{_IM}.McpServerTool", "max_output_tokens"), (f"{_IM}.SearchResourceEncryptionKey", "is_service_level_key"), (f"{_IM}.SearchIndexerDataUserAssignedIdentity", "federated_identity_client_id"), @@ -190,6 +188,7 @@ def _model_capabilities() -> Mapping[str, Mapping[str, Any]]: (f"{_KBM}.KnowledgeBaseIndexedSharePointReference", "search_sensitivity_label_info"), (f"{_KBM}.KnowledgeBaseRemoteSharePointReference", "search_sensitivity_label_info"), (f"{_KBM}.KnowledgeBaseSearchIndexReference", "search_sensitivity_label_info"), + (f"{_KBM}.KnowledgeBaseWorkIQReference", "search_sensitivity_label_info"), (f"{_KBM}.KnowledgeSourceParams", "always_query_source"), (f"{_KBM}.KnowledgeSourceParams", "fail_on_error"), (f"{_KBM}.KnowledgeSourceParams", "max_output_documents"), @@ -247,8 +246,6 @@ def _model_capabilities() -> Mapping[str, Mapping[str, Any]]: (f"{_IM}.KnowledgeSourceKind", "FABRIC_ONTOLOGY"), (f"{_IM}.McpServerAuthenticationKind", "FOUNDRY_CONNECTION"), (f"{_IM}.McpServerAuthenticationKind", "STORED_HEADERS"), - (f"{_IM}.McpServerToolInclusionMode", "RERANKED"), - (f"{_IM}.McpServerToolInclusionMode", "ALWAYS"), (f"{_KBM}.KnowledgeBaseActivityRecordType", "WORK_IQ"), (f"{_KBM}.KnowledgeBaseActivityRecordType", "FABRIC_DATA_AGENT"), (f"{_KBM}.KnowledgeBaseActivityRecordType", "FABRIC_ONTOLOGY"), @@ -285,6 +282,8 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: f"{_IDX}.SearchIndexClient.get_knowledge_source", f"{_IDX}.SearchIndexClient.get_knowledge_source_status", f"{_IDX}.SearchIndexClient.upload_knowledge_source_file", + f"{_IDX}.SearchIndexClient.upload_knowledge_source_file_multipart", + f"{_IDX}.SearchIndexClient.update_knowledge_source_file", f"{_IDX}.SearchIndexClient.list_knowledge_source_files", f"{_IDX}.SearchIndexClient.delete_knowledge_source_file", f"{_IDX}.SearchIndexClient.list_knowledge_bases", @@ -303,6 +302,8 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: f"{_IDX}.aio.SearchIndexClient.get_knowledge_source", f"{_IDX}.aio.SearchIndexClient.get_knowledge_source_status", f"{_IDX}.aio.SearchIndexClient.upload_knowledge_source_file", + f"{_IDX}.aio.SearchIndexClient.upload_knowledge_source_file_multipart", + f"{_IDX}.aio.SearchIndexClient.update_knowledge_source_file", f"{_IDX}.aio.SearchIndexClient.list_knowledge_source_files", f"{_IDX}.aio.SearchIndexClient.delete_knowledge_source_file", f"{_IDX}.aio.SearchIndexClient.list_knowledge_bases", @@ -336,6 +337,18 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: ), (f"{_IDX}.SearchIndexClient.list_indexes", ("search", "page_size", "search_type")), (f"{_IDX}.SearchIndexClient.list_index_names", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexClient.list_aliases", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexClient.list_index_stats_summary", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexClient.list_knowledge_bases", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexClient.list_knowledge_sources", ("search", "page_size", "search_type")), + ( + f"{_IDX}.SearchIndexClient.list_knowledge_source_files", + ("prefix", "search", "page_size", "search_type"), + ), + (f"{_IDX}.SearchIndexClient.get_synonym_maps", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexerClient.get_data_source_connections", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexerClient.get_indexers", ("search", "page_size", "search_type")), + (f"{_IDX}.SearchIndexerClient.get_skillsets", ("search", "page_size", "search_type")), ( f"{_IDX}.aio.SearchIndexerClient.create_or_update_data_source_connection", ("skip_indexer_reset_requirement_for_cache",), @@ -350,6 +363,29 @@ def _client_capabilities() -> Mapping[str, Mapping[str, Any]]: ), (f"{_IDX}.aio.SearchIndexClient.list_indexes", ("search", "page_size", "search_type")), (f"{_IDX}.aio.SearchIndexClient.list_index_names", ("search", "page_size", "search_type")), + (f"{_IDX}.aio.SearchIndexClient.list_aliases", ("search", "page_size", "search_type")), + (f"{_IDX}.aio.SearchIndexClient.list_index_stats_summary", ("search", "page_size", "search_type")), + (f"{_IDX}.aio.SearchIndexClient.list_knowledge_bases", ("search", "page_size", "search_type")), + (f"{_IDX}.aio.SearchIndexClient.list_knowledge_sources", ("search", "page_size", "search_type")), + ( + f"{_IDX}.aio.SearchIndexClient.list_knowledge_source_files", + ("prefix", "search", "page_size", "search_type"), + ), + (f"{_IDX}.aio.SearchIndexClient.get_synonym_maps", ("search", "page_size", "search_type")), + ( + f"{_IDX}.aio.SearchIndexerClient.get_data_source_connections", + ("search", "page_size", "search_type"), + ), + (f"{_IDX}.aio.SearchIndexerClient.get_indexers", ("search", "page_size", "search_type")), + (f"{_IDX}.aio.SearchIndexerClient.get_skillsets", ("search", "page_size", "search_type")), + ( + f"{_KB}.KnowledgeBaseRetrievalClient.retrieve_stream", + ("query_source_authorization", "query_work_iq_source_authorization"), + ), + ( + f"{_KB}.aio.KnowledgeBaseRetrievalClient.retrieve_stream", + ("query_source_authorization", "query_work_iq_source_authorization"), + ), ] for dotted, kwargs in method_kwargs: for kw in kwargs: diff --git a/sdk/search/azure-search-documents/tests/conftest.py b/sdk/search/azure-search-documents/tests/conftest.py index bedf8b84d11c..ebdf95eee34e 100644 --- a/sdk/search/azure-search-documents/tests/conftest.py +++ b/sdk/search/azure-search-documents/tests/conftest.py @@ -25,6 +25,11 @@ def add_sanitizers(test_proxy): add_general_regex_sanitizer(value="AccountKey=FAKE;", regex=r"AccountKey=([^;]+);") # Remove storage account names from recordings add_general_regex_sanitizer(value="AccountName=fakestoragecs;", regex=r"AccountName=([^;]+);") + # Remove Azure OpenAI resource names from File knowledge source recordings + add_general_regex_sanitizer( + value="https://fake-openai.openai.azure.com", + regex=r"https://[^\"/]+\.openai\.azure\.com", + ) # Remove the following sanitizers since certain fields are needed in tests and are non-sensitive: # - AZSDK3493: $..name remove_batch_sanitizers(["AZSDK3493"]) diff --git a/sdk/search/azure-search-documents/tests/search_service_preparer.py b/sdk/search/azure-search-documents/tests/search_service_preparer.py index 03bcfed029e4..14575acc993d 100644 --- a/sdk/search/azure-search-documents/tests/search_service_preparer.py +++ b/sdk/search/azure-search-documents/tests/search_service_preparer.py @@ -18,6 +18,9 @@ "DefaultEndpointsProtocol=https;AccountName=fakestoragecs;AccountKey=FAKE;EndpointSuffix=core.windows.net" ) FAKE_STORAGE_CONTAINER_NAME = "fakestoragecontainer" +FAKE_AZURE_OPENAI_ENDPOINT = "https://fake-openai.openai.azure.com" +FAKE_AZURE_OPENAI_EMBEDDING_DEPLOYMENT = "fake-embedding-deployment" +FAKE_AZURE_OPENAI_EMBEDDING_MODEL = "text-embedding-3-small" SKILLSET_NOT_ENABLED_MESSAGE = "skillset related operations are not enabled in this region" SearchEnvVarPreparer = functools.partial( @@ -27,6 +30,9 @@ search_service_name=FAKE_SEARCH_SERVICE_NAME, search_storage_connection_string=FAKE_STORAGE_CONNECTION_STRING, search_storage_container_name=FAKE_STORAGE_CONTAINER_NAME, + search_azure_openai_endpoint=FAKE_AZURE_OPENAI_ENDPOINT, + search_azure_openai_embedding_deployment=FAKE_AZURE_OPENAI_EMBEDDING_DEPLOYMENT, + search_azure_openai_embedding_model=FAKE_AZURE_OPENAI_EMBEDDING_MODEL, ) diff --git a/sdk/search/azure-search-documents/tests/test_capabilities.py b/sdk/search/azure-search-documents/tests/test_capabilities.py new file mode 100644 index 000000000000..0e59caddc9ce --- /dev/null +++ b/sdk/search/azure-search-documents/tests/test_capabilities.py @@ -0,0 +1,22 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Tests for the current preview capability registry.""" + +from _capabilities import CAPABILITIES, _has_capability_attr, _resolve + + +def test_all_registered_capabilities_match_current_public_surface(): + unresolved = [] + + for name, capability in CAPABILITIES.items(): + try: + owner = _resolve(capability["owner"]) + except (ImportError, AttributeError): + unresolved.append(name) + continue + if any(not _has_capability_attr(owner, item) for item in capability["kwargs"]): + unresolved.append(name) + + assert unresolved == [] \ No newline at end of file diff --git a/sdk/search/azure-search-documents/tests/test_generator_workarounds.py b/sdk/search/azure-search-documents/tests/test_generator_workarounds.py new file mode 100644 index 000000000000..19f6b1d90612 --- /dev/null +++ b/sdk/search/azure-search-documents/tests/test_generator_workarounds.py @@ -0,0 +1,24 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Tests for package-owned post-generation workarounds.""" + +from pathlib import Path +import subprocess +import sys + + +def test_generator_workarounds_are_applied(): + package_root = Path(__file__).resolve().parents[1] + script = package_root / ".github/skills/azure-search-documents/scripts/apply_generator_workarounds.py" + + result = subprocess.run( + [sys.executable, str(script), "--check"], + cwd=package_root, + check=False, + capture_output=True, + text=True, + ) + + assert result.returncode == 0, result.stdout + result.stderr \ No newline at end of file diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py index 32466de31433..8c2e4c5e48e1 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client.py @@ -193,9 +193,12 @@ def generated_retrieve_stream(_self, _request, **kwargs): stream = client.retrieve_stream( KnowledgeBaseRetrievalRequest(), query_source_authorization="query-token", + query_work_iq_source_authorization="work-iq-token", ) assert isinstance(stream, KnowledgeBaseRetrievalStream) assert generated_kwargs["query_source_authorization"] == "query-token" + assert generated_kwargs["query_work_iq_source_authorization"] == "work-iq-token" + assert KnowledgeBaseRetrievalStream.__module__ == "azure.search.documents.knowledgebases" stream.close() observed = {} diff --git a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py index bc698d255278..70aa1557bf62 100644 --- a/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py +++ b/sdk/search/azure-search-documents/tests/test_knowledge_base_retrieval_client_async.py @@ -76,6 +76,47 @@ async def test_constructor_translates_audience_to_credential_scope(self): @pytest.mark.asyncio class TestKnowledgeBaseRetrievalStreamAsync: + async def test_stream_deserializes_all_known_event_types(self): + require_capability("AsyncKnowledgeBaseRetrievalStream", "KnowledgeBaseRetrievalEvent") + from azure.search.documents.knowledgebases.aio import AsyncKnowledgeBaseRetrievalStream + from azure.search.documents.knowledgebases.models import ( + KnowledgeBaseActivityStartedEvent, + KnowledgeBaseAnswerCompletedEvent, + KnowledgeBaseRetrievalStartedEvent, + KnowledgeBaseSearchIndexActivityRecord, + KnowledgeBaseSearchIndexReference, + KnowledgeBaseStreamErrorEvent, + ) + + raw_stream = _AsyncRawStream( + [ + _frame( + "retrieval.started", + { + "requestId": "request-id", + "knowledgeBaseName": KNOWLEDGE_BASE_NAME, + "outputMode": "extractiveData", + "reasoningEffort": {"kind": "minimal"}, + }, + ), + _frame("activity.started", {"id": 1, "type": "searchIndex", "startedAt": "2026-08-10T00:00:00Z"}), + _frame("activity.completed", {"id": 1, "type": "searchIndex"}), + _frame("answer.completed", {"messageIndex": 0, "message": {"role": "assistant", "content": []}}), + _frame("references.completed", [{"type": "searchIndex", "id": "doc-1", "activitySource": 1}]), + _frame("error", {"error": {"code": "Failed", "message": "retrieval failed"}}), + ] + ) + stream = AsyncKnowledgeBaseRetrievalStream(response=_AsyncResponse(), raw_stream=raw_stream) + events = [event async for event in stream] + + assert isinstance(events[0].data, KnowledgeBaseRetrievalStartedEvent) + assert isinstance(events[1].data, KnowledgeBaseActivityStartedEvent) + assert isinstance(events[2].data, KnowledgeBaseSearchIndexActivityRecord) + assert isinstance(events[3].data, KnowledgeBaseAnswerCompletedEvent) + assert isinstance(events[4].data[0], KnowledgeBaseSearchIndexReference) + assert isinstance(events[5].data, KnowledgeBaseStreamErrorEvent) + assert AsyncKnowledgeBaseRetrievalStream.__module__ == "azure.search.documents.knowledgebases.aio" + async def test_stream_handles_fragmented_events_and_terminal_cleanup(self): require_capability("AsyncKnowledgeBaseRetrievalStream", "KnowledgeBaseRetrievalEvent") from azure.search.documents.knowledgebases.aio import AsyncKnowledgeBaseRetrievalStream @@ -154,9 +195,11 @@ async def generated_retrieve_stream(_self, _request, **kwargs): ): stream = await client.retrieve_stream( KnowledgeBaseRetrievalRequest(), + query_source_authorization="query-token", query_work_iq_source_authorization="work-iq-token", ) assert isinstance(stream, AsyncKnowledgeBaseRetrievalStream) + assert generated_kwargs["query_source_authorization"] == "query-token" assert generated_kwargs["query_work_iq_source_authorization"] == "work-iq-token" await stream.close() diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client.py b/sdk/search/azure-search-documents/tests/test_search_index_client.py index cf51d3842cc3..ce9222042155 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client.py @@ -185,3 +185,55 @@ def test_delete_knowledge_source_file_forwards_file_id(self, mock_delete): kwargs = mock_delete.call_args.kwargs assert kwargs["name"] == "files-source" assert kwargs["file_id"] == "file-1" + + @mock.patch( + "azure.search.documents.indexes._operations._operations." + "_SearchIndexClientOperationsMixin.update_knowledge_source_file" + ) + def test_update_knowledge_source_file_uses_name_first_and_forwards_by_keyword(self, mock_update): + require_capability("azure.search.documents.indexes.SearchIndexClient.update_knowledge_source_file") + from azure.search.documents.indexes.models import UpdateKnowledgeSourceFileRequest + + body = UpdateKnowledgeSourceFileRequest({"metadata": {"fileName": "updated.txt"}, "content": b"updated"}) + + _client().update_knowledge_source_file("files-source", "file-1", body) + + mock_update.assert_called_once_with(name="files-source", file_id="file-1", body=body) + + +@pytest.mark.parametrize( + ("public_method", "generated_method"), + [ + ("get_synonym_maps", "_get_synonym_maps"), + ("get_data_source_connections", "_get_data_source_connections"), + ("get_indexers", "_get_indexers"), + ("get_skillsets", "_get_skillsets"), + ], +) +def test_custom_list_wrappers_forward_search_paging(public_method, generated_method): + from azure.search.documents.indexes import SearchIndexerClient + + client = _client() if public_method == "get_synonym_maps" else SearchIndexerClient(ENDPOINT, AzureKeyCredential(KEY)) + generated_owner = ( + "_SearchIndexClientOperationsMixin" if public_method == "get_synonym_maps" else "_SearchIndexerClientOperationsMixin" + ) + patch_target = ( + "azure.search.documents.indexes._operations._operations." + f"{generated_owner}.{generated_method}" + ) + + with mock.patch(patch_target, return_value=[]) as mock_list: + result = getattr(client, public_method)( + select=["name"], + search="hot", + page_size=2, + search_type="prefix", + ) + + assert result == [] + mock_list.assert_called_once_with( + select=["name"], + search="hot", + page_size=2, + search_type="prefix", + ) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_async.py index dc583e6e9b4b..29706ea4777d 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_async.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_async.py @@ -202,3 +202,56 @@ async def test_delete_knowledge_source_file_forwards_file_id(self): kwargs = mock_delete.call_args.kwargs assert kwargs["name"] == "files-source" assert kwargs["file_id"] == "file-1" + + async def test_update_knowledge_source_file_uses_name_first_and_forwards_by_keyword(self): + require_capability("azure.search.documents.indexes.aio.SearchIndexClient.update_knowledge_source_file") + from azure.search.documents.indexes.models import UpdateKnowledgeSourceFileRequest + + body = UpdateKnowledgeSourceFileRequest({"metadata": {"fileName": "updated.txt"}, "content": b"updated"}) + with mock.patch( + "azure.search.documents.indexes.aio._operations._operations." + "_SearchIndexClientOperationsMixin.update_knowledge_source_file", + new_callable=mock.AsyncMock, + ) as mock_update: + await _client().update_knowledge_source_file("files-source", "file-1", body) + + mock_update.assert_awaited_once_with(name="files-source", file_id="file-1", body=body) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("public_method", "generated_method"), + [ + ("get_synonym_maps", "_get_synonym_maps"), + ("get_data_source_connections", "_get_data_source_connections"), + ("get_indexers", "_get_indexers"), + ("get_skillsets", "_get_skillsets"), + ], +) +async def test_custom_list_wrappers_forward_search_paging(public_method, generated_method): + from azure.search.documents.indexes.aio import SearchIndexerClient + + client = _client() if public_method == "get_synonym_maps" else SearchIndexerClient(ENDPOINT, AzureKeyCredential(KEY)) + generated_owner = ( + "_SearchIndexClientOperationsMixin" if public_method == "get_synonym_maps" else "_SearchIndexerClientOperationsMixin" + ) + patch_target = ( + "azure.search.documents.indexes.aio._operations._operations." + f"{generated_owner}.{generated_method}" + ) + + with mock.patch(patch_target, side_effect=_empty_async_pager) as mock_list: + result = await getattr(client, public_method)( + select=["name"], + search="hot", + page_size=2, + search_type="prefix", + ) + + assert result == [] + mock_list.assert_called_once_with( + select=["name"], + search="hot", + page_size=2, + search_type="prefix", + ) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py new file mode 100644 index 000000000000..5e6c103c3891 --- /dev/null +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py @@ -0,0 +1,156 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Live tests for synchronous File knowledge source operations.""" + +from __future__ import annotations + +from devtools_testutils import AzureRecordedTestCase + +from _capabilities import require_capability +from _search_helpers import live_test, make_index_client, safe_delete + +_FILE_CAPABILITIES = ( + "azure.search.documents.indexes.SearchIndexClient.create_or_update_knowledge_source", + "azure.search.documents.indexes.SearchIndexClient.delete_knowledge_source", + "azure.search.documents.indexes.SearchIndexClient.upload_knowledge_source_file_multipart", + "azure.search.documents.indexes.SearchIndexClient.update_knowledge_source_file", + "azure.search.documents.indexes.SearchIndexClient.list_knowledge_source_files", + "azure.search.documents.indexes.SearchIndexClient.delete_knowledge_source_file", + "azure.search.documents.indexes.models.FileKnowledgeSource", + "azure.search.documents.indexes.models.FileKnowledgeSourceParameters", + "azure.search.documents.indexes.models.FileUploadMetadata", + "azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest", + "azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest", + "azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer", + "azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters", +) + + +def _build_file_knowledge_source(name, endpoint, deployment, model): + from azure.search.documents.indexes.models import ( + AzureOpenAIVectorizerParameters, + FileKnowledgeSource, + FileKnowledgeSourceParameters, + ) + from azure.search.documents.knowledgebases.models import ( + KnowledgeSourceAzureOpenAIVectorizer, + KnowledgeSourceIngestionParameters, + ) + + return FileKnowledgeSource( + name=name, + file_parameters=FileKnowledgeSourceParameters( + ingestion_parameters=KnowledgeSourceIngestionParameters( + content_extraction_mode="minimal", + network_access_mode="public", + embedding_model=KnowledgeSourceAzureOpenAIVectorizer( + azure_open_ai_parameters=AzureOpenAIVectorizerParameters( + resource_url=endpoint, + deployment_name=deployment, + model_name=model, + ) + ), + ) + ), + ) + + +class TestSearchIndexClientKnowledgeSourceFiles(AzureRecordedTestCase): + @live_test() + def test_multipart_upload_update_list_and_delete( + self, + endpoint: str, + search_azure_openai_endpoint: str, + search_azure_openai_embedding_deployment: str, + search_azure_openai_embedding_model: str, + ) -> None: + require_capability(*_FILE_CAPABILITIES) + from azure.search.documents.indexes.models import ( + FileUploadMetadata, + UpdateKnowledgeSourceFileRequest, + UploadKnowledgeSourceFileMultipartRequest, + ) + + source_name = self.get_resource_name("knowledge-source-files") + primary_id = None + annex_id = None + + with make_index_client(endpoint) as client: + try: + client.create_or_update_knowledge_source( + _build_file_knowledge_source( + source_name, + search_azure_openai_endpoint, + search_azure_openai_embedding_deployment, + search_azure_openai_embedding_model, + ) + ) + + primary_metadata = FileUploadMetadata( + file_name="hotels/primary.txt", + metadata={"category": "hotel", "city": "Seattle"}, + ) + primary = client.upload_knowledge_source_file_multipart( + source_name, + UploadKnowledgeSourceFileMultipartRequest( + metadata=primary_metadata, + content=("primary.txt", b"Historic Harbor Hotel has free parking.", "text/plain"), + ), + ) + primary_id = primary.file_id + assert primary_id is not None + + annex = client.upload_knowledge_source_file_multipart( + source_name, + UploadKnowledgeSourceFileMultipartRequest( + metadata=FileUploadMetadata( + file_name="hotels/annex.txt", + metadata={"category": "hotel", "city": "Portland"}, + ), + content=("annex.txt", b"Harbor Hotel Annex has meeting rooms.", "text/plain"), + ), + ) + annex_id = annex.file_id + assert annex_id is not None + + updated = client.update_knowledge_source_file( + source_name, + primary_id, + UpdateKnowledgeSourceFileRequest( + metadata=primary_metadata, + content=( + "primary.txt", + b"Historic Harbor Hotel has free parking and free Wi-Fi.", + "text/plain", + ), + ), + ) + assert updated.file_id == primary_id + assert updated.metadata == {"category": "hotel", "city": "Seattle"} + + files = list( + client.list_knowledge_source_files( + source_name, + prefix="hotels/", + search="hotels", + page_size=1, + search_type="prefix", + ) + ) + file_ids = [file.file_id for file in files] + assert set(file_ids) == {primary_id, annex_id} + assert len(file_ids) == len(set(file_ids)) + + client.delete_knowledge_source_file(source_name, primary_id) + primary_id = None + client.delete_knowledge_source_file(source_name, annex_id) + annex_id = None + assert list(client.list_knowledge_source_files(source_name, prefix="hotels/")) == [] + finally: + if primary_id is not None: + safe_delete(client.delete_knowledge_source_file, source_name, primary_id) + if annex_id is not None: + safe_delete(client.delete_knowledge_source_file, source_name, annex_id) + safe_delete(client.delete_knowledge_source, source_name) \ No newline at end of file diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py new file mode 100644 index 000000000000..8f3926dc949a --- /dev/null +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py @@ -0,0 +1,157 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Live tests for asynchronous File knowledge source operations.""" + +from __future__ import annotations + +from devtools_testutils import AzureRecordedTestCase + +from _capabilities import require_capability +from _search_helpers_async import live_test, make_index_client, safe_delete + +_FILE_CAPABILITIES = ( + "azure.search.documents.indexes.aio.SearchIndexClient.create_or_update_knowledge_source", + "azure.search.documents.indexes.aio.SearchIndexClient.delete_knowledge_source", + "azure.search.documents.indexes.aio.SearchIndexClient.upload_knowledge_source_file_multipart", + "azure.search.documents.indexes.aio.SearchIndexClient.update_knowledge_source_file", + "azure.search.documents.indexes.aio.SearchIndexClient.list_knowledge_source_files", + "azure.search.documents.indexes.aio.SearchIndexClient.delete_knowledge_source_file", + "azure.search.documents.indexes.models.FileKnowledgeSource", + "azure.search.documents.indexes.models.FileKnowledgeSourceParameters", + "azure.search.documents.indexes.models.FileUploadMetadata", + "azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest", + "azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest", + "azure.search.documents.knowledgebases.models.KnowledgeSourceAzureOpenAIVectorizer", + "azure.search.documents.knowledgebases.models.KnowledgeSourceIngestionParameters", +) + + +def _build_file_knowledge_source(name, endpoint, deployment, model): + from azure.search.documents.indexes.models import ( + AzureOpenAIVectorizerParameters, + FileKnowledgeSource, + FileKnowledgeSourceParameters, + ) + from azure.search.documents.knowledgebases.models import ( + KnowledgeSourceAzureOpenAIVectorizer, + KnowledgeSourceIngestionParameters, + ) + + return FileKnowledgeSource( + name=name, + file_parameters=FileKnowledgeSourceParameters( + ingestion_parameters=KnowledgeSourceIngestionParameters( + content_extraction_mode="minimal", + network_access_mode="public", + embedding_model=KnowledgeSourceAzureOpenAIVectorizer( + azure_open_ai_parameters=AzureOpenAIVectorizerParameters( + resource_url=endpoint, + deployment_name=deployment, + model_name=model, + ) + ), + ) + ), + ) + + +class TestSearchIndexClientKnowledgeSourceFilesAsync(AzureRecordedTestCase): + @live_test() + async def test_multipart_upload_update_list_and_delete( + self, + endpoint: str, + search_azure_openai_endpoint: str, + search_azure_openai_embedding_deployment: str, + search_azure_openai_embedding_model: str, + ) -> None: + require_capability(*_FILE_CAPABILITIES) + from azure.search.documents.indexes.models import ( + FileUploadMetadata, + UpdateKnowledgeSourceFileRequest, + UploadKnowledgeSourceFileMultipartRequest, + ) + + source_name = self.get_resource_name("knowledge-source-files") + primary_id = None + annex_id = None + + async with make_index_client(endpoint) as client: + try: + await client.create_or_update_knowledge_source( + _build_file_knowledge_source( + source_name, + search_azure_openai_endpoint, + search_azure_openai_embedding_deployment, + search_azure_openai_embedding_model, + ) + ) + + primary_metadata = FileUploadMetadata( + file_name="hotels/primary.txt", + metadata={"category": "hotel", "city": "Seattle"}, + ) + primary = await client.upload_knowledge_source_file_multipart( + source_name, + UploadKnowledgeSourceFileMultipartRequest( + metadata=primary_metadata, + content=("primary.txt", b"Historic Harbor Hotel has free parking.", "text/plain"), + ), + ) + primary_id = primary.file_id + assert primary_id is not None + + annex = await client.upload_knowledge_source_file_multipart( + source_name, + UploadKnowledgeSourceFileMultipartRequest( + metadata=FileUploadMetadata( + file_name="hotels/annex.txt", + metadata={"category": "hotel", "city": "Portland"}, + ), + content=("annex.txt", b"Harbor Hotel Annex has meeting rooms.", "text/plain"), + ), + ) + annex_id = annex.file_id + assert annex_id is not None + + updated = await client.update_knowledge_source_file( + source_name, + primary_id, + UpdateKnowledgeSourceFileRequest( + metadata=primary_metadata, + content=( + "primary.txt", + b"Historic Harbor Hotel has free parking and free Wi-Fi.", + "text/plain", + ), + ), + ) + assert updated.file_id == primary_id + assert updated.metadata == {"category": "hotel", "city": "Seattle"} + + files = [ + file + async for file in client.list_knowledge_source_files( + source_name, + prefix="hotels/", + search="hotels", + page_size=1, + search_type="prefix", + ) + ] + file_ids = [file.file_id for file in files] + assert set(file_ids) == {primary_id, annex_id} + assert len(file_ids) == len(set(file_ids)) + + await client.delete_knowledge_source_file(source_name, primary_id) + primary_id = None + await client.delete_knowledge_source_file(source_name, annex_id) + annex_id = None + assert [file async for file in client.list_knowledge_source_files(source_name, prefix="hotels/")] == [] + finally: + if primary_id is not None: + await safe_delete(client.delete_knowledge_source_file, source_name, primary_id) + if annex_id is not None: + await safe_delete(client.delete_knowledge_source_file, source_name, annex_id) + await safe_delete(client.delete_knowledge_source, source_name) \ No newline at end of file From d866d09f573eccbb22e6f32f04783994b302c162 Mon Sep 17 00:00:00 2001 From: Efrain Retana Date: Mon, 24 Aug 2026 15:38:54 -0500 Subject: [PATCH 15/17] Add File KKS tests, green tests --- .../azure-search-documents/GENERATOR-BUGS.md | 87 ------------------- sdk/search/azure-search-documents/assets.json | 2 +- .../tests/_capabilities.py | 4 + .../azure-search-documents/tests/conftest.py | 2 +- .../tests/search_service_preparer.py | 4 +- ...ndex_client_knowledge_source_files_live.py | 1 - ...lient_knowledge_source_files_live_async.py | 1 - 7 files changed, 8 insertions(+), 93 deletions(-) delete mode 100644 sdk/search/azure-search-documents/GENERATOR-BUGS.md diff --git a/sdk/search/azure-search-documents/GENERATOR-BUGS.md b/sdk/search/azure-search-documents/GENERATOR-BUGS.md deleted file mode 100644 index 69ae3d9b119c..000000000000 --- a/sdk/search/azure-search-documents/GENERATOR-BUGS.md +++ /dev/null @@ -1,87 +0,0 @@ -# Python emitter generates invalid type annotations for Azure AI Search - -## Suggested issue title - -Python emitter generates invalid enum imports and TypedDict inheritance for Azure AI Search - -## Environment - -- Package: `azure-search-documents` -- API version: `2026-08-01-preview` -- Python emitter: `@azure-tools/typespec-python` 0.63.3 -- TypeSpec project: `specification/search/data-plane/Search` -- TypeSpec commit: `84400eeb46c48ffe88d81e126449725508c17547` -- Validation: MyPy with Python 3.10 compatibility - -## Summary - -The Python emitter generates four MyPy errors across three `types.py` surfaces. Direct edits to -these files are not viable because SDK regeneration overwrites them. - -## Reproduction - -Generate `azure-search-documents` from the TypeSpec project above, then run: - -```shell -azpysdk --isolate mypy . -``` - -## Actual diagnostics - -```text -azure/search/documents/types.py:16: error: Module "azure.search.documents.models" has no attribute "SemanticQueryRewritesResultType" [attr-defined] -azure/search/documents/types.py:382: error: Name "_enums" is not defined [name-defined] -azure/search/documents/knowledgebases/types.py:28: error: Name "KnowledgeSourceKind" already defined (possibly by an import) [no-redef] -azure/search/documents/indexes/types.py:5443: error: Overwriting TypedDict field "generatedKeyName" while extending [misc] -``` - -## Bug 1: inconsistent enum export and reference - -`SemanticQueryRewritesResultType` is generated in `azure.search.documents.models._enums`, but it is -not exported from `azure.search.documents.models`. The generated `TYPE_CHECKING` import expects the -public export, while `SearchDocumentsResult` refers to the undefined name -`_enums.SemanticQueryRewritesResultType`. - -Expected generation: - -1. Export `SemanticQueryRewritesResultType` from `azure.search.documents.models`. -2. Use a valid direct or public reference in `SearchDocumentsResult`, consistent with the other - generated enum annotations. - -## Bug 2: duplicate enum import - -`azure.search.documents.knowledgebases.types` imports `KnowledgeSourceKind` at runtime from -`indexes.models._enums`, then imports the same name again under `TYPE_CHECKING` from -`indexesmodels`. - -Expected generation: emit only one import for `KnowledgeSourceKind`. The existing runtime import is -sufficient for the generated `Literal` annotations. - -## Bug 3: TypedDict requiredness override - -`SearchIndexerKnowledgeStoreProjectionSelector` declares `generatedKeyName` as optional because the -base `TypedDict` uses `total=False`. `SearchIndexerKnowledgeStoreTableProjectionSelector` inherits -from it and redeclares the same key as `Required[str]`. MyPy does not permit changing a TypedDict -key's requiredness through inheritance. - -Expected generation: preserve `generatedKeyName` as required for table projections without -overwriting an inherited TypedDict field. One valid representation is a standalone table-projection -TypedDict containing the shared selector fields plus required `generatedKeyName` and `tableName`. - -## Expected result - -The generated package passes MyPy without SDK-side edits to generated files, while preserving the -public enum exports and required fields represented by the TypeSpec model. - -## Temporary SDK workaround - -Until the emitter is fixed, the SDK repository applies exact post-generation replacements with: - -```shell -python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py -python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py --check -``` - -The script is idempotent and fails if regenerated output differs from the expected emitter shape. -It repairs only the four diagnostics listed above. Delete the script and its regeneration-guide -references after upgrading to an emitter version that passes MyPy without these replacements. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/assets.json b/sdk/search/azure-search-documents/assets.json index fcbf45b2376c..87064b838664 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": "python", "TagPrefix": "python/search/azure-search-documents", - "Tag": "python/search/azure-search-documents_766e6de99d" + "Tag": "python/search/azure-search-documents_a3f89a168c" } diff --git a/sdk/search/azure-search-documents/tests/_capabilities.py b/sdk/search/azure-search-documents/tests/_capabilities.py index f557ee71d72d..fd74ecc968e2 100644 --- a/sdk/search/azure-search-documents/tests/_capabilities.py +++ b/sdk/search/azure-search-documents/tests/_capabilities.py @@ -58,7 +58,11 @@ def _model_capabilities() -> Mapping[str, Mapping[str, Any]]: # File f"{_IM}.FileKnowledgeSource", f"{_IM}.FileKnowledgeSourceParameters", + f"{_IM}.FileUploadMetadata", + f"{_IM}.UpdateKnowledgeSourceFileRequest", + f"{_IM}.UploadKnowledgeSourceFileMultipartRequest", f"{_KBM}.FileKnowledgeSourceParams", + f"{_KBM}.KnowledgeSourceAzureOpenAIVectorizer", # MCP server f"{_IM}.McpServerKnowledgeSource", f"{_IM}.McpServerKnowledgeSourceParameters", diff --git a/sdk/search/azure-search-documents/tests/conftest.py b/sdk/search/azure-search-documents/tests/conftest.py index ebdf95eee34e..a2b9c3a39153 100644 --- a/sdk/search/azure-search-documents/tests/conftest.py +++ b/sdk/search/azure-search-documents/tests/conftest.py @@ -19,7 +19,7 @@ def add_sanitizers(test_proxy): # Ensure all search service endpoint names are mocked to "test-service" add_general_regex_sanitizer( value="://fakesearchendpoint.search.windows.net", - regex=r"://(.+).search.windows.net", + regex=r"://([^/\"]+)\.search\.windows\.net", ) # Remove storage connection strings from recordings add_general_regex_sanitizer(value="AccountKey=FAKE;", regex=r"AccountKey=([^;]+);") diff --git a/sdk/search/azure-search-documents/tests/search_service_preparer.py b/sdk/search/azure-search-documents/tests/search_service_preparer.py index 14575acc993d..f9eb7872978c 100644 --- a/sdk/search/azure-search-documents/tests/search_service_preparer.py +++ b/sdk/search/azure-search-documents/tests/search_service_preparer.py @@ -18,8 +18,8 @@ "DefaultEndpointsProtocol=https;AccountName=fakestoragecs;AccountKey=FAKE;EndpointSuffix=core.windows.net" ) FAKE_STORAGE_CONTAINER_NAME = "fakestoragecontainer" -FAKE_AZURE_OPENAI_ENDPOINT = "https://fake-openai.openai.azure.com" -FAKE_AZURE_OPENAI_EMBEDDING_DEPLOYMENT = "fake-embedding-deployment" +FAKE_AZURE_OPENAI_ENDPOINT = "https://fake-openai.openai.azure.com/" +FAKE_AZURE_OPENAI_EMBEDDING_DEPLOYMENT = "text-embedding-3-small" FAKE_AZURE_OPENAI_EMBEDDING_MODEL = "text-embedding-3-small" SKILLSET_NOT_ENABLED_MESSAGE = "skillset related operations are not enabled in this region" diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py index 5e6c103c3891..a72122a06398 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live.py @@ -44,7 +44,6 @@ def _build_file_knowledge_source(name, endpoint, deployment, model): file_parameters=FileKnowledgeSourceParameters( ingestion_parameters=KnowledgeSourceIngestionParameters( content_extraction_mode="minimal", - network_access_mode="public", embedding_model=KnowledgeSourceAzureOpenAIVectorizer( azure_open_ai_parameters=AzureOpenAIVectorizerParameters( resource_url=endpoint, diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py index 8f3926dc949a..02f25f139341 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_knowledge_source_files_live_async.py @@ -44,7 +44,6 @@ def _build_file_knowledge_source(name, endpoint, deployment, model): file_parameters=FileKnowledgeSourceParameters( ingestion_parameters=KnowledgeSourceIngestionParameters( content_extraction_mode="minimal", - network_access_mode="public", embedding_model=KnowledgeSourceAzureOpenAIVectorizer( azure_open_ai_parameters=AzureOpenAIVectorizerParameters( resource_url=endpoint, From 4a402b6ac4993170107097e6b5987e8cf65a6773 Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Mon, 24 Aug 2026 22:28:49 +0000 Subject: [PATCH 16/17] Address copilot comments --- .../references/customizations.md | 3 +- sdk/search/azure-search-documents/GAPS.md | 98 ------------------- sdk/search/azure-search-documents/README.md | 2 +- ...wledge_base_configuration_preview_async.py | 4 +- 4 files changed, 4 insertions(+), 103 deletions(-) delete mode 100644 sdk/search/azure-search-documents/GAPS.md 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 fdcebd021778..574d00a386d2 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 @@ -4,8 +4,7 @@ File-by-file inventory of every non-empty `_patch.py` in `azure-search-documents ## Temporary Python emitter workarounds -Until the issues in `GENERATOR-BUGS.md` are fixed upstream, run the package-owned rewriter after -every regeneration: + Until the emitter issues encoded in the package-owned rewriter are fixed upstream, run it after ```bash python .github/skills/azure-search-documents/scripts/apply_generator_workarounds.py diff --git a/sdk/search/azure-search-documents/GAPS.md b/sdk/search/azure-search-documents/GAPS.md deleted file mode 100644 index 2616a10bd675..000000000000 --- a/sdk/search/azure-search-documents/GAPS.md +++ /dev/null @@ -1,98 +0,0 @@ -# Azure Search Documents 2026-08-01-preview Gap Disposition - -This report verifies the Python SDK against Azure/azure-rest-api-specs commit -`c195a3fe73b28cd90bf8a302944b2c0ec3d80def` and the package-specific regeneration, -testing, and release guidance. - -## Resolved locally - -| Finding | Resolution | -|---|---| -| File update argument order | Added sync and async `_patch.py` wrappers exposing `update_knowledge_source_file(name, file_id, body)` and forwarding to generated code by keyword. Focused tests verify both signatures and delegation. | -| Stream class namespace | Set `KnowledgeBaseRetrievalStream.__module__` to `azure.search.documents.knowledgebases` and `AsyncKnowledgeBaseRetrievalStream.__module__` to `azure.search.documents.knowledgebases.aio`. | -| File operation coverage | Added sync and async tests for the customized File update operation. Registered both update and multipart upload operations in the preview capability surface. | -| Listing capability and wrapper coverage | Registered `search`, `page_size`, and `search_type` on all August list surfaces, plus File-list `prefix`. Added sync and async forwarding tests for the four SDK-owned list wrappers. | -| Streaming asymmetry | Added async deserialization coverage for all known event types and mirrored both authorization-header forwarding assertions in sync and async tests. | -| Stale preview capabilities | Removed `WorkIQAttribution`, `McpServerTool.inclusion_mode`, and removed inclusion-mode enum members. Added `KnowledgeBaseWorkIQReference.search_sensitivity_label_info` and current August operation/parameter capabilities. All registered capabilities now resolve. | -| Generator workaround drift | Added a package test that executes `apply_generator_workarounds.py --check`. Updated the script to skip obsolete issue shapes only when the affected generated feature is absent, while retaining fail-fast behavior for unknown output. | -| Generated ingestion-parameter import | Corrected the generated `indexes.types` type-only import to resolve `KnowledgeSourceIngestionParameters` from the public `knowledgebases.models` namespace. Added the exact repair to the package-owned post-generation workaround. | -| APIView artifact refresh | Regenerated `api.md` and `api.metadata.yml` from the fresh token. The artifact now shows `update_knowledge_source_file(name, file_id, body)` and both stream classes in their public namespaces. | -| Release notes | Updated the pinned TypeSpec commit, removed the post-cut logical-reasoning claim, and recorded the SDK-owned signature and namespace fixes. | - -## Findings rejected - -### Generated `types` modules are not missing from `__all__` - -The three `types` modules are explicitly importable and documented. Azure SDK package `__all__` -lists public symbols for wildcard imports, not submodule objects. Adding `types` would diverge from -repository-wide generated package conventions without improving explicit imports or APIView. - -### Generated base-client API-version prose is not the exported client contract - -Generated base clients describe `api_version=None`, meaning “use the operation default.” The -exported clients are package `_patch.py` subclasses whose docstrings name -`ApiVersion.V2026_08_01_PREVIEW`, and every configuration resolves an omitted value to -`"2026-08-01-preview"`. Editing generated base files would be overwritten and is prohibited by the -package customization guide. - -### Shared event exports in the async namespace are intentional convenience exports - -`KnowledgeBaseRetrievalEvent` and `KnowledgeBaseRetrievalEventData` are transport-neutral event -types used by both stream implementations. Keeping them available from the async namespace avoids -forcing async users to import the synchronous package. Their canonical module remains -`azure.search.documents.knowledgebases`; removing the async aliases would be an unnecessary preview -breaking change. - -## Remaining gaps - -### Multipart File service recording - -The new multipart upload and update service behavior does not yet have a recorded live pytest using -a File knowledge source. Public surface, request models, samples, capability registration, and the -SDK-owned update wrapper are covered locally, but a Test Proxy recording requires provisioned File -knowledge-source resources. Before declaring live-sample coverage complete, record matching sync and -async tests for multipart upload/update and push the updated `assets.json` tag. This does not block -unit, MyPy, Pylint, Sphinx, or existing playback validation. - -### Changelog verifier integration - -The package `CHANGELOG.md` is updated for `12.1.0b2`, but `azpysdk changelog verify` cannot use the -repository-pinned Chronus installation because the launcher hardcodes `.github/package.json` and -`.github/node_modules/.bin/chronus`; the actual pinned project and lockfile are under -`.github/chronus`. Invoking that pinned Chronus binary directly reports that -`azure-search-documents` has no pending changeset. The package release guide still documents direct -`CHANGELOG.md` maintenance, and adding a `feature` changeset would request a new minor version rather -than the planned beta patch. The repository changelog-tool owner should reconcile the launcher path -and release workflow before Chronus verification is treated as a package blocker. - -## APIView export environment disposition - -`azpysdk apistub .` successfully generates a fresh `azure-search-documents_python.json` token. The -token contains the corrected public `update_knowledge_source_file(name, file_id, body)` signature and -the public stream namespaces. - -The system-installed PowerShell 7.6.4 runtime aborted with a stack overflow on every command tested, -including `1+1`, `Write-Output`, and two-byte JSON parsing. Package integrity verification reported -no modified installed files. Side-by-side Microsoft PowerShell 7.6.3 and 7.5.9 packages passed the -same runtime smoke tests, identifying 7.6.4 as the regression boundary. The APIView failure also -reproduced for the released `azure-search-documents==12.1.0b1` wheel, proving it was not caused by -this SDK surface. PowerShell 7.5.9 completed the supported `azpysdk apistub .` workflow. No API -artifact was hand-edited. - -## Local release validation - -The following checks pass on the final local package: - -- Tests: 336 passed, with no failures, skips, or warnings. -- MyPy: 74 source files and 64 sample files pass. -- Pylint: no warnings or errors. -- Sphinx: strict build passes with no warnings. -- Black: formatting passes with no changes. -- VerifyTypes: passes with 99.5% completeness; remaining partial types are existing dynamic - patch/mixin annotations and are nonblocking. -- Import-all, sdist verification, wheel verification, and Bandit all pass. - -The aggregate Azure SDK MCP check could not start its server, so equivalent local `azpysdk` checks -were run individually. APIView token, Markdown, and metadata generation pass with PowerShell 7.5.9; -the system PowerShell 7.6.4 installation remains unusable and should be downgraded or repaired before -future APIView regeneration. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index c46ba225c56e..bc1fb3f5242e 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -134,7 +134,7 @@ An Azure AI Search service contains one or more indexes that provide persistent storage of searchable data in the form of JSON documents. _(If you're brand new to search, you can make a very rough analogy between indexes and database tables.)_ The Azure.Search.Documents client library -exposes operations on these resources through three main client types. +exposes operations on these resources through four main client types. * `SearchClient` helps with: * [Searching](https://learn.microsoft.com/azure/search/search-lucene-query-architecture) diff --git a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py index 564d3acf9d9a..ea45fb98e6bf 100644 --- a/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py +++ b/sdk/search/azure-search-documents/samples/sample_knowledge_base_configuration_preview_async.py @@ -120,7 +120,7 @@ async def main(): retrieve_defaults=KnowledgeBaseRetrieveDefaults( max_runtime_in_seconds=60, max_output_documents=20, - max_output_size_in_tokens=4000, + max_output_size_in_tokens=5000, ), ) created_knowledge_base = await index_client.create_or_update_knowledge_base(knowledge_base) @@ -130,7 +130,7 @@ async def main(): assert retrieved_knowledge_base.retrieval_reasoning_effort is not None assert retrieved_knowledge_base.retrieve_defaults is not None assert retrieved_knowledge_base.retrieval_reasoning_effort.kind == "auto" - assert retrieved_knowledge_base.retrieve_defaults.max_output_size_in_tokens == 4000 + assert retrieved_knowledge_base.retrieve_defaults.max_output_size_in_tokens == 5000 retrieval_client = KnowledgeBaseRetrievalClient( service_endpoint, AzureKeyCredential(key), knowledge_base_name=knowledge_base_name From db151fca3722521fbac9200afffc36598bbaf067 Mon Sep 17 00:00:00 2001 From: efrainretana <141282336+efrainretana@users.noreply.github.com> Date: Mon, 24 Aug 2026 22:59:25 +0000 Subject: [PATCH 17/17] Fix type import error --- .../skills/azure-search-documents/references/customizations.md | 1 + .../azure/search/documents/indexes/types.py | 2 +- .../azure/search/documents/knowledgebases/types.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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 574d00a386d2..facd5134f7b5 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 @@ -15,6 +15,7 @@ The script is idempotent and applies exact replacements only. It exits with an e files if the emitter output no longer matches either the known generated or patched form. Remove the script and these instructions after the emitter produces all four corrected type surfaces and the package passes MyPy without the rewriter. +Note: Occasionally, types.py might import packages incorrectly. Verify that the imports are valid and actually reference something valid. --- diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py index 6b60af3660d6..adf851efecd6 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/types.py @@ -25,7 +25,7 @@ if TYPE_CHECKING: from ..knowledgebases.models import KnowledgeSourceIngestionParameters from ..knowledgebases.types import KnowledgeRetrievalReasoningEffort - from ..knowledgebasesmodels import KnowledgeRetrievalOutputMode + from ..knowledgebases.models import KnowledgeRetrievalOutputMode from .models import ( AIFoundryModelCatalogName, AzureOpenAIModelName, diff --git a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py index f5acb7257fd8..ac3703cb3c23 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py +++ b/sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: from ..indexes.types import SearchIndexKnowledgeSourceQueryHints - from ..indexesmodels import KnowledgeSourceResultsProcessing + from ..indexes.models import KnowledgeSourceResultsProcessing from .models import KnowledgeRetrievalOutputMode