diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs
index fc1c7f45a00e..267dd3c78398 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs
@@ -35,10 +35,10 @@ protected AIProjectClient()
}
/// Initializes a new instance of AIProjectClient.
- /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
+ /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
/// The Azure subscription ID.
/// The name of the Azure Resource Group.
- /// The Azure AI Studio project name.
+ /// The Azure AI Foundry project name.
/// A credential used to authenticate to an Azure Service.
/// , , , or is null.
/// , or is an empty string, and was expected to be non-empty.
@@ -47,10 +47,10 @@ protected AIProjectClient()
}
/// Initializes a new instance of AIProjectClient.
- /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
+ /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
/// The Azure subscription ID.
/// The name of the Azure Resource Group.
- /// The Azure AI Studio project name.
+ /// The Azure AI Foundry project name.
/// A credential used to authenticate to an Azure Service.
/// The options for configuring the client.
/// , , , or is null.
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs
index 02f3bc489b92..acd83ee1a217 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs
@@ -16,10 +16,10 @@ public static partial class AIProjectsClientBuilderExtensions
{
/// Registers a instance.
/// The builder to register with.
- /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
+ /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
/// The Azure subscription ID.
/// The name of the Azure Resource Group.
- /// The Azure AI Studio project name.
+ /// The Azure AI Foundry project name.
public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName)
where TBuilder : IAzureClientFactoryBuilderWithCredential
{
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
index cbab281da95b..7080847507e8 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
@@ -21,7 +21,7 @@ public static partial class AIProjectsModelFactory
/// 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 .
///
- /// Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique.
+ /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique.
/// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
/// Metadata containing createdBy and modifiedBy information.
/// Status of the evaluation. It is set by service and is read-only.
@@ -164,6 +164,24 @@ public static CredentialsApiKeyAuth CredentialsApiKeyAuth(string key = null)
return new CredentialsApiKeyAuth(key, serializedAdditionalRawData: null);
}
+ /// Initializes a new instance of .
+ /// The type of binding, which is always 'storage_queue'.
+ /// Storage queue.
+ /// A new instance for mocking.
+ public static AzureFunctionBinding AzureFunctionBinding(AzureFunctionBindingType type = default, AzureFunctionStorageQueue storageQueue = null)
+ {
+ return new AzureFunctionBinding(type, storageQueue, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Type.
+ /// The JSON schema, describing response format.
+ /// A new instance for mocking.
+ public static ResponseFormatJsonSchemaType ResponseFormatJsonSchemaType(ResponseFormatJsonSchemaTypeType type = default, ResponseFormatJsonSchema jsonSchema = null)
+ {
+ return new ResponseFormatJsonSchemaType(type, jsonSchema, serializedAdditionalRawData: null);
+ }
+
/// Initializes a new instance of .
///
/// The role of the entity that is creating the message. Allowed values include:
@@ -306,15 +324,46 @@ public static RunStepCodeInterpreterImageReference RunStepCodeInterpreterImageRe
/// Initializes a new instance of .
/// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
+ /// For now, this is always going to be an empty object.
/// A new instance for mocking.
- public static RunStepFileSearchToolCall RunStepFileSearchToolCall(string id = null, IReadOnlyDictionary fileSearch = null)
+ public static RunStepFileSearchToolCall RunStepFileSearchToolCall(string id = null, RunStepFileSearchToolCallResults fileSearch = null)
{
- fileSearch ??= new Dictionary();
-
return new RunStepFileSearchToolCall("file_search", id, serializedAdditionalRawData: null, fileSearch);
}
+ /// Initializes a new instance of .
+ /// Ranking options for file search.
+ /// The array of a file search results.
+ /// A new instance for mocking.
+ public static RunStepFileSearchToolCallResults RunStepFileSearchToolCallResults(FileSearchRankingOptions rankingOptions = null, IEnumerable results = null)
+ {
+ results ??= new List();
+
+ return new RunStepFileSearchToolCallResults(rankingOptions, results?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the file that result was found in.
+ /// The name of the file that result was found in.
+ /// The score of the result. All values must be a floating point number between 0 and 1.
+ /// The content of the result that was found. The content is only included if requested via the include query parameter.
+ /// A new instance for mocking.
+ public static RunStepFileSearchToolCallResult RunStepFileSearchToolCallResult(string fileId = null, string fileName = null, float score = default, IEnumerable content = null)
+ {
+ content ??= new List();
+
+ return new RunStepFileSearchToolCallResult(fileId, fileName, score, content?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the content.
+ /// The text content of the file.
+ /// A new instance for mocking.
+ public static FileSearchToolCallContent FileSearchToolCallContent(FileSearchToolCallContentType type = default, string text = null)
+ {
+ return new FileSearchToolCallContent(type, text, serializedAdditionalRawData: null);
+ }
+
/// Initializes a new instance of .
/// The ID of the tool call. This ID must be referenced when you submit tool outputs.
/// Reserved for future use.
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs
index 394ba7cc4b5a..8d1ff839899f 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs
@@ -56,7 +56,7 @@ public partial class Agent
///
/// The collection of tools enabled for the agent.
/// 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 .
///
///
/// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter`
@@ -104,7 +104,7 @@ internal Agent(string id, DateTimeOffset createdAt, string name, string descript
///
/// The collection of tools enabled for the agent.
/// 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 .
///
///
/// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter`
@@ -162,7 +162,7 @@ internal Agent()
///
/// The collection of tools enabled for the agent.
/// 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 IReadOnlyList Tools { get; }
///
@@ -203,6 +203,9 @@ internal Agent()
/// -
///
///
+ /// -
+ ///
+ ///
///
///
/// Examples:
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs
index 0c2e715e09a9..97c4efa2a29e 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs
@@ -77,7 +77,7 @@ public AgentStreamEvent(string value)
public static AgentStreamEvent ThreadRunRequiresAction { get; } = new AgentStreamEvent(ThreadRunRequiresActionValue);
/// Event sent when a run is completed. The data of this event is of type ThreadRun.
public static AgentStreamEvent ThreadRunCompleted { get; } = new AgentStreamEvent(ThreadRunCompletedValue);
- /// Event sent when a run ends incompleted. The data of this event is of type ThreadRun.
+ /// Event sent when a run ends incomplete. The data of this event is of type ThreadRun.
public static AgentStreamEvent ThreadRunIncomplete { get; } = new AgentStreamEvent(ThreadRunIncompleteValue);
/// Event sent when a run fails. The data of this event is of type ThreadRun.
public static AgentStreamEvent ThreadRunFailed { get; } = new AgentStreamEvent(ThreadRunFailedValue);
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs
index ee86ff64e490..dcf23c64e9f5 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.Serialization.cs
@@ -76,7 +76,7 @@ internal static AgentsApiResponseFormat DeserializeAgentsApiResponseFormat(JsonE
{
return null;
}
- ApiResponseFormat? type = default;
+ ResponseFormat? type = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
@@ -87,7 +87,7 @@ internal static AgentsApiResponseFormat DeserializeAgentsApiResponseFormat(JsonE
{
continue;
}
- type = new ApiResponseFormat(property.Value.GetString());
+ type = new ResponseFormat(property.Value.GetString());
continue;
}
if (options.Format != "W")
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs
index 9349f601da77..b481792951e0 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs
@@ -56,13 +56,13 @@ public AgentsApiResponseFormat()
/// Initializes a new instance of .
/// Must be one of `text` or `json_object`.
/// Keeps track of any properties unknown to the library.
- internal AgentsApiResponseFormat(ApiResponseFormat? type, IDictionary serializedAdditionalRawData)
+ internal AgentsApiResponseFormat(ResponseFormat? type, IDictionary serializedAdditionalRawData)
{
Type = type;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
/// Must be one of `text` or `json_object`.
- public ApiResponseFormat? Type { get; set; }
+ public ResponseFormat? Type { get; set; }
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs
index 6d8476ffe785..0953266d0706 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs
@@ -44,10 +44,10 @@ protected AgentsClient()
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The token credential to copy.
- /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
+ /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
/// The Azure subscription ID.
/// The name of the Azure Resource Group.
- /// The Azure AI Studio project name.
+ /// The Azure AI Foundry project name.
/// The API version to use for this operation.
internal AgentsClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName, string apiVersion)
{
@@ -1706,11 +1706,16 @@ public virtual Response UpdateMessage(string threadId, string messageId, Request
/// The strategy to use for dropping messages as the context windows moves forward.
/// Controls whether or not and which tool is called by the model.
/// Specifies the format that the model must output.
+ /// If `true` functions will run in parallel during tool use.
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The cancellation token to use.
/// or is null.
/// is an empty string, and was expected to be non-empty.
- public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default)
+ public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNull(assistantId, nameof(assistantId));
@@ -1730,10 +1735,11 @@ public virtual async Task> CreateRunAsync(string threadId, s
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await CreateRunAsync(threadId, createRunRequest.ToRequestContent(), context).ConfigureAwait(false);
+ Response response = await CreateRunAsync(threadId, createRunRequest.ToRequestContent(), include, context).ConfigureAwait(false);
return Response.FromValue(ThreadRun.FromResponse(response), response);
}
@@ -1776,11 +1782,16 @@ public virtual async Task> CreateRunAsync(string threadId, s
/// The strategy to use for dropping messages as the context windows moves forward.
/// Controls whether or not and which tool is called by the model.
/// Specifies the format that the model must output.
+ /// If `true` functions will run in parallel during tool use.
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The cancellation token to use.
/// or is null.
/// is an empty string, and was expected to be non-empty.
- public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default)
+ public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNull(assistantId, nameof(assistantId));
@@ -1800,10 +1811,11 @@ public virtual Response CreateRun(string threadId, string assistantId
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = CreateRun(threadId, createRunRequest.ToRequestContent(), context);
+ Response response = CreateRun(threadId, createRunRequest.ToRequestContent(), include, context);
return Response.FromValue(ThreadRun.FromResponse(response), response);
}
@@ -1817,19 +1829,23 @@ public virtual Response CreateRun(string threadId, string assistantId
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// Identifier of the thread.
/// The content to send as the body of the request.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// or is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- public virtual async Task CreateRunAsync(string threadId, RequestContent content, RequestContext context = null)
+ public virtual async Task CreateRunAsync(string threadId, RequestContent content, IEnumerable include = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNull(content, nameof(content));
@@ -1838,7 +1854,7 @@ public virtual async Task CreateRunAsync(string threadId, RequestConte
scope.Start();
try
{
- using HttpMessage message = CreateCreateRunRequest(threadId, content, context);
+ using HttpMessage message = CreateCreateRunRequest(threadId, content, include, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -1858,19 +1874,23 @@ public virtual async Task CreateRunAsync(string threadId, RequestConte
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// Identifier of the thread.
/// The content to send as the body of the request.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// or is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- public virtual Response CreateRun(string threadId, RequestContent content, RequestContext context = null)
+ public virtual Response CreateRun(string threadId, RequestContent content, IEnumerable include = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNull(content, nameof(content));
@@ -1879,7 +1899,7 @@ public virtual Response CreateRun(string threadId, RequestContent content, Reque
scope.Start();
try
{
- using HttpMessage message = CreateCreateRunRequest(threadId, content, context);
+ using HttpMessage message = CreateCreateRunRequest(threadId, content, include, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -2522,10 +2542,11 @@ public virtual Response CancelRun(string threadId, string runId, RequestContext
/// The strategy to use for dropping messages as the context windows moves forward.
/// Controls whether or not and which tool is called by the model.
/// Specifies the format that the model must output.
+ /// If `true` functions will run in parallel during tool use.
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
/// The cancellation token to use.
/// is null.
- public virtual async Task> CreateThreadAndRunAsync(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default)
+ public virtual async Task> CreateThreadAndRunAsync(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(assistantId, nameof(assistantId));
@@ -2544,6 +2565,7 @@ public virtual async Task> CreateThreadAndRunAsync(string as
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
@@ -2586,10 +2608,11 @@ public virtual async Task> CreateThreadAndRunAsync(string as
/// The strategy to use for dropping messages as the context windows moves forward.
/// Controls whether or not and which tool is called by the model.
/// Specifies the format that the model must output.
+ /// If `true` functions will run in parallel during tool use.
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
/// The cancellation token to use.
/// is null.
- public virtual Response CreateThreadAndRun(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default)
+ public virtual Response CreateThreadAndRun(string assistantId, AgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(assistantId, nameof(assistantId));
@@ -2608,6 +2631,7 @@ public virtual Response CreateThreadAndRun(string assistantId, AgentT
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
@@ -2625,7 +2649,7 @@ public virtual Response CreateThreadAndRun(string assistantId, AgentT
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -2663,7 +2687,7 @@ public virtual async Task CreateThreadAndRunAsync(RequestContent conte
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -2695,17 +2719,21 @@ public virtual Response CreateThreadAndRun(RequestContent content, RequestContex
/// Identifier of the thread.
/// Identifier of the run.
/// Identifier of the run step.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The cancellation token to use.
/// , or is null.
/// , or is an empty string, and was expected to be non-empty.
- public virtual async Task> GetRunStepAsync(string threadId, string runId, string stepId, CancellationToken cancellationToken = default)
+ public virtual async Task> GetRunStepAsync(string threadId, string runId, string stepId, IEnumerable include = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
Argument.AssertNotNullOrEmpty(stepId, nameof(stepId));
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await GetRunStepAsync(threadId, runId, stepId, context).ConfigureAwait(false);
+ Response response = await GetRunStepAsync(threadId, runId, stepId, include, context).ConfigureAwait(false);
return Response.FromValue(RunStep.FromResponse(response), response);
}
@@ -2713,17 +2741,21 @@ public virtual async Task> GetRunStepAsync(string threadId, st
/// Identifier of the thread.
/// Identifier of the run.
/// Identifier of the run step.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The cancellation token to use.
/// , or is null.
/// , or is an empty string, and was expected to be non-empty.
- public virtual Response GetRunStep(string threadId, string runId, string stepId, CancellationToken cancellationToken = default)
+ public virtual Response GetRunStep(string threadId, string runId, string stepId, IEnumerable include = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
Argument.AssertNotNullOrEmpty(stepId, nameof(stepId));
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = GetRunStep(threadId, runId, stepId, context);
+ Response response = GetRunStep(threadId, runId, stepId, include, context);
return Response.FromValue(RunStep.FromResponse(response), response);
}
@@ -2737,7 +2769,7 @@ public virtual Response GetRunStep(string threadId, string runId, strin
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -2745,12 +2777,16 @@ public virtual Response GetRunStep(string threadId, string runId, strin
/// Identifier of the thread.
/// Identifier of the run.
/// Identifier of the run step.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// , or is null.
/// , or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- public virtual async Task GetRunStepAsync(string threadId, string runId, string stepId, RequestContext context)
+ public virtual async Task GetRunStepAsync(string threadId, string runId, string stepId, IEnumerable include, RequestContext context)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
@@ -2760,7 +2796,7 @@ public virtual async Task GetRunStepAsync(string threadId, string runI
scope.Start();
try
{
- using HttpMessage message = CreateGetRunStepRequest(threadId, runId, stepId, context);
+ using HttpMessage message = CreateGetRunStepRequest(threadId, runId, stepId, include, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -2780,7 +2816,7 @@ public virtual async Task GetRunStepAsync(string threadId, string runI
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -2788,12 +2824,16 @@ public virtual async Task GetRunStepAsync(string threadId, string runI
/// Identifier of the thread.
/// Identifier of the run.
/// Identifier of the run step.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// , or is null.
/// , or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- public virtual Response GetRunStep(string threadId, string runId, string stepId, RequestContext context)
+ public virtual Response GetRunStep(string threadId, string runId, string stepId, IEnumerable include, RequestContext context)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
@@ -2803,7 +2843,7 @@ public virtual Response GetRunStep(string threadId, string runId, string stepId,
scope.Start();
try
{
- using HttpMessage message = CreateGetRunStepRequest(threadId, runId, stepId, context);
+ using HttpMessage message = CreateGetRunStepRequest(threadId, runId, stepId, include, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -2816,6 +2856,10 @@ public virtual Response GetRunStep(string threadId, string runId, string stepId,
/// Gets a list of run steps from a thread run.
/// Identifier of the thread.
/// Identifier of the run.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
/// Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
/// A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@@ -2823,19 +2867,23 @@ public virtual Response GetRunStep(string threadId, string runId, string stepId,
/// The cancellation token to use.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
- internal virtual async Task> InternalGetRunStepsAsync(string threadId, string runId, int? limit = null, ListSortOrder? order = null, string after = null, string before = null, CancellationToken cancellationToken = default)
+ internal virtual async Task> InternalGetRunStepsAsync(string threadId, string runId, IEnumerable include = null, int? limit = null, ListSortOrder? order = null, string after = null, string before = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await InternalGetRunStepsAsync(threadId, runId, limit, order?.ToString(), after, before, context).ConfigureAwait(false);
+ Response response = await InternalGetRunStepsAsync(threadId, runId, include, limit, order?.ToString(), after, before, context).ConfigureAwait(false);
return Response.FromValue(InternalOpenAIPageableListOfRunStep.FromResponse(response), response);
}
/// Gets a list of run steps from a thread run.
/// Identifier of the thread.
/// Identifier of the run.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
/// Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
/// A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@@ -2843,13 +2891,13 @@ internal virtual async Task> Inter
/// The cancellation token to use.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
- internal virtual Response InternalGetRunSteps(string threadId, string runId, int? limit = null, ListSortOrder? order = null, string after = null, string before = null, CancellationToken cancellationToken = default)
+ internal virtual Response InternalGetRunSteps(string threadId, string runId, IEnumerable include = null, int? limit = null, ListSortOrder? order = null, string after = null, string before = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = InternalGetRunSteps(threadId, runId, limit, order?.ToString(), after, before, context);
+ Response response = InternalGetRunSteps(threadId, runId, include, limit, order?.ToString(), after, before, context);
return Response.FromValue(InternalOpenAIPageableListOfRunStep.FromResponse(response), response);
}
@@ -2863,13 +2911,17 @@ internal virtual Response InternalGetRunSte
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// Identifier of the thread.
/// Identifier of the run.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
/// Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Allowed values: "asc" | "desc".
/// A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@@ -2879,7 +2931,7 @@ internal virtual Response InternalGetRunSte
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- internal virtual async Task InternalGetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestContext context)
+ internal virtual async Task InternalGetRunStepsAsync(string threadId, string runId, IEnumerable include, int? limit, string order, string after, string before, RequestContext context)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
@@ -2888,7 +2940,7 @@ internal virtual async Task InternalGetRunStepsAsync(string threadId,
scope.Start();
try
{
- using HttpMessage message = CreateInternalGetRunStepsRequest(threadId, runId, limit, order, after, before, context);
+ using HttpMessage message = CreateInternalGetRunStepsRequest(threadId, runId, include, limit, order, after, before, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -2908,13 +2960,17 @@ internal virtual async Task InternalGetRunStepsAsync(string threadId,
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// Identifier of the thread.
/// Identifier of the run.
+ ///
+ /// A list of additional fields to include in the response.
+ /// Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content.
+ ///
/// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
/// Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Allowed values: "asc" | "desc".
/// A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
@@ -2924,7 +2980,7 @@ internal virtual async Task InternalGetRunStepsAsync(string threadId,
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- internal virtual Response InternalGetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestContext context)
+ internal virtual Response InternalGetRunSteps(string threadId, string runId, IEnumerable include, int? limit, string order, string after, string before, RequestContext context)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNullOrEmpty(runId, nameof(runId));
@@ -2933,7 +2989,7 @@ internal virtual Response InternalGetRunSteps(string threadId, string runId, int
scope.Start();
try
{
- using HttpMessage message = CreateInternalGetRunStepsRequest(threadId, runId, limit, order, after, before, context);
+ using HttpMessage message = CreateInternalGetRunStepsRequest(threadId, runId, include, limit, order, after, before, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -5267,7 +5323,7 @@ internal HttpMessage CreateUpdateMessageRequest(string threadId, string messageI
return message;
}
- internal HttpMessage CreateCreateRunRequest(string threadId, RequestContent content, RequestContext context)
+ internal HttpMessage CreateCreateRunRequest(string threadId, RequestContent content, IEnumerable include, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
@@ -5284,6 +5340,10 @@ internal HttpMessage CreateCreateRunRequest(string threadId, RequestContent cont
uri.AppendPath(threadId, true);
uri.AppendPath("/runs", false);
uri.AppendQuery("api-version", _apiVersion, true);
+ if (include != null && !(include is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined))
+ {
+ uri.AppendQueryDelimited("include[]", include, ",", true);
+ }
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -5449,7 +5509,7 @@ internal HttpMessage CreateCreateThreadAndRunRequest(RequestContent content, Req
return message;
}
- internal HttpMessage CreateGetRunStepRequest(string threadId, string runId, string stepId, RequestContext context)
+ internal HttpMessage CreateGetRunStepRequest(string threadId, string runId, string stepId, IEnumerable include, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
@@ -5469,12 +5529,16 @@ internal HttpMessage CreateGetRunStepRequest(string threadId, string runId, stri
uri.AppendPath("/steps/", false);
uri.AppendPath(stepId, true);
uri.AppendQuery("api-version", _apiVersion, true);
+ if (include != null && !(include is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined))
+ {
+ uri.AppendQueryDelimited("include[]", include, ",", true);
+ }
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
- internal HttpMessage CreateInternalGetRunStepsRequest(string threadId, string runId, int? limit, string order, string after, string before, RequestContext context)
+ internal HttpMessage CreateInternalGetRunStepsRequest(string threadId, string runId, IEnumerable include, int? limit, string order, string after, string before, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
@@ -5493,6 +5557,10 @@ internal HttpMessage CreateInternalGetRunStepsRequest(string threadId, string ru
uri.AppendPath(runId, true);
uri.AppendPath("/steps", false);
uri.AppendQuery("api-version", _apiVersion, true);
+ if (include != null && !(include is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined))
+ {
+ uri.AppendQueryDelimited("include[]", include, ",", true);
+ }
if (limit != null)
{
uri.AppendQuery("limit", limit.Value, true);
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.Serialization.cs
new file mode 100644
index 000000000000..a4debebae798
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.Serialization.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class AzureFunctionBinding : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ writer.WritePropertyName("storage_queue"u8);
+ writer.WriteObjectValue(StorageQueue, options);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ AzureFunctionBinding IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAzureFunctionBinding(document.RootElement, options);
+ }
+
+ internal static AzureFunctionBinding DeserializeAzureFunctionBinding(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ AzureFunctionBindingType type = default;
+ AzureFunctionStorageQueue storageQueue = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = new AzureFunctionBindingType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("storage_queue"u8))
+ {
+ storageQueue = AzureFunctionStorageQueue.DeserializeAzureFunctionStorageQueue(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AzureFunctionBinding(type, storageQueue, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AzureFunctionBinding IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAzureFunctionBinding(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AzureFunctionBinding)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AzureFunctionBinding FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAzureFunctionBinding(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.cs
new file mode 100644
index 000000000000..86898f39d812
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBinding.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// The structure for keeping storage queue name and URI.
+ public partial class AzureFunctionBinding
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// Storage queue.
+ /// is null.
+ public AzureFunctionBinding(AzureFunctionStorageQueue storageQueue)
+ {
+ Argument.AssertNotNull(storageQueue, nameof(storageQueue));
+
+ StorageQueue = storageQueue;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of binding, which is always 'storage_queue'.
+ /// Storage queue.
+ /// Keeps track of any properties unknown to the library.
+ internal AzureFunctionBinding(AzureFunctionBindingType type, AzureFunctionStorageQueue storageQueue, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ StorageQueue = storageQueue;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AzureFunctionBinding()
+ {
+ }
+
+ /// The type of binding, which is always 'storage_queue'.
+ public AzureFunctionBindingType Type { get; } = AzureFunctionBindingType.StorageQueue;
+
+ /// Storage queue.
+ public AzureFunctionStorageQueue StorageQueue { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBindingType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBindingType.cs
new file mode 100644
index 000000000000..d3ef7652d782
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionBindingType.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.AI.Projects
+{
+ /// The AzureFunctionBinding_type.
+ public readonly partial struct AzureFunctionBindingType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AzureFunctionBindingType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string StorageQueueValue = "storage_queue";
+
+ /// storage_queue.
+ public static AzureFunctionBindingType StorageQueue { get; } = new AzureFunctionBindingType(StorageQueueValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AzureFunctionBindingType left, AzureFunctionBindingType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AzureFunctionBindingType left, AzureFunctionBindingType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator AzureFunctionBindingType(string value) => new AzureFunctionBindingType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AzureFunctionBindingType other && Equals(other);
+ ///
+ public bool Equals(AzureFunctionBindingType 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/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.Serialization.cs
new file mode 100644
index 000000000000..1965136e4c3d
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.Serialization.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class AzureFunctionStorageQueue : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("queue_service_endpoint"u8);
+ writer.WriteStringValue(StorageServiceEndpoint);
+ writer.WritePropertyName("queue_name"u8);
+ writer.WriteStringValue(QueueName);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ AzureFunctionStorageQueue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAzureFunctionStorageQueue(document.RootElement, options);
+ }
+
+ internal static AzureFunctionStorageQueue DeserializeAzureFunctionStorageQueue(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string queueServiceEndpoint = default;
+ string queueName = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("queue_service_endpoint"u8))
+ {
+ queueServiceEndpoint = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("queue_name"u8))
+ {
+ queueName = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AzureFunctionStorageQueue(queueServiceEndpoint, queueName, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AzureFunctionStorageQueue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAzureFunctionStorageQueue(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AzureFunctionStorageQueue)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AzureFunctionStorageQueue FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAzureFunctionStorageQueue(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs
new file mode 100644
index 000000000000..1782ede5ac86
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// The structure for keeping storage queue name and URI.
+ public partial class AzureFunctionStorageQueue
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// URI to the Azure Storage Queue service allowing you to manipulate a queue.
+ /// The name of an Azure function storage queue.
+ /// or is null.
+ public AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName)
+ {
+ Argument.AssertNotNull(storageServiceEndpoint, nameof(storageServiceEndpoint));
+ Argument.AssertNotNull(queueName, nameof(queueName));
+
+ StorageServiceEndpoint = storageServiceEndpoint;
+ QueueName = queueName;
+ }
+
+ /// Initializes a new instance of .
+ /// URI to the Azure Storage Queue service allowing you to manipulate a queue.
+ /// The name of an Azure function storage queue.
+ /// Keeps track of any properties unknown to the library.
+ internal AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName, IDictionary serializedAdditionalRawData)
+ {
+ StorageServiceEndpoint = storageServiceEndpoint;
+ QueueName = queueName;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AzureFunctionStorageQueue()
+ {
+ }
+
+ /// URI to the Azure Storage Queue service allowing you to manipulate a queue.
+ public string StorageServiceEndpoint { get; set; }
+ /// The name of an Azure function storage queue.
+ public string QueueName { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.Serialization.cs
new file mode 100644
index 000000000000..c9e8e4dfddb4
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.Serialization.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class AzureFunctionToolDefinition : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("azure_function"u8);
+ writer.WriteObjectValue(InternalAzureFunction, options);
+ }
+
+ AzureFunctionToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAzureFunctionToolDefinition(document.RootElement, options);
+ }
+
+ internal static AzureFunctionToolDefinition DeserializeAzureFunctionToolDefinition(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ InternalAzureFunctionDefinition azureFunction = default;
+ string type = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("azure_function"u8))
+ {
+ azureFunction = InternalAzureFunctionDefinition.DeserializeInternalAzureFunctionDefinition(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AzureFunctionToolDefinition(type, serializedAdditionalRawData, azureFunction);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AzureFunctionToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeAzureFunctionToolDefinition(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AzureFunctionToolDefinition)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new AzureFunctionToolDefinition FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeAzureFunctionToolDefinition(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.cs
new file mode 100644
index 000000000000..0400d1a83dca
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionToolDefinition.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// The input definition information for a azure function tool as used to configure an agent.
+ public partial class AzureFunctionToolDefinition : ToolDefinition
+ {
+ /// Initializes a new instance of .
+ /// The definition of the concrete function that the function tool should call.
+ /// is null.
+ public AzureFunctionToolDefinition(InternalAzureFunctionDefinition internalAzureFunction)
+ {
+ Argument.AssertNotNull(internalAzureFunction, nameof(internalAzureFunction));
+
+ Type = "azure_function";
+ InternalAzureFunction = internalAzureFunction;
+ }
+
+ /// Initializes a new instance of .
+ /// The object type.
+ /// Keeps track of any properties unknown to the library.
+ /// The definition of the concrete function that the function tool should call.
+ internal AzureFunctionToolDefinition(string type, IDictionary serializedAdditionalRawData, InternalAzureFunctionDefinition internalAzureFunction) : base(type, serializedAdditionalRawData)
+ {
+ InternalAzureFunction = internalAzureFunction;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AzureFunctionToolDefinition()
+ {
+ }
+
+ /// The definition of the concrete function that the function tool should call.
+ public InternalAzureFunctionDefinition InternalAzureFunction { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs
index 591b09e30792..9dda204238ad 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs
@@ -65,7 +65,7 @@ internal CreateAgentRequest(string model)
///
/// The collection of tools to enable for the new agent.
/// 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 .
///
///
/// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter`
@@ -115,7 +115,7 @@ internal CreateAgentRequest()
///
/// The collection of tools to enable for the new agent.
/// 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 IReadOnlyList Tools { get; }
///
@@ -156,6 +156,9 @@ internal CreateAgentRequest()
/// -
///
///
+ /// -
+ ///
+ ///
///
///
/// Examples:
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs
index 91cd817d3827..bde5271e3de4 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.Serialization.cs
@@ -209,6 +209,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
writer.WriteNull("response_format");
}
}
+ if (Optional.IsDefined(ParallelToolCalls))
+ {
+ writer.WritePropertyName("parallel_tool_calls"u8);
+ writer.WriteBooleanValue(ParallelToolCalls.Value);
+ }
if (Optional.IsCollectionDefined(Metadata))
{
if (Metadata != null)
@@ -278,6 +283,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element
TruncationObject truncationStrategy = default;
BinaryData toolChoice = default;
BinaryData responseFormat = default;
+ bool? parallelToolCalls = default;
IReadOnlyDictionary metadata = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
@@ -425,6 +431,15 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element
responseFormat = BinaryData.FromString(property.Value.GetRawText());
continue;
}
+ if (property.NameEquals("parallel_tool_calls"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ parallelToolCalls = property.Value.GetBoolean();
+ continue;
+ }
if (property.NameEquals("metadata"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -460,6 +475,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
serializedAdditionalRawData);
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs
index f3f8b30781b3..9b9969dd27eb 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs
@@ -70,7 +70,7 @@ internal CreateRunRequest(string assistantId)
///
/// The overridden list of enabled tools that the agent should use to run the thread.
/// 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 .
///
///
/// If `true`, returns a stream of events that happen during the Run as server-sent events,
@@ -100,9 +100,10 @@ internal CreateRunRequest(string assistantId)
/// The strategy to use for dropping messages as the context windows moves forward.
/// Controls whether or not and which tool is called by the model.
/// Specifies the format that the model must output.
+ /// If `true` functions will run in parallel during tool use.
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
/// Keeps track of any properties unknown to the library.
- internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData)
+ internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData)
{
AssistantId = assistantId;
OverrideModelName = overrideModelName;
@@ -118,6 +119,7 @@ internal CreateRunRequest(string assistantId, string overrideModelName, string o
TruncationStrategy = truncationStrategy;
ToolChoice = toolChoice;
ResponseFormat = responseFormat;
+ ParallelToolCalls = parallelToolCalls;
Metadata = metadata;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
@@ -143,7 +145,7 @@ internal CreateRunRequest()
///
/// The overridden list of enabled tools that the agent should use to run the thread.
/// 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 IReadOnlyList OverrideTools { get; }
///
@@ -244,6 +246,9 @@ internal CreateRunRequest()
/// -
///
///
+ /// -
+ ///
+ ///
///
///
/// Examples:
@@ -268,6 +273,8 @@ internal CreateRunRequest()
///
///
public BinaryData ResponseFormat { get; }
+ /// If `true` functions will run in parallel during tool use.
+ public bool? ParallelToolCalls { get; }
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
public IReadOnlyDictionary Metadata { get; }
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs
index 10ad472113df..0af226f2493c 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.Serialization.cs
@@ -197,6 +197,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
writer.WriteNull("response_format");
}
}
+ if (Optional.IsDefined(ParallelToolCalls))
+ {
+ writer.WritePropertyName("parallel_tool_calls"u8);
+ writer.WriteBooleanValue(ParallelToolCalls.Value);
+ }
if (Optional.IsCollectionDefined(Metadata))
{
if (Metadata != null)
@@ -266,6 +271,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J
TruncationObject truncationStrategy = default;
BinaryData toolChoice = default;
BinaryData responseFormat = default;
+ bool? parallelToolCalls = default;
IReadOnlyDictionary metadata = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
@@ -408,6 +414,15 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J
responseFormat = BinaryData.FromString(property.Value.GetRawText());
continue;
}
+ if (property.NameEquals("parallel_tool_calls"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ parallelToolCalls = property.Value.GetBoolean();
+ continue;
+ }
if (property.NameEquals("metadata"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@@ -443,6 +458,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
serializedAdditionalRawData);
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs
index d234f56a46c8..58bc40b50d21 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs
@@ -65,7 +65,7 @@ internal CreateThreadAndRunRequest(string assistantId)
///
/// The overridden list of enabled tools the agent should use to run the thread.
/// 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 .
///
/// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis.
///
@@ -96,9 +96,10 @@ internal CreateThreadAndRunRequest(string assistantId)
/// The strategy to use for dropping messages as the context windows moves forward.
/// Controls whether or not and which tool is called by the model.
/// Specifies the format that the model must output.
+ /// If `true` functions will run in parallel during tool use.
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
/// Keeps track of any properties unknown to the library.
- internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData)
+ internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData)
{
AssistantId = assistantId;
Thread = thread;
@@ -114,6 +115,7 @@ internal CreateThreadAndRunRequest(string assistantId, AgentThreadCreationOption
TruncationStrategy = truncationStrategy;
ToolChoice = toolChoice;
ResponseFormat = responseFormat;
+ ParallelToolCalls = parallelToolCalls;
Metadata = metadata;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
@@ -134,7 +136,7 @@ internal CreateThreadAndRunRequest()
///
/// The overridden list of enabled tools the agent should use to run the thread.
/// 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 IReadOnlyList OverrideTools { get; }
/// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis.
@@ -237,6 +239,9 @@ internal CreateThreadAndRunRequest()
/// -
///
///
+ /// -
+ ///
+ ///
///
///
/// Examples:
@@ -261,6 +266,8 @@ internal CreateThreadAndRunRequest()
///
///
public BinaryData ResponseFormat { get; }
+ /// If `true` functions will run in parallel during tool use.
+ public bool? ParallelToolCalls { get; }
/// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
public IReadOnlyDictionary Metadata { get; }
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs
index 173443bdd0bd..a5bb875ca420 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/Evaluation.cs
@@ -71,7 +71,7 @@ public Evaluation(InputData data, IDictionary ev
/// 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 .
///
- /// Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique.
+ /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique.
/// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
/// Metadata containing createdBy and modifiedBy information.
/// Status of the evaluation. It is set by service and is read-only.
@@ -106,7 +106,7 @@ internal Evaluation()
/// The available derived classes include and .
///
public InputData Data { get; set; }
- /// Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique.
+ /// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique.
public string DisplayName { get; set; }
/// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
public string Description { get; set; }
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs
index 2df054d1bb74..f577d7d06da6 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/EvaluationsClient.cs
@@ -42,10 +42,10 @@ protected EvaluationsClient()
/// The handler for diagnostic messaging in the client.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The token credential to copy.
- /// The Azure AI Studio project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
+ /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
/// The Azure subscription ID.
/// The name of the Azure Resource Group.
- /// The Azure AI Studio project name.
+ /// The Azure AI Foundry project name.
/// The API version to use for this operation.
internal EvaluationsClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName, string apiVersion)
{
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContent.Serialization.cs
new file mode 100644
index 000000000000..d4dd84071ff9
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContent.Serialization.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class FileSearchToolCallContent : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(FileSearchToolCallContent)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ writer.WritePropertyName("text"u8);
+ writer.WriteStringValue(Text);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ FileSearchToolCallContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(FileSearchToolCallContent)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeFileSearchToolCallContent(document.RootElement, options);
+ }
+
+ internal static FileSearchToolCallContent DeserializeFileSearchToolCallContent(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ FileSearchToolCallContentType type = default;
+ string text = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = new FileSearchToolCallContentType(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("text"u8))
+ {
+ text = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new FileSearchToolCallContent(type, text, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(FileSearchToolCallContent)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ FileSearchToolCallContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeFileSearchToolCallContent(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(FileSearchToolCallContent)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static FileSearchToolCallContent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeFileSearchToolCallContent(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContent.cs
new file mode 100644
index 000000000000..657101f969fe
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContent.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// The file search result content object.
+ public partial class FileSearchToolCallContent
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The text content of the file.
+ /// is null.
+ internal FileSearchToolCallContent(string text)
+ {
+ Argument.AssertNotNull(text, nameof(text));
+
+ Text = text;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of the content.
+ /// The text content of the file.
+ /// Keeps track of any properties unknown to the library.
+ internal FileSearchToolCallContent(FileSearchToolCallContentType type, string text, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ Text = text;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal FileSearchToolCallContent()
+ {
+ }
+
+ /// The type of the content.
+ public FileSearchToolCallContentType Type { get; } = FileSearchToolCallContentType.Text;
+
+ /// The text content of the file.
+ public string Text { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContentType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContentType.cs
new file mode 100644
index 000000000000..177f40ed440f
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolCallContentType.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.AI.Projects
+{
+ /// The FileSearchToolCallContent_type.
+ public readonly partial struct FileSearchToolCallContentType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public FileSearchToolCallContentType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string TextValue = "text";
+
+ /// text.
+ public static FileSearchToolCallContentType Text { get; } = new FileSearchToolCallContentType(TextValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(FileSearchToolCallContentType left, FileSearchToolCallContentType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(FileSearchToolCallContentType left, FileSearchToolCallContentType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator FileSearchToolCallContentType(string value) => new FileSearchToolCallContentType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is FileSearchToolCallContentType other && Equals(other);
+ ///
+ public bool Equals(FileSearchToolCallContentType 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/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.Serialization.cs
new file mode 100644
index 000000000000..1a3d51797196
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.Serialization.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ internal partial class InternalAzureFunctionDefinition : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("function"u8);
+ writer.WriteObjectValue(Function, options);
+ writer.WritePropertyName("input_binding"u8);
+ writer.WriteObjectValue(InputBinding, options);
+ writer.WritePropertyName("output_binding"u8);
+ writer.WriteObjectValue(OutputBinding, options);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ InternalAzureFunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeInternalAzureFunctionDefinition(document.RootElement, options);
+ }
+
+ internal static InternalAzureFunctionDefinition DeserializeInternalAzureFunctionDefinition(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ InternalFunctionDefinition function = default;
+ AzureFunctionBinding inputBinding = default;
+ AzureFunctionBinding outputBinding = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("function"u8))
+ {
+ function = InternalFunctionDefinition.DeserializeInternalFunctionDefinition(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("input_binding"u8))
+ {
+ inputBinding = AzureFunctionBinding.DeserializeAzureFunctionBinding(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("output_binding"u8))
+ {
+ outputBinding = AzureFunctionBinding.DeserializeAzureFunctionBinding(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new InternalAzureFunctionDefinition(function, inputBinding, outputBinding, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ InternalAzureFunctionDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeInternalAzureFunctionDefinition(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(InternalAzureFunctionDefinition)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static InternalAzureFunctionDefinition FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeInternalAzureFunctionDefinition(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.cs
new file mode 100644
index 000000000000..f566ee9d15b9
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/InternalAzureFunctionDefinition.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// The definition of Azure function.
+ internal partial class InternalAzureFunctionDefinition
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The definition of azure function and its parameters.
+ /// Input storage queue. The queue storage trigger runs a function as messages are added to it.
+ /// Output storage queue. The function writes output to this queue when the input items are processed.
+ /// , or is null.
+ public InternalAzureFunctionDefinition(InternalFunctionDefinition function, AzureFunctionBinding inputBinding, AzureFunctionBinding outputBinding)
+ {
+ Argument.AssertNotNull(function, nameof(function));
+ Argument.AssertNotNull(inputBinding, nameof(inputBinding));
+ Argument.AssertNotNull(outputBinding, nameof(outputBinding));
+
+ Function = function;
+ InputBinding = inputBinding;
+ OutputBinding = outputBinding;
+ }
+
+ /// Initializes a new instance of .
+ /// The definition of azure function and its parameters.
+ /// Input storage queue. The queue storage trigger runs a function as messages are added to it.
+ /// Output storage queue. The function writes output to this queue when the input items are processed.
+ /// Keeps track of any properties unknown to the library.
+ internal InternalAzureFunctionDefinition(InternalFunctionDefinition function, AzureFunctionBinding inputBinding, AzureFunctionBinding outputBinding, IDictionary serializedAdditionalRawData)
+ {
+ Function = function;
+ InputBinding = inputBinding;
+ OutputBinding = outputBinding;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal InternalAzureFunctionDefinition()
+ {
+ }
+
+ /// The definition of azure function and its parameters.
+ public InternalFunctionDefinition Function { get; set; }
+ /// Input storage queue. The queue storage trigger runs a function as messages are added to it.
+ public AzureFunctionBinding InputBinding { get; set; }
+ /// Output storage queue. The function writes output to this queue when the input items are processed.
+ public AzureFunctionBinding OutputBinding { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs
index 124ba52d97e1..9a3751e9f5ea 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.Serialization.cs
@@ -39,15 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
writer.WritePropertyName("file_id"u8);
writer.WriteStringValue(FileId);
}
- if (Optional.IsCollectionDefined(DataSources))
+ if (Optional.IsDefined(DataSource))
{
- writer.WritePropertyName("data_sources"u8);
- writer.WriteStartArray();
- foreach (var item in DataSources)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
+ writer.WritePropertyName("data_source"u8);
+ writer.WriteObjectValue(DataSource, options);
}
writer.WritePropertyName("tools"u8);
writer.WriteStartArray();
@@ -106,7 +101,7 @@ internal static MessageAttachment DeserializeMessageAttachment(JsonElement eleme
return null;
}
string fileId = default;
- IList dataSources = default;
+ VectorStoreDataSource dataSource = default;
IList tools = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
@@ -117,18 +112,13 @@ internal static MessageAttachment DeserializeMessageAttachment(JsonElement eleme
fileId = property.Value.GetString();
continue;
}
- if (property.NameEquals("data_sources"u8))
+ if (property.NameEquals("data_source"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
- {
- array.Add(VectorStoreDataSource.DeserializeVectorStoreDataSource(item, options));
- }
- dataSources = array;
+ dataSource = VectorStoreDataSource.DeserializeVectorStoreDataSource(property.Value, options);
continue;
}
if (property.NameEquals("tools"u8))
@@ -154,7 +144,7 @@ internal static MessageAttachment DeserializeMessageAttachment(JsonElement eleme
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new MessageAttachment(fileId, dataSources ?? new ChangeTrackingList(), tools, serializedAdditionalRawData);
+ return new MessageAttachment(fileId, dataSource, tools, serializedAdditionalRawData);
}
BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs
index 0aab327fa3db..be25230a7c4c 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/MessageAttachment.cs
@@ -53,19 +53,18 @@ public MessageAttachment(IEnumerable tools)
{
Argument.AssertNotNull(tools, nameof(tools));
- DataSources = new ChangeTrackingList();
Tools = tools.ToList();
}
/// Initializes a new instance of .
/// The ID of the file to attach to the message.
- /// Azure asset ID.
+ /// Azure asset ID.
/// The tools to add to this file.
/// Keeps track of any properties unknown to the library.
- internal MessageAttachment(string fileId, IList dataSources, IList tools, IDictionary serializedAdditionalRawData)
+ internal MessageAttachment(string fileId, VectorStoreDataSource dataSource, IList tools, IDictionary serializedAdditionalRawData)
{
FileId = fileId;
- DataSources = dataSources;
+ DataSource = dataSource;
Tools = tools;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
@@ -78,7 +77,7 @@ internal MessageAttachment()
/// The ID of the file to attach to the message.
public string FileId { get; set; }
/// Azure asset ID.
- public IList DataSources { get; }
+ public VectorStoreDataSource DataSource { get; set; }
///
/// The tools to add to this file.
///
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.Serialization.cs
new file mode 100644
index 000000000000..e2b9cdf54847
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.Serialization.cs
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class OpenApiAnonymousAuthDetails : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ }
+
+ OpenApiAnonymousAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiAnonymousAuthDetails(document.RootElement, options);
+ }
+
+ internal static OpenApiAnonymousAuthDetails DeserializeOpenApiAnonymousAuthDetails(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ OpenApiAuthType type = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = new OpenApiAuthType(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new OpenApiAnonymousAuthDetails(type, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiAnonymousAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeOpenApiAnonymousAuthDetails(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiAnonymousAuthDetails)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new OpenApiAnonymousAuthDetails FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiAnonymousAuthDetails(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.cs
new file mode 100644
index 000000000000..5a86750c6c95
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAnonymousAuthDetails.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// Security details for OpenApi anonymous authentication.
+ public partial class OpenApiAnonymousAuthDetails : OpenApiAuthDetails
+ {
+ /// Initializes a new instance of .
+ public OpenApiAnonymousAuthDetails()
+ {
+ Type = OpenApiAuthType.Anonymous;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of authentication, must be anonymous/connection/managed_identity.
+ /// Keeps track of any properties unknown to the library.
+ internal OpenApiAnonymousAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData)
+ {
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.Serialization.cs
new file mode 100644
index 000000000000..8d9043b1b4ba
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.Serialization.cs
@@ -0,0 +1,135 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ [PersistableModelProxy(typeof(UnknownOpenApiAuthDetails))]
+ public partial class OpenApiAuthDetails : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ OpenApiAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiAuthDetails(document.RootElement, options);
+ }
+
+ internal static OpenApiAuthDetails DeserializeOpenApiAuthDetails(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "anonymous": return OpenApiAnonymousAuthDetails.DeserializeOpenApiAnonymousAuthDetails(element, options);
+ case "connection": return OpenApiConnectionAuthDetails.DeserializeOpenApiConnectionAuthDetails(element, options);
+ case "managed_identity": return OpenApiManagedAuthDetails.DeserializeOpenApiManagedAuthDetails(element, options);
+ }
+ }
+ return UnknownOpenApiAuthDetails.DeserializeUnknownOpenApiAuthDetails(element, options);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeOpenApiAuthDetails(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiAuthDetails)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static OpenApiAuthDetails FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiAuthDetails(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.cs
new file mode 100644
index 000000000000..596d594a2488
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthDetails.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ ///
+ /// authentication details for OpenApiFunctionDefinition
+ /// 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 OpenApiAuthDetails
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected OpenApiAuthDetails()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The type of authentication, must be anonymous/connection/managed_identity.
+ /// Keeps track of any properties unknown to the library.
+ internal OpenApiAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The type of authentication, must be anonymous/connection/managed_identity.
+ internal OpenApiAuthType Type { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs
new file mode 100644
index 000000000000..230257cdbd7b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects
+{
+ ///
+ /// Authentication type for OpenApi endpoint. Allowed types are:
+ /// - Anonymous (no authentication required)
+ /// - Connection (requires connection_id to endpoint, as setup in AI Foundry)
+ /// - Managed_Identity (requires audience for identity based auth)
+ ///
+ internal readonly partial struct OpenApiAuthType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public OpenApiAuthType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string AnonymousValue = "anonymous";
+ private const string ConnectionValue = "connection";
+ private const string ManagedIdentityValue = "managed_identity";
+
+ /// anonymous.
+ public static OpenApiAuthType Anonymous { get; } = new OpenApiAuthType(AnonymousValue);
+ /// connection.
+ public static OpenApiAuthType Connection { get; } = new OpenApiAuthType(ConnectionValue);
+ /// managed_identity.
+ public static OpenApiAuthType ManagedIdentity { get; } = new OpenApiAuthType(ManagedIdentityValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(OpenApiAuthType left, OpenApiAuthType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(OpenApiAuthType left, OpenApiAuthType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator OpenApiAuthType(string value) => new OpenApiAuthType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is OpenApiAuthType other && Equals(other);
+ ///
+ public bool Equals(OpenApiAuthType 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/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.Serialization.cs
new file mode 100644
index 000000000000..3594791bd427
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.Serialization.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class OpenApiConnectionAuthDetails : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("security_scheme"u8);
+ writer.WriteObjectValue(SecurityScheme, options);
+ }
+
+ OpenApiConnectionAuthDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiConnectionAuthDetails(document.RootElement, options);
+ }
+
+ internal static OpenApiConnectionAuthDetails DeserializeOpenApiConnectionAuthDetails(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ OpenApiConnectionSecurityScheme securityScheme = default;
+ OpenApiAuthType type = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("security_scheme"u8))
+ {
+ securityScheme = OpenApiConnectionSecurityScheme.DeserializeOpenApiConnectionSecurityScheme(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new OpenApiAuthType(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new OpenApiConnectionAuthDetails(type, serializedAdditionalRawData, securityScheme);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiConnectionAuthDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeOpenApiConnectionAuthDetails(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiConnectionAuthDetails)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new OpenApiConnectionAuthDetails FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiConnectionAuthDetails(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.cs
new file mode 100644
index 000000000000..8c2771c0f3b9
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionAuthDetails.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// Security details for OpenApi connection authentication.
+ public partial class OpenApiConnectionAuthDetails : OpenApiAuthDetails
+ {
+ /// Initializes a new instance of .
+ /// Connection auth security details.
+ /// is null.
+ public OpenApiConnectionAuthDetails(OpenApiConnectionSecurityScheme securityScheme)
+ {
+ Argument.AssertNotNull(securityScheme, nameof(securityScheme));
+
+ Type = OpenApiAuthType.Connection;
+ SecurityScheme = securityScheme;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of authentication, must be anonymous/connection/managed_identity.
+ /// Keeps track of any properties unknown to the library.
+ /// Connection auth security details.
+ internal OpenApiConnectionAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData, OpenApiConnectionSecurityScheme securityScheme) : base(type, serializedAdditionalRawData)
+ {
+ SecurityScheme = securityScheme;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal OpenApiConnectionAuthDetails()
+ {
+ }
+
+ /// Connection auth security details.
+ public OpenApiConnectionSecurityScheme SecurityScheme { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.Serialization.cs
new file mode 100644
index 000000000000..3587020a8867
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.Serialization.cs
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class OpenApiConnectionSecurityScheme : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("connection_id"u8);
+ writer.WriteStringValue(ConnectionId);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ OpenApiConnectionSecurityScheme IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiConnectionSecurityScheme(document.RootElement, options);
+ }
+
+ internal static OpenApiConnectionSecurityScheme DeserializeOpenApiConnectionSecurityScheme(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string connectionId = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("connection_id"u8))
+ {
+ connectionId = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new OpenApiConnectionSecurityScheme(connectionId, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiConnectionSecurityScheme IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeOpenApiConnectionSecurityScheme(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiConnectionSecurityScheme)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static OpenApiConnectionSecurityScheme FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiConnectionSecurityScheme(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.cs
new file mode 100644
index 000000000000..d74d1bae8a27
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiConnectionSecurityScheme.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// Security scheme for OpenApi managed_identity authentication.
+ public partial class OpenApiConnectionSecurityScheme
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// Connection id for Connection auth type.
+ /// is null.
+ public OpenApiConnectionSecurityScheme(string connectionId)
+ {
+ Argument.AssertNotNull(connectionId, nameof(connectionId));
+
+ ConnectionId = connectionId;
+ }
+
+ /// Initializes a new instance of .
+ /// Connection id for Connection auth type.
+ /// Keeps track of any properties unknown to the library.
+ internal OpenApiConnectionSecurityScheme(string connectionId, IDictionary serializedAdditionalRawData)
+ {
+ ConnectionId = connectionId;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal OpenApiConnectionSecurityScheme()
+ {
+ }
+
+ /// Connection id for Connection auth type.
+ public string ConnectionId { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.Serialization.cs
new file mode 100644
index 000000000000..52bd220dc908
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.Serialization.cs
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects
+{
+ public partial class OpenApiFunctionDefinition : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ writer.WritePropertyName("spec"u8);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(Spec);
+#else
+ using (JsonDocument document = JsonDocument.Parse(Spec))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ writer.WritePropertyName("auth"u8);
+ writer.WriteObjectValue(Auth, options);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ OpenApiFunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiFunctionDefinition(document.RootElement, options);
+ }
+
+ internal static OpenApiFunctionDefinition DeserializeOpenApiFunctionDefinition(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string name = default;
+ string description = default;
+ BinaryData spec = default;
+ OpenApiAuthDetails auth = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("spec"u8))
+ {
+ spec = BinaryData.FromString(property.Value.GetRawText());
+ continue;
+ }
+ if (property.NameEquals("auth"u8))
+ {
+ auth = OpenApiAuthDetails.DeserializeOpenApiAuthDetails(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new OpenApiFunctionDefinition(name, description, spec, auth, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiFunctionDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeOpenApiFunctionDefinition(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiFunctionDefinition)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static OpenApiFunctionDefinition FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiFunctionDefinition(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.cs
new file mode 100644
index 000000000000..8980b1cfe70e
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiFunctionDefinition.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// The input definition information for an openapi function.
+ public partial class OpenApiFunctionDefinition
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The name of the function to be called.
+ /// The openapi function shape, described as a JSON Schema object.
+ ///
+ /// Open API authentication details
+ /// 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 OpenApiFunctionDefinition(string name, BinaryData spec, OpenApiAuthDetails auth)
+ {
+ Argument.AssertNotNull(name, nameof(name));
+ Argument.AssertNotNull(spec, nameof(spec));
+ Argument.AssertNotNull(auth, nameof(auth));
+
+ Name = name;
+ Spec = spec;
+ Auth = auth;
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the function to be called.
+ /// A description of what the function does, used by the model to choose when and how to call the function.
+ /// The openapi function shape, described as a JSON Schema object.
+ ///
+ /// Open API authentication details
+ /// 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 .
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal OpenApiFunctionDefinition(string name, string description, BinaryData spec, OpenApiAuthDetails auth, IDictionary serializedAdditionalRawData)
+ {
+ Name = name;
+ Description = description;
+ Spec = spec;
+ Auth = auth;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal OpenApiFunctionDefinition()
+ {
+ }
+
+ /// The name of the function to be called.
+ public string Name { get; set; }
+ /// A description of what the function does, used by the model to choose when and how to call the function.
+ public string Description { get; set; }
+ ///
+ /// The openapi function shape, described as a JSON Schema object.
+ ///
+ /// To assign an object to this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ ///