diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs
index 394ba7cc4b5a..e7dcf6b9822d 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; }
///
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/AgentsClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs
index 6d8476ffe785..03f27eba3f54 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsClient.cs
@@ -1706,11 +1706,12 @@ 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.
/// 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, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNull(assistantId, nameof(assistantId));
@@ -1730,6 +1731,7 @@ public virtual async Task> CreateRunAsync(string threadId, s
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
@@ -1776,11 +1778,12 @@ 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.
/// 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, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
Argument.AssertNotNull(assistantId, nameof(assistantId));
@@ -1800,6 +1803,7 @@ public virtual Response CreateRun(string threadId, string assistantId
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
@@ -1817,7 +1821,7 @@ 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.
///
///
///
@@ -1858,7 +1862,7 @@ 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.
///
///
///
@@ -2522,10 +2526,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 +2549,7 @@ public virtual async Task> CreateThreadAndRunAsync(string as
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
@@ -2586,10 +2592,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 +2615,7 @@ public virtual Response CreateThreadAndRun(string assistantId, AgentT
truncationStrategy,
toolChoice,
responseFormat,
+ parallelToolCalls,
metadata ?? new ChangeTrackingDictionary(),
null);
RequestContext context = FromCancellationToken(cancellationToken);
@@ -2625,7 +2633,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 +2671,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.
///
///
///
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs
index 591b09e30792..3196dbf045ad 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; }
///
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..705463fe6c35 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; }
///
@@ -268,6 +270,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..fe74938b4393 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.
@@ -261,6 +263,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/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..552622c70847
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiAuthType.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects
+{
+ /// Type of chunking strategy.
+ 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:
+ ///
+ /// -
+ /// 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" }.
+ ///
+ ///
+ ///
+ ///
+ public BinaryData Spec { get; set; }
+ ///
+ /// 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 .
+ ///
+ public OpenApiAuthDetails Auth { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.Serialization.cs
new file mode 100644
index 000000000000..6f05aaf2f05c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.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 OpenApiManagedAuthDetails : 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(OpenApiManagedAuthDetails)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("security_scheme"u8);
+ writer.WriteObjectValue(SecurityScheme, options);
+ }
+
+ OpenApiManagedAuthDetails 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(OpenApiManagedAuthDetails)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiManagedAuthDetails(document.RootElement, options);
+ }
+
+ internal static OpenApiManagedAuthDetails DeserializeOpenApiManagedAuthDetails(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ OpenApiManagedSecurityScheme 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 = OpenApiManagedSecurityScheme.DeserializeOpenApiManagedSecurityScheme(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 OpenApiManagedAuthDetails(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(OpenApiManagedAuthDetails)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiManagedAuthDetails 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 DeserializeOpenApiManagedAuthDetails(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiManagedAuthDetails)} 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 OpenApiManagedAuthDetails FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiManagedAuthDetails(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/OpenApiManagedAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.cs
new file mode 100644
index 000000000000..9a51a510225c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedAuthDetails.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 managed_identity authentication.
+ public partial class OpenApiManagedAuthDetails : OpenApiAuthDetails
+ {
+ /// Initializes a new instance of .
+ /// Connection auth security details.
+ /// is null.
+ public OpenApiManagedAuthDetails(OpenApiManagedSecurityScheme securityScheme)
+ {
+ Argument.AssertNotNull(securityScheme, nameof(securityScheme));
+
+ Type = OpenApiAuthType.ManagedIdentity;
+ 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 OpenApiManagedAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData, OpenApiManagedSecurityScheme securityScheme) : base(type, serializedAdditionalRawData)
+ {
+ SecurityScheme = securityScheme;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal OpenApiManagedAuthDetails()
+ {
+ }
+
+ /// Connection auth security details.
+ public OpenApiManagedSecurityScheme SecurityScheme { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.Serialization.cs
new file mode 100644
index 000000000000..61a1375c0007
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.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 OpenApiManagedSecurityScheme : 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(OpenApiManagedSecurityScheme)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("audience"u8);
+ writer.WriteStringValue(Audience);
+ 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
+ }
+ }
+ }
+
+ OpenApiManagedSecurityScheme 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(OpenApiManagedSecurityScheme)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiManagedSecurityScheme(document.RootElement, options);
+ }
+
+ internal static OpenApiManagedSecurityScheme DeserializeOpenApiManagedSecurityScheme(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string audience = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("audience"u8))
+ {
+ audience = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new OpenApiManagedSecurityScheme(audience, 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(OpenApiManagedSecurityScheme)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiManagedSecurityScheme 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 DeserializeOpenApiManagedSecurityScheme(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiManagedSecurityScheme)} 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 OpenApiManagedSecurityScheme FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiManagedSecurityScheme(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/OpenApiManagedSecurityScheme.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.cs
new file mode 100644
index 000000000000..e1c3d9970098
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiManagedSecurityScheme.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 OpenApiManagedSecurityScheme
+ {
+ ///
+ /// 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 .
+ /// Authentication scope for managed_identity auth type.
+ /// is null.
+ public OpenApiManagedSecurityScheme(string audience)
+ {
+ Argument.AssertNotNull(audience, nameof(audience));
+
+ Audience = audience;
+ }
+
+ /// Initializes a new instance of .
+ /// Authentication scope for managed_identity auth type.
+ /// Keeps track of any properties unknown to the library.
+ internal OpenApiManagedSecurityScheme(string audience, IDictionary serializedAdditionalRawData)
+ {
+ Audience = audience;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal OpenApiManagedSecurityScheme()
+ {
+ }
+
+ /// Authentication scope for managed_identity auth type.
+ public string Audience { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.Serialization.cs
new file mode 100644
index 000000000000..bd31655d48ab
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.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 OpenApiToolDefinition : 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(OpenApiToolDefinition)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("openapi"u8);
+ writer.WriteObjectValue(Openapi, options);
+ }
+
+ OpenApiToolDefinition 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(OpenApiToolDefinition)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeOpenApiToolDefinition(document.RootElement, options);
+ }
+
+ internal static OpenApiToolDefinition DeserializeOpenApiToolDefinition(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ OpenApiFunctionDefinition openapi = default;
+ string type = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("openapi"u8))
+ {
+ openapi = OpenApiFunctionDefinition.DeserializeOpenApiFunctionDefinition(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 OpenApiToolDefinition(type, serializedAdditionalRawData, openapi);
+ }
+
+ 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(OpenApiToolDefinition)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ OpenApiToolDefinition 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 DeserializeOpenApiToolDefinition(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(OpenApiToolDefinition)} 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 OpenApiToolDefinition FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeOpenApiToolDefinition(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/OpenApiToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.cs
new file mode 100644
index 000000000000..f56708e3d6e5
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/OpenApiToolDefinition.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 an OpenAPI tool as used to configure an agent.
+ public partial class OpenApiToolDefinition : ToolDefinition
+ {
+ /// Initializes a new instance of .
+ /// The openapi function definition.
+ /// is null.
+ public OpenApiToolDefinition(OpenApiFunctionDefinition openapi)
+ {
+ Argument.AssertNotNull(openapi, nameof(openapi));
+
+ Type = "openapi";
+ Openapi = openapi;
+ }
+
+ /// Initializes a new instance of .
+ /// The object type.
+ /// Keeps track of any properties unknown to the library.
+ /// The openapi function definition.
+ internal OpenApiToolDefinition(string type, IDictionary serializedAdditionalRawData, OpenApiFunctionDefinition openapi) : base(type, serializedAdditionalRawData)
+ {
+ Openapi = openapi;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal OpenApiToolDefinition()
+ {
+ }
+
+ /// The openapi function definition.
+ public OpenApiFunctionDefinition Openapi { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs
index 630d33f59e66..b3fd0dcab2ef 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs
@@ -43,7 +43,7 @@ public RunStreamEvent(string value)
public static RunStreamEvent ThreadRunRequiresAction { get; } = new RunStreamEvent(ThreadRunRequiresActionValue);
/// Event sent when a run is completed. The data of this event is of type ThreadRun.
public static RunStreamEvent ThreadRunCompleted { get; } = new RunStreamEvent(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 RunStreamEvent ThreadRunIncomplete { get; } = new RunStreamEvent(ThreadRunIncompleteValue);
/// Event sent when a run fails. The data of this event is of type ThreadRun.
public static RunStreamEvent ThreadRunFailed { get; } = new RunStreamEvent(ThreadRunFailedValue);
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs
index 3319be0f6b35..46c6f4a2e3f7 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs
@@ -251,11 +251,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
writer.WriteNull("tool_resources");
}
}
- if (Optional.IsDefined(ParallelToolCalls))
- {
- writer.WritePropertyName("parallelToolCalls"u8);
- writer.WriteBooleanValue(ParallelToolCalls.Value);
- }
+ writer.WritePropertyName("parallel_tool_calls"u8);
+ writer.WriteBooleanValue(ParallelToolCalls);
if (options.Format != "W" && _serializedAdditionalRawData != null)
{
foreach (var item in _serializedAdditionalRawData)
@@ -320,7 +317,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW
BinaryData responseFormat = default;
IReadOnlyDictionary metadata = default;
UpdateToolResourcesOptions toolResources = default;
- bool? parallelToolCalls = default;
+ bool parallelToolCalls = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
@@ -535,12 +532,8 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW
toolResources = UpdateToolResourcesOptions.DeserializeUpdateToolResourcesOptions(property.Value, options);
continue;
}
- if (property.NameEquals("parallelToolCalls"u8))
+ if (property.NameEquals("parallel_tool_calls"u8))
{
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
parallelToolCalls = property.Value.GetBoolean();
continue;
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs
index f60b310b3bcb..562268d2e6a8 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs
@@ -57,7 +57,7 @@ public partial class ThreadRun
///
/// The overridden enabled tools used for this agent thread run.
/// 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 .
///
/// The Unix timestamp, in seconds, representing when this object was created.
/// The Unix timestamp, in seconds, representing when this item expires.
@@ -73,8 +73,9 @@ public partial class ThreadRun
/// Controls whether or not and which tool is called by the model.
/// The response format of the tool calls used in this run.
/// 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.
+ /// Determines if tools can be executed in parallel within the run.
/// , , , , or is null.
- internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata)
+ internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, bool parallelToolCalls)
{
Argument.AssertNotNull(id, nameof(id));
Argument.AssertNotNull(threadId, nameof(threadId));
@@ -105,6 +106,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta
ToolChoice = toolChoice;
ResponseFormat = responseFormat;
Metadata = metadata;
+ ParallelToolCalls = parallelToolCalls;
}
/// Initializes a new instance of .
@@ -124,7 +126,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta
///
/// The overridden enabled tools used for this agent thread run.
/// 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 .
///
/// The Unix timestamp, in seconds, representing when this object was created.
/// The Unix timestamp, in seconds, representing when this item expires.
@@ -145,7 +147,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta
/// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis.
/// Determines if tools can be executed in parallel within the run.
/// Keeps track of any properties unknown to the library.
- internal ThreadRun(string id, string @object, string threadId, string assistantId, RunStatus status, RequiredAction requiredAction, RunError lastError, string model, string instructions, IReadOnlyList tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, UpdateToolResourcesOptions toolResources, bool? parallelToolCalls, IDictionary serializedAdditionalRawData)
+ internal ThreadRun(string id, string @object, string threadId, string assistantId, RunStatus status, RequiredAction requiredAction, RunError lastError, string model, string instructions, IReadOnlyList tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, UpdateToolResourcesOptions toolResources, bool parallelToolCalls, IDictionary serializedAdditionalRawData)
{
Id = id;
Object = @object;
@@ -207,7 +209,7 @@ internal ThreadRun()
///
/// The overridden enabled tools used for this agent thread run.
/// 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; }
/// The Unix timestamp, in seconds, representing when this object was created.
@@ -331,6 +333,6 @@ internal ThreadRun()
/// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis.
public UpdateToolResourcesOptions ToolResources { get; }
/// Determines if tools can be executed in parallel within the run.
- public bool? ParallelToolCalls { get; }
+ public bool ParallelToolCalls { get; }
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs
index 9f93ac27a465..e50d227d4b6b 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs
@@ -83,6 +83,7 @@ internal static ToolDefinition DeserializeToolDefinition(JsonElement element, Mo
case "fabric_aiskill": return MicrosoftFabricToolDefinition.DeserializeMicrosoftFabricToolDefinition(element, options);
case "file_search": return FileSearchToolDefinition.DeserializeFileSearchToolDefinition(element, options);
case "function": return FunctionToolDefinition.DeserializeFunctionToolDefinition(element, options);
+ case "openapi": return OpenApiToolDefinition.DeserializeOpenApiToolDefinition(element, options);
case "sharepoint_grounding": return SharepointToolDefinition.DeserializeSharepointToolDefinition(element, options);
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs
index 81252e5ccbba..65e55f3f9809 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs
@@ -13,7 +13,7 @@ namespace Azure.AI.Projects
///
/// An abstract representation of an input tool definition that an agent can use.
/// 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 abstract partial class ToolDefinition
{
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.Serialization.cs
new file mode 100644
index 000000000000..34ec6852a21e
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.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
+{
+ internal partial class UnknownOpenApiAuthDetails : 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(OpenApiAuthDetails)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ }
+
+ 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 UnknownOpenApiAuthDetails DeserializeUnknownOpenApiAuthDetails(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ OpenApiAuthType type = "Unknown";
+ 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 UnknownOpenApiAuthDetails(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(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 new UnknownOpenApiAuthDetails FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content);
+ return DeserializeUnknownOpenApiAuthDetails(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/UnknownOpenApiAuthDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.cs
new file mode 100644
index 000000000000..4844d77a2185
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownOpenApiAuthDetails.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects
+{
+ /// Unknown version of OpenApiAuthDetails.
+ internal partial class UnknownOpenApiAuthDetails : 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 UnknownOpenApiAuthDetails(OpenApiAuthType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData)
+ {
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal UnknownOpenApiAuthDetails()
+ {
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs
index da7f3ac2d4b5..0e7eabef5794 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs
@@ -60,7 +60,7 @@ internal UpdateAgentRequest()
///
/// The modified collection of tools to enable 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,
@@ -105,7 +105,7 @@ internal UpdateAgentRequest(string model, string name, string description, strin
///
/// The modified collection of tools to enable 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; }
///
diff --git a/sdk/ai/Azure.AI.Projects/tsp-location.yaml b/sdk/ai/Azure.AI.Projects/tsp-location.yaml
index b003672683bc..998746f17def 100644
--- a/sdk/ai/Azure.AI.Projects/tsp-location.yaml
+++ b/sdk/ai/Azure.AI.Projects/tsp-location.yaml
@@ -1,4 +1,4 @@
directory: specification/ai/Azure.AI.Projects
-commit: f82185fa22ee5b879726d7b3a35e98691016db5d
+commit: 61022e94bfd7909f7060814ae5f0db6f33dbe73f
repo: Azure/azure-rest-api-specs
additionalDirectories: