diff --git a/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs
index e6da67e60f81..d234dfe78aac 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/AliasesRestClient.cs
@@ -18,7 +18,7 @@ namespace Azure.Search.Documents
internal partial class AliasesRestClient
{
private readonly HttpPipeline _pipeline;
- private readonly string _endpoint;
+ private readonly Uri _endpoint;
private readonly Guid? _xMsClientRequestId;
private readonly string _apiVersion;
@@ -32,7 +32,7 @@ internal partial class AliasesRestClient
/// The tracking ID sent with the request to help with debugging.
/// Api Version.
/// , , or is null.
- public AliasesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-03-01-preview")
+ public AliasesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
{
ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
@@ -47,7 +47,7 @@ internal HttpMessage CreateCreateRequest(SearchAlias @alias)
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/aliases", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
@@ -119,7 +119,7 @@ internal HttpMessage CreateListRequest()
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/aliases", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
@@ -173,7 +173,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string aliasName, SearchAlias @
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/aliases('", false);
uri.AppendPath(aliasName, true);
uri.AppendPath("')", false);
@@ -272,7 +272,7 @@ internal HttpMessage CreateDeleteRequest(string aliasName, string ifMatch, strin
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/aliases('", false);
uri.AppendPath(aliasName, true);
uri.AppendPath("')", false);
@@ -346,7 +346,7 @@ internal HttpMessage CreateGetRequest(string aliasName)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/aliases('", false);
uri.AppendPath(aliasName, true);
uri.AppendPath("')", false);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs
index 8e2fe902a54b..d9cf19a1abd3 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/DataSourcesRestClient.cs
@@ -18,7 +18,7 @@ namespace Azure.Search.Documents
internal partial class DataSourcesRestClient
{
private readonly HttpPipeline _pipeline;
- private readonly string _endpoint;
+ private readonly Uri _endpoint;
private readonly Guid? _xMsClientRequestId;
private readonly string _apiVersion;
@@ -32,7 +32,7 @@ internal partial class DataSourcesRestClient
/// The tracking ID sent with the request to help with debugging.
/// Api Version.
/// , , or is null.
- public DataSourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-03-01-preview")
+ public DataSourcesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
{
ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
@@ -47,7 +47,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string dataSourceName, SearchIn
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/datasources('", false);
uri.AppendPath(dataSourceName, true);
uri.AppendPath("')", false);
@@ -152,7 +152,7 @@ internal HttpMessage CreateDeleteRequest(string dataSourceName, string ifMatch,
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/datasources('", false);
uri.AppendPath(dataSourceName, true);
uri.AppendPath("')", false);
@@ -226,7 +226,7 @@ internal HttpMessage CreateGetRequest(string dataSourceName)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/datasources('", false);
uri.AppendPath(dataSourceName, true);
uri.AppendPath("')", false);
@@ -296,7 +296,7 @@ internal HttpMessage CreateListRequest(string select)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/datasources", false);
if (select != null)
{
@@ -356,7 +356,7 @@ internal HttpMessage CreateCreateRequest(SearchIndexerDataSourceConnection dataS
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/datasources", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs
index d7c476be46ac..339d70e1071f 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/DocumentsRestClient.cs
@@ -19,7 +19,7 @@ namespace Azure.Search.Documents
internal partial class DocumentsRestClient
{
private readonly HttpPipeline _pipeline;
- private readonly string _endpoint;
+ private readonly Uri _endpoint;
private readonly string _indexName;
private readonly Guid? _xMsClientRequestId;
private readonly string _apiVersion;
@@ -36,7 +36,7 @@ internal partial class DocumentsRestClient
/// Api Version.
/// , , , or is null.
/// is an empty string, and was expected to be non-empty.
- public DocumentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string indexName, Guid? xMsClientRequestId = null, string apiVersion = "2025-03-01-preview")
+ public DocumentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string indexName, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
{
ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
@@ -52,7 +52,7 @@ internal HttpMessage CreateCountRequest()
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendRaw("/indexes('", false);
uri.AppendRaw(_indexName, true);
uri.AppendRaw("')", false);
@@ -103,19 +103,23 @@ public Response Count(CancellationToken cancellationToken = default)
}
}
- internal HttpMessage CreateSearchPostRequest(SearchOptions searchOptions)
+ internal HttpMessage CreateSearchPostRequest(SearchOptions searchOptions, string xMsQuerySourceAuthorization)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendRaw("/indexes('", false);
uri.AppendRaw(_indexName, true);
uri.AppendRaw("')", false);
uri.AppendPath("/docs/search.post.search", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
+ if (xMsQuerySourceAuthorization != null)
+ {
+ request.Headers.Add("x-ms-query-source-authorization", xMsQuerySourceAuthorization);
+ }
request.Headers.Add("Accept", "application/json; odata.metadata=none");
request.Headers.Add("Content-Type", "application/json");
var content = new Utf8JsonRequestContent();
@@ -126,20 +130,22 @@ internal HttpMessage CreateSearchPostRequest(SearchOptions searchOptions)
/// Searches for documents in the index.
/// The definition of the Search request.
+ /// Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents.
/// The cancellation token to use.
/// is null.
- public async Task> SearchPostAsync(SearchOptions searchOptions, CancellationToken cancellationToken = default)
+ public async Task> SearchPostAsync(SearchOptions searchOptions, string xMsQuerySourceAuthorization = null, CancellationToken cancellationToken = default)
{
if (searchOptions == null)
{
throw new ArgumentNullException(nameof(searchOptions));
}
- using var message = CreateSearchPostRequest(searchOptions);
+ using var message = CreateSearchPostRequest(searchOptions, xMsQuerySourceAuthorization);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
+ case 206:
{
SearchDocumentsResult value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
@@ -153,20 +159,22 @@ public async Task> SearchPostAsync(SearchOptions
/// Searches for documents in the index.
/// The definition of the Search request.
+ /// Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents.
/// The cancellation token to use.
/// is null.
- public Response SearchPost(SearchOptions searchOptions, CancellationToken cancellationToken = default)
+ public Response SearchPost(SearchOptions searchOptions, string xMsQuerySourceAuthorization = null, CancellationToken cancellationToken = default)
{
if (searchOptions == null)
{
throw new ArgumentNullException(nameof(searchOptions));
}
- using var message = CreateSearchPostRequest(searchOptions);
+ using var message = CreateSearchPostRequest(searchOptions, xMsQuerySourceAuthorization);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
+ case 206:
{
SearchDocumentsResult value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
@@ -178,13 +186,13 @@ public Response SearchPost(SearchOptions searchOptions, C
}
}
- internal HttpMessage CreateGetRequest(string key, IEnumerable selectedFields)
+ internal HttpMessage CreateGetRequest(string key, IEnumerable selectedFields, string xMsQuerySourceAuthorization)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendRaw("/indexes('", false);
uri.AppendRaw(_indexName, true);
uri.AppendRaw("')", false);
@@ -197,6 +205,10 @@ internal HttpMessage CreateGetRequest(string key, IEnumerable selectedFi
}
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
+ if (xMsQuerySourceAuthorization != null)
+ {
+ request.Headers.Add("x-ms-query-source-authorization", xMsQuerySourceAuthorization);
+ }
request.Headers.Add("Accept", "application/json; odata.metadata=none");
return message;
}
@@ -204,16 +216,17 @@ internal HttpMessage CreateGetRequest(string key, IEnumerable selectedFi
/// Retrieves a document from the index.
/// The key of the document to retrieve.
/// List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document.
+ /// Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents.
/// The cancellation token to use.
/// is null.
- public async Task>> GetAsync(string key, IEnumerable selectedFields = null, CancellationToken cancellationToken = default)
+ public async Task>> GetAsync(string key, IEnumerable selectedFields = null, string xMsQuerySourceAuthorization = null, CancellationToken cancellationToken = default)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
- using var message = CreateGetRequest(key, selectedFields);
+ using var message = CreateGetRequest(key, selectedFields, xMsQuerySourceAuthorization);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -244,16 +257,17 @@ public async Task>> GetAsync(string
/// Retrieves a document from the index.
/// The key of the document to retrieve.
/// List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document.
+ /// Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents.
/// The cancellation token to use.
/// is null.
- public Response> Get(string key, IEnumerable selectedFields = null, CancellationToken cancellationToken = default)
+ public Response> Get(string key, IEnumerable selectedFields = null, string xMsQuerySourceAuthorization = null, CancellationToken cancellationToken = default)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
- using var message = CreateGetRequest(key, selectedFields);
+ using var message = CreateGetRequest(key, selectedFields, xMsQuerySourceAuthorization);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
@@ -287,7 +301,7 @@ internal HttpMessage CreateSuggestPostRequest(SuggestOptions suggestOptions)
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendRaw("/indexes('", false);
uri.AppendRaw(_indexName, true);
uri.AppendRaw("')", false);
@@ -362,7 +376,7 @@ internal HttpMessage CreateIndexRequest(IndexBatch batch)
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendRaw("/indexes('", false);
uri.AppendRaw(_indexName, true);
uri.AppendRaw("')", false);
@@ -439,7 +453,7 @@ internal HttpMessage CreateAutocompletePostRequest(AutocompleteOptions autocompl
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendRaw("/indexes('", false);
uri.AppendRaw(_indexName, true);
uri.AppendRaw("')", false);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs
index d021cb826a9a..367fdbcb9bf7 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexersRestClient.cs
@@ -19,7 +19,7 @@ namespace Azure.Search.Documents
internal partial class IndexersRestClient
{
private readonly HttpPipeline _pipeline;
- private readonly string _endpoint;
+ private readonly Uri _endpoint;
private readonly Guid? _xMsClientRequestId;
private readonly string _apiVersion;
@@ -33,7 +33,7 @@ internal partial class IndexersRestClient
/// The tracking ID sent with the request to help with debugging.
/// Api Version.
/// , , or is null.
- public IndexersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-03-01-preview")
+ public IndexersRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
{
ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
@@ -48,7 +48,7 @@ internal HttpMessage CreateResetRequest(string indexerName)
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')/search.reset", false);
@@ -108,7 +108,7 @@ internal HttpMessage CreateResetDocsRequest(string indexerName, bool? overwrite,
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')/search.resetdocs", false);
@@ -177,13 +177,87 @@ public Response ResetDocs(string indexerName, bool? overwrite = null, ResetDocum
}
}
+ internal HttpMessage CreateResyncRequest(string indexerName, IndexerResyncBody indexerResync)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/indexers('", false);
+ uri.AppendPath(indexerName, true);
+ uri.AppendPath("')/search.resync", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(indexerResync);
+ request.Content = content;
+ return message;
+ }
+
+ /// Resync selective options from the datasource to be re-ingested by the indexer.
+ /// The name of the indexer to resync for.
+ /// The to use.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task ResyncAsync(string indexerName, IndexerResyncBody indexerResync, CancellationToken cancellationToken = default)
+ {
+ if (indexerName == null)
+ {
+ throw new ArgumentNullException(nameof(indexerName));
+ }
+ if (indexerResync == null)
+ {
+ throw new ArgumentNullException(nameof(indexerResync));
+ }
+
+ using var message = CreateResyncRequest(indexerName, indexerResync);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 204:
+ return message.Response;
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Resync selective options from the datasource to be re-ingested by the indexer.
+ /// The name of the indexer to resync for.
+ /// The to use.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response Resync(string indexerName, IndexerResyncBody indexerResync, CancellationToken cancellationToken = default)
+ {
+ if (indexerName == null)
+ {
+ throw new ArgumentNullException(nameof(indexerName));
+ }
+ if (indexerResync == null)
+ {
+ throw new ArgumentNullException(nameof(indexerResync));
+ }
+
+ using var message = CreateResyncRequest(indexerName, indexerResync);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 204:
+ return message.Response;
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
internal HttpMessage CreateRunRequest(string indexerName)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')/search.run", false);
@@ -243,7 +317,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string indexerName, SearchIndex
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')", false);
@@ -354,7 +428,7 @@ internal HttpMessage CreateDeleteRequest(string indexerName, string ifMatch, str
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')", false);
@@ -428,7 +502,7 @@ internal HttpMessage CreateGetRequest(string indexerName)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')", false);
@@ -498,7 +572,7 @@ internal HttpMessage CreateListRequest(string select)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers", false);
if (select != null)
{
@@ -558,7 +632,7 @@ internal HttpMessage CreateCreateRequest(SearchIndexer indexer)
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
@@ -630,7 +704,7 @@ internal HttpMessage CreateGetStatusRequest(string indexerName)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexers('", false);
uri.AppendPath(indexerName, true);
uri.AppendPath("')/search.status", false);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs
index edf5d4c0b39f..eaf7794836a3 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/IndexesRestClient.cs
@@ -18,7 +18,7 @@ namespace Azure.Search.Documents
internal partial class IndexesRestClient
{
private readonly HttpPipeline _pipeline;
- private readonly string _endpoint;
+ private readonly Uri _endpoint;
private readonly Guid? _xMsClientRequestId;
private readonly string _apiVersion;
@@ -32,7 +32,7 @@ internal partial class IndexesRestClient
/// The tracking ID sent with the request to help with debugging.
/// Api Version.
/// , , or is null.
- public IndexesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-03-01-preview")
+ public IndexesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
{
ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
@@ -47,7 +47,7 @@ internal HttpMessage CreateCreateRequest(SearchIndex index)
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
@@ -119,7 +119,7 @@ internal HttpMessage CreateListRequest(string select)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes", false);
if (select != null)
{
@@ -179,7 +179,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string indexName, SearchIndex i
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes('", false);
uri.AppendPath(indexName, true);
uri.AppendPath("')", false);
@@ -284,7 +284,7 @@ internal HttpMessage CreateDeleteRequest(string indexName, string ifMatch, strin
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes('", false);
uri.AppendPath(indexName, true);
uri.AppendPath("')", false);
@@ -358,7 +358,7 @@ internal HttpMessage CreateGetRequest(string indexName)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes('", false);
uri.AppendPath(indexName, true);
uri.AppendPath("')", false);
@@ -428,7 +428,7 @@ internal HttpMessage CreateGetStatisticsRequest(string indexName)
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes('", false);
uri.AppendPath(indexName, true);
uri.AppendPath("')/search.stats", false);
@@ -498,7 +498,7 @@ internal HttpMessage CreateAnalyzeRequest(string indexName, AnalyzeTextOptions r
var request0 = message.Request;
request0.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
- uri.AppendRaw(_endpoint, false);
+ uri.Reset(_endpoint);
uri.AppendPath("/indexes('", false);
uri.AppendPath(indexName, true);
uri.AppendPath("')/search.analyze", false);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/KnowledgeAgentsRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/KnowledgeAgentsRestClient.cs
new file mode 100644
index 000000000000..bba402b5aa4c
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/KnowledgeAgentsRestClient.cs
@@ -0,0 +1,413 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Search.Documents.Indexes.Models;
+
+namespace Azure.Search.Documents
+{
+ internal partial class KnowledgeAgentsRestClient
+ {
+ private readonly HttpPipeline _pipeline;
+ private readonly Uri _endpoint;
+ private readonly Guid? _xMsClientRequestId;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// Initializes a new instance of KnowledgeAgentsRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The endpoint URL of the search service.
+ /// The tracking ID sent with the request to help with debugging.
+ /// Api Version.
+ /// , , or is null.
+ public KnowledgeAgentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
+ {
+ ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
+ _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
+ _endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
+ _xMsClientRequestId = xMsClientRequestId;
+ _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ internal HttpMessage CreateCreateOrUpdateRequest(string agentName, KnowledgeAgent knowledgeAgent, string ifMatch, string ifNoneMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/agents('", false);
+ uri.AppendPath(agentName, true);
+ uri.AppendPath("')", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ if (ifMatch != null)
+ {
+ request.Headers.Add("If-Match", ifMatch);
+ }
+ if (ifNoneMatch != null)
+ {
+ request.Headers.Add("If-None-Match", ifNoneMatch);
+ }
+ request.Headers.Add("Prefer", "return=representation");
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(knowledgeAgent);
+ request.Content = content;
+ return message;
+ }
+
+ /// Creates a new agent or updates an agent if it already exists.
+ /// The name of the agent to create or update.
+ /// The definition of the agent to create or update.
+ /// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
+ /// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task> CreateOrUpdateAsync(string agentName, KnowledgeAgent knowledgeAgent, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (agentName == null)
+ {
+ throw new ArgumentNullException(nameof(agentName));
+ }
+ if (knowledgeAgent == null)
+ {
+ throw new ArgumentNullException(nameof(knowledgeAgent));
+ }
+
+ using var message = CreateCreateOrUpdateRequest(agentName, knowledgeAgent, ifMatch, ifNoneMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 201:
+ {
+ KnowledgeAgent value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
+ value = KnowledgeAgent.DeserializeKnowledgeAgent(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Creates a new agent or updates an agent if it already exists.
+ /// The name of the agent to create or update.
+ /// The definition of the agent to create or update.
+ /// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
+ /// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response CreateOrUpdate(string agentName, KnowledgeAgent knowledgeAgent, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (agentName == null)
+ {
+ throw new ArgumentNullException(nameof(agentName));
+ }
+ if (knowledgeAgent == null)
+ {
+ throw new ArgumentNullException(nameof(knowledgeAgent));
+ }
+
+ using var message = CreateCreateOrUpdateRequest(agentName, knowledgeAgent, ifMatch, ifNoneMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 201:
+ {
+ KnowledgeAgent value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
+ value = KnowledgeAgent.DeserializeKnowledgeAgent(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteRequest(string agentName, string ifMatch, string ifNoneMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/agents('", false);
+ uri.AppendPath(agentName, true);
+ uri.AppendPath("')", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ if (ifMatch != null)
+ {
+ request.Headers.Add("If-Match", ifMatch);
+ }
+ if (ifNoneMatch != null)
+ {
+ request.Headers.Add("If-None-Match", ifNoneMatch);
+ }
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ return message;
+ }
+
+ /// Deletes an existing agent.
+ /// The name of the agent to delete.
+ /// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
+ /// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task DeleteAsync(string agentName, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (agentName == null)
+ {
+ throw new ArgumentNullException(nameof(agentName));
+ }
+
+ using var message = CreateDeleteRequest(agentName, ifMatch, ifNoneMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 204:
+ case 404:
+ return message.Response;
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Deletes an existing agent.
+ /// The name of the agent to delete.
+ /// Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.
+ /// Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ /// The cancellation token to use.
+ /// is null.
+ public Response Delete(string agentName, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (agentName == null)
+ {
+ throw new ArgumentNullException(nameof(agentName));
+ }
+
+ using var message = CreateDeleteRequest(agentName, ifMatch, ifNoneMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 204:
+ case 404:
+ return message.Response;
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRequest(string agentName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/agents('", false);
+ uri.AppendPath(agentName, true);
+ uri.AppendPath("')", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ return message;
+ }
+
+ /// Retrieves an agent definition.
+ /// The name of the agent to retrieve.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> GetAsync(string agentName, CancellationToken cancellationToken = default)
+ {
+ if (agentName == null)
+ {
+ throw new ArgumentNullException(nameof(agentName));
+ }
+
+ using var message = CreateGetRequest(agentName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ KnowledgeAgent value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
+ value = KnowledgeAgent.DeserializeKnowledgeAgent(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Retrieves an agent definition.
+ /// The name of the agent to retrieve.
+ /// The cancellation token to use.
+ /// is null.
+ public Response Get(string agentName, CancellationToken cancellationToken = default)
+ {
+ if (agentName == null)
+ {
+ throw new ArgumentNullException(nameof(agentName));
+ }
+
+ using var message = CreateGetRequest(agentName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ KnowledgeAgent value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
+ value = KnowledgeAgent.DeserializeKnowledgeAgent(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateListRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/agents", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ return message;
+ }
+
+ /// Lists all agents available for a search service.
+ /// The cancellation token to use.
+ public async Task> ListAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateListRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListKnowledgeAgentsResult value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
+ value = ListKnowledgeAgentsResult.DeserializeListKnowledgeAgentsResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Lists all agents available for a search service.
+ /// The cancellation token to use.
+ public Response List(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateListRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListKnowledgeAgentsResult value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
+ value = ListKnowledgeAgentsResult.DeserializeListKnowledgeAgentsResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateRequest(KnowledgeAgent knowledgeAgent)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/agents", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(knowledgeAgent);
+ request.Content = content;
+ return message;
+ }
+
+ /// Creates a new agent.
+ /// The definition of the agent to create.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> CreateAsync(KnowledgeAgent knowledgeAgent, CancellationToken cancellationToken = default)
+ {
+ if (knowledgeAgent == null)
+ {
+ throw new ArgumentNullException(nameof(knowledgeAgent));
+ }
+
+ using var message = CreateCreateRequest(knowledgeAgent);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 201:
+ {
+ KnowledgeAgent value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
+ value = KnowledgeAgent.DeserializeKnowledgeAgent(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// Creates a new agent.
+ /// The definition of the agent to create.
+ /// The cancellation token to use.
+ /// is null.
+ public Response Create(KnowledgeAgent knowledgeAgent, CancellationToken cancellationToken = default)
+ {
+ if (knowledgeAgent == null)
+ {
+ throw new ArgumentNullException(nameof(knowledgeAgent));
+ }
+
+ using var message = CreateCreateRequest(knowledgeAgent);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 201:
+ {
+ KnowledgeAgent value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
+ value = KnowledgeAgent.DeserializeKnowledgeAgent(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/KnowledgeRetrievalRestClient.cs b/sdk/search/Azure.Search.Documents/src/Generated/KnowledgeRetrievalRestClient.cs
new file mode 100644
index 000000000000..1ea4bf769f2a
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/KnowledgeRetrievalRestClient.cs
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Search.Documents.Models;
+
+namespace Azure.Search.Documents
+{
+ internal partial class KnowledgeRetrievalRestClient
+ {
+ private readonly HttpPipeline _pipeline;
+ private readonly Uri _endpoint;
+ private readonly string _agentName;
+ private readonly Guid? _xMsClientRequestId;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// Initializes a new instance of KnowledgeRetrievalRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The endpoint URL of the search service.
+ /// The name of the agent.
+ /// The tracking ID sent with the request to help with debugging.
+ /// Api Version.
+ /// , , , or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public KnowledgeRetrievalRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string agentName, Guid? xMsClientRequestId = null, string apiVersion = "2025-05-01-preview")
+ {
+ ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics));
+ _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
+ _endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
+ _agentName = agentName ?? throw new ArgumentNullException(nameof(agentName));
+ _xMsClientRequestId = xMsClientRequestId;
+ _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ internal HttpMessage CreateRetrieveRequest(KnowledgeAgentRetrievalRequest retrievalRequest, string xMsQuerySourceAuthorization)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendRaw("/agents('", false);
+ uri.AppendRaw(_agentName, true);
+ uri.AppendRaw("')", false);
+ uri.AppendPath("/retrieve", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ if (xMsQuerySourceAuthorization != null)
+ {
+ request.Headers.Add("x-ms-query-source-authorization", xMsQuerySourceAuthorization);
+ }
+ request.Headers.Add("Accept", "application/json; odata.metadata=minimal");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(retrievalRequest);
+ request.Content = content;
+ return message;
+ }
+
+ /// KnowledgeAgent retrieves relevant data from backing stores.
+ /// The retrieval request to process.
+ /// Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> RetrieveAsync(KnowledgeAgentRetrievalRequest retrievalRequest, string xMsQuerySourceAuthorization = null, CancellationToken cancellationToken = default)
+ {
+ if (retrievalRequest == null)
+ {
+ throw new ArgumentNullException(nameof(retrievalRequest));
+ }
+
+ using var message = CreateRetrieveRequest(retrievalRequest, xMsQuerySourceAuthorization);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ KnowledgeAgentRetrievalResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
+ value = KnowledgeAgentRetrievalResponse.DeserializeKnowledgeAgentRetrievalResponse(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+
+ /// KnowledgeAgent retrieves relevant data from backing stores.
+ /// The retrieval request to process.
+ /// Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents.
+ /// The cancellation token to use.
+ /// is null.
+ public Response Retrieve(KnowledgeAgentRetrievalRequest retrievalRequest, string xMsQuerySourceAuthorization = null, CancellationToken cancellationToken = default)
+ {
+ if (retrievalRequest == null)
+ {
+ throw new ArgumentNullException(nameof(retrievalRequest));
+ }
+
+ using var message = CreateRetrieveRequest(retrievalRequest, xMsQuerySourceAuthorization);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ KnowledgeAgentRetrievalResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
+ value = KnowledgeAgentRetrievalResponse.DeserializeKnowledgeAgentRetrievalResponse(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw new RequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs
index d65745f5b56d..c5dbf1343bc9 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AIFoundryModelCatalogName.cs
@@ -10,7 +10,7 @@
namespace Azure.Search.Documents.Indexes.Models
{
- /// The name of the embedding model from the Azure AI Studio Catalog that will be called.
+ /// The name of the embedding model from the Azure AI Foundry Catalog that will be called.
public readonly partial struct AIFoundryModelCatalogName : IEquatable
{
private readonly string _value;
@@ -28,6 +28,7 @@ public AIFoundryModelCatalogName(string value)
private const string FacebookDinoV2ImageEmbeddingsViTGiantValue = "Facebook-DinoV2-Image-Embeddings-ViT-Giant";
private const string CohereEmbedV3EnglishValue = "Cohere-embed-v3-english";
private const string CohereEmbedV3MultilingualValue = "Cohere-embed-v3-multilingual";
+ private const string CohereEmbedV4Value = "Cohere-embed-v4";
/// OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32.
public static AIFoundryModelCatalogName OpenAIClipImageTextEmbeddingsVitBasePatch32 { get; } = new AIFoundryModelCatalogName(OpenAIClipImageTextEmbeddingsVitBasePatch32Value);
@@ -41,6 +42,8 @@ public AIFoundryModelCatalogName(string value)
public static AIFoundryModelCatalogName CohereEmbedV3English { get; } = new AIFoundryModelCatalogName(CohereEmbedV3EnglishValue);
/// Cohere-embed-v3-multilingual.
public static AIFoundryModelCatalogName CohereEmbedV3Multilingual { get; } = new AIFoundryModelCatalogName(CohereEmbedV3MultilingualValue);
+ /// Cohere embed v4 model for generating embeddings from both text and images.
+ public static AIFoundryModelCatalogName CohereEmbedV4 { get; } = new AIFoundryModelCatalogName(CohereEmbedV4Value);
/// Determines if two values are the same.
public static bool operator ==(AIFoundryModelCatalogName left, AIFoundryModelCatalogName right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs
index 933ce5586932..899f99a9246b 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningParameters.cs
@@ -25,7 +25,7 @@ public AzureMachineLearningParameters(Uri scoringUri)
/// (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}.
/// (Optional) When specified, indicates the timeout for the http client making the API call.
/// (Optional for token authentication). The region the AML service is deployed in.
- /// The name of the embedding model from the Azure AI Studio Catalog that is deployed at the provided endpoint.
+ /// The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the provided endpoint.
internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey, string resourceId, TimeSpan? timeout, string region, AIFoundryModelCatalogName? modelName)
{
ScoringUri = scoringUri;
@@ -46,7 +46,7 @@ internal AzureMachineLearningParameters(Uri scoringUri, string authenticationKey
public TimeSpan? Timeout { get; set; }
/// (Optional for token authentication). The region the AML service is deployed in.
public string Region { get; set; }
- /// The name of the embedding model from the Azure AI Studio Catalog that is deployed at the provided endpoint.
+ /// The name of the embedding model from the Azure AI Foundry Catalog that is deployed at the provided endpoint.
public AIFoundryModelCatalogName? ModelName { get; set; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs
index 7aef8e982c11..a459785ad47d 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureMachineLearningVectorizer.cs
@@ -9,7 +9,7 @@
namespace Azure.Search.Documents.Indexes.Models
{
- /// Specifies an Azure Machine Learning endpoint deployed via the Azure AI Studio Model Catalog for generating the vector embedding of a query string.
+ /// Specifies an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog for generating the vector embedding of a query string.
public partial class AzureMachineLearningVectorizer : VectorSearchVectorizer
{
/// Initializes a new instance of .
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureOpenAIModelName.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureOpenAIModelName.cs
index 24bd4068aa82..2058c258f233 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureOpenAIModelName.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/AzureOpenAIModelName.cs
@@ -25,6 +25,11 @@ public AzureOpenAIModelName(string value)
private const string TextEmbeddingAda002Value = "text-embedding-ada-002";
private const string TextEmbedding3LargeValue = "text-embedding-3-large";
private const string TextEmbedding3SmallValue = "text-embedding-3-small";
+ private const string Gpt4OValue = "gpt-4o";
+ private const string Gpt4OMiniValue = "gpt-4o-mini";
+ private const string Gpt41Value = "gpt-4.1";
+ private const string Gpt41MiniValue = "gpt-4.1-mini";
+ private const string Gpt41NanoValue = "gpt-4.1-nano";
/// text-embedding-ada-002.
public static AzureOpenAIModelName TextEmbeddingAda002 { get; } = new AzureOpenAIModelName(TextEmbeddingAda002Value);
@@ -32,6 +37,16 @@ public AzureOpenAIModelName(string value)
public static AzureOpenAIModelName TextEmbedding3Large { get; } = new AzureOpenAIModelName(TextEmbedding3LargeValue);
/// text-embedding-3-small.
public static AzureOpenAIModelName TextEmbedding3Small { get; } = new AzureOpenAIModelName(TextEmbedding3SmallValue);
+ /// gpt-4o.
+ public static AzureOpenAIModelName Gpt4O { get; } = new AzureOpenAIModelName(Gpt4OValue);
+ /// gpt-4o-mini.
+ public static AzureOpenAIModelName Gpt4OMini { get; } = new AzureOpenAIModelName(Gpt4OMiniValue);
+ /// gpt-4.1.
+ public static AzureOpenAIModelName Gpt41 { get; } = new AzureOpenAIModelName(Gpt41Value);
+ /// gpt-4.1-mini.
+ public static AzureOpenAIModelName Gpt41Mini { get; } = new AzureOpenAIModelName(Gpt41MiniValue);
+ /// gpt-4.1-nano.
+ public static AzureOpenAIModelName Gpt41Nano { get; } = new AzureOpenAIModelName(Gpt41NanoValue);
/// Determines if two values are the same.
public static bool operator ==(AzureOpenAIModelName left, AzureOpenAIModelName right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionExtraParametersBehavior.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionExtraParametersBehavior.cs
new file mode 100644
index 000000000000..326bc420aa3d
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionExtraParametersBehavior.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Specifies how 'extraParameters' should be handled by Azure AI Foundry. Defaults to 'error'.
+ public readonly partial struct ChatCompletionExtraParametersBehavior : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ChatCompletionExtraParametersBehavior(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string PassThroughValue = "passThrough";
+ private const string DropValue = "drop";
+ private const string ErrorValue = "error";
+
+ /// Passes any extra parameters directly to the model.
+ public static ChatCompletionExtraParametersBehavior PassThrough { get; } = new ChatCompletionExtraParametersBehavior(PassThroughValue);
+ /// Drops all extra parameters.
+ public static ChatCompletionExtraParametersBehavior Drop { get; } = new ChatCompletionExtraParametersBehavior(DropValue);
+ /// Raises an error if any extra parameter is present.
+ public static ChatCompletionExtraParametersBehavior Error { get; } = new ChatCompletionExtraParametersBehavior(ErrorValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(ChatCompletionExtraParametersBehavior left, ChatCompletionExtraParametersBehavior right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ChatCompletionExtraParametersBehavior left, ChatCompletionExtraParametersBehavior right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator ChatCompletionExtraParametersBehavior(string value) => new ChatCompletionExtraParametersBehavior(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ChatCompletionExtraParametersBehavior other && Equals(other);
+ ///
+ public bool Equals(ChatCompletionExtraParametersBehavior other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormat.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormat.Serialization.cs
new file mode 100644
index 000000000000..9eccc2a587d4
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormat.Serialization.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+using Azure.Search.Documents.Models;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class ChatCompletionResponseFormat : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Type))
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.Value.ToString());
+ }
+ if (Optional.IsDefined(ChatCompletionSchemaProperties))
+ {
+ if (ChatCompletionSchemaProperties != null)
+ {
+ writer.WritePropertyName("jsonSchemaProperties"u8);
+ writer.WriteObjectValue(ChatCompletionSchemaProperties);
+ }
+ else
+ {
+ writer.WriteNull("jsonSchemaProperties");
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static ChatCompletionResponseFormat DeserializeChatCompletionResponseFormat(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ ChatCompletionResponseFormatType? type = default;
+ ChatCompletionResponseFormatJsonSchemaProperties jsonSchemaProperties = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ type = new ChatCompletionResponseFormatType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("jsonSchemaProperties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ jsonSchemaProperties = null;
+ continue;
+ }
+ jsonSchemaProperties = ChatCompletionResponseFormatJsonSchemaProperties.DeserializeChatCompletionResponseFormatJsonSchemaProperties(property.Value);
+ continue;
+ }
+ }
+ return new ChatCompletionResponseFormat(type, jsonSchemaProperties);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ChatCompletionResponseFormat FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeChatCompletionResponseFormat(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormat.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormat.cs
new file mode 100644
index 000000000000..69b584b748b0
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormat.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Search.Documents.Models;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Determines how the language model's response should be serialized. Defaults to 'text'.
+ public partial class ChatCompletionResponseFormat
+ {
+ /// Initializes a new instance of .
+ public ChatCompletionResponseFormat()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Specifies how the LLM should format the response. Possible values: 'text' (plain string), 'json_object' (arbitrary JSON), or 'json_schema' (adheres to provided schema).
+ /// An open dictionary for extended properties. Required if 'type' == 'json_schema'.
+ internal ChatCompletionResponseFormat(ChatCompletionResponseFormatType? type, ChatCompletionResponseFormatJsonSchemaProperties chatCompletionSchemaProperties)
+ {
+ Type = type;
+ ChatCompletionSchemaProperties = chatCompletionSchemaProperties;
+ }
+
+ /// Specifies how the LLM should format the response. Possible values: 'text' (plain string), 'json_object' (arbitrary JSON), or 'json_schema' (adheres to provided schema).
+ public ChatCompletionResponseFormatType? Type { get; set; }
+ /// An open dictionary for extended properties. Required if 'type' == 'json_schema'.
+ public ChatCompletionResponseFormatJsonSchemaProperties ChatCompletionSchemaProperties { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatJsonSchemaProperties.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatJsonSchemaProperties.Serialization.cs
new file mode 100644
index 000000000000..9b4cd8bfc4c4
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatJsonSchemaProperties.Serialization.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+using Azure.Search.Documents.Indexes.Models;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class ChatCompletionResponseFormatJsonSchemaProperties : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Name))
+ {
+ if (Name != null)
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ else
+ {
+ writer.WriteNull("name");
+ }
+ }
+ if (Optional.IsDefined(Description))
+ {
+ if (Description != null)
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ else
+ {
+ writer.WriteNull("description");
+ }
+ }
+ if (Optional.IsDefined(Strict))
+ {
+ writer.WritePropertyName("strict"u8);
+ writer.WriteBooleanValue(Strict.Value);
+ }
+ if (Optional.IsDefined(Schema))
+ {
+ if (Schema != null)
+ {
+ writer.WritePropertyName("schema"u8);
+ writer.WriteObjectValue(Schema);
+ }
+ else
+ {
+ writer.WriteNull("schema");
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static ChatCompletionResponseFormatJsonSchemaProperties DeserializeChatCompletionResponseFormatJsonSchemaProperties(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string name = default;
+ string description = default;
+ bool? strict = default;
+ ChatCompletionSchema schema = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ name = null;
+ continue;
+ }
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ description = null;
+ continue;
+ }
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("strict"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ strict = property.Value.GetBoolean();
+ continue;
+ }
+ if (property.NameEquals("schema"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ schema = null;
+ continue;
+ }
+ schema = ChatCompletionSchema.DeserializeChatCompletionSchema(property.Value);
+ continue;
+ }
+ }
+ return new ChatCompletionResponseFormatJsonSchemaProperties(name, description, strict, schema);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ChatCompletionResponseFormatJsonSchemaProperties FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeChatCompletionResponseFormatJsonSchemaProperties(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatJsonSchemaProperties.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatJsonSchemaProperties.cs
new file mode 100644
index 000000000000..ee2a8100b60c
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatJsonSchemaProperties.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Search.Documents.Indexes.Models;
+
+namespace Azure.Search.Documents.Models
+{
+ /// An open dictionary for extended properties. Required if 'type' == 'json_schema'.
+ public partial class ChatCompletionResponseFormatJsonSchemaProperties
+ {
+ /// Initializes a new instance of .
+ public ChatCompletionResponseFormatJsonSchemaProperties()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Name of the json schema the model will adhere to.
+ /// Description of the json schema the model will adhere to.
+ /// Whether or not the model's response should use structured outputs. Default is true.
+ /// Object defining the custom schema the model will use to structure its output.
+ internal ChatCompletionResponseFormatJsonSchemaProperties(string name, string description, bool? strict, ChatCompletionSchema schema)
+ {
+ Name = name;
+ Description = description;
+ Strict = strict;
+ Schema = schema;
+ }
+
+ /// Name of the json schema the model will adhere to.
+ public string Name { get; set; }
+ /// Description of the json schema the model will adhere to.
+ public string Description { get; set; }
+ /// Whether or not the model's response should use structured outputs. Default is true.
+ public bool? Strict { get; set; }
+ /// Object defining the custom schema the model will use to structure its output.
+ public ChatCompletionSchema Schema { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatType.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatType.cs
new file mode 100644
index 000000000000..849d3b79137a
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionResponseFormatType.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Specifies how the LLM should format the response. Possible values: 'text' (plain string), 'json_object' (arbitrary JSON), or 'json_schema' (adheres to provided schema).
+ public readonly partial struct ChatCompletionResponseFormatType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ChatCompletionResponseFormatType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string TextValue = "text";
+ private const string JsonObjectValue = "jsonObject";
+ private const string JsonSchemaValue = "jsonSchema";
+
+ /// text.
+ public static ChatCompletionResponseFormatType Text { get; } = new ChatCompletionResponseFormatType(TextValue);
+ /// jsonObject.
+ public static ChatCompletionResponseFormatType JsonObject { get; } = new ChatCompletionResponseFormatType(JsonObjectValue);
+ /// jsonSchema.
+ public static ChatCompletionResponseFormatType JsonSchema { get; } = new ChatCompletionResponseFormatType(JsonSchemaValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(ChatCompletionResponseFormatType left, ChatCompletionResponseFormatType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ChatCompletionResponseFormatType left, ChatCompletionResponseFormatType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator ChatCompletionResponseFormatType(string value) => new ChatCompletionResponseFormatType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ChatCompletionResponseFormatType other && Equals(other);
+ ///
+ public bool Equals(ChatCompletionResponseFormatType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSchema.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSchema.Serialization.cs
new file mode 100644
index 000000000000..9078adc11e52
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSchema.Serialization.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class ChatCompletionSchema : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Type))
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type);
+ }
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteStringValue(Properties);
+ }
+ if (Optional.IsCollectionDefined(Required))
+ {
+ writer.WritePropertyName("required"u8);
+ writer.WriteStartArray();
+ foreach (var item in Required)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsDefined(AdditionalProperties))
+ {
+ writer.WritePropertyName("additionalProperties"u8);
+ writer.WriteBooleanValue(AdditionalProperties.Value);
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static ChatCompletionSchema DeserializeChatCompletionSchema(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string type = default;
+ string properties = default;
+ IList required = default;
+ bool? additionalProperties = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("properties"u8))
+ {
+ properties = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("required"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ required = array;
+ continue;
+ }
+ if (property.NameEquals("additionalProperties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ additionalProperties = property.Value.GetBoolean();
+ continue;
+ }
+ }
+ return new ChatCompletionSchema(type, properties, required ?? new ChangeTrackingList(), additionalProperties);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ChatCompletionSchema FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeChatCompletionSchema(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSchema.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSchema.cs
new file mode 100644
index 000000000000..a5216aa5d7d0
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSchema.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Object defining the custom schema the model will use to structure its output.
+ public partial class ChatCompletionSchema
+ {
+ /// Initializes a new instance of .
+ public ChatCompletionSchema()
+ {
+ Required = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// Type of schema representation. Usually 'object'. Default is 'object'.
+ /// A JSON-formatted string that defines the output schema's properties and constraints for the model.
+ /// 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.
+ /// Controls whether it is allowable for an object to contain additional keys / values that were not defined in the JSON Schema. Default is false.
+ internal ChatCompletionSchema(string type, string properties, IList required, bool? additionalProperties)
+ {
+ Type = type;
+ Properties = properties;
+ Required = required;
+ AdditionalProperties = additionalProperties;
+ }
+
+ /// Type of schema representation. Usually 'object'. Default is 'object'.
+ public string Type { get; set; }
+ /// A JSON-formatted string that defines the output schema's properties and constraints for the model.
+ public string Properties { get; set; }
+ /// 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.
+ public IList Required { get; }
+ /// Controls whether it is allowable for an object to contain additional keys / values that were not defined in the JSON Schema. Default is false.
+ public bool? AdditionalProperties { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSkill.Serialization.cs
new file mode 100644
index 000000000000..712aefac920a
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSkill.Serialization.cs
@@ -0,0 +1,417 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class ChatCompletionSkill : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(ApiKey))
+ {
+ writer.WritePropertyName("apiKey"u8);
+ writer.WriteStringValue(ApiKey);
+ }
+ if (Optional.IsDefined(CommonModelParameters))
+ {
+ writer.WritePropertyName("commonModelParameters"u8);
+ writer.WriteObjectValue(CommonModelParameters);
+ }
+ if (Optional.IsCollectionDefined(ExtraParameters))
+ {
+ if (ExtraParameters != null)
+ {
+ writer.WritePropertyName("extraParameters"u8);
+ writer.WriteStartObject();
+ foreach (var item in ExtraParameters)
+ {
+ writer.WritePropertyName(item.Key);
+ if (item.Value == null)
+ {
+ writer.WriteNullValue();
+ continue;
+ }
+ writer.WriteObjectValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ else
+ {
+ writer.WriteNull("extraParameters");
+ }
+ }
+ if (Optional.IsDefined(ExtraParametersBehavior))
+ {
+ writer.WritePropertyName("extraParametersBehavior"u8);
+ writer.WriteStringValue(ExtraParametersBehavior.Value.ToString());
+ }
+ if (Optional.IsDefined(ResponseFormat))
+ {
+ writer.WritePropertyName("responseFormat"u8);
+ writer.WriteObjectValue(ResponseFormat);
+ }
+ writer.WritePropertyName("uri"u8);
+ writer.WriteStringValue(Uri);
+ if (Optional.IsCollectionDefined(HttpHeaders))
+ {
+ if (HttpHeaders != null)
+ {
+ writer.WritePropertyName("httpHeaders"u8);
+ writer.WriteStartObject();
+ foreach (var item in HttpHeaders)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ else
+ {
+ writer.WriteNull("httpHeaders");
+ }
+ }
+ if (Optional.IsDefined(HttpMethod))
+ {
+ writer.WritePropertyName("httpMethod"u8);
+ writer.WriteStringValue(HttpMethod);
+ }
+ if (Optional.IsDefined(Timeout))
+ {
+ if (Timeout != null)
+ {
+ writer.WritePropertyName("timeout"u8);
+ writer.WriteStringValue(Timeout.Value, "P");
+ }
+ else
+ {
+ writer.WriteNull("timeout");
+ }
+ }
+ if (Optional.IsDefined(BatchSize))
+ {
+ if (BatchSize != null)
+ {
+ writer.WritePropertyName("batchSize"u8);
+ writer.WriteNumberValue(BatchSize.Value);
+ }
+ else
+ {
+ writer.WriteNull("batchSize");
+ }
+ }
+ if (Optional.IsDefined(DegreeOfParallelism))
+ {
+ if (DegreeOfParallelism != null)
+ {
+ writer.WritePropertyName("degreeOfParallelism"u8);
+ writer.WriteNumberValue(DegreeOfParallelism.Value);
+ }
+ else
+ {
+ writer.WriteNull("degreeOfParallelism");
+ }
+ }
+ if (Optional.IsDefined(AuthResourceId))
+ {
+ if (AuthResourceId != null)
+ {
+ writer.WritePropertyName("authResourceId"u8);
+ writer.WriteStringValue(AuthResourceId);
+ }
+ else
+ {
+ writer.WriteNull("authResourceId");
+ }
+ }
+ if (Optional.IsDefined(AuthIdentity))
+ {
+ if (AuthIdentity != null)
+ {
+ writer.WritePropertyName("authIdentity"u8);
+ writer.WriteObjectValue(AuthIdentity);
+ }
+ else
+ {
+ writer.WriteNull("authIdentity");
+ }
+ }
+ writer.WritePropertyName("@odata.type"u8);
+ writer.WriteStringValue(ODataType);
+ if (Optional.IsDefined(Name))
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ if (Optional.IsDefined(Context))
+ {
+ writer.WritePropertyName("context"u8);
+ writer.WriteStringValue(Context);
+ }
+ writer.WritePropertyName("inputs"u8);
+ writer.WriteStartArray();
+ foreach (var item in Inputs)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ writer.WritePropertyName("outputs"u8);
+ writer.WriteStartArray();
+ foreach (var item in Outputs)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ writer.WriteEndObject();
+ }
+
+ internal static ChatCompletionSkill DeserializeChatCompletionSkill(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string apiKey = default;
+ CommonModelParameters commonModelParameters = default;
+ IDictionary extraParameters = default;
+ ChatCompletionExtraParametersBehavior? extraParametersBehavior = default;
+ ChatCompletionResponseFormat responseFormat = default;
+ string uri = default;
+ IDictionary httpHeaders = default;
+ string httpMethod = default;
+ TimeSpan? timeout = default;
+ int? batchSize = default;
+ int? degreeOfParallelism = default;
+ ResourceIdentifier authResourceId = default;
+ SearchIndexerDataIdentity authIdentity = default;
+ string odataType = default;
+ string name = default;
+ string description = default;
+ string context = default;
+ IList inputs = default;
+ IList outputs = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("apiKey"u8))
+ {
+ apiKey = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("commonModelParameters"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ commonModelParameters = CommonModelParameters.DeserializeCommonModelParameters(property.Value);
+ continue;
+ }
+ if (property.NameEquals("extraParameters"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ extraParameters = null;
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(property0.Name, property0.Value.GetObject());
+ }
+ }
+ extraParameters = dictionary;
+ continue;
+ }
+ if (property.NameEquals("extraParametersBehavior"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ extraParametersBehavior = new ChatCompletionExtraParametersBehavior(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("responseFormat"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ responseFormat = ChatCompletionResponseFormat.DeserializeChatCompletionResponseFormat(property.Value);
+ continue;
+ }
+ if (property.NameEquals("uri"u8))
+ {
+ uri = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("httpHeaders"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ httpHeaders = null;
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ dictionary.Add(property0.Name, property0.Value.GetString());
+ }
+ httpHeaders = dictionary;
+ continue;
+ }
+ if (property.NameEquals("httpMethod"u8))
+ {
+ httpMethod = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("timeout"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ timeout = null;
+ continue;
+ }
+ timeout = property.Value.GetTimeSpan("P");
+ continue;
+ }
+ if (property.NameEquals("batchSize"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ batchSize = null;
+ continue;
+ }
+ batchSize = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("degreeOfParallelism"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ degreeOfParallelism = null;
+ continue;
+ }
+ degreeOfParallelism = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("authResourceId"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ authResourceId = null;
+ continue;
+ }
+ authResourceId = new ResourceIdentifier(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("authIdentity"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ authIdentity = null;
+ continue;
+ }
+ authIdentity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value);
+ continue;
+ }
+ if (property.NameEquals("@odata.type"u8))
+ {
+ odataType = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("context"u8))
+ {
+ context = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("inputs"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item));
+ }
+ inputs = array;
+ continue;
+ }
+ if (property.NameEquals("outputs"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item));
+ }
+ outputs = array;
+ continue;
+ }
+ }
+ return new ChatCompletionSkill(
+ odataType,
+ name,
+ description,
+ context,
+ inputs,
+ outputs,
+ uri,
+ httpHeaders ?? new ChangeTrackingDictionary(),
+ httpMethod,
+ timeout,
+ batchSize,
+ degreeOfParallelism,
+ authResourceId,
+ authIdentity,
+ apiKey,
+ commonModelParameters,
+ extraParameters ?? new ChangeTrackingDictionary(),
+ extraParametersBehavior,
+ responseFormat);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new ChatCompletionSkill FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeChatCompletionSkill(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSkill.cs
new file mode 100644
index 000000000000..2f2d564ac4c0
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ChatCompletionSkill.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// A skill that calls a language model via Azure AI Foundry's Chat Completions endpoint.
+ public partial class ChatCompletionSkill : WebApiSkill
+ {
+ /// Initializes a new instance of .
+ /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill.
+ /// 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.
+ /// The url for the Web API.
+ /// , or is null.
+ public ChatCompletionSkill(IEnumerable inputs, IEnumerable outputs, string uri) : base(inputs, outputs, uri)
+ {
+ Argument.AssertNotNull(inputs, nameof(inputs));
+ Argument.AssertNotNull(outputs, nameof(outputs));
+ Argument.AssertNotNull(uri, nameof(uri));
+
+ ExtraParameters = new ChangeTrackingDictionary();
+ ODataType = "#Microsoft.Skills.Custom.ChatCompletionSkill";
+ }
+
+ /// Initializes a new instance of .
+ /// A URI fragment specifying the type of skill.
+ /// 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 '#'.
+ /// The description of the skill which describes the inputs, outputs, and usage of the skill.
+ /// 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.
+ /// Inputs of the skills could be a column in the source data set, or the output of an upstream skill.
+ /// 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.
+ /// The url for the Web API.
+ /// The headers required to make the http request.
+ /// The method for the http request.
+ /// The desired timeout for the request. Default is 30 seconds.
+ /// The desired batch size which indicates number of documents.
+ /// If set, the number of parallel calls that can be made to the Web API.
+ /// 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.
+ ///
+ /// 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.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ /// API key for authenticating to the model. Both apiKey and authIdentity cannot be specified at the same time.
+ /// Common language model parameters that customers can tweak. If omitted, reasonable defaults will be applied.
+ /// Open-type dictionary for model-specific parameters that should be appended to the chat completions call. Follows Azure AI Foundry’s extensibility pattern.
+ /// How extra parameters are handled by Azure AI Foundry. Default is 'error'.
+ /// Determines how the LLM should format its response. Defaults to 'text' response type.
+ internal ChatCompletionSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, string uri, IDictionary httpHeaders, string httpMethod, TimeSpan? timeout, int? batchSize, int? degreeOfParallelism, ResourceIdentifier authResourceId, SearchIndexerDataIdentity authIdentity, string apiKey, CommonModelParameters commonModelParameters, IDictionary extraParameters, ChatCompletionExtraParametersBehavior? extraParametersBehavior, ChatCompletionResponseFormat responseFormat) : base(oDataType, name, description, context, inputs, outputs, uri, httpHeaders, httpMethod, timeout, batchSize, degreeOfParallelism, authResourceId, authIdentity)
+ {
+ ApiKey = apiKey;
+ CommonModelParameters = commonModelParameters;
+ ExtraParameters = extraParameters;
+ ExtraParametersBehavior = extraParametersBehavior;
+ ResponseFormat = responseFormat;
+ ODataType = oDataType ?? "#Microsoft.Skills.Custom.ChatCompletionSkill";
+ }
+
+ /// API key for authenticating to the model. Both apiKey and authIdentity cannot be specified at the same time.
+ public string ApiKey { get; set; }
+ /// Common language model parameters that customers can tweak. If omitted, reasonable defaults will be applied.
+ public CommonModelParameters CommonModelParameters { get; set; }
+ /// Open-type dictionary for model-specific parameters that should be appended to the chat completions call. Follows Azure AI Foundry’s extensibility pattern.
+ public IDictionary ExtraParameters { get; set; }
+ /// How extra parameters are handled by Azure AI Foundry. Default is 'error'.
+ public ChatCompletionExtraParametersBehavior? ExtraParametersBehavior { get; set; }
+ /// Determines how the LLM should format its response. Defaults to 'text' response type.
+ public ChatCompletionResponseFormat ResponseFormat { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonModelParameters.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonModelParameters.Serialization.cs
new file mode 100644
index 000000000000..6a62321c194a
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonModelParameters.Serialization.cs
@@ -0,0 +1,228 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class CommonModelParameters : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Model))
+ {
+ if (Model != null)
+ {
+ writer.WritePropertyName("model"u8);
+ writer.WriteStringValue(Model);
+ }
+ else
+ {
+ writer.WriteNull("model");
+ }
+ }
+ if (Optional.IsDefined(FrequencyPenalty))
+ {
+ if (FrequencyPenalty != null)
+ {
+ writer.WritePropertyName("frequencyPenalty"u8);
+ writer.WriteNumberValue(FrequencyPenalty.Value);
+ }
+ else
+ {
+ writer.WriteNull("frequencyPenalty");
+ }
+ }
+ if (Optional.IsDefined(PresencePenalty))
+ {
+ if (PresencePenalty != null)
+ {
+ writer.WritePropertyName("presencePenalty"u8);
+ writer.WriteNumberValue(PresencePenalty.Value);
+ }
+ else
+ {
+ writer.WriteNull("presencePenalty");
+ }
+ }
+ if (Optional.IsDefined(MaxTokens))
+ {
+ if (MaxTokens != null)
+ {
+ writer.WritePropertyName("maxTokens"u8);
+ writer.WriteNumberValue(MaxTokens.Value);
+ }
+ else
+ {
+ writer.WriteNull("maxTokens");
+ }
+ }
+ if (Optional.IsDefined(Temperature))
+ {
+ if (Temperature != null)
+ {
+ writer.WritePropertyName("temperature"u8);
+ writer.WriteNumberValue(Temperature.Value);
+ }
+ else
+ {
+ writer.WriteNull("temperature");
+ }
+ }
+ if (Optional.IsDefined(Seed))
+ {
+ if (Seed != null)
+ {
+ writer.WritePropertyName("seed"u8);
+ writer.WriteNumberValue(Seed.Value);
+ }
+ else
+ {
+ writer.WriteNull("seed");
+ }
+ }
+ if (Optional.IsCollectionDefined(Stop))
+ {
+ if (Stop != null)
+ {
+ writer.WritePropertyName("stop"u8);
+ writer.WriteStartArray();
+ foreach (var item in Stop)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ else
+ {
+ writer.WriteNull("stop");
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static CommonModelParameters DeserializeCommonModelParameters(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string model = default;
+ float? frequencyPenalty = default;
+ float? presencePenalty = default;
+ int? maxTokens = default;
+ float? temperature = default;
+ int? seed = default;
+ IList stop = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("model"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ model = null;
+ continue;
+ }
+ model = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("frequencyPenalty"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ frequencyPenalty = null;
+ continue;
+ }
+ frequencyPenalty = property.Value.GetSingle();
+ continue;
+ }
+ if (property.NameEquals("presencePenalty"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ presencePenalty = null;
+ continue;
+ }
+ presencePenalty = property.Value.GetSingle();
+ continue;
+ }
+ if (property.NameEquals("maxTokens"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ maxTokens = null;
+ continue;
+ }
+ maxTokens = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("temperature"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ temperature = null;
+ continue;
+ }
+ temperature = property.Value.GetSingle();
+ continue;
+ }
+ if (property.NameEquals("seed"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ seed = null;
+ continue;
+ }
+ seed = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("stop"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ stop = null;
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ stop = array;
+ continue;
+ }
+ }
+ return new CommonModelParameters(
+ model,
+ frequencyPenalty,
+ presencePenalty,
+ maxTokens,
+ temperature,
+ seed,
+ stop ?? new ChangeTrackingList());
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static CommonModelParameters FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCommonModelParameters(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonModelParameters.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonModelParameters.cs
new file mode 100644
index 000000000000..4285af207e3d
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonModelParameters.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Common language model parameters for Chat Completions. If omitted, default values are used.
+ public partial class CommonModelParameters
+ {
+ /// Initializes a new instance of .
+ public CommonModelParameters()
+ {
+ Stop = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.
+ /// A float in the range [-2,2] that reduces or increases likelihood of repeated tokens. Default is 0.
+ /// A float in the range [-2,2] that penalizes new tokens based on their existing presence. Default is 0.
+ /// Maximum number of tokens to generate.
+ /// Sampling temperature. Default is 0.7.
+ /// Random seed for controlling deterministic outputs. If omitted, randomization is used.
+ /// List of stop sequences that will cut off text generation. Default is none.
+ internal CommonModelParameters(string model, float? frequencyPenalty, float? presencePenalty, int? maxTokens, float? temperature, int? seed, IList stop)
+ {
+ Model = model;
+ FrequencyPenalty = frequencyPenalty;
+ PresencePenalty = presencePenalty;
+ MaxTokens = maxTokens;
+ Temperature = temperature;
+ Seed = seed;
+ Stop = stop;
+ }
+
+ /// The name of the model to use (e.g., 'gpt-4o', etc.). Default is null if not specified.
+ public string Model { get; set; }
+ /// A float in the range [-2,2] that reduces or increases likelihood of repeated tokens. Default is 0.
+ public float? FrequencyPenalty { get; set; }
+ /// A float in the range [-2,2] that penalizes new tokens based on their existing presence. Default is 0.
+ public float? PresencePenalty { get; set; }
+ /// Maximum number of tokens to generate.
+ public int? MaxTokens { get; set; }
+ /// Sampling temperature. Default is 0.7.
+ public float? Temperature { get; set; }
+ /// Random seed for controlling deterministic outputs. If omitted, randomization is used.
+ public int? Seed { get; set; }
+ /// List of stop sequences that will cut off text generation. Default is none.
+ public IList Stop { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.Serialization.cs
index dcee507c5a2c..44fd64673c2a 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.Serialization.cs
@@ -5,6 +5,7 @@
#nullable disable
+using System.Collections.Generic;
using System.Text.Json;
namespace Azure.Search.Documents.Models
@@ -19,6 +20,7 @@ internal static DocumentDebugInfo DeserializeDocumentDebugInfo(JsonElement eleme
}
SemanticDebugInfo semantic = default;
VectorsDebugInfo vectors = default;
+ IReadOnlyDictionary> innerHits = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("semantic"u8))
@@ -39,8 +41,34 @@ internal static DocumentDebugInfo DeserializeDocumentDebugInfo(JsonElement eleme
vectors = VectorsDebugInfo.DeserializeVectorsDebugInfo(property.Value);
continue;
}
+ if (property.NameEquals("innerHits"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary> dictionary = new Dictionary>();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ List array = new List();
+ foreach (var item in property0.Value.EnumerateArray())
+ {
+ array.Add(QueryResultDocumentInnerHit.DeserializeQueryResultDocumentInnerHit(item));
+ }
+ dictionary.Add(property0.Name, array);
+ }
+ }
+ innerHits = dictionary;
+ continue;
+ }
}
- return new DocumentDebugInfo(semantic, vectors);
+ return new DocumentDebugInfo(semantic, vectors, innerHits ?? new ChangeTrackingDictionary>());
}
/// Deserializes the model from a raw response.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.cs
index ca41ce4d1962..aab3ce66c7e1 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentDebugInfo.cs
@@ -5,6 +5,8 @@
#nullable disable
+using System.Collections.Generic;
+
namespace Azure.Search.Documents.Models
{
/// Contains debugging information that can be used to further explore your search results.
@@ -13,20 +15,25 @@ public partial class DocumentDebugInfo
/// Initializes a new instance of .
internal DocumentDebugInfo()
{
+ InnerHits = new ChangeTrackingDictionary>();
}
/// Initializes a new instance of .
/// Contains debugging information specific to semantic ranking requests.
/// Contains debugging information specific to vector and hybrid search.
- internal DocumentDebugInfo(SemanticDebugInfo semantic, VectorsDebugInfo vectors)
+ /// Contains debugging information specific to vectors matched within a collection of complex types.
+ internal DocumentDebugInfo(SemanticDebugInfo semantic, VectorsDebugInfo vectors, IReadOnlyDictionary> innerHits)
{
Semantic = semantic;
Vectors = vectors;
+ InnerHits = innerHits;
}
/// Contains debugging information specific to semantic ranking requests.
public SemanticDebugInfo Semantic { get; }
/// Contains debugging information specific to vector and hybrid search.
public VectorsDebugInfo Vectors { get; }
+ /// Contains debugging information specific to vectors matched within a collection of complex types.
+ public IReadOnlyDictionary> InnerHits { get; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs
index 91f1e56a192c..4611eb4fe308 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.Serialization.cs
@@ -16,6 +16,18 @@ public partial class DocumentIntelligenceLayoutSkill : IUtf8JsonSerializable
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
+ if (Optional.IsDefined(OutputFormat))
+ {
+ if (OutputFormat != null)
+ {
+ writer.WritePropertyName("outputFormat"u8);
+ writer.WriteStringValue(OutputFormat.Value.ToString());
+ }
+ else
+ {
+ writer.WriteNull("outputFormat");
+ }
+ }
if (Optional.IsDefined(OutputMode))
{
if (OutputMode != null)
@@ -40,6 +52,35 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WriteNull("markdownHeaderDepth");
}
}
+ if (Optional.IsCollectionDefined(ExtractionOptions))
+ {
+ if (ExtractionOptions != null)
+ {
+ writer.WritePropertyName("extractionOptions"u8);
+ writer.WriteStartArray();
+ foreach (var item in ExtractionOptions)
+ {
+ writer.WriteStringValue(item.ToString());
+ }
+ writer.WriteEndArray();
+ }
+ else
+ {
+ writer.WriteNull("extractionOptions");
+ }
+ }
+ if (Optional.IsDefined(ChunkingProperties))
+ {
+ if (ChunkingProperties != null)
+ {
+ writer.WritePropertyName("chunkingProperties"u8);
+ writer.WriteObjectValue(ChunkingProperties);
+ }
+ else
+ {
+ writer.WriteNull("chunkingProperties");
+ }
+ }
writer.WritePropertyName("@odata.type"u8);
writer.WriteStringValue(ODataType);
if (Optional.IsDefined(Name))
@@ -80,8 +121,11 @@ internal static DocumentIntelligenceLayoutSkill DeserializeDocumentIntelligenceL
{
return null;
}
+ DocumentIntelligenceLayoutSkillOutputFormat? outputFormat = default;
DocumentIntelligenceLayoutSkillOutputMode? outputMode = default;
DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? markdownHeaderDepth = default;
+ IList extractionOptions = default;
+ DocumentIntelligenceLayoutSkillChunkingProperties chunkingProperties = default;
string odataType = default;
string name = default;
string description = default;
@@ -90,6 +134,16 @@ internal static DocumentIntelligenceLayoutSkill DeserializeDocumentIntelligenceL
IList outputs = default;
foreach (var property in element.EnumerateObject())
{
+ if (property.NameEquals("outputFormat"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ outputFormat = null;
+ continue;
+ }
+ outputFormat = new DocumentIntelligenceLayoutSkillOutputFormat(property.Value.GetString());
+ continue;
+ }
if (property.NameEquals("outputMode"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -110,6 +164,31 @@ internal static DocumentIntelligenceLayoutSkill DeserializeDocumentIntelligenceL
markdownHeaderDepth = new DocumentIntelligenceLayoutSkillMarkdownHeaderDepth(property.Value.GetString());
continue;
}
+ if (property.NameEquals("extractionOptions"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ extractionOptions = null;
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(new DocumentIntelligenceLayoutSkillExtractionOptions(item.GetString()));
+ }
+ extractionOptions = array;
+ continue;
+ }
+ if (property.NameEquals("chunkingProperties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ chunkingProperties = null;
+ continue;
+ }
+ chunkingProperties = DocumentIntelligenceLayoutSkillChunkingProperties.DeserializeDocumentIntelligenceLayoutSkillChunkingProperties(property.Value);
+ continue;
+ }
if (property.NameEquals("@odata.type"u8))
{
odataType = property.Value.GetString();
@@ -158,8 +237,11 @@ internal static DocumentIntelligenceLayoutSkill DeserializeDocumentIntelligenceL
context,
inputs,
outputs,
+ outputFormat,
outputMode,
- markdownHeaderDepth);
+ markdownHeaderDepth,
+ extractionOptions ?? new ChangeTrackingList(),
+ chunkingProperties);
}
/// Deserializes the model from a raw response.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.cs
index 75eafce1323a..2a491c492f5b 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkill.cs
@@ -10,7 +10,7 @@
namespace Azure.Search.Documents.Indexes.Models
{
- /// A skill that extracts content and layout information (as markdown), via Azure AI Services, from files within the enrichment pipeline.
+ /// A skill that extracts content and layout information, via Azure AI Services, from files within the enrichment pipeline.
public partial class DocumentIntelligenceLayoutSkill : SearchIndexerSkill
{
/// Initializes a new instance of .
@@ -22,6 +22,7 @@ public DocumentIntelligenceLayoutSkill(IEnumerable input
Argument.AssertNotNull(inputs, nameof(inputs));
Argument.AssertNotNull(outputs, nameof(outputs));
+ ExtractionOptions = new ChangeTrackingList();
ODataType = "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill";
}
@@ -32,18 +33,30 @@ public DocumentIntelligenceLayoutSkill(IEnumerable input
/// 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.
/// Inputs of the skills could be a column in the source data set, or the output of an upstream skill.
/// 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.
+ /// Controls the cardinality of the output format. Default is 'markdown'.
/// Controls the cardinality of the output produced by the skill. Default is 'oneToMany'.
/// The depth of headers in the markdown output. Default is h6.
- internal DocumentIntelligenceLayoutSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, DocumentIntelligenceLayoutSkillOutputMode? outputMode, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? markdownHeaderDepth) : base(oDataType, name, description, context, inputs, outputs)
+ /// Controls the cardinality of the content extracted from the document by the skill.
+ /// Controls the cardinality for chunking the content.
+ internal DocumentIntelligenceLayoutSkill(string oDataType, string name, string description, string context, IList inputs, IList outputs, DocumentIntelligenceLayoutSkillOutputFormat? outputFormat, DocumentIntelligenceLayoutSkillOutputMode? outputMode, DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? markdownHeaderDepth, IList extractionOptions, DocumentIntelligenceLayoutSkillChunkingProperties chunkingProperties) : base(oDataType, name, description, context, inputs, outputs)
{
+ OutputFormat = outputFormat;
OutputMode = outputMode;
MarkdownHeaderDepth = markdownHeaderDepth;
+ ExtractionOptions = extractionOptions;
+ ChunkingProperties = chunkingProperties;
ODataType = oDataType ?? "#Microsoft.Skills.Util.DocumentIntelligenceLayoutSkill";
}
+ /// Controls the cardinality of the output format. Default is 'markdown'.
+ public DocumentIntelligenceLayoutSkillOutputFormat? OutputFormat { get; set; }
/// Controls the cardinality of the output produced by the skill. Default is 'oneToMany'.
public DocumentIntelligenceLayoutSkillOutputMode? OutputMode { get; set; }
/// The depth of headers in the markdown output. Default is h6.
public DocumentIntelligenceLayoutSkillMarkdownHeaderDepth? MarkdownHeaderDepth { get; set; }
+ /// Controls the cardinality of the content extracted from the document by the skill.
+ public IList ExtractionOptions { get; set; }
+ /// Controls the cardinality for chunking the content.
+ public DocumentIntelligenceLayoutSkillChunkingProperties ChunkingProperties { get; set; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingProperties.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingProperties.Serialization.cs
new file mode 100644
index 000000000000..62f50c8ccfd5
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingProperties.Serialization.cs
@@ -0,0 +1,118 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class DocumentIntelligenceLayoutSkillChunkingProperties : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Unit))
+ {
+ if (Unit != null)
+ {
+ writer.WritePropertyName("unit"u8);
+ writer.WriteStringValue(Unit.Value.ToString());
+ }
+ else
+ {
+ writer.WriteNull("unit");
+ }
+ }
+ if (Optional.IsDefined(MaximumLength))
+ {
+ if (MaximumLength != null)
+ {
+ writer.WritePropertyName("maximumLength"u8);
+ writer.WriteNumberValue(MaximumLength.Value);
+ }
+ else
+ {
+ writer.WriteNull("maximumLength");
+ }
+ }
+ if (Optional.IsDefined(OverlapLength))
+ {
+ if (OverlapLength != null)
+ {
+ writer.WritePropertyName("overlapLength"u8);
+ writer.WriteNumberValue(OverlapLength.Value);
+ }
+ else
+ {
+ writer.WriteNull("overlapLength");
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static DocumentIntelligenceLayoutSkillChunkingProperties DeserializeDocumentIntelligenceLayoutSkillChunkingProperties(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ DocumentIntelligenceLayoutSkillChunkingUnit? unit = default;
+ int? maximumLength = default;
+ int? overlapLength = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("unit"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ unit = null;
+ continue;
+ }
+ unit = new DocumentIntelligenceLayoutSkillChunkingUnit(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("maximumLength"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ maximumLength = null;
+ continue;
+ }
+ maximumLength = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("overlapLength"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ overlapLength = null;
+ continue;
+ }
+ overlapLength = property.Value.GetInt32();
+ continue;
+ }
+ }
+ return new DocumentIntelligenceLayoutSkillChunkingProperties(unit, maximumLength, overlapLength);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DocumentIntelligenceLayoutSkillChunkingProperties FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeDocumentIntelligenceLayoutSkillChunkingProperties(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingProperties.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingProperties.cs
new file mode 100644
index 000000000000..d87cfc89a2a7
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingProperties.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Controls the cardinality for chunking the content.
+ public partial class DocumentIntelligenceLayoutSkillChunkingProperties
+ {
+ /// Initializes a new instance of .
+ public DocumentIntelligenceLayoutSkillChunkingProperties()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The unit of the chunk.
+ /// The maximum chunk length in characters. Default is 500.
+ /// The length of overlap provided between two text chunks. Default is 0.
+ internal DocumentIntelligenceLayoutSkillChunkingProperties(DocumentIntelligenceLayoutSkillChunkingUnit? unit, int? maximumLength, int? overlapLength)
+ {
+ Unit = unit;
+ MaximumLength = maximumLength;
+ OverlapLength = overlapLength;
+ }
+
+ /// The unit of the chunk.
+ public DocumentIntelligenceLayoutSkillChunkingUnit? Unit { get; set; }
+ /// The maximum chunk length in characters. Default is 500.
+ public int? MaximumLength { get; set; }
+ /// The length of overlap provided between two text chunks. Default is 0.
+ public int? OverlapLength { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingUnit.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingUnit.cs
new file mode 100644
index 000000000000..beae9ab3a252
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillChunkingUnit.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Controls the cardinality of the chunk unit. Default is 'characters'.
+ public readonly partial struct DocumentIntelligenceLayoutSkillChunkingUnit : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public DocumentIntelligenceLayoutSkillChunkingUnit(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string CharactersValue = "characters";
+
+ /// Specifies chunk by characters.
+ public static DocumentIntelligenceLayoutSkillChunkingUnit Characters { get; } = new DocumentIntelligenceLayoutSkillChunkingUnit(CharactersValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(DocumentIntelligenceLayoutSkillChunkingUnit left, DocumentIntelligenceLayoutSkillChunkingUnit right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(DocumentIntelligenceLayoutSkillChunkingUnit left, DocumentIntelligenceLayoutSkillChunkingUnit right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator DocumentIntelligenceLayoutSkillChunkingUnit(string value) => new DocumentIntelligenceLayoutSkillChunkingUnit(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is DocumentIntelligenceLayoutSkillChunkingUnit other && Equals(other);
+ ///
+ public bool Equals(DocumentIntelligenceLayoutSkillChunkingUnit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillExtractionOptions.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillExtractionOptions.cs
new file mode 100644
index 000000000000..d21d930ae891
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillExtractionOptions.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Controls the cardinality of the content extracted from the document by the skill.
+ public readonly partial struct DocumentIntelligenceLayoutSkillExtractionOptions : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public DocumentIntelligenceLayoutSkillExtractionOptions(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string ImagesValue = "images";
+ private const string LocationMetadataValue = "locationMetadata";
+
+ /// Specify that image content should be extracted from the document.
+ public static DocumentIntelligenceLayoutSkillExtractionOptions Images { get; } = new DocumentIntelligenceLayoutSkillExtractionOptions(ImagesValue);
+ /// Specify that location metadata should be extracted from the document.
+ public static DocumentIntelligenceLayoutSkillExtractionOptions LocationMetadata { get; } = new DocumentIntelligenceLayoutSkillExtractionOptions(LocationMetadataValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(DocumentIntelligenceLayoutSkillExtractionOptions left, DocumentIntelligenceLayoutSkillExtractionOptions right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(DocumentIntelligenceLayoutSkillExtractionOptions left, DocumentIntelligenceLayoutSkillExtractionOptions right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator DocumentIntelligenceLayoutSkillExtractionOptions(string value) => new DocumentIntelligenceLayoutSkillExtractionOptions(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is DocumentIntelligenceLayoutSkillExtractionOptions other && Equals(other);
+ ///
+ public bool Equals(DocumentIntelligenceLayoutSkillExtractionOptions other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputFormat.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputFormat.cs
new file mode 100644
index 000000000000..4d1ee1179571
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputFormat.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Controls the cardinality of the output format. Default is 'markdown'.
+ public readonly partial struct DocumentIntelligenceLayoutSkillOutputFormat : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public DocumentIntelligenceLayoutSkillOutputFormat(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string TextValue = "text";
+ private const string MarkdownValue = "markdown";
+
+ /// Specify the format of the output as text.
+ public static DocumentIntelligenceLayoutSkillOutputFormat Text { get; } = new DocumentIntelligenceLayoutSkillOutputFormat(TextValue);
+ /// Specify the format of the output as markdown.
+ public static DocumentIntelligenceLayoutSkillOutputFormat Markdown { get; } = new DocumentIntelligenceLayoutSkillOutputFormat(MarkdownValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(DocumentIntelligenceLayoutSkillOutputFormat left, DocumentIntelligenceLayoutSkillOutputFormat right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(DocumentIntelligenceLayoutSkillOutputFormat left, DocumentIntelligenceLayoutSkillOutputFormat right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator DocumentIntelligenceLayoutSkillOutputFormat(string value) => new DocumentIntelligenceLayoutSkillOutputFormat(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is DocumentIntelligenceLayoutSkillOutputFormat other && Equals(other);
+ ///
+ public bool Equals(DocumentIntelligenceLayoutSkillOutputFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs
index 50559c358b55..536498a0ab24 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DocumentIntelligenceLayoutSkillOutputMode.cs
@@ -24,7 +24,7 @@ public DocumentIntelligenceLayoutSkillOutputMode(string value)
private const string OneToManyValue = "oneToMany";
- /// Specify the deepest markdown header section to parse.
+ /// Specify that the output should be parsed as 'oneToMany'.
public static DocumentIntelligenceLayoutSkillOutputMode OneToMany { get; } = new DocumentIntelligenceLayoutSkillOutputMode(OneToManyValue);
/// Determines if two values are the same.
public static bool operator ==(DocumentIntelligenceLayoutSkillOutputMode left, DocumentIntelligenceLayoutSkillOutputMode right) => left.Equals(right);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs
index 6cd00f2b438b..97365b663f5e 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.Serialization.cs
@@ -21,7 +21,7 @@ internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonEle
}
IndexerExecutionStatus status = default;
IndexerExecutionStatusDetail? statusDetail = default;
- IndexerState currentState = default;
+ IndexingMode? mode = default;
string errorMessage = default;
DateTimeOffset? startTime = default;
DateTimeOffset? endTime = default;
@@ -48,13 +48,13 @@ internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonEle
statusDetail = new IndexerExecutionStatusDetail(property.Value.GetString());
continue;
}
- if (property.NameEquals("currentState"u8))
+ if (property.NameEquals("mode"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- currentState = IndexerState.DeserializeIndexerState(property.Value);
+ mode = new IndexingMode(property.Value.GetString());
continue;
}
if (property.NameEquals("errorMessage"u8))
@@ -125,7 +125,7 @@ internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonEle
return new IndexerExecutionResult(
status,
statusDetail,
- currentState,
+ mode,
errorMessage,
startTime,
endTime,
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs
index 16d5530e3ad3..d56dae6ba704 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionResult.cs
@@ -32,7 +32,7 @@ internal IndexerExecutionResult(IndexerExecutionStatus status, IEnumerable Initializes a new instance of .
/// The outcome of this indexer execution.
/// The outcome of this indexer execution.
- /// All of the state that defines and dictates the indexer's current execution.
+ /// The mode the indexer is running in.
/// The error message indicating the top-level error, if any.
/// The start time of this indexer execution.
/// The end time of this indexer execution, if the execution has already completed.
@@ -42,11 +42,11 @@ internal IndexerExecutionResult(IndexerExecutionStatus status, IEnumerable The number of items that failed to be indexed during this indexer execution.
/// Change tracking state with which an indexer execution started.
/// Change tracking state with which an indexer execution finished.
- internal IndexerExecutionResult(IndexerExecutionStatus status, IndexerExecutionStatusDetail? statusDetail, IndexerState currentState, string errorMessage, DateTimeOffset? startTime, DateTimeOffset? endTime, IReadOnlyList errors, IReadOnlyList warnings, int itemCount, int failedItemCount, string initialTrackingState, string finalTrackingState)
+ internal IndexerExecutionResult(IndexerExecutionStatus status, IndexerExecutionStatusDetail? statusDetail, IndexingMode? mode, string errorMessage, DateTimeOffset? startTime, DateTimeOffset? endTime, IReadOnlyList errors, IReadOnlyList warnings, int itemCount, int failedItemCount, string initialTrackingState, string finalTrackingState)
{
Status = status;
StatusDetail = statusDetail;
- CurrentState = currentState;
+ Mode = mode;
ErrorMessage = errorMessage;
StartTime = startTime;
EndTime = endTime;
@@ -62,8 +62,8 @@ internal IndexerExecutionResult(IndexerExecutionStatus status, IndexerExecutionS
public IndexerExecutionStatus Status { get; }
/// The outcome of this indexer execution.
public IndexerExecutionStatusDetail? StatusDetail { get; }
- /// All of the state that defines and dictates the indexer's current execution.
- public IndexerState CurrentState { get; }
+ /// The mode the indexer is running in.
+ public IndexingMode? Mode { get; }
/// The error message indicating the top-level error, if any.
public string ErrorMessage { get; }
/// The start time of this indexer execution.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs
index b66b5527d807..9f79f6207aaa 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerExecutionStatusDetail.cs
@@ -23,9 +23,12 @@ public IndexerExecutionStatusDetail(string value)
}
private const string ResetDocsValue = "resetDocs";
+ private const string ResyncValue = "resync";
/// Indicates that the reset that occurred was for a call to ResetDocs.
public static IndexerExecutionStatusDetail ResetDocs { get; } = new IndexerExecutionStatusDetail(ResetDocsValue);
+ /// Indicates to selectively resync based on option(s) from data source.
+ public static IndexerExecutionStatusDetail Resync { get; } = new IndexerExecutionStatusDetail(ResyncValue);
/// Determines if two values are the same.
public static bool operator ==(IndexerExecutionStatusDetail left, IndexerExecutionStatusDetail right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerPermissionOption.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerPermissionOption.cs
new file mode 100644
index 000000000000..8710b88cc598
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerPermissionOption.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Options with various types of permission data to index.
+ public readonly partial struct IndexerPermissionOption : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public IndexerPermissionOption(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string UserIdsValue = "userIds";
+ private const string GroupIdsValue = "groupIds";
+ private const string RbacScopeValue = "rbacScope";
+
+ /// Indexer to ingest ACL userIds from data source to index.
+ public static IndexerPermissionOption UserIds { get; } = new IndexerPermissionOption(UserIdsValue);
+ /// Indexer to ingest ACL groupIds from data source to index.
+ public static IndexerPermissionOption GroupIds { get; } = new IndexerPermissionOption(GroupIdsValue);
+ /// Indexer to ingest Azure RBAC scope from data source to index.
+ public static IndexerPermissionOption RbacScope { get; } = new IndexerPermissionOption(RbacScopeValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(IndexerPermissionOption left, IndexerPermissionOption right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(IndexerPermissionOption left, IndexerPermissionOption right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator IndexerPermissionOption(string value) => new IndexerPermissionOption(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is IndexerPermissionOption other && Equals(other);
+ ///
+ public bool Equals(IndexerPermissionOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncBody.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncBody.Serialization.cs
new file mode 100644
index 000000000000..2dde11b541c7
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncBody.Serialization.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class IndexerResyncBody : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsCollectionDefined(Options))
+ {
+ if (Options != null)
+ {
+ writer.WritePropertyName("options"u8);
+ writer.WriteStartArray();
+ foreach (var item in Options)
+ {
+ writer.WriteStringValue(item.ToString());
+ }
+ writer.WriteEndArray();
+ }
+ else
+ {
+ writer.WriteNull("options");
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncBody.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncBody.cs
new file mode 100644
index 000000000000..74fd00e15f9e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncBody.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using Azure.Search.Documents.Indexes.Models;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The IndexerResyncBody.
+ public partial class IndexerResyncBody
+ {
+ /// Initializes a new instance of .
+ public IndexerResyncBody()
+ {
+ Options = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// Re-sync options that have been pre-defined from data source.
+ internal IndexerResyncBody(IList options)
+ {
+ Options = options;
+ }
+
+ /// Re-sync options that have been pre-defined from data source.
+ public IList Options { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncOption.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncOption.cs
new file mode 100644
index 000000000000..b70cdddbeb6d
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerResyncOption.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Options with various types of permission data to index.
+ public readonly partial struct IndexerResyncOption : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public IndexerResyncOption(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string PermissionsValue = "permissions";
+
+ /// Indexer to re-ingest pre-selected permissions data from data source to index.
+ public static IndexerResyncOption Permissions { get; } = new IndexerResyncOption(PermissionsValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(IndexerResyncOption left, IndexerResyncOption right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(IndexerResyncOption left, IndexerResyncOption right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator IndexerResyncOption(string value) => new IndexerResyncOption(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is IndexerResyncOption other && Equals(other);
+ ///
+ public bool Equals(IndexerResyncOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.Serialization.cs
index 52b14853ef52..561f28ed5854 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.Serialization.cs
@@ -19,12 +19,14 @@ internal static IndexerState DeserializeIndexerState(JsonElement element)
return null;
}
IndexingMode? mode = default;
- string allDocsInitialChangeTrackingState = default;
- string allDocsFinalChangeTrackingState = default;
- string resetDocsInitialChangeTrackingState = default;
- string resetDocsFinalChangeTrackingState = default;
+ string allDocsInitialTrackingState = default;
+ string allDocsFinalTrackingState = default;
+ string resetDocsInitialTrackingState = default;
+ string resetDocsFinalTrackingState = default;
IReadOnlyList resetDocumentKeys = default;
IReadOnlyList resetDatasourceDocumentIds = default;
+ string resyncInitialTrackingState = default;
+ string resyncFinalTrackingState = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("mode"u8))
@@ -36,24 +38,24 @@ internal static IndexerState DeserializeIndexerState(JsonElement element)
mode = new IndexingMode(property.Value.GetString());
continue;
}
- if (property.NameEquals("allDocsInitialChangeTrackingState"u8))
+ if (property.NameEquals("allDocsInitialTrackingState"u8))
{
- allDocsInitialChangeTrackingState = property.Value.GetString();
+ allDocsInitialTrackingState = property.Value.GetString();
continue;
}
- if (property.NameEquals("allDocsFinalChangeTrackingState"u8))
+ if (property.NameEquals("allDocsFinalTrackingState"u8))
{
- allDocsFinalChangeTrackingState = property.Value.GetString();
+ allDocsFinalTrackingState = property.Value.GetString();
continue;
}
- if (property.NameEquals("resetDocsInitialChangeTrackingState"u8))
+ if (property.NameEquals("resetDocsInitialTrackingState"u8))
{
- resetDocsInitialChangeTrackingState = property.Value.GetString();
+ resetDocsInitialTrackingState = property.Value.GetString();
continue;
}
- if (property.NameEquals("resetDocsFinalChangeTrackingState"u8))
+ if (property.NameEquals("resetDocsFinalTrackingState"u8))
{
- resetDocsFinalChangeTrackingState = property.Value.GetString();
+ resetDocsFinalTrackingState = property.Value.GetString();
continue;
}
if (property.NameEquals("resetDocumentKeys"u8))
@@ -84,15 +86,27 @@ internal static IndexerState DeserializeIndexerState(JsonElement element)
resetDatasourceDocumentIds = array;
continue;
}
+ if (property.NameEquals("resyncInitialTrackingState"u8))
+ {
+ resyncInitialTrackingState = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("resyncFinalTrackingState"u8))
+ {
+ resyncFinalTrackingState = property.Value.GetString();
+ continue;
+ }
}
return new IndexerState(
mode,
- allDocsInitialChangeTrackingState,
- allDocsFinalChangeTrackingState,
- resetDocsInitialChangeTrackingState,
- resetDocsFinalChangeTrackingState,
+ allDocsInitialTrackingState,
+ allDocsFinalTrackingState,
+ resetDocsInitialTrackingState,
+ resetDocsFinalTrackingState,
resetDocumentKeys ?? new ChangeTrackingList(),
- resetDatasourceDocumentIds ?? new ChangeTrackingList());
+ resetDatasourceDocumentIds ?? new ChangeTrackingList(),
+ resyncInitialTrackingState,
+ resyncFinalTrackingState);
}
/// Deserializes the model from a raw response.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.cs
index 8047262f3e4f..6678d5f11c6b 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexerState.cs
@@ -19,9 +19,44 @@ internal IndexerState()
ResetDataSourceDocumentIds = new ChangeTrackingList();
}
+ /// Initializes a new instance of .
+ /// The mode the indexer is running in.
+ /// Change tracking state used when indexing starts on all documents in the datasource.
+ /// Change tracking state value when indexing finishes on all documents in the datasource.
+ /// Change tracking state used when indexing starts on select, reset documents in the datasource.
+ /// Change tracking state value when indexing finishes on select, reset documents in the datasource.
+ /// The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
+ /// The list of datasource document ids that have been reset. The datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize selectively re-ingesting these ids.
+ /// Change tracking state used when indexing starts on selective options from the datasource.
+ /// Change tracking state value when indexing finishes on selective options from the datasource.
+ internal IndexerState(IndexingMode? mode, string allDocsInitialTrackingState, string allDocsFinalTrackingState, string resetDocsInitialTrackingState, string resetDocsFinalTrackingState, IReadOnlyList resetDocumentKeys, IReadOnlyList resetDataSourceDocumentIds, string resyncInitialTrackingState, string resyncFinalTrackingState)
+ {
+ Mode = mode;
+ AllDocsInitialTrackingState = allDocsInitialTrackingState;
+ AllDocsFinalTrackingState = allDocsFinalTrackingState;
+ ResetDocsInitialTrackingState = resetDocsInitialTrackingState;
+ ResetDocsFinalTrackingState = resetDocsFinalTrackingState;
+ ResetDocumentKeys = resetDocumentKeys;
+ ResetDataSourceDocumentIds = resetDataSourceDocumentIds;
+ ResyncInitialTrackingState = resyncInitialTrackingState;
+ ResyncFinalTrackingState = resyncFinalTrackingState;
+ }
+
/// The mode the indexer is running in.
public IndexingMode? Mode { get; }
+ /// Change tracking state used when indexing starts on all documents in the datasource.
+ public string AllDocsInitialTrackingState { get; }
+ /// Change tracking state value when indexing finishes on all documents in the datasource.
+ public string AllDocsFinalTrackingState { get; }
+ /// Change tracking state used when indexing starts on select, reset documents in the datasource.
+ public string ResetDocsInitialTrackingState { get; }
+ /// Change tracking state value when indexing finishes on select, reset documents in the datasource.
+ public string ResetDocsFinalTrackingState { get; }
/// The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
public IReadOnlyList ResetDocumentKeys { get; }
+ /// Change tracking state used when indexing starts on selective options from the datasource.
+ public string ResyncInitialTrackingState { get; }
+ /// Change tracking state value when indexing finishes on selective options from the datasource.
+ public string ResyncFinalTrackingState { get; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs
index d06c75c206b1..df0a050db730 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexingMode.cs
@@ -24,6 +24,9 @@ public IndexingMode(string value)
private const string AllDocumentsValue = "indexingAllDocs";
private const string ResetDocumentsValue = "indexingResetDocs";
+ private const string IndexingResyncValue = "indexingResync";
+ /// The indexer is resyncing and indexing selective option(s) from the datasource.
+ public static IndexingMode IndexingResync { get; } = new IndexingMode(IndexingResyncValue);
/// Determines if two values are the same.
public static bool operator ==(IndexingMode left, IndexingMode right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgent.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgent.Serialization.cs
new file mode 100644
index 000000000000..32558a15698c
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgent.Serialization.cs
@@ -0,0 +1,161 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class KnowledgeAgent : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ writer.WritePropertyName("models"u8);
+ writer.WriteStartArray();
+ foreach (var item in Models)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ writer.WritePropertyName("targetIndexes"u8);
+ writer.WriteStartArray();
+ foreach (var item in TargetIndexes)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ if (Optional.IsDefined(RequestLimits))
+ {
+ writer.WritePropertyName("requestLimits"u8);
+ writer.WriteObjectValue(RequestLimits);
+ }
+ if (Optional.IsDefined(ETag))
+ {
+ writer.WritePropertyName("@odata.etag"u8);
+ writer.WriteStringValue(ETag);
+ }
+ if (Optional.IsDefined(EncryptionKey))
+ {
+ if (EncryptionKey != null)
+ {
+ writer.WritePropertyName("encryptionKey"u8);
+ writer.WriteObjectValue(EncryptionKey);
+ }
+ else
+ {
+ writer.WriteNull("encryptionKey");
+ }
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgent DeserializeKnowledgeAgent(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string name = default;
+ IList models = default;
+ IList targetIndexes = default;
+ KnowledgeAgentRequestLimits requestLimits = default;
+ string odataEtag = default;
+ SearchResourceEncryptionKey encryptionKey = default;
+ string description = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("models"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgentModel.DeserializeKnowledgeAgentModel(item));
+ }
+ models = array;
+ continue;
+ }
+ if (property.NameEquals("targetIndexes"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgentTargetIndex.DeserializeKnowledgeAgentTargetIndex(item));
+ }
+ targetIndexes = array;
+ continue;
+ }
+ if (property.NameEquals("requestLimits"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ requestLimits = KnowledgeAgentRequestLimits.DeserializeKnowledgeAgentRequestLimits(property.Value);
+ continue;
+ }
+ if (property.NameEquals("@odata.etag"u8))
+ {
+ odataEtag = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("encryptionKey"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ encryptionKey = null;
+ continue;
+ }
+ encryptionKey = SearchResourceEncryptionKey.DeserializeSearchResourceEncryptionKey(property.Value);
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ }
+ return new KnowledgeAgent(
+ name,
+ models,
+ targetIndexes,
+ requestLimits,
+ odataEtag,
+ encryptionKey,
+ description);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgent.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgent.cs
new file mode 100644
index 000000000000..40f3b923bc63
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgent.cs
@@ -0,0 +1,79 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// The KnowledgeAgent.
+ public partial class KnowledgeAgent
+ {
+ /// Initializes a new instance of .
+ /// The name of the knowledge agent.
+ ///
+ /// Contains configuration options on how to connect to AI models.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ ///
+ /// , or is null.
+ public KnowledgeAgent(string name, IEnumerable models, IEnumerable targetIndexes)
+ {
+ Argument.AssertNotNull(name, nameof(name));
+ Argument.AssertNotNull(models, nameof(models));
+ Argument.AssertNotNull(targetIndexes, nameof(targetIndexes));
+
+ Name = name;
+ Models = models.ToList();
+ TargetIndexes = targetIndexes.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the knowledge agent.
+ ///
+ /// Contains configuration options on how to connect to AI models.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ ///
+ /// Guardrails to limit how much resources are utilized for a single agent retrieval request.
+ /// The ETag of the agent.
+ /// 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 agent definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your agent 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 agent 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.
+ /// The description of the agent.
+ internal KnowledgeAgent(string name, IList models, IList targetIndexes, KnowledgeAgentRequestLimits requestLimits, string eTag, SearchResourceEncryptionKey encryptionKey, string description)
+ {
+ Name = name;
+ Models = models;
+ TargetIndexes = targetIndexes;
+ RequestLimits = requestLimits;
+ ETag = eTag;
+ EncryptionKey = encryptionKey;
+ Description = description;
+ }
+
+ /// The name of the knowledge agent.
+ public string Name { get; set; }
+ ///
+ /// Contains configuration options on how to connect to AI models.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ public IList Models { get; }
+ /// Gets the target indexes.
+ public IList TargetIndexes { get; }
+ /// Guardrails to limit how much resources are utilized for a single agent retrieval request.
+ public KnowledgeAgentRequestLimits RequestLimits { get; set; }
+ /// The ETag of the agent.
+ public string ETag { get; set; }
+ /// 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 agent definition when you want full assurance that no one, not even Microsoft, can decrypt them. Once you have encrypted your agent 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 agent 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.
+ public SearchResourceEncryptionKey EncryptionKey { get; set; }
+ /// The description of the agent.
+ public string Description { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentActivityRecord.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentActivityRecord.Serialization.cs
new file mode 100644
index 000000000000..f8d95a4eec7e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentActivityRecord.Serialization.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentActivityRecord
+ {
+ internal static KnowledgeAgentActivityRecord DeserializeKnowledgeAgentActivityRecord(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "AzureSearchQuery": return KnowledgeAgentSearchActivityRecord.DeserializeKnowledgeAgentSearchActivityRecord(element);
+ case "AzureSearchSemanticRanker": return KnowledgeAgentSemanticRankerActivityRecord.DeserializeKnowledgeAgentSemanticRankerActivityRecord(element);
+ case "ModelQueryPlanning": return KnowledgeAgentModelQueryPlanningActivityRecord.DeserializeKnowledgeAgentModelQueryPlanningActivityRecord(element);
+ }
+ }
+ return UnknownKnowledgeAgentActivityRecord.DeserializeUnknownKnowledgeAgentActivityRecord(element);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentActivityRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentActivityRecord(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentActivityRecord.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentActivityRecord.cs
new file mode 100644
index 000000000000..94bc00a15286
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentActivityRecord.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ ///
+ /// Base type for activity records.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ public abstract partial class KnowledgeAgentActivityRecord
+ {
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ protected KnowledgeAgentActivityRecord(int id)
+ {
+ Id = id;
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ /// The type of the activity record.
+ internal KnowledgeAgentActivityRecord(int id, string type)
+ {
+ Id = id;
+ Type = type;
+ }
+
+ /// The ID of the activity record.
+ public int Id { get; }
+ /// The type of the activity record.
+ internal string Type { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureOpenAIModel.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureOpenAIModel.Serialization.cs
new file mode 100644
index 000000000000..2bbd56492835
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureOpenAIModel.Serialization.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class KnowledgeAgentAzureOpenAIModel : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("azureOpenAIParameters"u8);
+ writer.WriteObjectValue(AzureOpenAIParameters);
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentAzureOpenAIModel DeserializeKnowledgeAgentAzureOpenAIModel(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ AzureOpenAIVectorizerParameters azureOpenAIParameters = default;
+ KnowledgeAgentModelKind kind = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("azureOpenAIParameters"u8))
+ {
+ azureOpenAIParameters = AzureOpenAIVectorizerParameters.DeserializeAzureOpenAIVectorizerParameters(property.Value);
+ continue;
+ }
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new KnowledgeAgentModelKind(property.Value.GetString());
+ continue;
+ }
+ }
+ return new KnowledgeAgentAzureOpenAIModel(kind, azureOpenAIParameters);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentAzureOpenAIModel FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentAzureOpenAIModel(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureOpenAIModel.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureOpenAIModel.cs
new file mode 100644
index 000000000000..dbb8dafc79d0
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureOpenAIModel.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Specifies the Azure OpenAI resource used to do query planning.
+ public partial class KnowledgeAgentAzureOpenAIModel : KnowledgeAgentModel
+ {
+ /// Initializes a new instance of .
+ /// Contains the parameters specific to Azure OpenAI model endpoint.
+ /// is null.
+ public KnowledgeAgentAzureOpenAIModel(AzureOpenAIVectorizerParameters azureOpenAIParameters)
+ {
+ Argument.AssertNotNull(azureOpenAIParameters, nameof(azureOpenAIParameters));
+
+ AzureOpenAIParameters = azureOpenAIParameters;
+ Kind = KnowledgeAgentModelKind.AzureOpenAI;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of AI model.
+ /// Contains the parameters specific to Azure OpenAI model endpoint.
+ internal KnowledgeAgentAzureOpenAIModel(KnowledgeAgentModelKind kind, AzureOpenAIVectorizerParameters azureOpenAIParameters) : base(kind)
+ {
+ AzureOpenAIParameters = azureOpenAIParameters;
+ Kind = kind;
+ }
+
+ /// Contains the parameters specific to Azure OpenAI model endpoint.
+ public AzureOpenAIVectorizerParameters AzureOpenAIParameters { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureSearchDocReference.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureSearchDocReference.Serialization.cs
new file mode 100644
index 000000000000..1ef2cda51b46
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureSearchDocReference.Serialization.cs
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentAzureSearchDocReference
+ {
+ internal static KnowledgeAgentAzureSearchDocReference DeserializeKnowledgeAgentAzureSearchDocReference(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string docKey = default;
+ IReadOnlyDictionary sourceData = default;
+ string type = default;
+ string id = default;
+ int activitySource = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("docKey"u8))
+ {
+ docKey = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("sourceData"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(property0.Name, property0.Value.GetObject());
+ }
+ }
+ sourceData = dictionary;
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("activitySource"u8))
+ {
+ activitySource = property.Value.GetInt32();
+ continue;
+ }
+ }
+ return new KnowledgeAgentAzureSearchDocReference(type, id, activitySource, docKey, sourceData ?? new ChangeTrackingDictionary());
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentAzureSearchDocReference FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentAzureSearchDocReference(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureSearchDocReference.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureSearchDocReference.cs
new file mode 100644
index 000000000000..77eaa0d99e84
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentAzureSearchDocReference.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Represents an Azure Search document reference.
+ public partial class KnowledgeAgentAzureSearchDocReference : KnowledgeAgentReference
+ {
+ /// Initializes a new instance of .
+ /// The ID of the reference.
+ /// The source activity ID for the reference.
+ /// is null.
+ internal KnowledgeAgentAzureSearchDocReference(string id, int activitySource) : base(id, activitySource)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+
+ SourceData = new ChangeTrackingDictionary();
+ Type = "AzureSearchDoc";
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the reference.
+ /// The ID of the reference.
+ /// The source activity ID for the reference.
+ /// The document key for the reference.
+ /// Dictionary of <any>.
+ internal KnowledgeAgentAzureSearchDocReference(string type, string id, int activitySource, string docKey, IReadOnlyDictionary sourceData) : base(type, id, activitySource)
+ {
+ DocKey = docKey;
+ SourceData = sourceData;
+ Type = type ?? "AzureSearchDoc";
+ }
+
+ /// The document key for the reference.
+ public string DocKey { get; }
+ /// Dictionary of <any>.
+ public IReadOnlyDictionary SourceData { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentIndexParams.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentIndexParams.Serialization.cs
new file mode 100644
index 000000000000..c0ae7a6e6fd1
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentIndexParams.Serialization.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentIndexParams : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(IndexName))
+ {
+ writer.WritePropertyName("indexName"u8);
+ writer.WriteStringValue(IndexName);
+ }
+ if (Optional.IsDefined(FilterAddOn))
+ {
+ writer.WritePropertyName("filterAddOn"u8);
+ writer.WriteStringValue(FilterAddOn);
+ }
+ if (Optional.IsDefined(MaxDocsForReranker))
+ {
+ writer.WritePropertyName("maxDocsForReranker"u8);
+ writer.WriteNumberValue(MaxDocsForReranker.Value);
+ }
+ if (Optional.IsDefined(RerankerThreshold))
+ {
+ writer.WritePropertyName("rerankerThreshold"u8);
+ writer.WriteNumberValue(RerankerThreshold.Value);
+ }
+ if (Optional.IsDefined(IncludeReferenceSourceData))
+ {
+ writer.WritePropertyName("includeReferenceSourceData"u8);
+ writer.WriteBooleanValue(IncludeReferenceSourceData.Value);
+ }
+ writer.WriteEndObject();
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentIndexParams.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentIndexParams.cs
new file mode 100644
index 000000000000..57675f165c49
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentIndexParams.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// The KnowledgeAgentIndexParams.
+ public partial class KnowledgeAgentIndexParams
+ {
+ /// Initializes a new instance of .
+ public KnowledgeAgentIndexParams()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the index the params apply to.
+ /// A filter condition applied to the index (e.g., 'State eq VA').
+ /// Limits the number of documents considered for ranking.
+ /// A threshold for reranking results (range: 0-4).
+ /// Indicates whether reference source data should be included.
+ internal KnowledgeAgentIndexParams(string indexName, string filterAddOn, int? maxDocsForReranker, float? rerankerThreshold, bool? includeReferenceSourceData)
+ {
+ IndexName = indexName;
+ FilterAddOn = filterAddOn;
+ MaxDocsForReranker = maxDocsForReranker;
+ RerankerThreshold = rerankerThreshold;
+ IncludeReferenceSourceData = includeReferenceSourceData;
+ }
+
+ /// The name of the index the params apply to.
+ public string IndexName { get; set; }
+ /// A filter condition applied to the index (e.g., 'State eq VA').
+ public string FilterAddOn { get; set; }
+ /// Limits the number of documents considered for ranking.
+ public int? MaxDocsForReranker { get; set; }
+ /// A threshold for reranking results (range: 0-4).
+ public float? RerankerThreshold { get; set; }
+ /// Indicates whether reference source data should be included.
+ public bool? IncludeReferenceSourceData { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessage.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessage.Serialization.cs
new file mode 100644
index 000000000000..557054bf2037
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessage.Serialization.cs
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentMessage : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("role"u8);
+ writer.WriteStringValue(Role);
+ writer.WritePropertyName("content"u8);
+ writer.WriteStartArray();
+ foreach (var item in Content)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentMessage DeserializeKnowledgeAgentMessage(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string role = default;
+ IList content = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("role"u8))
+ {
+ role = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("content"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgentMessageContent.DeserializeKnowledgeAgentMessageContent(item));
+ }
+ content = array;
+ continue;
+ }
+ }
+ return new KnowledgeAgentMessage(role, content);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentMessage FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentMessage(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessage.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessage.cs
new file mode 100644
index 000000000000..2a760dc95e22
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessage.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The natural language message style object.
+ public partial class KnowledgeAgentMessage
+ {
+ /// Initializes a new instance of .
+ /// The role of the tool response.
+ ///
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ /// or is null.
+ public KnowledgeAgentMessage(string role, IEnumerable content)
+ {
+ Argument.AssertNotNull(role, nameof(role));
+ Argument.AssertNotNull(content, nameof(content));
+
+ Role = role;
+ Content = content.ToList();
+ }
+
+ /// Initializes a new instance of .
+ /// The role of the tool response.
+ ///
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ internal KnowledgeAgentMessage(string role, IList content)
+ {
+ Role = role;
+ Content = content;
+ }
+
+ /// The role of the tool response.
+ public string Role { get; set; }
+ ///
+ /// Gets the content
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ public IList Content { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContent.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContent.Serialization.cs
new file mode 100644
index 000000000000..495216155ffc
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContent.Serialization.cs
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentMessageContent : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentMessageContent DeserializeKnowledgeAgentMessageContent(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "image": return KnowledgeAgentMessageImageContent.DeserializeKnowledgeAgentMessageImageContent(element);
+ case "text": return KnowledgeAgentMessageTextContent.DeserializeKnowledgeAgentMessageTextContent(element);
+ }
+ }
+ return UnknownKnowledgeAgentMessageContent.DeserializeUnknownKnowledgeAgentMessageContent(element);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentMessageContent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentMessageContent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContent.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContent.cs
new file mode 100644
index 000000000000..32296c8b4261
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContent.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ ///
+ /// Specifies the type of the message content.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ public abstract partial class KnowledgeAgentMessageContent
+ {
+ /// Initializes a new instance of .
+ protected KnowledgeAgentMessageContent()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the message.
+ internal KnowledgeAgentMessageContent(KnowledgeAgentMessageContentType type)
+ {
+ Type = type;
+ }
+
+ /// The type of the message.
+ internal KnowledgeAgentMessageContentType Type { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContentType.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContentType.cs
new file mode 100644
index 000000000000..adaa79603149
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageContentType.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The type of message content.
+ public readonly partial struct KnowledgeAgentMessageContentType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public KnowledgeAgentMessageContentType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string TextValue = "text";
+ private const string ImageValue = "image";
+
+ /// Text message content kind.
+ public static KnowledgeAgentMessageContentType Text { get; } = new KnowledgeAgentMessageContentType(TextValue);
+ /// Image message content kind.
+ public static KnowledgeAgentMessageContentType Image { get; } = new KnowledgeAgentMessageContentType(ImageValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(KnowledgeAgentMessageContentType left, KnowledgeAgentMessageContentType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(KnowledgeAgentMessageContentType left, KnowledgeAgentMessageContentType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator KnowledgeAgentMessageContentType(string value) => new KnowledgeAgentMessageContentType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is KnowledgeAgentMessageContentType other && Equals(other);
+ ///
+ public bool Equals(KnowledgeAgentMessageContentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContent.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContent.Serialization.cs
new file mode 100644
index 000000000000..248ac708ed95
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContent.Serialization.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentMessageImageContent : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("image"u8);
+ writer.WriteObjectValue(Image);
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentMessageImageContent DeserializeKnowledgeAgentMessageImageContent(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ KnowledgeAgentMessageImageContentImage image = default;
+ KnowledgeAgentMessageContentType type = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("image"u8))
+ {
+ image = KnowledgeAgentMessageImageContentImage.DeserializeKnowledgeAgentMessageImageContentImage(property.Value);
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new KnowledgeAgentMessageContentType(property.Value.GetString());
+ continue;
+ }
+ }
+ return new KnowledgeAgentMessageImageContent(type, image);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentMessageImageContent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentMessageImageContent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContent.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContent.cs
new file mode 100644
index 000000000000..e5003bef93b7
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContent.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Text message type.
+ public partial class KnowledgeAgentMessageImageContent : KnowledgeAgentMessageContent
+ {
+ /// Initializes a new instance of .
+ ///
+ /// is null.
+ public KnowledgeAgentMessageImageContent(KnowledgeAgentMessageImageContentImage image)
+ {
+ Argument.AssertNotNull(image, nameof(image));
+
+ Image = image;
+ Type = KnowledgeAgentMessageContentType.Image;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the message.
+ ///
+ internal KnowledgeAgentMessageImageContent(KnowledgeAgentMessageContentType type, KnowledgeAgentMessageImageContentImage image) : base(type)
+ {
+ Image = image;
+ Type = type;
+ }
+
+ /// Gets or sets the image.
+ public KnowledgeAgentMessageImageContentImage Image { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContentImage.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContentImage.Serialization.cs
new file mode 100644
index 000000000000..d1261a203fb1
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContentImage.Serialization.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentMessageImageContentImage : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("url"u8);
+ writer.WriteStringValue(Url);
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentMessageImageContentImage DeserializeKnowledgeAgentMessageImageContentImage(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string url = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("url"u8))
+ {
+ url = property.Value.GetString();
+ continue;
+ }
+ }
+ return new KnowledgeAgentMessageImageContentImage(url);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentMessageImageContentImage FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentMessageImageContentImage(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContentImage.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContentImage.cs
new file mode 100644
index 000000000000..ffdddfb52ad2
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageImageContentImage.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The KnowledgeAgentMessageImageContentImage.
+ public partial class KnowledgeAgentMessageImageContentImage
+ {
+ /// Initializes a new instance of .
+ /// The url of the image.
+ /// is null.
+ public KnowledgeAgentMessageImageContentImage(string url)
+ {
+ Argument.AssertNotNull(url, nameof(url));
+
+ Url = url;
+ }
+
+ /// The url of the image.
+ public string Url { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageTextContent.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageTextContent.Serialization.cs
new file mode 100644
index 000000000000..2bec55c19cc4
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageTextContent.Serialization.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentMessageTextContent : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("text"u8);
+ writer.WriteStringValue(Text);
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentMessageTextContent DeserializeKnowledgeAgentMessageTextContent(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string text = default;
+ KnowledgeAgentMessageContentType type = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("text"u8))
+ {
+ text = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new KnowledgeAgentMessageContentType(property.Value.GetString());
+ continue;
+ }
+ }
+ return new KnowledgeAgentMessageTextContent(type, text);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentMessageTextContent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentMessageTextContent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageTextContent.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageTextContent.cs
new file mode 100644
index 000000000000..e66ddd7f5659
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentMessageTextContent.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Text message type.
+ public partial class KnowledgeAgentMessageTextContent : KnowledgeAgentMessageContent
+ {
+ /// Initializes a new instance of .
+ ///
+ /// is null.
+ public KnowledgeAgentMessageTextContent(string text)
+ {
+ Argument.AssertNotNull(text, nameof(text));
+
+ Text = text;
+ Type = KnowledgeAgentMessageContentType.Text;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the message.
+ ///
+ internal KnowledgeAgentMessageTextContent(KnowledgeAgentMessageContentType type, string text) : base(type)
+ {
+ Text = text;
+ Type = type;
+ }
+
+ /// Gets or sets the text.
+ public string Text { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModel.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModel.Serialization.cs
new file mode 100644
index 000000000000..ad6ba573114a
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModel.Serialization.cs
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+using Azure.Search.Documents.Models;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class KnowledgeAgentModel : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentModel DeserializeKnowledgeAgentModel(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("kind", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "azureOpenAI": return KnowledgeAgentAzureOpenAIModel.DeserializeKnowledgeAgentAzureOpenAIModel(element);
+ }
+ }
+ return UnknownKnowledgeAgentModel.DeserializeUnknownKnowledgeAgentModel(element);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentModel FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentModel(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModel.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModel.cs
new file mode 100644
index 000000000000..4fac0859d0c8
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModel.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ ///
+ /// Specifies the connection parameters for the model to use for query planning.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ public abstract partial class KnowledgeAgentModel
+ {
+ /// Initializes a new instance of .
+ protected KnowledgeAgentModel()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The type of AI model.
+ internal KnowledgeAgentModel(KnowledgeAgentModelKind kind)
+ {
+ Kind = kind;
+ }
+
+ /// The type of AI model.
+ internal KnowledgeAgentModelKind Kind { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelKind.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelKind.cs
new file mode 100644
index 000000000000..7b06357ba598
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelKind.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// The AI model to be used for query planning.
+ public readonly partial struct KnowledgeAgentModelKind : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public KnowledgeAgentModelKind(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string AzureOpenAIValue = "azureOpenAI";
+
+ /// Use Azure Open AI models for query planning.
+ public static KnowledgeAgentModelKind AzureOpenAI { get; } = new KnowledgeAgentModelKind(AzureOpenAIValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(KnowledgeAgentModelKind left, KnowledgeAgentModelKind right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(KnowledgeAgentModelKind left, KnowledgeAgentModelKind right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator KnowledgeAgentModelKind(string value) => new KnowledgeAgentModelKind(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is KnowledgeAgentModelKind other && Equals(other);
+ ///
+ public bool Equals(KnowledgeAgentModelKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelQueryPlanningActivityRecord.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelQueryPlanningActivityRecord.Serialization.cs
new file mode 100644
index 000000000000..5fff38471a3e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelQueryPlanningActivityRecord.Serialization.cs
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentModelQueryPlanningActivityRecord
+ {
+ internal static KnowledgeAgentModelQueryPlanningActivityRecord DeserializeKnowledgeAgentModelQueryPlanningActivityRecord(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int? inputTokens = default;
+ int? outputTokens = default;
+ int? elapsedMs = default;
+ int id = default;
+ string type = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("inputTokens"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ inputTokens = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("outputTokens"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ outputTokens = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("elapsedMs"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ elapsedMs = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ }
+ return new KnowledgeAgentModelQueryPlanningActivityRecord(id, type, inputTokens, outputTokens, elapsedMs);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentModelQueryPlanningActivityRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentModelQueryPlanningActivityRecord(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelQueryPlanningActivityRecord.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelQueryPlanningActivityRecord.cs
new file mode 100644
index 000000000000..635ceae5979e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentModelQueryPlanningActivityRecord.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// Represents an LLM query planning activity record.
+ public partial class KnowledgeAgentModelQueryPlanningActivityRecord : KnowledgeAgentActivityRecord
+ {
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ internal KnowledgeAgentModelQueryPlanningActivityRecord(int id) : base(id)
+ {
+ Type = "ModelQueryPlanning";
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ /// The type of the activity record.
+ /// The number of input tokens for the LLM query planning activity.
+ /// The number of output tokens for the LLM query planning activity.
+ /// The elapsed time in milliseconds for the model activity.
+ internal KnowledgeAgentModelQueryPlanningActivityRecord(int id, string type, int? inputTokens, int? outputTokens, int? elapsedMs) : base(id, type)
+ {
+ InputTokens = inputTokens;
+ OutputTokens = outputTokens;
+ ElapsedMs = elapsedMs;
+ Type = type ?? "ModelQueryPlanning";
+ }
+
+ /// The number of input tokens for the LLM query planning activity.
+ public int? InputTokens { get; }
+ /// The number of output tokens for the LLM query planning activity.
+ public int? OutputTokens { get; }
+ /// The elapsed time in milliseconds for the model activity.
+ public int? ElapsedMs { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentReference.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentReference.Serialization.cs
new file mode 100644
index 000000000000..227ec2a35242
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentReference.Serialization.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentReference
+ {
+ internal static KnowledgeAgentReference DeserializeKnowledgeAgentReference(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "AzureSearchDoc": return KnowledgeAgentAzureSearchDocReference.DeserializeKnowledgeAgentAzureSearchDocReference(element);
+ }
+ }
+ return UnknownKnowledgeAgentReference.DeserializeUnknownKnowledgeAgentReference(element);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentReference FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentReference(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentReference.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentReference.cs
new file mode 100644
index 000000000000..0560cddee2ac
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentReference.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Models
+{
+ ///
+ /// Base type for references.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ public abstract partial class KnowledgeAgentReference
+ {
+ /// Initializes a new instance of .
+ /// The ID of the reference.
+ /// The source activity ID for the reference.
+ /// is null.
+ protected KnowledgeAgentReference(string id, int activitySource)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+
+ Id = id;
+ ActivitySource = activitySource;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the reference.
+ /// The ID of the reference.
+ /// The source activity ID for the reference.
+ internal KnowledgeAgentReference(string type, string id, int activitySource)
+ {
+ Type = type;
+ Id = id;
+ ActivitySource = activitySource;
+ }
+
+ /// The type of the reference.
+ internal string Type { get; set; }
+ /// The ID of the reference.
+ public string Id { get; }
+ /// The source activity ID for the reference.
+ public int ActivitySource { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRequestLimits.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRequestLimits.Serialization.cs
new file mode 100644
index 000000000000..583082a52b4e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRequestLimits.Serialization.cs
@@ -0,0 +1,79 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class KnowledgeAgentRequestLimits : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ if (Optional.IsDefined(MaxRuntimeInSeconds))
+ {
+ writer.WritePropertyName("maxRuntimeInSeconds"u8);
+ writer.WriteNumberValue(MaxRuntimeInSeconds.Value);
+ }
+ if (Optional.IsDefined(MaxOutputSize))
+ {
+ writer.WritePropertyName("maxOutputSize"u8);
+ writer.WriteNumberValue(MaxOutputSize.Value);
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentRequestLimits DeserializeKnowledgeAgentRequestLimits(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int? maxRuntimeInSeconds = default;
+ int? maxOutputSize = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("maxRuntimeInSeconds"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ maxRuntimeInSeconds = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("maxOutputSize"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ maxOutputSize = property.Value.GetInt32();
+ continue;
+ }
+ }
+ return new KnowledgeAgentRequestLimits(maxRuntimeInSeconds, maxOutputSize);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentRequestLimits FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentRequestLimits(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRequestLimits.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRequestLimits.cs
new file mode 100644
index 000000000000..2806f1d859f5
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRequestLimits.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Guardrails to limit how much resources are utilized for a single agent retrieval request.
+ public partial class KnowledgeAgentRequestLimits
+ {
+ /// Initializes a new instance of .
+ public KnowledgeAgentRequestLimits()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The maximum runtime in seconds.
+ /// Limits the maximum size of the content in the output.
+ internal KnowledgeAgentRequestLimits(int? maxRuntimeInSeconds, int? maxOutputSize)
+ {
+ MaxRuntimeInSeconds = maxRuntimeInSeconds;
+ MaxOutputSize = maxOutputSize;
+ }
+
+ /// The maximum runtime in seconds.
+ public int? MaxRuntimeInSeconds { get; set; }
+ /// Limits the maximum size of the content in the output.
+ public int? MaxOutputSize { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalRequest.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalRequest.Serialization.cs
new file mode 100644
index 000000000000..d417a98a2c89
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalRequest.Serialization.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentRetrievalRequest : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("messages"u8);
+ writer.WriteStartArray();
+ foreach (var item in Messages)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ if (Optional.IsCollectionDefined(TargetIndexParams))
+ {
+ writer.WritePropertyName("targetIndexParams"u8);
+ writer.WriteStartArray();
+ foreach (var item in TargetIndexParams)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ writer.WriteEndObject();
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalRequest.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalRequest.cs
new file mode 100644
index 000000000000..4da3c5cf829e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalRequest.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The input contract for the retrieval request.
+ public partial class KnowledgeAgentRetrievalRequest
+ {
+ /// Initializes a new instance of .
+ ///
+ /// is null.
+ public KnowledgeAgentRetrievalRequest(IEnumerable messages)
+ {
+ Argument.AssertNotNull(messages, nameof(messages));
+
+ Messages = messages.ToList();
+ TargetIndexParams = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ ///
+ ///
+ internal KnowledgeAgentRetrievalRequest(IList messages, IList targetIndexParams)
+ {
+ Messages = messages;
+ TargetIndexParams = targetIndexParams;
+ }
+
+ /// Gets the messages.
+ public IList Messages { get; }
+ /// Gets the target index params.
+ public IList TargetIndexParams { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalResponse.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalResponse.Serialization.cs
new file mode 100644
index 000000000000..cff97e219164
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalResponse.Serialization.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentRetrievalResponse
+ {
+ internal static KnowledgeAgentRetrievalResponse DeserializeKnowledgeAgentRetrievalResponse(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList response = default;
+ IReadOnlyList activity = default;
+ IReadOnlyList references = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("response"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgentMessage.DeserializeKnowledgeAgentMessage(item));
+ }
+ response = array;
+ continue;
+ }
+ if (property.NameEquals("activity"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgentActivityRecord.DeserializeKnowledgeAgentActivityRecord(item));
+ }
+ activity = array;
+ continue;
+ }
+ if (property.NameEquals("references"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgentReference.DeserializeKnowledgeAgentReference(item));
+ }
+ references = array;
+ continue;
+ }
+ }
+ return new KnowledgeAgentRetrievalResponse(response ?? new ChangeTrackingList(), activity ?? new ChangeTrackingList(), references ?? new ChangeTrackingList());
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentRetrievalResponse FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentRetrievalResponse(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalResponse.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalResponse.cs
new file mode 100644
index 000000000000..0b9394da24b8
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentRetrievalResponse.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+
+namespace Azure.Search.Documents.Models
+{
+ /// The output contract for the retrieval response.
+ public partial class KnowledgeAgentRetrievalResponse
+ {
+ /// Initializes a new instance of .
+ internal KnowledgeAgentRetrievalResponse()
+ {
+ Response = new ChangeTrackingList();
+ Activity = new ChangeTrackingList();
+ References = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ ///
+ ///
+ /// The activity records for tracking progress and billing implications.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ ///
+ /// The references for the retrieval data used in the response.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ internal KnowledgeAgentRetrievalResponse(IReadOnlyList response, IReadOnlyList activity, IReadOnlyList references)
+ {
+ Response = response;
+ Activity = activity;
+ References = references;
+ }
+
+ /// Gets the response.
+ public IReadOnlyList Response { get; }
+ ///
+ /// The activity records for tracking progress and billing implications.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ public IReadOnlyList Activity { get; }
+ ///
+ /// The references for the retrieval data used in the response.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ public IReadOnlyList References { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecord.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecord.Serialization.cs
new file mode 100644
index 000000000000..f989c1f5d1d4
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecord.Serialization.cs
@@ -0,0 +1,100 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentSearchActivityRecord
+ {
+ internal static KnowledgeAgentSearchActivityRecord DeserializeKnowledgeAgentSearchActivityRecord(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string targetIndex = default;
+ KnowledgeAgentSearchActivityRecordQuery query = default;
+ DateTimeOffset? queryTime = default;
+ int? count = default;
+ int? elapsedMs = default;
+ int id = default;
+ string type = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("targetIndex"u8))
+ {
+ targetIndex = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("query"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ query = KnowledgeAgentSearchActivityRecordQuery.DeserializeKnowledgeAgentSearchActivityRecordQuery(property.Value);
+ continue;
+ }
+ if (property.NameEquals("queryTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ queryTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("count"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ count = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("elapsedMs"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ elapsedMs = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ }
+ return new KnowledgeAgentSearchActivityRecord(
+ id,
+ type,
+ targetIndex,
+ query,
+ queryTime,
+ count,
+ elapsedMs);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentSearchActivityRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentSearchActivityRecord(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecord.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecord.cs
new file mode 100644
index 000000000000..a31942fcf04d
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecord.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Represents a retrieval activity record.
+ public partial class KnowledgeAgentSearchActivityRecord : KnowledgeAgentActivityRecord
+ {
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ internal KnowledgeAgentSearchActivityRecord(int id) : base(id)
+ {
+ Type = "AzureSearchQuery";
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ /// The type of the activity record.
+ /// The target index for the retrieval activity.
+ /// The query details for the retrieval activity.
+ /// The query time for this retrieval activity.
+ /// The count of documents retrieved.
+ /// The elapsed time in milliseconds for the retrieval activity.
+ internal KnowledgeAgentSearchActivityRecord(int id, string type, string targetIndex, KnowledgeAgentSearchActivityRecordQuery query, DateTimeOffset? queryTime, int? count, int? elapsedMs) : base(id, type)
+ {
+ TargetIndex = targetIndex;
+ Query = query;
+ QueryTime = queryTime;
+ Count = count;
+ ElapsedMs = elapsedMs;
+ Type = type ?? "AzureSearchQuery";
+ }
+
+ /// The target index for the retrieval activity.
+ public string TargetIndex { get; }
+ /// The query details for the retrieval activity.
+ public KnowledgeAgentSearchActivityRecordQuery Query { get; }
+ /// The query time for this retrieval activity.
+ public DateTimeOffset? QueryTime { get; }
+ /// The count of documents retrieved.
+ public int? Count { get; }
+ /// The elapsed time in milliseconds for the retrieval activity.
+ public int? ElapsedMs { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecordQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecordQuery.Serialization.cs
new file mode 100644
index 000000000000..e77cb3f28c2e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecordQuery.Serialization.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentSearchActivityRecordQuery
+ {
+ internal static KnowledgeAgentSearchActivityRecordQuery DeserializeKnowledgeAgentSearchActivityRecordQuery(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string search = default;
+ string filter = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("search"u8))
+ {
+ search = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("filter"u8))
+ {
+ filter = property.Value.GetString();
+ continue;
+ }
+ }
+ return new KnowledgeAgentSearchActivityRecordQuery(search, filter);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentSearchActivityRecordQuery FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentSearchActivityRecordQuery(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecordQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecordQuery.cs
new file mode 100644
index 000000000000..5018dd3c2608
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSearchActivityRecordQuery.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// The query details for the retrieval activity.
+ public partial class KnowledgeAgentSearchActivityRecordQuery
+ {
+ /// Initializes a new instance of .
+ internal KnowledgeAgentSearchActivityRecordQuery()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The search string.
+ /// The filter string.
+ internal KnowledgeAgentSearchActivityRecordQuery(string search, string filter)
+ {
+ Search = search;
+ Filter = filter;
+ }
+
+ /// The search string.
+ public string Search { get; }
+ /// The filter string.
+ public string Filter { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSemanticRankerActivityRecord.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSemanticRankerActivityRecord.Serialization.cs
new file mode 100644
index 000000000000..6a7ef36a298e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSemanticRankerActivityRecord.Serialization.cs
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class KnowledgeAgentSemanticRankerActivityRecord
+ {
+ internal static KnowledgeAgentSemanticRankerActivityRecord DeserializeKnowledgeAgentSemanticRankerActivityRecord(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int? inputTokens = default;
+ int? elapsedMs = default;
+ int id = default;
+ string type = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("inputTokens"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ inputTokens = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("elapsedMs"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ elapsedMs = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ }
+ return new KnowledgeAgentSemanticRankerActivityRecord(id, type, inputTokens, elapsedMs);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new KnowledgeAgentSemanticRankerActivityRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentSemanticRankerActivityRecord(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSemanticRankerActivityRecord.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSemanticRankerActivityRecord.cs
new file mode 100644
index 000000000000..8be1e2eed1ed
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentSemanticRankerActivityRecord.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// Represents a semantic ranker activity record.
+ public partial class KnowledgeAgentSemanticRankerActivityRecord : KnowledgeAgentActivityRecord
+ {
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ internal KnowledgeAgentSemanticRankerActivityRecord(int id) : base(id)
+ {
+ Type = "AzureSearchSemanticRanker";
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ /// The type of the activity record.
+ /// The number of input tokens for the semantic ranker activity.
+ /// The elapsed time in milliseconds for the model activity.
+ internal KnowledgeAgentSemanticRankerActivityRecord(int id, string type, int? inputTokens, int? elapsedMs) : base(id, type)
+ {
+ InputTokens = inputTokens;
+ ElapsedMs = elapsedMs;
+ Type = type ?? "AzureSearchSemanticRanker";
+ }
+
+ /// The number of input tokens for the semantic ranker activity.
+ public int? InputTokens { get; }
+ /// The elapsed time in milliseconds for the model activity.
+ public int? ElapsedMs { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentTargetIndex.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentTargetIndex.Serialization.cs
new file mode 100644
index 000000000000..5a7b5d33c61e
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentTargetIndex.Serialization.cs
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ public partial class KnowledgeAgentTargetIndex : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("indexName"u8);
+ writer.WriteStringValue(IndexName);
+ if (Optional.IsDefined(DefaultRerankerThreshold))
+ {
+ writer.WritePropertyName("defaultRerankerThreshold"u8);
+ writer.WriteNumberValue(DefaultRerankerThreshold.Value);
+ }
+ if (Optional.IsDefined(DefaultIncludeReferenceSourceData))
+ {
+ writer.WritePropertyName("defaultIncludeReferenceSourceData"u8);
+ writer.WriteBooleanValue(DefaultIncludeReferenceSourceData.Value);
+ }
+ if (Optional.IsDefined(DefaultMaxDocsForReranker))
+ {
+ writer.WritePropertyName("defaultMaxDocsForReranker"u8);
+ writer.WriteNumberValue(DefaultMaxDocsForReranker.Value);
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static KnowledgeAgentTargetIndex DeserializeKnowledgeAgentTargetIndex(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string indexName = default;
+ float? defaultRerankerThreshold = default;
+ bool? defaultIncludeReferenceSourceData = default;
+ int? defaultMaxDocsForReranker = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("indexName"u8))
+ {
+ indexName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("defaultRerankerThreshold"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ defaultRerankerThreshold = property.Value.GetSingle();
+ continue;
+ }
+ if (property.NameEquals("defaultIncludeReferenceSourceData"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ defaultIncludeReferenceSourceData = property.Value.GetBoolean();
+ continue;
+ }
+ if (property.NameEquals("defaultMaxDocsForReranker"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ defaultMaxDocsForReranker = property.Value.GetInt32();
+ continue;
+ }
+ }
+ return new KnowledgeAgentTargetIndex(indexName, defaultRerankerThreshold, defaultIncludeReferenceSourceData, defaultMaxDocsForReranker);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static KnowledgeAgentTargetIndex FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeKnowledgeAgentTargetIndex(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentTargetIndex.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentTargetIndex.cs
new file mode 100644
index 000000000000..c4824d90658b
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KnowledgeAgentTargetIndex.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// The KnowledgeAgentTargetIndex.
+ public partial class KnowledgeAgentTargetIndex
+ {
+ /// Initializes a new instance of .
+ /// The name of the target index.
+ /// is null.
+ public KnowledgeAgentTargetIndex(string indexName)
+ {
+ Argument.AssertNotNull(indexName, nameof(indexName));
+
+ IndexName = indexName;
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the target index.
+ /// A threshold for reranking results (range: 0-4).
+ /// Indicates whether reference source data should be included.
+ /// Limits the number of documents considered for ranking.
+ internal KnowledgeAgentTargetIndex(string indexName, float? defaultRerankerThreshold, bool? defaultIncludeReferenceSourceData, int? defaultMaxDocsForReranker)
+ {
+ IndexName = indexName;
+ DefaultRerankerThreshold = defaultRerankerThreshold;
+ DefaultIncludeReferenceSourceData = defaultIncludeReferenceSourceData;
+ DefaultMaxDocsForReranker = defaultMaxDocsForReranker;
+ }
+
+ /// The name of the target index.
+ public string IndexName { get; set; }
+ /// A threshold for reranking results (range: 0-4).
+ public float? DefaultRerankerThreshold { get; set; }
+ /// Indicates whether reference source data should be included.
+ public bool? DefaultIncludeReferenceSourceData { get; set; }
+ /// Limits the number of documents considered for ranking.
+ public int? DefaultMaxDocsForReranker { get; set; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ListKnowledgeAgentsResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ListKnowledgeAgentsResult.Serialization.cs
new file mode 100644
index 000000000000..385c76c7feca
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ListKnowledgeAgentsResult.Serialization.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ internal partial class ListKnowledgeAgentsResult
+ {
+ internal static ListKnowledgeAgentsResult DeserializeListKnowledgeAgentsResult(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IReadOnlyList value = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("value"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(KnowledgeAgent.DeserializeKnowledgeAgent(item));
+ }
+ value = array;
+ continue;
+ }
+ }
+ return new ListKnowledgeAgentsResult(value);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ListKnowledgeAgentsResult FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeListKnowledgeAgentsResult(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/ListKnowledgeAgentsResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/ListKnowledgeAgentsResult.cs
new file mode 100644
index 000000000000..c1900d566b28
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/ListKnowledgeAgentsResult.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// The ListKnowledgeAgentsResult.
+ internal partial class ListKnowledgeAgentsResult
+ {
+ /// Initializes a new instance of .
+ ///
+ /// is null.
+ internal ListKnowledgeAgentsResult(IEnumerable knowledgeAgents)
+ {
+ Argument.AssertNotNull(knowledgeAgents, nameof(knowledgeAgents));
+
+ KnowledgeAgents = knowledgeAgents.ToList();
+ }
+
+ /// Initializes a new instance of .
+ ///
+ internal ListKnowledgeAgentsResult(IReadOnlyList knowledgeAgents)
+ {
+ KnowledgeAgents = knowledgeAgents;
+ }
+
+ /// Gets the knowledge agents.
+ public IReadOnlyList KnowledgeAgents { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/PermissionFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/PermissionFilter.cs
new file mode 100644
index 000000000000..226a4167aee6
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/PermissionFilter.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Models
+{
+ /// A value indicating whether the field should be used as a permission filter.
+ public readonly partial struct PermissionFilter : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public PermissionFilter(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string UserIdsValue = "userIds";
+ private const string GroupIdsValue = "groupIds";
+ private const string RbacScopeValue = "rbacScope";
+
+ /// Field represents user IDs that should be used to filter document access on queries.
+ public static PermissionFilter UserIds { get; } = new PermissionFilter(UserIdsValue);
+ /// Field represents group IDs that should be used to filter document access on queries.
+ public static PermissionFilter GroupIds { get; } = new PermissionFilter(GroupIdsValue);
+ /// Field represents an RBAC scope that should be used to filter document access on queries.
+ public static PermissionFilter RbacScope { get; } = new PermissionFilter(RbacScopeValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(PermissionFilter left, PermissionFilter right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(PermissionFilter left, PermissionFilter right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator PermissionFilter(string value) => new PermissionFilter(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is PermissionFilter other && Equals(other);
+ ///
+ public bool Equals(PermissionFilter other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs
index 28bc67685efc..49563992980a 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryDebugMode.cs
@@ -26,6 +26,7 @@ public QueryDebugMode(string value)
private const string SemanticValue = "semantic";
private const string VectorValue = "vector";
private const string QueryRewritesValue = "queryRewrites";
+ private const string InnerHitsValue = "innerHits";
private const string AllValue = "all";
/// No query debugging information will be returned.
@@ -36,6 +37,8 @@ public QueryDebugMode(string value)
public static QueryDebugMode Vector { get; } = new QueryDebugMode(VectorValue);
/// Allows the user to explore the list of query rewrites generated for their search request.
public static QueryDebugMode QueryRewrites { get; } = new QueryDebugMode(QueryRewritesValue);
+ /// Allows the user to retrieve scoring information regarding vectors matched within a collection of complex types.
+ public static QueryDebugMode InnerHits { get; } = new QueryDebugMode(InnerHitsValue);
/// Turn on all debug options.
public static QueryDebugMode All { get; } = new QueryDebugMode(AllValue);
/// Determines if two values are the same.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryResultDocumentInnerHit.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryResultDocumentInnerHit.Serialization.cs
new file mode 100644
index 000000000000..fea2233a9271
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryResultDocumentInnerHit.Serialization.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ public partial class QueryResultDocumentInnerHit
+ {
+ internal static QueryResultDocumentInnerHit DeserializeQueryResultDocumentInnerHit(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ long? ordinal = default;
+ IReadOnlyList> vectors = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("ordinal"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ ordinal = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("vectors"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List> array = new List>();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in item.EnumerateObject())
+ {
+ dictionary.Add(property0.Name, SingleVectorFieldResult.DeserializeSingleVectorFieldResult(property0.Value));
+ }
+ array.Add(dictionary);
+ }
+ }
+ vectors = array;
+ continue;
+ }
+ }
+ return new QueryResultDocumentInnerHit(ordinal, vectors ?? new ChangeTrackingList>());
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static QueryResultDocumentInnerHit FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeQueryResultDocumentInnerHit(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryResultDocumentInnerHit.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryResultDocumentInnerHit.cs
new file mode 100644
index 000000000000..153a06f76870
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/QueryResultDocumentInnerHit.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Detailed scoring information for an individual element of a complex collection.
+ public partial class QueryResultDocumentInnerHit
+ {
+ /// Initializes a new instance of .
+ internal QueryResultDocumentInnerHit()
+ {
+ Vectors = new ChangeTrackingList>();
+ }
+
+ /// Initializes a new instance of .
+ /// Position of this specific matching element within it's original collection. Position starts at 0.
+ /// Detailed scoring information for an individual element of a complex collection that matched a vector query.
+ internal QueryResultDocumentInnerHit(long? ordinal, IReadOnlyList> vectors)
+ {
+ Ordinal = ordinal;
+ Vectors = vectors;
+ }
+
+ /// Position of this specific matching element within it's original collection. Position starts at 0.
+ public long? Ordinal { get; }
+ /// Detailed scoring information for an individual element of a complex collection that matched a vector query.
+ public IReadOnlyList> Vectors { get; }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/RankingOrder.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/RankingOrder.cs
new file mode 100644
index 000000000000..01c5b759b091
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/RankingOrder.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Indexes.Models
+{
+ /// Represents score to use for sort order of documents.
+ public readonly partial struct RankingOrder : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public RankingOrder(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string BoostedRerankerScoreValue = "BoostedRerankerScore";
+ private const string ReRankerScoreValue = "RerankerScore";
+
+ /// Sets sort order as BoostedRerankerScore.
+ public static RankingOrder BoostedRerankerScore { get; } = new RankingOrder(BoostedRerankerScoreValue);
+ /// Sets sort order as ReRankerScore.
+ public static RankingOrder ReRankerScore { get; } = new RankingOrder(ReRankerScoreValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(RankingOrder left, RankingOrder right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(RankingOrder left, RankingOrder right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator RankingOrder(string value) => new RankingOrder(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is RankingOrder other && Equals(other);
+ ///
+ public bool Equals(RankingOrder other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs
index d8edd0e7d8f5..1f8815b60c68 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.Serialization.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
+using Azure.Search.Documents.Models;
namespace Azure.Search.Documents.Indexes.Models
{
@@ -55,6 +56,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("facetable"u8);
writer.WriteBooleanValue(IsFacetable.Value);
}
+ if (Optional.IsDefined(PermissionFilter))
+ {
+ if (PermissionFilter != null)
+ {
+ writer.WritePropertyName("permissionFilter"u8);
+ writer.WriteStringValue(PermissionFilter.Value.ToString());
+ }
+ else
+ {
+ writer.WriteNull("permissionFilter");
+ }
+ }
if (Optional.IsDefined(AnalyzerName))
{
if (AnalyzerName != null)
@@ -177,6 +190,7 @@ internal static SearchField DeserializeSearchField(JsonElement element)
bool? filterable = default;
bool? sortable = default;
bool? facetable = default;
+ PermissionFilter? permissionFilter = default;
LexicalAnalyzerName? analyzer = default;
LexicalAnalyzerName? searchAnalyzer = default;
LexicalAnalyzerName? indexAnalyzer = default;
@@ -261,6 +275,16 @@ internal static SearchField DeserializeSearchField(JsonElement element)
facetable = property.Value.GetBoolean();
continue;
}
+ if (property.NameEquals("permissionFilter"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ permissionFilter = null;
+ continue;
+ }
+ permissionFilter = new PermissionFilter(property.Value.GetString());
+ continue;
+ }
if (property.NameEquals("analyzer"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -370,6 +394,7 @@ internal static SearchField DeserializeSearchField(JsonElement element)
filterable,
sortable,
facetable,
+ permissionFilter,
analyzer,
searchAnalyzer,
indexAnalyzer,
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs
index 4bbad7499be6..e54dee64cf83 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchField.cs
@@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
+using Azure.Search.Documents.Models;
namespace Azure.Search.Documents.Indexes.Models
{
@@ -23,6 +24,7 @@ public partial class SearchField
/// 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.
/// 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.
/// 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.
+ /// A value indicating whether the field should be used as a permission filter.
/// 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.
/// 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.
/// 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.
@@ -32,7 +34,7 @@ public partial class SearchField
/// The encoding format to interpret the field contents.
/// 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.
/// 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.
- internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? isRetrievable, bool? isStored, bool? isSearchable, bool? isFilterable, bool? isSortable, bool? isFacetable, LexicalAnalyzerName? analyzerName, LexicalAnalyzerName? searchAnalyzerName, LexicalAnalyzerName? indexAnalyzerName, LexicalNormalizerName? normalizerName, int? vectorSearchDimensions, string vectorSearchProfileName, VectorEncodingFormat? vectorEncodingFormat, IList synonymMapNames, IList fields)
+ internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? isRetrievable, bool? isStored, bool? isSearchable, bool? isFilterable, bool? isSortable, bool? isFacetable, PermissionFilter? permissionFilter, LexicalAnalyzerName? analyzerName, LexicalAnalyzerName? searchAnalyzerName, LexicalAnalyzerName? indexAnalyzerName, LexicalNormalizerName? normalizerName, int? vectorSearchDimensions, string vectorSearchProfileName, VectorEncodingFormat? vectorEncodingFormat, IList synonymMapNames, IList fields)
{
Name = name;
Type = type;
@@ -43,6 +45,7 @@ internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? i
IsFilterable = isFilterable;
IsSortable = isSortable;
IsFacetable = isFacetable;
+ PermissionFilter = permissionFilter;
AnalyzerName = analyzerName;
SearchAnalyzerName = searchAnalyzerName;
IndexAnalyzerName = indexAnalyzerName;
@@ -53,6 +56,8 @@ internal SearchField(string name, SearchFieldDataType type, bool? isKey, bool? i
SynonymMapNames = synonymMapNames;
Fields = fields;
}
+ /// A value indicating whether the field should be used as a permission filter.
+ public PermissionFilter? PermissionFilter { get; set; }
/// The dimensionality of the vector field.
public int? VectorSearchDimensions { get; set; }
/// The name of the vector search profile that specifies the algorithm and vectorizer to use when searching the vector field.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs
index 44028bd8351e..18fb1a7a9b9a 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.Serialization.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
+using Azure.Search.Documents.Models;
namespace Azure.Search.Documents.Indexes.Models
{
@@ -18,6 +19,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WriteStartObject();
writer.WritePropertyName("name"u8);
writer.WriteStringValue(Name);
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
writer.WritePropertyName("fields"u8);
writer.WriteStartArray();
foreach (var item in _fields)
@@ -153,6 +159,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WriteNull("vectorSearch");
}
}
+ if (Optional.IsDefined(PermissionFilterOption))
+ {
+ if (PermissionFilterOption != null)
+ {
+ writer.WritePropertyName("permissionFilterOption"u8);
+ writer.WriteStringValue(PermissionFilterOption.Value.ToString());
+ }
+ else
+ {
+ writer.WriteNull("permissionFilterOption");
+ }
+ }
if (Optional.IsDefined(_etag))
{
writer.WritePropertyName("@odata.etag"u8);
@@ -168,6 +186,7 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element)
return null;
}
string name = default;
+ string description = default;
IList fields = default;
IList scoringProfiles = default;
string defaultScoringProfile = default;
@@ -182,6 +201,7 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element)
SimilarityAlgorithm similarity = default;
SemanticSearch semantic = default;
VectorSearch vectorSearch = default;
+ SearchIndexPermissionFilterOption? permissionFilterOption = default;
string odataEtag = default;
foreach (var property in element.EnumerateObject())
{
@@ -190,6 +210,11 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element)
name = property.Value.GetString();
continue;
}
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
if (property.NameEquals("fields"u8))
{
List array = new List();
@@ -352,6 +377,16 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element)
vectorSearch = VectorSearch.DeserializeVectorSearch(property.Value);
continue;
}
+ if (property.NameEquals("permissionFilterOption"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ permissionFilterOption = null;
+ continue;
+ }
+ permissionFilterOption = new SearchIndexPermissionFilterOption(property.Value.GetString());
+ continue;
+ }
if (property.NameEquals("@odata.etag"u8))
{
odataEtag = property.Value.GetString();
@@ -360,6 +395,7 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element)
}
return new SearchIndex(
name,
+ description,
fields,
scoringProfiles ?? new ChangeTrackingList(),
defaultScoringProfile,
@@ -374,6 +410,7 @@ internal static SearchIndex DeserializeSearchIndex(JsonElement element)
similarity,
semantic,
vectorSearch,
+ permissionFilterOption,
odataEtag);
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs
index dfaafc2d2553..3b4e9386b210 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndex.cs
@@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Azure.Search.Documents.Models;
namespace Azure.Search.Documents.Indexes.Models
{
@@ -16,6 +17,7 @@ public partial class SearchIndex
{
/// Initializes a new instance of .
/// The name of the index.
+ /// The description of the index.
/// The fields of the index.
/// The scoring profiles for the index.
/// 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.
@@ -54,10 +56,12 @@ public partial class SearchIndex
///
/// Defines parameters for a search index that influence semantic capabilities.
/// Contains configuration options related to vector search.
+ /// A value indicating whether permission filtering is enabled for the index.
/// The ETag of the index.
- internal SearchIndex(string name, IList fields, IList scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList suggesters, IList analyzers, IList tokenizers, IList tokenFilters, IList charFilters, IList normalizers, SearchResourceEncryptionKey encryptionKey, SimilarityAlgorithm similarity, SemanticSearch semanticSearch, VectorSearch vectorSearch, string etag)
+ internal SearchIndex(string name, string description, IList fields, IList scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList suggesters, IList analyzers, IList tokenizers, IList tokenFilters, IList charFilters, IList normalizers, SearchResourceEncryptionKey encryptionKey, SimilarityAlgorithm similarity, SemanticSearch semanticSearch, VectorSearch vectorSearch, SearchIndexPermissionFilterOption? permissionFilterOption, string etag)
{
Name = name;
+ Description = description;
_fields = fields;
ScoringProfiles = scoringProfiles;
DefaultScoringProfile = defaultScoringProfile;
@@ -72,8 +76,11 @@ internal SearchIndex(string name, IList fields, IList The description of the index.
+ public string Description { get; set; }
/// 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.
public string DefaultScoringProfile { get; set; }
/// Options to control Cross-Origin Resource Sharing (CORS) for the index.
@@ -90,5 +97,7 @@ internal SearchIndex(string name, IList fields, IList Contains configuration options related to vector search.
public VectorSearch VectorSearch { get; set; }
+ /// A value indicating whether permission filtering is enabled for the index.
+ public SearchIndexPermissionFilterOption? PermissionFilterOption { get; set; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexPermissionFilterOption.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexPermissionFilterOption.cs
new file mode 100644
index 000000000000..dfa62813545b
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexPermissionFilterOption.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Search.Documents.Models
+{
+ /// A value indicating whether permission filtering is enabled for the index.
+ public readonly partial struct SearchIndexPermissionFilterOption : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public SearchIndexPermissionFilterOption(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string EnabledValue = "enabled";
+ private const string DisabledValue = "disabled";
+
+ /// enabled.
+ public static SearchIndexPermissionFilterOption Enabled { get; } = new SearchIndexPermissionFilterOption(EnabledValue);
+ /// disabled.
+ public static SearchIndexPermissionFilterOption Disabled { get; } = new SearchIndexPermissionFilterOption(DisabledValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(SearchIndexPermissionFilterOption left, SearchIndexPermissionFilterOption right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(SearchIndexPermissionFilterOption left, SearchIndexPermissionFilterOption right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator SearchIndexPermissionFilterOption(string value) => new SearchIndexPermissionFilterOption(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is SearchIndexPermissionFilterOption other && Equals(other);
+ ///
+ public bool Equals(SearchIndexPermissionFilterOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.Serialization.cs
index 6ee8a098669e..35dffb9163ec 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.Serialization.cs
@@ -5,6 +5,7 @@
#nullable disable
+using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
@@ -40,6 +41,23 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WriteNull("identity");
}
}
+ if (Optional.IsCollectionDefined(IndexerPermissionOptions))
+ {
+ if (IndexerPermissionOptions != null)
+ {
+ writer.WritePropertyName("indexerPermissionOptions"u8);
+ writer.WriteStartArray();
+ foreach (var item in IndexerPermissionOptions)
+ {
+ writer.WriteStringValue(item.ToString());
+ }
+ writer.WriteEndArray();
+ }
+ else
+ {
+ writer.WriteNull("indexerPermissionOptions");
+ }
+ }
if (Optional.IsDefined(DataChangeDetectionPolicy))
{
if (DataChangeDetectionPolicy != null)
@@ -96,6 +114,7 @@ internal static SearchIndexerDataSourceConnection DeserializeSearchIndexerDataSo
DataSourceCredentials credentials = default;
SearchIndexerDataContainer container = default;
SearchIndexerDataIdentity identity = default;
+ IList indexerPermissionOptions = default;
DataChangeDetectionPolicy dataChangeDetectionPolicy = default;
DataDeletionDetectionPolicy dataDeletionDetectionPolicy = default;
string odataEtag = default;
@@ -137,6 +156,21 @@ internal static SearchIndexerDataSourceConnection DeserializeSearchIndexerDataSo
identity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value);
continue;
}
+ if (property.NameEquals("indexerPermissionOptions"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ indexerPermissionOptions = null;
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(new IndexerPermissionOption(item.GetString()));
+ }
+ indexerPermissionOptions = array;
+ continue;
+ }
if (property.NameEquals("dataChangeDetectionPolicy"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -180,6 +214,7 @@ internal static SearchIndexerDataSourceConnection DeserializeSearchIndexerDataSo
credentials,
container,
identity,
+ indexerPermissionOptions ?? new ChangeTrackingList(),
dataChangeDetectionPolicy,
dataDeletionDetectionPolicy,
odataEtag,
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.cs
index 675a4a69a7bf..c6bf579a0b53 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerDataSourceConnection.cs
@@ -6,6 +6,7 @@
#nullable disable
using System;
+using System.Collections.Generic;
namespace Azure.Search.Documents.Indexes.Models
{
@@ -23,6 +24,7 @@ public partial class SearchIndexerDataSourceConnection
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include and .
///
+ /// Ingestion options with various types of permission data.
///
/// The data change detection policy for the datasource.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
@@ -35,7 +37,7 @@ public partial class SearchIndexerDataSourceConnection
///
/// The ETag of the data source.
/// 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.
- internal SearchIndexerDataSourceConnection(string name, string description, SearchIndexerDataSourceType type, DataSourceCredentials credentialsInternal, SearchIndexerDataContainer container, SearchIndexerDataIdentity identity, DataChangeDetectionPolicy dataChangeDetectionPolicy, DataDeletionDetectionPolicy dataDeletionDetectionPolicy, string etag, SearchResourceEncryptionKey encryptionKey)
+ internal SearchIndexerDataSourceConnection(string name, string description, SearchIndexerDataSourceType type, DataSourceCredentials credentialsInternal, SearchIndexerDataContainer container, SearchIndexerDataIdentity identity, IList indexerPermissionOptions, DataChangeDetectionPolicy dataChangeDetectionPolicy, DataDeletionDetectionPolicy dataDeletionDetectionPolicy, string etag, SearchResourceEncryptionKey encryptionKey)
{
Name = name;
Description = description;
@@ -43,6 +45,7 @@ internal SearchIndexerDataSourceConnection(string name, string description, Sear
CredentialsInternal = credentialsInternal;
Container = container;
Identity = identity;
+ IndexerPermissionOptions = indexerPermissionOptions;
DataChangeDetectionPolicy = dataChangeDetectionPolicy;
DataDeletionDetectionPolicy = dataDeletionDetectionPolicy;
_etag = etag;
@@ -63,6 +66,8 @@ internal SearchIndexerDataSourceConnection(string name, string description, Sear
/// The available derived classes include and .
///
public SearchIndexerDataIdentity Identity { get; set; }
+ /// Ingestion options with various types of permission data.
+ public IList IndexerPermissionOptions { get; set; }
///
/// The data change detection policy for the datasource.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs
index e70066d747d8..1e17380885a3 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.Serialization.cs
@@ -61,6 +61,7 @@ internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement ele
switch (discriminator.GetString())
{
case "#Microsoft.Skills.Custom.AmlSkill": return AzureMachineLearningSkill.DeserializeAzureMachineLearningSkill(element);
+ case "#Microsoft.Skills.Custom.ChatCompletionSkill": return ChatCompletionSkill.DeserializeChatCompletionSkill(element);
case "#Microsoft.Skills.Custom.WebApiSkill": return WebApiSkill.DeserializeWebApiSkill(element);
case "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill": return AzureOpenAIEmbeddingSkill.DeserializeAzureOpenAIEmbeddingSkill(element);
case "#Microsoft.Skills.Text.CustomEntityLookupSkill": return CustomEntityLookupSkill.DeserializeCustomEntityLookupSkill(element);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs
index bf57982dd95d..fbecf5239a35 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkill.cs
@@ -14,7 +14,7 @@ namespace Azure.Search.Documents.Indexes.Models
///
/// Base type for skills.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , , , , , , , , , , , , and .
+ /// The available derived classes include , , , , , , , , , , , , , , , , , , , and .
///
public partial class SearchIndexerSkill
{
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs
index 764d79fd01c7..c53829ce63db 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs
@@ -19,7 +19,7 @@ public partial class SearchIndexerSkillset
///
/// A list of skills in the skillset.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , , , , , , , , , , , , and .
+ /// The available derived classes include , , , , , , , , , , , , , , , , , , , and .
///
/// or is null.
public SearchIndexerSkillset(string name, IEnumerable skills)
@@ -37,7 +37,7 @@ public SearchIndexerSkillset(string name, IEnumerable skills
///
/// A list of skills in the skillset.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , , , , , , , , , , , , and .
+ /// The available derived classes include , , , , , , , , , , , , , , , , , , , and .
///
///
/// Details about the Azure AI service to be used when running skills.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.Serialization.cs
index 65e6164e6f21..7cf3f9a0c5f7 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.Serialization.cs
@@ -22,6 +22,7 @@ internal static SearchIndexerStatus DeserializeSearchIndexerStatus(JsonElement e
IndexerExecutionResult lastResult = default;
IReadOnlyList executionHistory = default;
SearchIndexerLimits limits = default;
+ IndexerState currentState = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("status"u8))
@@ -54,8 +55,17 @@ internal static SearchIndexerStatus DeserializeSearchIndexerStatus(JsonElement e
limits = SearchIndexerLimits.DeserializeSearchIndexerLimits(property.Value);
continue;
}
+ if (property.NameEquals("currentState"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ currentState = IndexerState.DeserializeIndexerState(property.Value);
+ continue;
+ }
}
- return new SearchIndexerStatus(status, lastResult, executionHistory, limits);
+ return new SearchIndexerStatus(status, lastResult, executionHistory, limits, currentState);
}
/// Deserializes the model from a raw response.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.cs
index 3d58b1f940b8..570e3f4b6486 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerStatus.cs
@@ -29,12 +29,14 @@ internal SearchIndexerStatus(IndexerStatus status, IEnumerable The result of the most recent or an in-progress indexer execution.
/// History of the recent indexer executions, sorted in reverse chronological order.
/// The execution limits for the indexer.
- internal SearchIndexerStatus(IndexerStatus status, IndexerExecutionResult lastResult, IReadOnlyList executionHistory, SearchIndexerLimits limits)
+ /// All of the state that defines and dictates the indexer's current execution.
+ internal SearchIndexerStatus(IndexerStatus status, IndexerExecutionResult lastResult, IReadOnlyList executionHistory, SearchIndexerLimits limits, IndexerState currentState)
{
Status = status;
LastResult = lastResult;
ExecutionHistory = executionHistory;
Limits = limits;
+ CurrentState = currentState;
}
/// Overall indexer status.
@@ -45,5 +47,7 @@ internal SearchIndexerStatus(IndexerStatus status, IndexerExecutionResult lastRe
public IReadOnlyList ExecutionHistory { get; }
/// The execution limits for the indexer.
public SearchIndexerLimits Limits { get; }
+ /// All of the state that defines and dictates the indexer's current execution.
+ public IndexerState CurrentState { get; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs
index ef439e06e95e..49d0e3f94357 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.Serialization.cs
@@ -20,6 +20,7 @@ internal static SearchResult DeserializeSearchResult(JsonElement element)
}
double searchScore = default;
double? searchRerankerScore = default;
+ double? searchRerankerBoostedScore = default;
IReadOnlyDictionary> searchHighlights = default;
IReadOnlyList searchCaptions = default;
DocumentDebugInfo searchDocumentDebugInfo = default;
@@ -42,6 +43,16 @@ internal static SearchResult DeserializeSearchResult(JsonElement element)
searchRerankerScore = property.Value.GetDouble();
continue;
}
+ if (property.NameEquals("@search.rerankerBoostedScore"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ searchRerankerBoostedScore = null;
+ continue;
+ }
+ searchRerankerBoostedScore = property.Value.GetDouble();
+ continue;
+ }
if (property.NameEquals("@search.highlights"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -99,6 +110,7 @@ internal static SearchResult DeserializeSearchResult(JsonElement element)
return new SearchResult(
searchScore,
searchRerankerScore,
+ searchRerankerBoostedScore,
searchHighlights ?? new ChangeTrackingDictionary>(),
searchCaptions ?? new ChangeTrackingList(),
searchDocumentDebugInfo,
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs
index dc3fd651496e..55cde1b732e1 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchResult.cs
@@ -25,14 +25,16 @@ internal SearchResult(double score)
/// Initializes a new instance of .
/// The relevance score of the document compared to other documents returned by the query.
/// The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'.
+ /// The relevance score computed by 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'.
/// 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.
/// 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'.
/// Contains debugging information that can be used to further explore your search results.
/// Additional Properties.
- internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary> highlights, IReadOnlyList captions, DocumentDebugInfo documentDebugInfo, IReadOnlyDictionary additionalProperties)
+ internal SearchResult(double score, double? rerankerScore, double? rerankerBoostedScore, IReadOnlyDictionary> highlights, IReadOnlyList captions, DocumentDebugInfo documentDebugInfo, IReadOnlyDictionary additionalProperties)
{
Score = score;
RerankerScore = rerankerScore;
+ RerankerBoostedScore = rerankerBoostedScore;
Highlights = highlights;
Captions = captions;
DocumentDebugInfo = documentDebugInfo;
@@ -43,6 +45,8 @@ internal SearchResult(double score, double? rerankerScore, IReadOnlyDictionary 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'.
public double? RerankerScore { get; }
+ /// 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'.
+ public double? RerankerBoostedScore { get; }
/// 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.
public IReadOnlyDictionary> Highlights { get; }
/// 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'.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.Serialization.cs
index c6cbc8142492..8a943b7b9c30 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.Serialization.cs
@@ -19,6 +19,18 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WriteStringValue(Name);
writer.WritePropertyName("prioritizedFields"u8);
writer.WriteObjectValue(PrioritizedFields);
+ if (Optional.IsDefined(RankingOrder))
+ {
+ if (RankingOrder != null)
+ {
+ writer.WritePropertyName("rankingOrder"u8);
+ writer.WriteStringValue(RankingOrder.Value.ToString());
+ }
+ else
+ {
+ writer.WriteNull("rankingOrder");
+ }
+ }
if (Optional.IsDefined(FlightingOptIn))
{
writer.WritePropertyName("flightingOptIn"u8);
@@ -35,6 +47,7 @@ internal static SemanticConfiguration DeserializeSemanticConfiguration(JsonEleme
}
string name = default;
SemanticPrioritizedFields prioritizedFields = default;
+ RankingOrder? rankingOrder = default;
bool? flightingOptIn = default;
foreach (var property in element.EnumerateObject())
{
@@ -48,6 +61,16 @@ internal static SemanticConfiguration DeserializeSemanticConfiguration(JsonEleme
prioritizedFields = SemanticPrioritizedFields.DeserializeSemanticPrioritizedFields(property.Value);
continue;
}
+ if (property.NameEquals("rankingOrder"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ rankingOrder = null;
+ continue;
+ }
+ rankingOrder = new RankingOrder(property.Value.GetString());
+ continue;
+ }
if (property.NameEquals("flightingOptIn"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -58,7 +81,7 @@ internal static SemanticConfiguration DeserializeSemanticConfiguration(JsonEleme
continue;
}
}
- return new SemanticConfiguration(name, prioritizedFields, flightingOptIn);
+ return new SemanticConfiguration(name, prioritizedFields, rankingOrder, flightingOptIn);
}
/// Deserializes the model from a raw response.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.cs
index cc03bf762248..d14b81359622 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SemanticConfiguration.cs
@@ -28,11 +28,13 @@ public SemanticConfiguration(string name, SemanticPrioritizedFields prioritizedF
/// Initializes a new instance of .
/// The name of the semantic configuration.
/// 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.
- /// Determines how which semantic or query rewrite models to use during model flighting/upgrades.
- internal SemanticConfiguration(string name, SemanticPrioritizedFields prioritizedFields, bool? flightingOptIn)
+ /// Specifies the score type to be used for the sort order of the search results.
+ /// Determines which semantic or query rewrite models to use during model flighting/upgrades.
+ internal SemanticConfiguration(string name, SemanticPrioritizedFields prioritizedFields, RankingOrder? rankingOrder, bool? flightingOptIn)
{
Name = name;
PrioritizedFields = prioritizedFields;
+ RankingOrder = rankingOrder;
FlightingOptIn = flightingOptIn;
}
@@ -40,7 +42,9 @@ internal SemanticConfiguration(string name, SemanticPrioritizedFields prioritize
public string Name { get; set; }
/// 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.
public SemanticPrioritizedFields PrioritizedFields { get; set; }
- /// Determines how which semantic or query rewrite models to use during model flighting/upgrades.
+ /// Specifies the score type to be used for the sort order of the search results.
+ public RankingOrder? RankingOrder { get; set; }
+ /// Determines which semantic or query rewrite models to use during model flighting/upgrades.
public bool? FlightingOptIn { get; set; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentActivityRecord.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentActivityRecord.Serialization.cs
new file mode 100644
index 000000000000..6687b76388e6
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentActivityRecord.Serialization.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ internal partial class UnknownKnowledgeAgentActivityRecord
+ {
+ internal static UnknownKnowledgeAgentActivityRecord DeserializeUnknownKnowledgeAgentActivityRecord(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int id = default;
+ string type = "Unknown";
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ }
+ return new UnknownKnowledgeAgentActivityRecord(id, type);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new UnknownKnowledgeAgentActivityRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeUnknownKnowledgeAgentActivityRecord(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentActivityRecord.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentActivityRecord.cs
new file mode 100644
index 000000000000..86cfc907626c
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentActivityRecord.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// Unknown version of KnowledgeAgentActivityRecord.
+ internal partial class UnknownKnowledgeAgentActivityRecord : KnowledgeAgentActivityRecord
+ {
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ /// The type of the activity record.
+ internal UnknownKnowledgeAgentActivityRecord(int id, string type) : base(id, type)
+ {
+ Type = type ?? "Unknown";
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentMessageContent.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentMessageContent.Serialization.cs
new file mode 100644
index 000000000000..700320de0a9c
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentMessageContent.Serialization.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Search.Documents.Models
+{
+ internal partial class UnknownKnowledgeAgentMessageContent : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static UnknownKnowledgeAgentMessageContent DeserializeUnknownKnowledgeAgentMessageContent(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ KnowledgeAgentMessageContentType type = "Unknown";
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = new KnowledgeAgentMessageContentType(property.Value.GetString());
+ continue;
+ }
+ }
+ return new UnknownKnowledgeAgentMessageContent(type);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new UnknownKnowledgeAgentMessageContent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeUnknownKnowledgeAgentMessageContent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentMessageContent.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentMessageContent.cs
new file mode 100644
index 000000000000..0b1e25a63c81
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentMessageContent.cs
@@ -0,0 +1,20 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// Unknown version of KnowledgeAgentMessageContent.
+ internal partial class UnknownKnowledgeAgentMessageContent : KnowledgeAgentMessageContent
+ {
+ /// Initializes a new instance of .
+ /// The type of the message.
+ internal UnknownKnowledgeAgentMessageContent(KnowledgeAgentMessageContentType type) : base(type)
+ {
+ Type = type;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentModel.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentModel.Serialization.cs
new file mode 100644
index 000000000000..7da206b0aa59
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentModel.Serialization.cs
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+using Azure.Search.Documents.Indexes.Models;
+
+namespace Azure.Search.Documents.Models
+{
+ internal partial class UnknownKnowledgeAgentModel : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ writer.WriteEndObject();
+ }
+
+ internal static UnknownKnowledgeAgentModel DeserializeUnknownKnowledgeAgentModel(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ KnowledgeAgentModelKind kind = "Unknown";
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new KnowledgeAgentModelKind(property.Value.GetString());
+ continue;
+ }
+ }
+ return new UnknownKnowledgeAgentModel(kind);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new UnknownKnowledgeAgentModel FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeUnknownKnowledgeAgentModel(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this);
+ return content;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentModel.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentModel.cs
new file mode 100644
index 000000000000..5f4cdeb0df76
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentModel.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Search.Documents.Indexes.Models;
+
+namespace Azure.Search.Documents.Models
+{
+ /// Unknown version of KnowledgeAgentModel.
+ internal partial class UnknownKnowledgeAgentModel : KnowledgeAgentModel
+ {
+ /// Initializes a new instance of .
+ /// The type of AI model.
+ internal UnknownKnowledgeAgentModel(KnowledgeAgentModelKind kind) : base(kind)
+ {
+ Kind = kind;
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentReference.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentReference.Serialization.cs
new file mode 100644
index 000000000000..3f2a59a6108f
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentReference.Serialization.cs
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+
+namespace Azure.Search.Documents.Models
+{
+ internal partial class UnknownKnowledgeAgentReference
+ {
+ internal static UnknownKnowledgeAgentReference DeserializeUnknownKnowledgeAgentReference(JsonElement element)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string type = "Unknown";
+ string id = default;
+ int activitySource = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("activitySource"u8))
+ {
+ activitySource = property.Value.GetInt32();
+ continue;
+ }
+ }
+ return new UnknownKnowledgeAgentReference(type, id, activitySource);
+ }
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new UnknownKnowledgeAgentReference FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeUnknownKnowledgeAgentReference(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentReference.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentReference.cs
new file mode 100644
index 000000000000..a4c55e613553
--- /dev/null
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownKnowledgeAgentReference.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Search.Documents.Models
+{
+ /// Unknown version of KnowledgeAgentReference.
+ internal partial class UnknownKnowledgeAgentReference : KnowledgeAgentReference
+ {
+ /// Initializes a new instance of .
+ /// The type of the reference.
+ /// The ID of the reference.
+ /// The source activity ID for the reference.
+ internal UnknownKnowledgeAgentReference(string type, string id, int activitySource) : base(type, id, activitySource)
+ {
+ Type = type ?? "Unknown";
+ }
+ }
+}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.Serialization.cs
index d63f388ad166..e51b467b59ed 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.Serialization.cs
@@ -52,6 +52,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("filterOverride"u8);
writer.WriteStringValue(FilterOverride);
}
+ if (Optional.IsDefined(PerDocumentVectorLimit))
+ {
+ writer.WritePropertyName("perDocumentVectorLimit"u8);
+ writer.WriteNumberValue(PerDocumentVectorLimit.Value);
+ }
writer.WriteEndObject();
}
@@ -69,6 +74,7 @@ internal static UnknownVectorQuery DeserializeUnknownVectorQuery(JsonElement ele
float? weight = default;
VectorThreshold threshold = default;
string filterOverride = default;
+ int? perDocumentVectorLimit = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("kind"u8))
@@ -131,6 +137,15 @@ internal static UnknownVectorQuery DeserializeUnknownVectorQuery(JsonElement ele
filterOverride = property.Value.GetString();
continue;
}
+ if (property.NameEquals("perDocumentVectorLimit"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ perDocumentVectorLimit = property.Value.GetInt32();
+ continue;
+ }
}
return new UnknownVectorQuery(
kind,
@@ -140,7 +155,8 @@ internal static UnknownVectorQuery DeserializeUnknownVectorQuery(JsonElement ele
oversampling,
weight,
threshold,
- filterOverride);
+ filterOverride,
+ perDocumentVectorLimit);
}
/// Deserializes the model from a raw response.
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.cs
index e9909cf5d413..f547eb43c949 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/UnknownVectorQuery.cs
@@ -23,7 +23,8 @@ internal partial class UnknownVectorQuery : VectorQuery
/// The available derived classes include and .
///
/// 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.
- internal UnknownVectorQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride)
+ /// Controls how many vectors can be matched from each document in a vector search query. Setting it to 1 ensures at most one vector per document is matched, guaranteeing results come from distinct documents. Setting it to 0 (unlimited) allows multiple relevant vectors from the same document to be matched. Default is 0.
+ internal UnknownVectorQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, int? perDocumentVectorLimit) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride, perDocumentVectorLimit)
{
Kind = kind;
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.Serialization.cs
index ac3e6b6903c9..dbf46e12cfb7 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.Serialization.cs
@@ -52,6 +52,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("filterOverride"u8);
writer.WriteStringValue(FilterOverride);
}
+ if (Optional.IsDefined(PerDocumentVectorLimit))
+ {
+ writer.WritePropertyName("perDocumentVectorLimit"u8);
+ writer.WriteNumberValue(PerDocumentVectorLimit.Value);
+ }
writer.WriteEndObject();
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.cs
index 94a1b9283bef..12a485032f17 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorQuery.cs
@@ -32,7 +32,8 @@ protected VectorQuery()
/// The available derived classes include and .
///
/// 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.
- internal VectorQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride)
+ /// Controls how many vectors can be matched from each document in a vector search query. Setting it to 1 ensures at most one vector per document is matched, guaranteeing results come from distinct documents. Setting it to 0 (unlimited) allows multiple relevant vectors from the same document to be matched. Default is 0.
+ internal VectorQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, int? perDocumentVectorLimit)
{
Kind = kind;
KNearestNeighborsCount = kNearestNeighborsCount;
@@ -42,6 +43,7 @@ internal VectorQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string f
Weight = weight;
Threshold = threshold;
FilterOverride = filterOverride;
+ PerDocumentVectorLimit = perDocumentVectorLimit;
}
/// The kind of vector query being performed.
@@ -62,5 +64,7 @@ internal VectorQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string f
public VectorThreshold Threshold { get; set; }
/// 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.
public string FilterOverride { get; set; }
+ /// 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.
+ public int? PerDocumentVectorLimit { get; set; }
}
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs
index bef6730ac985..7443589ba5fc 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorSearchVectorizerKind.cs
@@ -33,7 +33,7 @@ public VectorSearchVectorizerKind(string value)
public static VectorSearchVectorizerKind CustomWebApi { get; } = new VectorSearchVectorizerKind(CustomWebApiValue);
/// Generate embeddings for an image or text input at query time using the Azure AI Services Vision Vectorize API.
public static VectorSearchVectorizerKind AIServicesVision { get; } = new VectorSearchVectorizerKind(AIServicesVisionValue);
- /// Generate embeddings using an Azure Machine Learning endpoint deployed via the Azure AI Studio Model Catalog at query time.
+ /// Generate embeddings using an Azure Machine Learning endpoint deployed via the Azure AI Foundry Model Catalog at query time.
public static VectorSearchVectorizerKind AML { get; } = new VectorSearchVectorizerKind(AMLValue);
/// Determines if two values are the same.
public static bool operator ==(VectorSearchVectorizerKind left, VectorSearchVectorizerKind right) => left.Equals(right);
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.Serialization.cs
index f33b607a7b13..da22d72fba54 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.Serialization.cs
@@ -57,6 +57,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("filterOverride"u8);
writer.WriteStringValue(FilterOverride);
}
+ if (Optional.IsDefined(PerDocumentVectorLimit))
+ {
+ writer.WritePropertyName("perDocumentVectorLimit"u8);
+ writer.WriteNumberValue(PerDocumentVectorLimit.Value);
+ }
writer.WriteEndObject();
}
@@ -75,6 +80,7 @@ internal static VectorizableImageBinaryQuery DeserializeVectorizableImageBinaryQ
float? weight = default;
VectorThreshold threshold = default;
string filterOverride = default;
+ int? perDocumentVectorLimit = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("base64Image"u8))
@@ -142,6 +148,15 @@ internal static VectorizableImageBinaryQuery DeserializeVectorizableImageBinaryQ
filterOverride = property.Value.GetString();
continue;
}
+ if (property.NameEquals("perDocumentVectorLimit"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ perDocumentVectorLimit = property.Value.GetInt32();
+ continue;
+ }
}
return new VectorizableImageBinaryQuery(
kind,
@@ -152,6 +167,7 @@ internal static VectorizableImageBinaryQuery DeserializeVectorizableImageBinaryQ
weight,
threshold,
filterOverride,
+ perDocumentVectorLimit,
base64Image);
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.cs
index 2bd927d67b15..47abdc7c1932 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageBinaryQuery.cs
@@ -29,8 +29,9 @@ public VectorizableImageBinaryQuery()
/// The available derived classes include and .
///
/// 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.
+ /// 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.
/// The base 64 encoded binary of an image to be vectorized to perform a vector search query.
- internal VectorizableImageBinaryQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, string base64Image) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride)
+ internal VectorizableImageBinaryQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, int? perDocumentVectorLimit, string base64Image) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride, perDocumentVectorLimit)
{
Base64Image = base64Image;
Kind = kind;
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.Serialization.cs
index d950d85484b8..87a9acbe2fa6 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.Serialization.cs
@@ -58,6 +58,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("filterOverride"u8);
writer.WriteStringValue(FilterOverride);
}
+ if (Optional.IsDefined(PerDocumentVectorLimit))
+ {
+ writer.WritePropertyName("perDocumentVectorLimit"u8);
+ writer.WriteNumberValue(PerDocumentVectorLimit.Value);
+ }
writer.WriteEndObject();
}
@@ -76,6 +81,7 @@ internal static VectorizableImageUrlQuery DeserializeVectorizableImageUrlQuery(J
float? weight = default;
VectorThreshold threshold = default;
string filterOverride = default;
+ int? perDocumentVectorLimit = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("url"u8))
@@ -147,6 +153,15 @@ internal static VectorizableImageUrlQuery DeserializeVectorizableImageUrlQuery(J
filterOverride = property.Value.GetString();
continue;
}
+ if (property.NameEquals("perDocumentVectorLimit"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ perDocumentVectorLimit = property.Value.GetInt32();
+ continue;
+ }
}
return new VectorizableImageUrlQuery(
kind,
@@ -157,6 +172,7 @@ internal static VectorizableImageUrlQuery DeserializeVectorizableImageUrlQuery(J
weight,
threshold,
filterOverride,
+ perDocumentVectorLimit,
url);
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.cs
index 38d5b710e388..f5e9a7c00bdb 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableImageUrlQuery.cs
@@ -31,8 +31,9 @@ public VectorizableImageUrlQuery()
/// The available derived classes include and .
///
/// 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.
+ /// 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.
/// The URL of an image to be vectorized to perform a vector search query.
- internal VectorizableImageUrlQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, Uri url) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride)
+ internal VectorizableImageUrlQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, int? perDocumentVectorLimit, Uri url) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride, perDocumentVectorLimit)
{
Url = url;
Kind = kind;
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs
index 4143ea131796..4d7ad6ab77a4 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.Serialization.cs
@@ -59,6 +59,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("filterOverride"u8);
writer.WriteStringValue(FilterOverride);
}
+ if (Optional.IsDefined(PerDocumentVectorLimit))
+ {
+ writer.WritePropertyName("perDocumentVectorLimit"u8);
+ writer.WriteNumberValue(PerDocumentVectorLimit.Value);
+ }
writer.WriteEndObject();
}
@@ -78,6 +83,7 @@ internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonEleme
float? weight = default;
VectorThreshold threshold = default;
string filterOverride = default;
+ int? perDocumentVectorLimit = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("text"u8))
@@ -154,6 +160,15 @@ internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonEleme
filterOverride = property.Value.GetString();
continue;
}
+ if (property.NameEquals("perDocumentVectorLimit"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ perDocumentVectorLimit = property.Value.GetInt32();
+ continue;
+ }
}
return new VectorizableTextQuery(
kind,
@@ -164,6 +179,7 @@ internal static VectorizableTextQuery DeserializeVectorizableTextQuery(JsonEleme
weight,
threshold,
filterOverride,
+ perDocumentVectorLimit,
text,
queryRewrites);
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs
index c72e86c1ceb3..18757ddd83b8 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizableTextQuery.cs
@@ -36,9 +36,10 @@ public VectorizableTextQuery(string text)
/// The available derived classes include and .
///
/// 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.
+ /// 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.
/// The text to be vectorized to perform a vector search query.
/// Can be configured to let a generative model rewrite the query before sending it to be vectorized.
- internal VectorizableTextQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, string text, QueryRewritesType? queryRewrites) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride)
+ internal VectorizableTextQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, int? perDocumentVectorLimit, string text, QueryRewritesType? queryRewrites) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride, perDocumentVectorLimit)
{
Text = text;
QueryRewrites = queryRewrites;
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.Serialization.cs
index 0bd9a870d967..71ffbe9ab06d 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.Serialization.cs
@@ -60,6 +60,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
writer.WritePropertyName("filterOverride"u8);
writer.WriteStringValue(FilterOverride);
}
+ if (Optional.IsDefined(PerDocumentVectorLimit))
+ {
+ writer.WritePropertyName("perDocumentVectorLimit"u8);
+ writer.WriteNumberValue(PerDocumentVectorLimit.Value);
+ }
writer.WriteEndObject();
}
@@ -78,6 +83,7 @@ internal static VectorizedQuery DeserializeVectorizedQuery(JsonElement element)
float? weight = default;
VectorThreshold threshold = default;
string filterOverride = default;
+ int? perDocumentVectorLimit = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("vector"u8))
@@ -156,6 +162,15 @@ internal static VectorizedQuery DeserializeVectorizedQuery(JsonElement element)
filterOverride = property.Value.GetString();
continue;
}
+ if (property.NameEquals("perDocumentVectorLimit"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ perDocumentVectorLimit = property.Value.GetInt32();
+ continue;
+ }
}
return new VectorizedQuery(
kind,
@@ -166,6 +181,7 @@ internal static VectorizedQuery DeserializeVectorizedQuery(JsonElement element)
weight,
threshold,
filterOverride,
+ perDocumentVectorLimit,
vector);
}
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.cs
index 60236c73dfd9..744734be2a75 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/VectorizedQuery.cs
@@ -33,8 +33,9 @@ public VectorizedQuery(ReadOnlyMemory vector)
/// The available derived classes include and .
///
/// 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.
+ /// 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.
/// The vector representation of a search query.
- internal VectorizedQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, ReadOnlyMemory vector) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride)
+ internal VectorizedQuery(VectorQueryKind kind, int? kNearestNeighborsCount, string fieldsRaw, bool? exhaustive, double? oversampling, float? weight, VectorThreshold threshold, string filterOverride, int? perDocumentVectorLimit, ReadOnlyMemory vector) : base(kind, kNearestNeighborsCount, fieldsRaw, exhaustive, oversampling, weight, threshold, filterOverride, perDocumentVectorLimit)
{
Vector = vector;
Kind = kind;
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs
index 5c0503004795..ca055241b0f0 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.Serialization.cs
@@ -142,6 +142,13 @@ internal static WebApiSkill DeserializeWebApiSkill(JsonElement element)
{
return null;
}
+ if (element.TryGetProperty("@odata.type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "#Microsoft.Skills.Custom.ChatCompletionSkill": return ChatCompletionSkill.DeserializeChatCompletionSkill(element);
+ }
+ }
string uri = default;
IDictionary httpHeaders = default;
string httpMethod = default;
@@ -150,7 +157,7 @@ internal static WebApiSkill DeserializeWebApiSkill(JsonElement element)
int? degreeOfParallelism = default;
ResourceIdentifier authResourceId = default;
SearchIndexerDataIdentity authIdentity = default;
- string odataType = default;
+ string odataType = "#Microsoft.Skills.Custom.WebApiSkill";
string name = default;
string description = default;
string context = default;
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.cs
index 61734865b71d..8855c8fc8ef1 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/WebApiSkill.cs
@@ -11,7 +11,11 @@
namespace Azure.Search.Documents.Indexes.Models
{
- /// A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code.
+ ///
+ /// A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
public partial class WebApiSkill : SearchIndexerSkill
{
/// Initializes a new instance of .
diff --git a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs
index 35935eb9ddb3..30266137f8a8 100644
--- a/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs
+++ b/sdk/search/Azure.Search.Documents/src/Generated/SearchModelFactory.cs
@@ -15,6 +15,235 @@ namespace Azure.Search.Documents.Models
/// Model factory for models.
public static partial class SearchModelFactory
{
+ /// Initializes a new instance of .
+ ///
+ ///
+ /// The activity records for tracking progress and billing implications.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ ///
+ /// The references for the retrieval data used in the response.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ /// A new instance for mocking.
+ public static KnowledgeAgentRetrievalResponse KnowledgeAgentRetrievalResponse(IEnumerable response = null, IEnumerable activity = null, IEnumerable references = null)
+ {
+ response ??= new List();
+ activity ??= new List();
+ references ??= new List();
+
+ return new KnowledgeAgentRetrievalResponse(response?.ToList(), activity?.ToList(), references?.ToList());
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the activity record.
+ /// The type of the activity record.
+ /// A new instance for mocking.
+ public static KnowledgeAgentActivityRecord KnowledgeAgentActivityRecord(int id = default, string type = null)
+ {
+ return new UnknownKnowledgeAgentActivityRecord(id, type);
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the reference.
+ /// The ID of the reference.
+ /// The source activity ID for the reference.
+ /// A new instance for mocking.
+ public static KnowledgeAgentReference KnowledgeAgentReference(string type = null, string id = null, int activitySource = default)
+ {
+ return new UnknownKnowledgeAgentReference(type, id, activitySource);
+ }
+
+ /// Initializes a new instance of .
+ /// Overall indexer status.
+ /// The result of the most recent or an in-progress indexer execution.
+ /// History of the recent indexer executions, sorted in reverse chronological order.
+ /// The execution limits for the indexer.
+ /// All of the state that defines and dictates the indexer's current execution.
+ /// A new instance for mocking.
+ public static SearchIndexerStatus SearchIndexerStatus(IndexerStatus status = default, IndexerExecutionResult lastResult = null, IEnumerable executionHistory = null, SearchIndexerLimits limits = null, IndexerState currentState = null)
+ {
+ executionHistory ??= new List();
+
+ return new SearchIndexerStatus(status, lastResult, executionHistory?.ToList(), limits, currentState);
+ }
+
+ /// Initializes a new instance of .
+ /// The outcome of this indexer execution.
+ /// The outcome of this indexer execution.
+ /// The mode the indexer is running in.
+ /// The error message indicating the top-level error, if any.
+ /// The start time of this indexer execution.
+ /// The end time of this indexer execution, if the execution has already completed.
+ /// The item-level indexing errors.
+ /// The item-level indexing warnings.
+ /// The number of items that were processed during this indexer execution. This includes both successfully processed items and items where indexing was attempted but failed.
+ /// The number of items that failed to be indexed during this indexer execution.
+ /// Change tracking state with which an indexer execution started.
+ /// Change tracking state with which an indexer execution finished.
+ /// A new instance for mocking.
+ public static IndexerExecutionResult IndexerExecutionResult(IndexerExecutionStatus status = default, IndexerExecutionStatusDetail? statusDetail = null, IndexingMode? mode = null, string errorMessage = null, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, IEnumerable errors = null, IEnumerable warnings = null, int itemCount = default, int failedItemCount = default, string initialTrackingState = null, string finalTrackingState = null)
+ {
+ errors ??= new List();
+ warnings ??= new List();
+
+ return new IndexerExecutionResult(
+ status,
+ statusDetail,
+ mode,
+ errorMessage,
+ startTime,
+ endTime,
+ errors?.ToList(),
+ warnings?.ToList(),
+ itemCount,
+ failedItemCount,
+ initialTrackingState,
+ finalTrackingState);
+ }
+
+ /// Initializes a new instance of .
+ /// The mode the indexer is running in.
+ /// Change tracking state used when indexing starts on all documents in the datasource.
+ /// Change tracking state value when indexing finishes on all documents in the datasource.
+ /// Change tracking state used when indexing starts on select, reset documents in the datasource.
+ /// Change tracking state value when indexing finishes on select, reset documents in the datasource.
+ /// The list of document keys that have been reset. The document key is the document's unique identifier for the data in the search index. The indexer will prioritize selectively re-ingesting these keys.
+ /// The list of datasource document ids that have been reset. The datasource document id is the unique identifier for the data in the datasource. The indexer will prioritize selectively re-ingesting these ids.
+ /// Change tracking state used when indexing starts on selective options from the datasource.
+ /// Change tracking state value when indexing finishes on selective options from the datasource.
+ /// A new instance for mocking.
+ public static IndexerState IndexerState(IndexingMode? mode = null, string allDocsInitialTrackingState = null, string allDocsFinalTrackingState = null, string resetDocsInitialTrackingState = null, string resetDocsFinalTrackingState = null, IEnumerable resetDocumentKeys = null, IEnumerable resetDataSourceDocumentIds = null, string resyncInitialTrackingState = null, string resyncFinalTrackingState = null)
+ {
+ resetDocumentKeys ??= new List();
+ resetDataSourceDocumentIds ??= new List();
+
+ return new IndexerState(
+ mode,
+ allDocsInitialTrackingState,
+ allDocsFinalTrackingState,
+ resetDocsInitialTrackingState,
+ resetDocsFinalTrackingState,
+ resetDocumentKeys?.ToList(),
+ resetDataSourceDocumentIds?.ToList(),
+ resyncInitialTrackingState,
+ resyncFinalTrackingState);
+ }
+
+ /// Initializes a new instance of .
+ /// The number of documents in the index.
+ /// The amount of storage in bytes consumed by the index.
+ /// The amount of memory in bytes consumed by vectors in the index.
+ /// A new instance for mocking.
+ public static SearchIndexStatistics SearchIndexStatistics(long documentCount = default, long storageSize = default, long vectorIndexSize = default)
+ {
+ return new SearchIndexStatistics(documentCount, storageSize, vectorIndexSize);
+ }
+
+ /// Initializes a new instance of .
+ /// Total number of aliases.
+ /// Total number of documents across all indexes in the service.
+ /// Total number of indexes.
+ /// Total number of indexers.
+ /// Total number of data sources.
+ /// Total size of used storage in bytes.
+ /// Total number of synonym maps.
+ /// Total number of skillsets.
+ /// Total memory consumption of all vector indexes within the service, in bytes.
+ /// , , , , , , , or is null.
+ /// A new instance for mocking.
+ public static SearchServiceCounters SearchServiceCounters(SearchResourceCounter aliasCounter = null, SearchResourceCounter documentCounter = null, SearchResourceCounter indexCounter = null, SearchResourceCounter indexerCounter = null, SearchResourceCounter dataSourceCounter = null, SearchResourceCounter storageSizeCounter = null, SearchResourceCounter synonymMapCounter = null, SearchResourceCounter skillsetCounter = null, SearchResourceCounter vectorIndexSizeCounter = null)
+ {
+ if (aliasCounter == null)
+ {
+ throw new ArgumentNullException(nameof(aliasCounter));
+ }
+ if (documentCounter == null)
+ {
+ throw new ArgumentNullException(nameof(documentCounter));
+ }
+ if (indexCounter == null)
+ {
+ throw new ArgumentNullException(nameof(indexCounter));
+ }
+ if (indexerCounter == null)
+ {
+ throw new ArgumentNullException(nameof(indexerCounter));
+ }
+ if (dataSourceCounter == null)
+ {
+ throw new ArgumentNullException(nameof(dataSourceCounter));
+ }
+ if (storageSizeCounter == null)
+ {
+ throw new ArgumentNullException(nameof(storageSizeCounter));
+ }
+ if (synonymMapCounter == null)
+ {
+ throw new ArgumentNullException(nameof(synonymMapCounter));
+ }
+ if (skillsetCounter == null)
+ {
+ throw new ArgumentNullException(nameof(skillsetCounter));
+ }
+ if (vectorIndexSizeCounter == null)
+ {
+ throw new ArgumentNullException(nameof(vectorIndexSizeCounter));
+ }
+
+ return new SearchServiceCounters(
+ aliasCounter,
+ documentCounter,
+ indexCounter,
+ indexerCounter,
+ dataSourceCounter,
+ storageSizeCounter,
+ synonymMapCounter,
+ skillsetCounter,
+ vectorIndexSizeCounter);
+ }
+
+ /// Initializes a new instance of .
+ /// The maximum allowed fields per index.
+ /// The maximum depth which you can nest sub-fields in an index, including the top-level complex field. For example, a/b/c has a nesting depth of 3.
+ /// The maximum number of fields of type Collection(Edm.ComplexType) allowed in an index.
+ /// The maximum number of objects in complex collections allowed per document.
+ /// The maximum amount of storage in bytes allowed per index.
+ /// A new instance for mocking.
+ public static SearchServiceLimits SearchServiceLimits(int? maxFieldsPerIndex = null, int? maxFieldNestingDepthPerIndex = null, int? maxComplexCollectionFieldsPerIndex = null, int? maxComplexObjectsInCollectionsPerDocument = null, long? maxStoragePerIndexInBytes = null)
+ {
+ return new SearchServiceLimits(maxFieldsPerIndex, maxFieldNestingDepthPerIndex, maxComplexCollectionFieldsPerIndex, maxComplexObjectsInCollectionsPerDocument, maxStoragePerIndexInBytes);
+ }
+
+ /// Initializes a new instance of .
+ /// The Statistics summary of all indexes in the Search service.
+ /// A new instance for mocking.
+ public static ListIndexStatsSummary ListIndexStatsSummary(IEnumerable indexesStatistics = null)
+ {
+ indexesStatistics ??= new List();
+
+ return new ListIndexStatsSummary(indexesStatistics?.ToList());
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the index.
+ /// The number of documents in the index.
+ /// The amount of storage in bytes consumed by the index.
+ /// The amount of memory in bytes consumed by vectors in the index.
+ /// is null.
+ /// A new instance for mocking.
+ public static IndexStatisticsSummary IndexStatisticsSummary(string name = null, long documentCount = default, long storageSize = default, long vectorIndexSize = default)
+ {
+ if (name == null)
+ {
+ throw new ArgumentNullException(nameof(name));
+ }
+
+ return new IndexStatisticsSummary(name, documentCount, storageSize, vectorIndexSize);
+ }
+
/// Initializes a new instance of .
/// The approximate count of documents falling within the bucket described by this facet.
/// The resulting total sum for the facet when a sum metric is requested.
@@ -88,10 +317,13 @@ public static QueryCaptionResult QueryCaptionResult(string text = null, string h
/// Initializes a new instance of .
/// Contains debugging information specific to semantic ranking requests.
/// Contains debugging information specific to vector and hybrid search.
+ /// Contains debugging information specific to vectors matched within a collection of complex types.
/// A new instance for mocking.
- public static DocumentDebugInfo DocumentDebugInfo(SemanticDebugInfo semantic = null, VectorsDebugInfo vectors = null)
+ public static DocumentDebugInfo DocumentDebugInfo(SemanticDebugInfo semantic = null, VectorsDebugInfo vectors = null, IReadOnlyDictionary> innerHits = null)
{
- return new DocumentDebugInfo(semantic, vectors);
+ innerHits ??= new Dictionary>();
+
+ return new DocumentDebugInfo(semantic, vectors, innerHits);
}
///