diff --git a/api/OpenAI.net8.0.cs b/api/OpenAI.net8.0.cs index 8730aed5d..894ce641d 100644 --- a/api/OpenAI.net8.0.cs +++ b/api/OpenAI.net8.0.cs @@ -4594,10 +4594,21 @@ public enum ComputerCallActionMouseButton { Forward = 4 } [Experimental("OPENAICUA001")] + public class ComputerCallOutput : IJsonModel, IPersistableModel { + public static ComputerCallOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); + public static ComputerCallOutput CreateScreenshotOutput(string screenshotImageFileId); + public static ComputerCallOutput CreateScreenshotOutput(Uri screenshotImageUri); + protected virtual ComputerCallOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); + protected virtual ComputerCallOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); + } + [Experimental("OPENAICUA001")] public class ComputerCallOutputResponseItem : ResponseItem, IJsonModel, IPersistableModel { + public ComputerCallOutputResponseItem(string callId, ComputerCallOutput output); public IList AcknowledgedSafetyChecks { get; } - public string CallId { get; } - public ComputerOutput Output { get; } + public string CallId { get; set; } + public ComputerCallOutput Output { get; set; } public ComputerCallOutputStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); @@ -4613,8 +4624,8 @@ public enum ComputerCallOutputStatus { [Experimental("OPENAICUA001")] public class ComputerCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { public ComputerCallResponseItem(string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks); - public ComputerCallAction Action { get; } - public string CallId { get; } + public ComputerCallAction Action { get; set; } + public string CallId { get; set; } public IList PendingSafetyChecks { get; } public ComputerCallStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); @@ -4640,16 +4651,6 @@ public enum ComputerCallStatus { Incomplete = 2 } [Experimental("OPENAICUA001")] - public class ComputerOutput : IJsonModel, IPersistableModel { - public static ComputerOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); - public static ComputerOutput CreateScreenshotOutput(string screenshotImageFileId); - public static ComputerOutput CreateScreenshotOutput(Uri screenshotImageUri); - protected virtual ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); - protected virtual ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); - } - [Experimental("OPENAICUA001")] public readonly partial struct ComputerToolEnvironment : IEquatable { public ComputerToolEnvironment(string value); public static ComputerToolEnvironment Browser { get; } @@ -4670,8 +4671,9 @@ public class ComputerOutput : IJsonModel, IPersistableModel, IPersistableModel { + public FileSearchCallResponseItem(IEnumerable queries); public IList Queries { get; } - public IList Results { get; } + public IList Results { get; set; } public FileSearchCallStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); @@ -4680,7 +4682,7 @@ public class FileSearchCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { - public IReadOnlyDictionary Attributes { get; } + public IDictionary Attributes { get; } public string FileId { get; set; } public string Filename { get; set; } public float? Score { get; set; } @@ -4725,7 +4727,8 @@ public class FileSearchToolRankingOptions : IJsonModel, IPersistableModel { - public string CallId { get; } + public FunctionCallOutputResponseItem(string callId, string functionOutput); + public string CallId { get; set; } public string FunctionOutput { get; set; } public FunctionCallOutputStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); @@ -4741,7 +4744,8 @@ public enum FunctionCallOutputStatus { } [Experimental("OPENAI001")] public class FunctionCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { - public string CallId { get; } + public FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments); + public string CallId { get; set; } public BinaryData FunctionArguments { get; set; } public string FunctionName { get; set; } public FunctionCallStatus? Status { get; } @@ -4867,9 +4871,9 @@ public static class OpenAIResponsesModelFactory { public class ReasoningResponseItem : ResponseItem, IJsonModel, IPersistableModel { public ReasoningResponseItem(IEnumerable summaryParts); public ReasoningResponseItem(string summaryText); - public string EncryptedContent { get; } + public string EncryptedContent { get; set; } public ReasoningStatus? Status { get; } - public IReadOnlyList SummaryParts { get; } + public IList SummaryParts { get; } public string GetSummaryText(); protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); @@ -4884,7 +4888,7 @@ public enum ReasoningStatus { } [Experimental("OPENAI001")] public class ReasoningSummaryPart : IJsonModel, IPersistableModel { - public static ReasoningSummaryPart CreateTextPart(string text); + public static ReasoningSummaryTextPart CreateTextPart(string text); protected virtual ReasoningSummaryPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); protected virtual ReasoningSummaryPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); @@ -5072,14 +5076,10 @@ public class ResponseItem : IJsonModel, IPersistableModel pendingSafetyChecks); [Experimental("OPENAICUA001")] - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); - [Experimental("OPENAICUA001")] - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, string screenshotImageFileId); - [Experimental("OPENAICUA001")] - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, Uri screenshotImageUri); + public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, ComputerCallOutput output); public static MessageResponseItem CreateDeveloperMessageItem(IEnumerable contentParts); public static MessageResponseItem CreateDeveloperMessageItem(string inputTextContent); - public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable queries, IEnumerable results); + public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable queries); public static FunctionCallResponseItem CreateFunctionCallItem(string callId, string functionName, BinaryData functionArguments); public static FunctionCallOutputResponseItem CreateFunctionCallOutputItem(string callId, string functionOutput); public static ReasoningResponseItem CreateReasoningItem(IEnumerable summaryParts); @@ -5551,6 +5551,7 @@ public class StreamingResponseWebSearchCallSearchingUpdate : StreamingResponseUp } [Experimental("OPENAI001")] public class WebSearchCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { + public WebSearchCallResponseItem(); public WebSearchCallStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); diff --git a/api/OpenAI.netstandard2.0.cs b/api/OpenAI.netstandard2.0.cs index b6473efcc..c3f22884a 100644 --- a/api/OpenAI.netstandard2.0.cs +++ b/api/OpenAI.netstandard2.0.cs @@ -4044,10 +4044,20 @@ public enum ComputerCallActionMouseButton { Back = 3, Forward = 4 } + public class ComputerCallOutput : IJsonModel, IPersistableModel { + public static ComputerCallOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); + public static ComputerCallOutput CreateScreenshotOutput(string screenshotImageFileId); + public static ComputerCallOutput CreateScreenshotOutput(Uri screenshotImageUri); + protected virtual ComputerCallOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); + protected virtual ComputerCallOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); + } public class ComputerCallOutputResponseItem : ResponseItem, IJsonModel, IPersistableModel { + public ComputerCallOutputResponseItem(string callId, ComputerCallOutput output); public IList AcknowledgedSafetyChecks { get; } - public string CallId { get; } - public ComputerOutput Output { get; } + public string CallId { get; set; } + public ComputerCallOutput Output { get; set; } public ComputerCallOutputStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); @@ -4061,8 +4071,8 @@ public enum ComputerCallOutputStatus { } public class ComputerCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { public ComputerCallResponseItem(string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks); - public ComputerCallAction Action { get; } - public string CallId { get; } + public ComputerCallAction Action { get; set; } + public string CallId { get; set; } public IList PendingSafetyChecks { get; } public ComputerCallStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); @@ -4085,15 +4095,6 @@ public enum ComputerCallStatus { Completed = 1, Incomplete = 2 } - public class ComputerOutput : IJsonModel, IPersistableModel { - public static ComputerOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); - public static ComputerOutput CreateScreenshotOutput(string screenshotImageFileId); - public static ComputerOutput CreateScreenshotOutput(Uri screenshotImageUri); - protected virtual ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); - protected virtual ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); - } public readonly partial struct ComputerToolEnvironment : IEquatable { public ComputerToolEnvironment(string value); public static ComputerToolEnvironment Browser { get; } @@ -4113,8 +4114,9 @@ public class ComputerOutput : IJsonModel, IPersistableModel, IPersistableModel { + public FileSearchCallResponseItem(IEnumerable queries); public IList Queries { get; } - public IList Results { get; } + public IList Results { get; set; } public FileSearchCallStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); @@ -4122,7 +4124,7 @@ public class FileSearchCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { - public IReadOnlyDictionary Attributes { get; } + public IDictionary Attributes { get; } public string FileId { get; set; } public string Filename { get; set; } public float? Score { get; set; } @@ -4163,7 +4165,8 @@ public class FileSearchToolRankingOptions : IJsonModel, IPersistableModel { - public string CallId { get; } + public FunctionCallOutputResponseItem(string callId, string functionOutput); + public string CallId { get; set; } public string FunctionOutput { get; set; } public FunctionCallOutputStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); @@ -4177,7 +4180,8 @@ public enum FunctionCallOutputStatus { Incomplete = 2 } public class FunctionCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { - public string CallId { get; } + public FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments); + public string CallId { get; set; } public BinaryData FunctionArguments { get; set; } public string FunctionName { get; set; } public FunctionCallStatus? Status { get; } @@ -4295,9 +4299,9 @@ public static class OpenAIResponsesModelFactory { public class ReasoningResponseItem : ResponseItem, IJsonModel, IPersistableModel { public ReasoningResponseItem(IEnumerable summaryParts); public ReasoningResponseItem(string summaryText); - public string EncryptedContent { get; } + public string EncryptedContent { get; set; } public ReasoningStatus? Status { get; } - public IReadOnlyList SummaryParts { get; } + public IList SummaryParts { get; } public string GetSummaryText(); protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); @@ -4310,7 +4314,7 @@ public enum ReasoningStatus { Incomplete = 2 } public class ReasoningSummaryPart : IJsonModel, IPersistableModel { - public static ReasoningSummaryPart CreateTextPart(string text); + public static ReasoningSummaryTextPart CreateTextPart(string text); protected virtual ReasoningSummaryPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); protected virtual ReasoningSummaryPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); @@ -4483,12 +4487,10 @@ public class ResponseItem : IJsonModel, IPersistableModel contentParts); public static MessageResponseItem CreateAssistantMessageItem(string outputTextContent, IEnumerable annotations = null); public static ComputerCallResponseItem CreateComputerCallItem(string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks); - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, string screenshotImageFileId); - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, Uri screenshotImageUri); + public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, ComputerCallOutput output); public static MessageResponseItem CreateDeveloperMessageItem(IEnumerable contentParts); public static MessageResponseItem CreateDeveloperMessageItem(string inputTextContent); - public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable queries, IEnumerable results); + public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable queries); public static FunctionCallResponseItem CreateFunctionCallItem(string callId, string functionName, BinaryData functionArguments); public static FunctionCallOutputResponseItem CreateFunctionCallOutputItem(string callId, string functionOutput); public static ReasoningResponseItem CreateReasoningItem(IEnumerable summaryParts); @@ -4914,6 +4916,7 @@ public class StreamingResponseWebSearchCallSearchingUpdate : StreamingResponseUp protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); } public class WebSearchCallResponseItem : ResponseItem, IJsonModel, IPersistableModel { + public WebSearchCallResponseItem(); public WebSearchCallStatus? Status { get; } protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); diff --git a/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs b/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs index a578d6b11..a0c5fbe16 100644 --- a/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs +++ b/codegen/generator/src/Visitors/ExperimentalAttributeVisitor.cs @@ -612,7 +612,7 @@ public class ExperimentalAttributeVisitor : ScmLibraryVisitor "ComputerCallResponseItem", "ComputerCallSafetyCheck", "ComputerCallStatus", - "ComputerOutput", + "ComputerCallOutput", "ComputerToolEnvironment", }; diff --git a/specification/client/responses.client.tsp b/specification/client/responses.client.tsp index d890c1ede..53d6e1e6e 100644 --- a/specification/client/responses.client.tsp +++ b/specification/client/responses.client.tsp @@ -6,3 +6,27 @@ using Azure.ClientGenerator.Core; @@alternateType(CreateResponse.service_tier, DotNetResponseServiceTier); @@alternateType(Response.service_tier, DotNetResponseServiceTier); + +@@visibility(ItemResource.id, Lifecycle.Read); +@@usage(ItemResource, Usage.input | Usage.output); + +@@visibility(ComputerToolCallItemResource.status, Lifecycle.Read); + +@@visibility(ComputerToolCallOutputItemResource.status, Lifecycle.Read); + +@@visibility(FileSearchToolCallItemResource.status, Lifecycle.Read); + +@@visibility(FunctionToolCallItemResource.status, Lifecycle.Read); +@@clientName(FunctionToolCallItemResource.name, "FunctionName"); +@@clientName(FunctionToolCallItemResource.arguments, "FunctionArguments"); +@@alternateType(FunctionToolCallItemResource.arguments, unknown); + +@@visibility(FunctionToolCallOutputItemResource.status, Lifecycle.Read); +@@clientName(FunctionToolCallOutputItemResource.output, "FunctionOutput"); + +@@visibility(ReasoningItemResource.status, Lifecycle.Read); +@@clientName(ReasoningItemResource.summary, "SummaryParts"); + +@@visibility(WebSearchToolCallItemResource.status, Lifecycle.Read); + +@@visibility(ResponsesMessageItemResource.status, Lifecycle.Read); diff --git a/src/Custom/Responses/Items/ComputerCallOutputResponseItem.cs b/src/Custom/Responses/Items/ComputerCallOutputResponseItem.cs deleted file mode 100644 index 0c6a9f465..000000000 --- a/src/Custom/Responses/Items/ComputerCallOutputResponseItem.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("ComputerToolCallOutputItemResource")] -public partial class ComputerCallOutputResponseItem -{ - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public ComputerCallOutputStatus? Status { get; } - - // CUSTOM: For reuse as an input model - internal ComputerCallOutputResponseItem(string callId, ComputerOutput output) - : this(id: null, callId, output, status: null) - { } -} diff --git a/src/Custom/Responses/Items/ComputerCallResponseItem.cs b/src/Custom/Responses/Items/ComputerCallResponseItem.cs deleted file mode 100644 index b7f8049a6..000000000 --- a/src/Custom/Responses/Items/ComputerCallResponseItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("ComputerToolCallItemResource")] -public partial class ComputerCallResponseItem -{ - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public ComputerCallStatus? Status { get; } - - // CUSTOM: For reuse as an input model - public ComputerCallResponseItem(string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks) - : this(id: null, callId, action, pendingSafetyChecks, status: null) - { } -} diff --git a/src/Custom/Responses/Items/ComputerCallAction.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallAction.cs similarity index 100% rename from src/Custom/Responses/Items/ComputerCallAction.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallAction.cs diff --git a/src/Custom/Responses/Items/ComputerCallActionKind.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallActionKind.cs similarity index 100% rename from src/Custom/Responses/Items/ComputerCallActionKind.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallActionKind.cs diff --git a/src/Custom/Responses/Items/ComputerCallActionMouseButton.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallActionMouseButton.cs similarity index 100% rename from src/Custom/Responses/Items/ComputerCallActionMouseButton.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallActionMouseButton.cs diff --git a/src/Custom/Responses/Items/ComputerOutput.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallOutput.cs similarity index 77% rename from src/Custom/Responses/Items/ComputerOutput.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallOutput.cs index 4e3154e65..c5323b2b6 100644 --- a/src/Custom/Responses/Items/ComputerOutput.cs +++ b/src/Custom/Responses/Items/ComputerTool/ComputerCallOutput.cs @@ -7,9 +7,9 @@ namespace OpenAI.Responses; // - Added Experimental attribute. // - Renamed. [CodeGenType("ComputerToolCallOutputItemOutput")] -public partial class ComputerOutput +public partial class ComputerCallOutput { - public static ComputerOutput CreateScreenshotOutput(Uri screenshotImageUri) + public static ComputerCallOutput CreateScreenshotOutput(Uri screenshotImageUri) { Argument.AssertNotNull(screenshotImageUri, nameof(screenshotImageUri)); @@ -19,7 +19,7 @@ public static ComputerOutput CreateScreenshotOutput(Uri screenshotImageUri) }; } - public static ComputerOutput CreateScreenshotOutput(string screenshotImageFileId) + public static ComputerCallOutput CreateScreenshotOutput(string screenshotImageFileId) { Argument.AssertNotNull(screenshotImageFileId, nameof(screenshotImageFileId)); @@ -29,7 +29,7 @@ public static ComputerOutput CreateScreenshotOutput(string screenshotImageFileId }; } - public static ComputerOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType) + public static ComputerCallOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType) { Argument.AssertNotNull(screenshotImageBytes, nameof(screenshotImageBytes)); Argument.AssertNotNull(screenshotImageBytesMediaType, nameof(screenshotImageBytesMediaType)); diff --git a/src/Custom/Responses/Items/ComputerTool/ComputerCallOutputResponseItem.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallOutputResponseItem.cs new file mode 100644 index 000000000..fa6abc634 --- /dev/null +++ b/src/Custom/Responses/Items/ComputerTool/ComputerCallOutputResponseItem.cs @@ -0,0 +1,10 @@ +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("ComputerToolCallOutputItemResource")] +public partial class ComputerCallOutputResponseItem +{ + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public ComputerCallOutputStatus? Status { get; } +} diff --git a/src/Custom/Responses/Items/ComputerCallOutputStatus.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallOutputStatus.cs similarity index 100% rename from src/Custom/Responses/Items/ComputerCallOutputStatus.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallOutputStatus.cs diff --git a/src/Custom/Responses/Items/ComputerTool/ComputerCallResponseItem.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallResponseItem.cs new file mode 100644 index 000000000..4beaecb67 --- /dev/null +++ b/src/Custom/Responses/Items/ComputerTool/ComputerCallResponseItem.cs @@ -0,0 +1,10 @@ +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("ComputerToolCallItemResource")] +public partial class ComputerCallResponseItem +{ + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public ComputerCallStatus? Status { get; } +} diff --git a/src/Custom/Responses/Items/ComputerCallSafetyCheck.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallSafetyCheck.cs similarity index 100% rename from src/Custom/Responses/Items/ComputerCallSafetyCheck.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallSafetyCheck.cs diff --git a/src/Custom/Responses/Items/ComputerCallStatus.cs b/src/Custom/Responses/Items/ComputerTool/ComputerCallStatus.cs similarity index 100% rename from src/Custom/Responses/Items/ComputerCallStatus.cs rename to src/Custom/Responses/Items/ComputerTool/ComputerCallStatus.cs diff --git a/src/Custom/Responses/Items/FileSearchCallResponseItem.cs b/src/Custom/Responses/Items/FileSearchCallResponseItem.cs deleted file mode 100644 index 78c3b7131..000000000 --- a/src/Custom/Responses/Items/FileSearchCallResponseItem.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("FileSearchToolCallItemResource")] -public partial class FileSearchCallResponseItem -{ - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public FileSearchCallStatus? Status { get; } - - // CUSTOM: For reuse as an input model - internal FileSearchCallResponseItem(IEnumerable queries, IEnumerable results = null) - : this( - kind: InternalItemType.FileSearchCall, - id: null, - additionalBinaryDataProperties: null, - queries.ToList(), - results.ToList(), - status: null) - { } -} \ No newline at end of file diff --git a/src/Custom/Responses/Items/FileSearchCallResult.cs b/src/Custom/Responses/Items/FileSearchCallResult.cs deleted file mode 100644 index 0bd7049d2..000000000 --- a/src/Custom/Responses/Items/FileSearchCallResult.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("FileSearchToolCallItemParamResult")] -public partial class FileSearchCallResult -{ - // CUSTOM: Use a plain dictionary. - [CodeGenMember("Attributes")] - public IReadOnlyDictionary Attributes { get; } -} \ No newline at end of file diff --git a/src/Custom/Responses/Items/FileSearchTool/FileSearchCallResponseItem.cs b/src/Custom/Responses/Items/FileSearchTool/FileSearchCallResponseItem.cs new file mode 100644 index 000000000..d39abc4c1 --- /dev/null +++ b/src/Custom/Responses/Items/FileSearchTool/FileSearchCallResponseItem.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("FileSearchToolCallItemResource")] +public partial class FileSearchCallResponseItem +{ + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public FileSearchCallStatus? Status { get; } +} \ No newline at end of file diff --git a/src/Custom/Responses/Items/FileSearchTool/FileSearchCallResult.cs b/src/Custom/Responses/Items/FileSearchTool/FileSearchCallResult.cs new file mode 100644 index 000000000..20e50c87f --- /dev/null +++ b/src/Custom/Responses/Items/FileSearchTool/FileSearchCallResult.cs @@ -0,0 +1,7 @@ +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("FileSearchToolCallItemParamResult")] +public partial class FileSearchCallResult +{ +} \ No newline at end of file diff --git a/src/Custom/Responses/Items/FileSearchCallStatus.cs b/src/Custom/Responses/Items/FileSearchTool/FileSearchCallStatus.cs similarity index 100% rename from src/Custom/Responses/Items/FileSearchCallStatus.cs rename to src/Custom/Responses/Items/FileSearchTool/FileSearchCallStatus.cs diff --git a/src/Custom/Responses/Items/FunctionCallOutputResponseItem.cs b/src/Custom/Responses/Items/FunctionCallOutputResponseItem.cs deleted file mode 100644 index 91a8b635c..000000000 --- a/src/Custom/Responses/Items/FunctionCallOutputResponseItem.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("FunctionToolCallOutputItemResource")] -public partial class FunctionCallOutputResponseItem -{ - // CUSTOM: Renamed. - [CodeGenMember("Output")] - public string FunctionOutput { get; set; } - - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public FunctionCallOutputStatus? Status { get; } - - // CUSTOM: For reuse as an input model - internal FunctionCallOutputResponseItem(string callId, string functionOutput) - : this(id: null, callId, functionOutput, status: null) - { } -} diff --git a/src/Custom/Responses/Items/FunctionCallResponseItem.cs b/src/Custom/Responses/Items/FunctionCallResponseItem.cs deleted file mode 100644 index becf27a07..000000000 --- a/src/Custom/Responses/Items/FunctionCallResponseItem.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; - -namespace OpenAI.Responses; - - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -// - Customized serialization of the BinaryData-as-string FunctionArguments. -[CodeGenType("FunctionToolCallItemResource")] -[CodeGenSerialization(nameof(FunctionArguments), SerializationValueHook = nameof(SerializeFunctionArgumentsValue), DeserializationValueHook = nameof(DeserializeFunctionArgumentsValue))] -public partial class FunctionCallResponseItem -{ - // CUSTOM: Renamed. - [CodeGenMember("Name")] - public string FunctionName { get; set; } - - // CUSTOM: - // - Renamed. - // - Changed type from string to BinaryData. - [CodeGenMember("Arguments")] - public BinaryData FunctionArguments { get; set; } - - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public FunctionCallStatus? Status { get; } - - // CUSTOM: For reuse as an input model - internal FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments) - : this(id: null, callId, functionName, functionArguments, status: null) - { } -} \ No newline at end of file diff --git a/src/Custom/Responses/Items/FunctionTool/FunctionCallOutputResponseItem.cs b/src/Custom/Responses/Items/FunctionTool/FunctionCallOutputResponseItem.cs new file mode 100644 index 000000000..d1f057516 --- /dev/null +++ b/src/Custom/Responses/Items/FunctionTool/FunctionCallOutputResponseItem.cs @@ -0,0 +1,10 @@ +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("FunctionToolCallOutputItemResource")] +public partial class FunctionCallOutputResponseItem +{ + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public FunctionCallOutputStatus? Status { get; } +} diff --git a/src/Custom/Responses/Items/FunctionCallOutputStatus.cs b/src/Custom/Responses/Items/FunctionTool/FunctionCallOutputStatus.cs similarity index 100% rename from src/Custom/Responses/Items/FunctionCallOutputStatus.cs rename to src/Custom/Responses/Items/FunctionTool/FunctionCallOutputStatus.cs diff --git a/src/Custom/Responses/Items/FunctionCallResponseItem.Serialization.cs b/src/Custom/Responses/Items/FunctionTool/FunctionCallResponseItem.Serialization.cs similarity index 86% rename from src/Custom/Responses/Items/FunctionCallResponseItem.Serialization.cs rename to src/Custom/Responses/Items/FunctionTool/FunctionCallResponseItem.Serialization.cs index 346b9c448..de389c0df 100644 --- a/src/Custom/Responses/Items/FunctionCallResponseItem.Serialization.cs +++ b/src/Custom/Responses/Items/FunctionTool/FunctionCallResponseItem.Serialization.cs @@ -5,6 +5,7 @@ namespace OpenAI.Responses; +[CodeGenSerialization(nameof(FunctionArguments), SerializationValueHook = nameof(SerializeFunctionArgumentsValue), DeserializationValueHook = nameof(DeserializeFunctionArgumentsValue))] public partial class FunctionCallResponseItem : IJsonModel { // CUSTOM: The REST API serializes this as a string. diff --git a/src/Custom/Responses/Items/FunctionTool/FunctionCallResponseItem.cs b/src/Custom/Responses/Items/FunctionTool/FunctionCallResponseItem.cs new file mode 100644 index 000000000..0b13de080 --- /dev/null +++ b/src/Custom/Responses/Items/FunctionTool/FunctionCallResponseItem.cs @@ -0,0 +1,10 @@ +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("FunctionToolCallItemResource")] +public partial class FunctionCallResponseItem +{ + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public FunctionCallStatus? Status { get; } +} \ No newline at end of file diff --git a/src/Custom/Responses/Items/FunctionCallStatus.cs b/src/Custom/Responses/Items/FunctionTool/FunctionCallStatus.cs similarity index 100% rename from src/Custom/Responses/Items/FunctionCallStatus.cs rename to src/Custom/Responses/Items/FunctionTool/FunctionCallStatus.cs diff --git a/src/Custom/Responses/Items/Internal/InternalResponsesAssistantMessage.cs b/src/Custom/Responses/Items/Internal/InternalResponsesAssistantMessage.cs index 344a4fb41..c1410a393 100644 --- a/src/Custom/Responses/Items/Internal/InternalResponsesAssistantMessage.cs +++ b/src/Custom/Responses/Items/Internal/InternalResponsesAssistantMessage.cs @@ -8,9 +8,4 @@ internal partial class InternalResponsesAssistantMessage // CUSTOM: Use generalized content type. [CodeGenMember("Content")] public IList InternalContent { get; } - - // CUSTOM: For reuse as an input model - internal InternalResponsesAssistantMessage(IEnumerable internalContent) - : this(id: null, status: null, internalContent) - { } } \ No newline at end of file diff --git a/src/Custom/Responses/Items/Internal/InternalResponsesDeveloperMessage.cs b/src/Custom/Responses/Items/Internal/InternalResponsesDeveloperMessage.cs index 83683f0cb..d2798a91b 100644 --- a/src/Custom/Responses/Items/Internal/InternalResponsesDeveloperMessage.cs +++ b/src/Custom/Responses/Items/Internal/InternalResponsesDeveloperMessage.cs @@ -8,9 +8,4 @@ internal partial class InternalResponsesDeveloperMessage // CUSTOM: Use generalized content type. [CodeGenMember("Content")] public IList InternalContent { get; } - - // CUSTOM: For reuse as an input model - internal InternalResponsesDeveloperMessage(IEnumerable internalContent) - : this(id: null, status: null, internalContent) - { } } \ No newline at end of file diff --git a/src/Custom/Responses/Items/Internal/InternalResponsesSystemMessage.cs b/src/Custom/Responses/Items/Internal/InternalResponsesSystemMessage.cs index 0a1746b6d..20c9199f4 100644 --- a/src/Custom/Responses/Items/Internal/InternalResponsesSystemMessage.cs +++ b/src/Custom/Responses/Items/Internal/InternalResponsesSystemMessage.cs @@ -8,9 +8,4 @@ internal partial class InternalResponsesSystemMessage // CUSTOM: Use generalized content type. [CodeGenMember("Content")] public IList InternalContent { get; } - - // CUSTOM: For reuse as an input model - internal InternalResponsesSystemMessage(IEnumerable internalContent) - : this(id: null, status: null, internalContent) - { } } \ No newline at end of file diff --git a/src/Custom/Responses/Items/Internal/InternalResponsesUserMessage.cs b/src/Custom/Responses/Items/Internal/InternalResponsesUserMessage.cs index 8f338abca..cfeee6cf2 100644 --- a/src/Custom/Responses/Items/Internal/InternalResponsesUserMessage.cs +++ b/src/Custom/Responses/Items/Internal/InternalResponsesUserMessage.cs @@ -8,9 +8,4 @@ internal partial class InternalResponsesUserMessage // CUSTOM: Use generalized content type. [CodeGenMember("Content")] public IList InternalContent { get; } - - // CUSTOM: For reuse as an input model - internal InternalResponsesUserMessage(IEnumerable internalContent) - : this(id: null, status: null, internalContent) - { } } \ No newline at end of file diff --git a/src/Custom/Responses/Items/MessageResponseItem.cs b/src/Custom/Responses/Items/Message/MessageResponseItem.cs similarity index 73% rename from src/Custom/Responses/Items/MessageResponseItem.cs rename to src/Custom/Responses/Items/Message/MessageResponseItem.cs index d947a93e6..42c0b601d 100644 --- a/src/Custom/Responses/Items/MessageResponseItem.cs +++ b/src/Custom/Responses/Items/Message/MessageResponseItem.cs @@ -1,14 +1,15 @@ using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; namespace OpenAI.Responses; -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. +// CUSTOM: Renamed. [CodeGenType("ResponsesMessageItemResource")] public partial class MessageResponseItem { + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public MessageStatus? Status { get; } + // CUSTOM: Expose public enum type with 'Unknown' using internal extensible role. [CodeGenMember("Role")] internal InternalResponsesMessageRole InternalRole { get; set; } @@ -18,10 +19,6 @@ public MessageRole Role private set => InternalRole = value.ToSerialString(); } - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public MessageStatus? Status { get; } - // CUSTOM: Recombined content from derived types. public IList Content => (this as InternalResponsesUserMessage)?.InternalContent @@ -29,9 +26,4 @@ public IList Content ?? (this as InternalResponsesSystemMessage)?.InternalContent ?? (this as InternalResponsesAssistantMessage)?.InternalContent ?? []; - - // CUSTOM: For reuse as an input model base - internal MessageResponseItem(InternalResponsesMessageRole internalRole) - : this(id: null, internalRole, status: null) - { } } diff --git a/src/Custom/Responses/Items/MessageRole.Serialization.cs b/src/Custom/Responses/Items/Message/MessageRole.Serialization.cs similarity index 100% rename from src/Custom/Responses/Items/MessageRole.Serialization.cs rename to src/Custom/Responses/Items/Message/MessageRole.Serialization.cs diff --git a/src/Custom/Responses/Items/MessageRole.cs b/src/Custom/Responses/Items/Message/MessageRole.cs similarity index 100% rename from src/Custom/Responses/Items/MessageRole.cs rename to src/Custom/Responses/Items/Message/MessageRole.cs diff --git a/src/Custom/Responses/Items/MessageStatus.cs b/src/Custom/Responses/Items/Message/MessageStatus.cs similarity index 100% rename from src/Custom/Responses/Items/MessageStatus.cs rename to src/Custom/Responses/Items/Message/MessageStatus.cs diff --git a/src/Custom/Responses/Items/Reasoning/ReasoningResponseItem.cs b/src/Custom/Responses/Items/Reasoning/ReasoningResponseItem.cs new file mode 100644 index 000000000..5c684f1c3 --- /dev/null +++ b/src/Custom/Responses/Items/Reasoning/ReasoningResponseItem.cs @@ -0,0 +1,26 @@ +using System.Linq; + +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("ReasoningItemResource")] +public partial class ReasoningResponseItem +{ + // CUSTOM: Made nullable since this is a read-only property. + [CodeGenMember("Status")] + public ReasoningStatus? Status { get; } + + // CUSTOM: Added for convenience. + public ReasoningResponseItem(string summaryText) : this(summaryParts: [new ReasoningSummaryTextPart(summaryText)]) + { + Argument.AssertNotNull(summaryText, nameof(summaryText)); + } + + // CUSTOM: Added for convenience. + public string GetSummaryText() + { + return string.Join( + separator: string.Empty, + values: SummaryParts.Select(part => (part as ReasoningSummaryTextPart)?.Text ?? string.Empty)); + } +} diff --git a/src/Custom/Responses/Items/ReasoningStatus.cs b/src/Custom/Responses/Items/Reasoning/ReasoningStatus.cs similarity index 100% rename from src/Custom/Responses/Items/ReasoningStatus.cs rename to src/Custom/Responses/Items/Reasoning/ReasoningStatus.cs diff --git a/src/Custom/Responses/Items/Reasoning/ReasoningSummaryPart.cs b/src/Custom/Responses/Items/Reasoning/ReasoningSummaryPart.cs new file mode 100644 index 000000000..e14bcf0f6 --- /dev/null +++ b/src/Custom/Responses/Items/Reasoning/ReasoningSummaryPart.cs @@ -0,0 +1,14 @@ +namespace OpenAI.Responses; + +// CUSTOM: Renamed. +[CodeGenType("ReasoningItemSummaryPart")] +public partial class ReasoningSummaryPart +{ + // CUSTOM: Added as a constructor alternative for discoverability + /// Creates a new instance of . + /// The summary text. + public static ReasoningSummaryTextPart CreateTextPart(string text) + { + return new ReasoningSummaryTextPart(text); + } +} diff --git a/src/Custom/Responses/Items/ReasoningSummaryTextPart.cs b/src/Custom/Responses/Items/Reasoning/ReasoningSummaryTextPart.cs similarity index 55% rename from src/Custom/Responses/Items/ReasoningSummaryTextPart.cs rename to src/Custom/Responses/Items/Reasoning/ReasoningSummaryTextPart.cs index 79b71ccca..5a91a1fab 100644 --- a/src/Custom/Responses/Items/ReasoningSummaryTextPart.cs +++ b/src/Custom/Responses/Items/Reasoning/ReasoningSummaryTextPart.cs @@ -1,10 +1,6 @@ -using System.Diagnostics.CodeAnalysis; - namespace OpenAI.Responses; -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. +// CUSTOM: Renamed. [CodeGenType("ReasoningItemSummaryTextPart")] public partial class ReasoningSummaryTextPart { diff --git a/src/Custom/Responses/Items/ReasoningResponseItem.cs b/src/Custom/Responses/Items/ReasoningResponseItem.cs deleted file mode 100644 index f1545919b..000000000 --- a/src/Custom/Responses/Items/ReasoningResponseItem.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("ReasoningItemResource")] -public partial class ReasoningResponseItem -{ - // CUSTOM: Retain optionality of OpenAPI read-only property value - [CodeGenMember("Status")] - public ReasoningStatus? Status { get; } - - // CUSTOM: Rename for collection clarity - [CodeGenMember("Summary")] - public IReadOnlyList SummaryParts { get; } - - // CUSTOM: Enable reuse as an input model - public ReasoningResponseItem(IEnumerable summaryParts) - : this(id: null, status: null, summaryParts) - { - } - - // CUSTOM: Facilitate typical single-item summary text input model use - public ReasoningResponseItem(string summaryText) - : this(summaryParts: [new ReasoningSummaryTextPart(summaryText)]) - { - } - - // CUSTOM: Provide convenience for typical single-item or text-concatenation scenario - public string GetSummaryText() - => string.Join( - separator: string.Empty, - SummaryParts.Select(part => (part as ReasoningSummaryTextPart)?.Text ?? string.Empty)); -} diff --git a/src/Custom/Responses/Items/ReasoningSummaryPart.cs b/src/Custom/Responses/Items/ReasoningSummaryPart.cs deleted file mode 100644 index 974bc9f20..000000000 --- a/src/Custom/Responses/Items/ReasoningSummaryPart.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("ReasoningItemSummaryPart")] -public partial class ReasoningSummaryPart -{ - // CUSTOM: Added as a constructor alternative for discoverability - /// - /// Creates a new instance of . - /// - /// - /// - /// - /// This is equivalent to creating an instance of via its constructor. - /// - public static ReasoningSummaryPart CreateTextPart(string text) - => new ReasoningSummaryTextPart(text); -} diff --git a/src/Custom/Responses/Items/Reference/ReferenceResponseItem.cs b/src/Custom/Responses/Items/Reference/ReferenceResponseItem.cs new file mode 100644 index 000000000..e99603885 --- /dev/null +++ b/src/Custom/Responses/Items/Reference/ReferenceResponseItem.cs @@ -0,0 +1,18 @@ +namespace OpenAI.Responses; + +// CUSTOM: +// - Renamed. +// - Made internal the constructor that does not take an ID, because contrary to other item types, +// the ID of reference items is not read-only and is required. +[CodeGenType("DotNetItemReferenceItemResource")] +[CodeGenVisibility(nameof(ReferenceResponseItem), CodeGenVisibility.Internal)] +public partial class ReferenceResponseItem +{ + // CUSTOM: Added a constructor that takes an ID. + public ReferenceResponseItem(string id) : base(InternalItemType.ItemReference) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + } +} diff --git a/src/Custom/Responses/Items/ReferenceResponseItem.cs b/src/Custom/Responses/Items/ReferenceResponseItem.cs deleted file mode 100644 index 6d4211c4f..000000000 --- a/src/Custom/Responses/Items/ReferenceResponseItem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace OpenAI.Responses; - -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. -[CodeGenType("DotNetItemReferenceItemResource")] -[CodeGenVisibility(nameof(ReferenceResponseItem), CodeGenVisibility.Internal)] -public partial class ReferenceResponseItem -{ - // CUSTOM: Added to support ease of input model use - public ReferenceResponseItem(string id) - : this(InternalItemType.ItemReference, id, additionalBinaryDataProperties: null) - { - } -} diff --git a/src/Custom/Responses/Items/ResponseItem.cs b/src/Custom/Responses/Items/ResponseItem.cs index 7f28563d9..f1e1cf0b5 100644 --- a/src/Custom/Responses/Items/ResponseItem.cs +++ b/src/Custom/Responses/Items/ResponseItem.cs @@ -12,7 +12,7 @@ public partial class ResponseItem { // CUSTOM: Specify read-only semantics for ID [CodeGenMember("Id")] - public string Id { get; } + public string Id { get; internal set; } public static MessageResponseItem CreateUserMessageItem(IEnumerable contentParts) { @@ -43,7 +43,7 @@ public static MessageResponseItem CreateDeveloperMessageItem(string inputTextCon public static MessageResponseItem CreateSystemMessageItem(IEnumerable contentParts) { Argument.AssertNotNull(contentParts, nameof(contentParts)); - return new InternalResponsesSystemMessage(id: null, status: null, contentParts); + return new InternalResponsesSystemMessage(contentParts); } public static MessageResponseItem CreateSystemMessageItem(string inputTextContent) @@ -53,16 +53,13 @@ public static MessageResponseItem CreateSystemMessageItem(string inputTextConten internalContent: [ResponseContentPart.CreateInputTextPart(inputTextContent)]); } - public static MessageResponseItem CreateAssistantMessageItem( - IEnumerable contentParts) + public static MessageResponseItem CreateAssistantMessageItem(IEnumerable contentParts) { Argument.AssertNotNull(contentParts, nameof(contentParts)); return new InternalResponsesAssistantMessage(contentParts); } - public static MessageResponseItem CreateAssistantMessageItem( - string outputTextContent, - IEnumerable annotations = null) + public static MessageResponseItem CreateAssistantMessageItem(string outputTextContent, IEnumerable annotations = null) { Argument.AssertNotNull(outputTextContent, nameof(outputTextContent)); return new InternalResponsesAssistantMessage( @@ -75,50 +72,13 @@ public static MessageResponseItem CreateAssistantMessageItem( [Experimental("OPENAICUA001")] public static ComputerCallResponseItem CreateComputerCallItem(string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks) { - Argument.AssertNotNull(callId, nameof(callId)); return new ComputerCallResponseItem(callId, action, pendingSafetyChecks); } [Experimental("OPENAICUA001")] - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, Uri screenshotImageUri) + public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, ComputerCallOutput output) { - Argument.AssertNotNull(callId, nameof(callId)); - ComputerCallOutputResponseItem item = new( - callId, - ComputerOutput.CreateScreenshotOutput(screenshotImageUri)); - foreach (ComputerCallSafetyCheck safetyCheck in acknowledgedSafetyChecks ?? []) - { - item.AcknowledgedSafetyChecks.Add(safetyCheck); - } - return item; - } - - [Experimental("OPENAICUA001")] - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, string screenshotImageFileId) - { - Argument.AssertNotNull(callId, nameof(callId)); - ComputerCallOutputResponseItem item = new( - callId, - ComputerOutput.CreateScreenshotOutput(screenshotImageFileId)); - foreach (ComputerCallSafetyCheck safetyCheck in acknowledgedSafetyChecks ?? []) - { - item.AcknowledgedSafetyChecks.Add(safetyCheck); - } - return item; - } - - [Experimental("OPENAICUA001")] - public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList acknowledgedSafetyChecks, BinaryData screenshotImageBytes, string screenshotImageBytesMediaType) - { - Argument.AssertNotNull(callId, nameof(callId)); - ComputerCallOutputResponseItem item = new( - callId, - ComputerOutput.CreateScreenshotOutput(screenshotImageBytes, screenshotImageBytesMediaType)); - foreach (ComputerCallSafetyCheck safetyCheck in acknowledgedSafetyChecks ?? []) - { - item.AcknowledgedSafetyChecks.Add(safetyCheck); - } - return item; + return new ComputerCallOutputResponseItem(callId, output); } public static WebSearchCallResponseItem CreateWebSearchCallItem() @@ -126,39 +86,28 @@ public static WebSearchCallResponseItem CreateWebSearchCallItem() return new WebSearchCallResponseItem(); } - public static FileSearchCallResponseItem CreateFileSearchCallItem( - IEnumerable queries, - IEnumerable results) + public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable queries) { - Argument.AssertNotNullOrEmpty(queries, nameof(queries)); - return new FileSearchCallResponseItem(queries, results); + return new FileSearchCallResponseItem(queries); } public static FunctionCallResponseItem CreateFunctionCallItem(string callId, string functionName, BinaryData functionArguments) { - Argument.AssertNotNull(callId, nameof(callId)); - Argument.AssertNotNull(functionName, nameof(functionName)); - Argument.AssertNotNull(functionArguments, nameof(functionArguments)); - return new FunctionCallResponseItem(callId, functionName, functionArguments); } public static FunctionCallOutputResponseItem CreateFunctionCallOutputItem(string callId, string functionOutput) { - Argument.AssertNotNull(callId, nameof(callId)); - Argument.AssertNotNull(functionOutput, nameof(functionOutput)); return new FunctionCallOutputResponseItem(callId, functionOutput); } public static ReasoningResponseItem CreateReasoningItem(IEnumerable summaryParts) { - Argument.AssertNotNullOrEmpty(summaryParts, nameof(summaryParts)); return new ReasoningResponseItem(summaryParts); } public static ReasoningResponseItem CreateReasoningItem(string summaryText) { - Argument.AssertNotNull(summaryText, nameof(summaryText)); return new ReasoningResponseItem(summaryText); } diff --git a/src/Custom/Responses/Items/WebSearchCallResponseItem.cs b/src/Custom/Responses/Items/WebSearchTool/WebSearchCallResponseItem.cs similarity index 54% rename from src/Custom/Responses/Items/WebSearchCallResponseItem.cs rename to src/Custom/Responses/Items/WebSearchTool/WebSearchCallResponseItem.cs index 61abe3a16..02d99178b 100644 --- a/src/Custom/Responses/Items/WebSearchCallResponseItem.cs +++ b/src/Custom/Responses/Items/WebSearchTool/WebSearchCallResponseItem.cs @@ -1,14 +1,10 @@ -using System.Diagnostics.CodeAnalysis; - namespace OpenAI.Responses; -// CUSTOM: -// - Added Experimental attribute. -// - Renamed. +// CUSTOM: Renamed. [CodeGenType("WebSearchToolCallItemResource")] public partial class WebSearchCallResponseItem { - // CUSTOM: Retain optionality of OpenAPI read-only property value + // CUSTOM: Made nullable since this is a read-only property. [CodeGenMember("Status")] public WebSearchCallStatus? Status { get; } } diff --git a/src/Custom/Responses/Items/WebSearchCallStatus.cs b/src/Custom/Responses/Items/WebSearchTool/WebSearchCallStatus.cs similarity index 100% rename from src/Custom/Responses/Items/WebSearchCallStatus.cs rename to src/Custom/Responses/Items/WebSearchTool/WebSearchCallStatus.cs diff --git a/src/Custom/Responses/OpenAIResponsesModelFactory.cs b/src/Custom/Responses/OpenAIResponsesModelFactory.cs index c7edae4e6..22a793aea 100644 --- a/src/Custom/Responses/OpenAIResponsesModelFactory.cs +++ b/src/Custom/Responses/OpenAIResponsesModelFactory.cs @@ -75,13 +75,14 @@ public static MessageResponseItem MessageResponseItem( MessageRole role = MessageRole.Assistant, MessageStatus? status = null) { - // Convert the public MessageRole to the internal role type - InternalResponsesMessageRole internalRole = role.ToSerialString(); - - return new MessageResponseItem( + MessageResponseItem item = new( + kind: InternalItemType.Message, id: id, - internalRole: internalRole, - status: status); + additionalBinaryDataProperties: null, + status: status, + internalRole: role.ToString()); + + return item; } /// Initializes a new instance of . diff --git a/src/Generated/Models/OpenAIContext.cs b/src/Generated/Models/OpenAIContext.cs index 8965dad7c..bc8b74d27 100644 --- a/src/Generated/Models/OpenAIContext.cs +++ b/src/Generated/Models/OpenAIContext.cs @@ -356,7 +356,7 @@ namespace OpenAI [ModelReaderWriterBuildable(typeof(InternalComputerActionWait))] [ModelReaderWriterBuildable(typeof(InternalComputerActionKeyPress))] [ModelReaderWriterBuildable(typeof(InternalComputerUsePreviewToolCallOutputItemParam))] - [ModelReaderWriterBuildable(typeof(ComputerOutput))] + [ModelReaderWriterBuildable(typeof(ComputerCallOutput))] [ModelReaderWriterBuildable(typeof(InternalUnknownComputerToolCallOutputItemOutput))] [ModelReaderWriterBuildable(typeof(InternalComputerToolCallOutputItemOutputComputerScreenshot))] [ModelReaderWriterBuildable(typeof(InternalWebSearchToolCallItemParam))] diff --git a/src/Generated/Models/Responses/ComputerOutput.Serialization.cs b/src/Generated/Models/Responses/ComputerCallOutput.Serialization.cs similarity index 64% rename from src/Generated/Models/Responses/ComputerOutput.Serialization.cs rename to src/Generated/Models/Responses/ComputerCallOutput.Serialization.cs index 697c04d34..582ef511b 100644 --- a/src/Generated/Models/Responses/ComputerOutput.Serialization.cs +++ b/src/Generated/Models/Responses/ComputerCallOutput.Serialization.cs @@ -10,13 +10,13 @@ namespace OpenAI.Responses { [PersistableModelProxy(typeof(InternalUnknownComputerToolCallOutputItemOutput))] - public partial class ComputerOutput : IJsonModel + public partial class ComputerCallOutput : IJsonModel { - internal ComputerOutput() + internal ComputerCallOutput() { } - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -25,10 +25,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ComputerOutput)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support writing '{format}' format."); } if (_additionalBinaryDataProperties?.ContainsKey("type") != true) { @@ -57,20 +57,20 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ComputerOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + ComputerCallOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); - protected virtual ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + protected virtual ComputerCallOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ComputerOutput)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeComputerOutput(document.RootElement, options); + return DeserializeComputerCallOutput(document.RootElement, options); } - internal static ComputerOutput DeserializeComputerOutput(JsonElement element, ModelReaderWriterOptions options) + internal static ComputerCallOutput DeserializeComputerCallOutput(JsonElement element, ModelReaderWriterOptions options) { if (element.ValueKind == JsonValueKind.Null) { @@ -87,37 +87,37 @@ internal static ComputerOutput DeserializeComputerOutput(JsonElement element, Mo return InternalUnknownComputerToolCallOutputItemOutput.DeserializeInternalUnknownComputerToolCallOutputItemOutput(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, OpenAIContext.Default); default: - throw new FormatException($"The model {nameof(ComputerOutput)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support writing '{options.Format}' format."); } } - ComputerOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + ComputerCallOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); - protected virtual ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + protected virtual ComputerCallOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": using (JsonDocument document = JsonDocument.Parse(data)) { - return DeserializeComputerOutput(document.RootElement, options); + return DeserializeComputerCallOutput(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ComputerOutput)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/src/Generated/Models/Responses/ComputerOutput.cs b/src/Generated/Models/Responses/ComputerCallOutput.cs similarity index 71% rename from src/Generated/Models/Responses/ComputerOutput.cs rename to src/Generated/Models/Responses/ComputerCallOutput.cs index bbef7123c..b0847e251 100644 --- a/src/Generated/Models/Responses/ComputerOutput.cs +++ b/src/Generated/Models/Responses/ComputerCallOutput.cs @@ -9,16 +9,16 @@ namespace OpenAI.Responses { [Experimental("OPENAICUA001")] - public partial class ComputerOutput + public partial class ComputerCallOutput { private protected IDictionary _additionalBinaryDataProperties; - private protected ComputerOutput(InternalComputerUsePreviewToolCallOutputOutputType kind) + private protected ComputerCallOutput(InternalComputerUsePreviewToolCallOutputOutputType kind) { Kind = kind; } - internal ComputerOutput(InternalComputerUsePreviewToolCallOutputOutputType kind, IDictionary additionalBinaryDataProperties) + internal ComputerCallOutput(InternalComputerUsePreviewToolCallOutputOutputType kind, IDictionary additionalBinaryDataProperties) { Kind = kind; _additionalBinaryDataProperties = additionalBinaryDataProperties; diff --git a/src/Generated/Models/Responses/ComputerCallOutputResponseItem.Serialization.cs b/src/Generated/Models/Responses/ComputerCallOutputResponseItem.Serialization.cs index 9bc4d6fa8..04416e61a 100644 --- a/src/Generated/Models/Responses/ComputerCallOutputResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/ComputerCallOutputResponseItem.Serialization.cs @@ -51,6 +51,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("output"u8); writer.WriteObjectValue(Output, options); } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { @@ -83,7 +84,7 @@ internal static ComputerCallOutputResponseItem DeserializeComputerCallOutputResp IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string callId = default; IList acknowledgedSafetyChecks = default; - ComputerOutput output = default; + ComputerCallOutput output = default; ComputerCallOutputStatus? status = default; foreach (var prop in element.EnumerateObject()) { @@ -118,7 +119,7 @@ internal static ComputerCallOutputResponseItem DeserializeComputerCallOutputResp } if (prop.NameEquals("output"u8)) { - output = ComputerOutput.DeserializeComputerOutput(prop.Value, options); + output = ComputerCallOutput.DeserializeComputerCallOutput(prop.Value, options); continue; } if (prop.NameEquals("status"u8)) diff --git a/src/Generated/Models/Responses/ComputerCallOutputResponseItem.cs b/src/Generated/Models/Responses/ComputerCallOutputResponseItem.cs index 9b886d77f..762799534 100644 --- a/src/Generated/Models/Responses/ComputerCallOutputResponseItem.cs +++ b/src/Generated/Models/Responses/ComputerCallOutputResponseItem.cs @@ -12,15 +12,17 @@ namespace OpenAI.Responses [Experimental("OPENAICUA001")] public partial class ComputerCallOutputResponseItem : ResponseItem { - internal ComputerCallOutputResponseItem(string id, string callId, ComputerOutput output, ComputerCallOutputStatus? status) : base(InternalItemType.ComputerCallOutput, id) + public ComputerCallOutputResponseItem(string callId, ComputerCallOutput output) : base(InternalItemType.ComputerCallOutput) { + Argument.AssertNotNull(callId, nameof(callId)); + Argument.AssertNotNull(output, nameof(output)); + CallId = callId; AcknowledgedSafetyChecks = new ChangeTrackingList(); Output = output; - Status = status; } - internal ComputerCallOutputResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string callId, IList acknowledgedSafetyChecks, ComputerOutput output, ComputerCallOutputStatus? status) : base(kind, id, additionalBinaryDataProperties) + internal ComputerCallOutputResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string callId, IList acknowledgedSafetyChecks, ComputerCallOutput output, ComputerCallOutputStatus? status) : base(kind, id, additionalBinaryDataProperties) { // Plugin customization: ensure initialization of collections CallId = callId; @@ -29,10 +31,10 @@ internal ComputerCallOutputResponseItem(InternalItemType kind, string id, IDicti Status = status; } - public string CallId { get; } + public string CallId { get; set; } public IList AcknowledgedSafetyChecks { get; } - public ComputerOutput Output { get; } + public ComputerCallOutput Output { get; set; } } } diff --git a/src/Generated/Models/Responses/ComputerCallResponseItem.Serialization.cs b/src/Generated/Models/Responses/ComputerCallResponseItem.Serialization.cs index 9e6450bcf..f13dd0009 100644 --- a/src/Generated/Models/Responses/ComputerCallResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/ComputerCallResponseItem.Serialization.cs @@ -51,6 +51,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { diff --git a/src/Generated/Models/Responses/ComputerCallResponseItem.cs b/src/Generated/Models/Responses/ComputerCallResponseItem.cs index e3f2d612e..9fc6eaa49 100644 --- a/src/Generated/Models/Responses/ComputerCallResponseItem.cs +++ b/src/Generated/Models/Responses/ComputerCallResponseItem.cs @@ -13,12 +13,15 @@ namespace OpenAI.Responses [Experimental("OPENAICUA001")] public partial class ComputerCallResponseItem : ResponseItem { - internal ComputerCallResponseItem(string id, string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks, ComputerCallStatus? status) : base(InternalItemType.ComputerCall, id) + public ComputerCallResponseItem(string callId, ComputerCallAction action, IEnumerable pendingSafetyChecks) : base(InternalItemType.ComputerCall) { + Argument.AssertNotNull(callId, nameof(callId)); + Argument.AssertNotNull(action, nameof(action)); + Argument.AssertNotNull(pendingSafetyChecks, nameof(pendingSafetyChecks)); + CallId = callId; Action = action; PendingSafetyChecks = pendingSafetyChecks.ToList(); - Status = status; } internal ComputerCallResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string callId, ComputerCallAction action, IList pendingSafetyChecks, ComputerCallStatus? status) : base(kind, id, additionalBinaryDataProperties) @@ -30,9 +33,9 @@ internal ComputerCallResponseItem(InternalItemType kind, string id, IDictionary< Status = status; } - public string CallId { get; } + public string CallId { get; set; } - public ComputerCallAction Action { get; } + public ComputerCallAction Action { get; set; } public IList PendingSafetyChecks { get; } } diff --git a/src/Generated/Models/Responses/FileSearchCallResponseItem.Serialization.cs b/src/Generated/Models/Responses/FileSearchCallResponseItem.Serialization.cs index d7b5a9ec2..ede998f8b 100644 --- a/src/Generated/Models/Responses/FileSearchCallResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/FileSearchCallResponseItem.Serialization.cs @@ -56,6 +56,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { diff --git a/src/Generated/Models/Responses/FileSearchCallResponseItem.cs b/src/Generated/Models/Responses/FileSearchCallResponseItem.cs index e2a11b18a..02f0d6ddd 100644 --- a/src/Generated/Models/Responses/FileSearchCallResponseItem.cs +++ b/src/Generated/Models/Responses/FileSearchCallResponseItem.cs @@ -13,11 +13,12 @@ namespace OpenAI.Responses [Experimental("OPENAI001")] public partial class FileSearchCallResponseItem : ResponseItem { - internal FileSearchCallResponseItem(string id, IEnumerable queries, FileSearchCallStatus? status) : base(InternalItemType.FileSearchCall, id) + public FileSearchCallResponseItem(IEnumerable queries) : base(InternalItemType.FileSearchCall) { + Argument.AssertNotNull(queries, nameof(queries)); + Queries = queries.ToList(); Results = new ChangeTrackingList(); - Status = status; } internal FileSearchCallResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, IList queries, IList results, FileSearchCallStatus? status) : base(kind, id, additionalBinaryDataProperties) @@ -30,6 +31,6 @@ internal FileSearchCallResponseItem(InternalItemType kind, string id, IDictionar public IList Queries { get; } - public IList Results { get; } + public IList Results { get; set; } } } diff --git a/src/Generated/Models/Responses/FileSearchCallResult.Serialization.cs b/src/Generated/Models/Responses/FileSearchCallResult.Serialization.cs index c4b22aed9..a5d145125 100644 --- a/src/Generated/Models/Responses/FileSearchCallResult.Serialization.cs +++ b/src/Generated/Models/Responses/FileSearchCallResult.Serialization.cs @@ -41,11 +41,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("filename"u8); writer.WriteStringValue(Filename); } - if (Optional.IsDefined(Score) && _additionalBinaryDataProperties?.ContainsKey("score") != true) - { - writer.WritePropertyName("score"u8); - writer.WriteNumberValue(Score.Value); - } if (Optional.IsCollectionDefined(Attributes) && _additionalBinaryDataProperties?.ContainsKey("attributes") != true) { writer.WritePropertyName("attributes"u8); @@ -69,6 +64,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } + if (Optional.IsDefined(Score) && _additionalBinaryDataProperties?.ContainsKey("score") != true) + { + writer.WritePropertyName("score"u8); + writer.WriteNumberValue(Score.Value); + } // Plugin customization: remove options.Format != "W" check if (_additionalBinaryDataProperties != null) { @@ -113,8 +113,8 @@ internal static FileSearchCallResult DeserializeFileSearchCallResult(JsonElement string fileId = default; string text = default; string filename = default; + IDictionary attributes = default; float? score = default; - IReadOnlyDictionary attributes = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); foreach (var prop in element.EnumerateObject()) { @@ -133,15 +133,6 @@ internal static FileSearchCallResult DeserializeFileSearchCallResult(JsonElement filename = prop.Value.GetString(); continue; } - if (prop.NameEquals("score"u8)) - { - if (prop.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - score = prop.Value.GetSingle(); - continue; - } if (prop.NameEquals("attributes"u8)) { if (prop.Value.ValueKind == JsonValueKind.Null) @@ -163,6 +154,15 @@ internal static FileSearchCallResult DeserializeFileSearchCallResult(JsonElement attributes = dictionary; continue; } + if (prop.NameEquals("score"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + score = prop.Value.GetSingle(); + continue; + } // Plugin customization: remove options.Format != "W" check additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } @@ -170,8 +170,8 @@ internal static FileSearchCallResult DeserializeFileSearchCallResult(JsonElement fileId, text, filename, - score, attributes ?? new ChangeTrackingDictionary(), + score, additionalBinaryDataProperties); } diff --git a/src/Generated/Models/Responses/FileSearchCallResult.cs b/src/Generated/Models/Responses/FileSearchCallResult.cs index 4b7234457..d60833d6f 100644 --- a/src/Generated/Models/Responses/FileSearchCallResult.cs +++ b/src/Generated/Models/Responses/FileSearchCallResult.cs @@ -14,18 +14,18 @@ public partial class FileSearchCallResult { private protected IDictionary _additionalBinaryDataProperties; - public FileSearchCallResult() : this(null, null, null, default, null, null) + public FileSearchCallResult() : this(null, null, null, null, default, null) { } - internal FileSearchCallResult(string fileId, string text, string filename, float? score, IReadOnlyDictionary attributes, IDictionary additionalBinaryDataProperties) + internal FileSearchCallResult(string fileId, string text, string filename, IDictionary attributes, float? score, IDictionary additionalBinaryDataProperties) { // Plugin customization: ensure initialization of collections FileId = fileId; Text = text; Filename = filename; - Score = score; Attributes = attributes ?? new ChangeTrackingDictionary(); + Score = score; _additionalBinaryDataProperties = additionalBinaryDataProperties; } @@ -35,6 +35,8 @@ internal FileSearchCallResult(string fileId, string text, string filename, float public string Filename { get; set; } + public IDictionary Attributes { get; } + public float? Score { get; set; } internal IDictionary SerializedAdditionalRawData diff --git a/src/Generated/Models/Responses/FunctionCallOutputResponseItem.Serialization.cs b/src/Generated/Models/Responses/FunctionCallOutputResponseItem.Serialization.cs index 8665b9bc1..7f978d0a1 100644 --- a/src/Generated/Models/Responses/FunctionCallOutputResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/FunctionCallOutputResponseItem.Serialization.cs @@ -41,6 +41,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("output"u8); writer.WriteStringValue(FunctionOutput); } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { diff --git a/src/Generated/Models/Responses/FunctionCallOutputResponseItem.cs b/src/Generated/Models/Responses/FunctionCallOutputResponseItem.cs index 99cf239f0..12b982eb0 100644 --- a/src/Generated/Models/Responses/FunctionCallOutputResponseItem.cs +++ b/src/Generated/Models/Responses/FunctionCallOutputResponseItem.cs @@ -5,17 +5,20 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using OpenAI; namespace OpenAI.Responses { [Experimental("OPENAI001")] public partial class FunctionCallOutputResponseItem : ResponseItem { - internal FunctionCallOutputResponseItem(string id, string callId, string functionOutput, FunctionCallOutputStatus? status) : base(InternalItemType.FunctionCallOutput, id) + public FunctionCallOutputResponseItem(string callId, string functionOutput) : base(InternalItemType.FunctionCallOutput) { + Argument.AssertNotNull(callId, nameof(callId)); + Argument.AssertNotNull(functionOutput, nameof(functionOutput)); + CallId = callId; FunctionOutput = functionOutput; - Status = status; } internal FunctionCallOutputResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string callId, string functionOutput, FunctionCallOutputStatus? status) : base(kind, id, additionalBinaryDataProperties) @@ -25,6 +28,8 @@ internal FunctionCallOutputResponseItem(InternalItemType kind, string id, IDicti Status = status; } - public string CallId { get; } + public string CallId { get; set; } + + public string FunctionOutput { get; set; } } } diff --git a/src/Generated/Models/Responses/FunctionCallResponseItem.Serialization.cs b/src/Generated/Models/Responses/FunctionCallResponseItem.Serialization.cs index 5df964f2e..6a18394f1 100644 --- a/src/Generated/Models/Responses/FunctionCallResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/FunctionCallResponseItem.Serialization.cs @@ -46,6 +46,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("arguments"u8); SerializeFunctionArgumentsValue(writer, options); } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { diff --git a/src/Generated/Models/Responses/FunctionCallResponseItem.cs b/src/Generated/Models/Responses/FunctionCallResponseItem.cs index ead18af1a..f30d21021 100644 --- a/src/Generated/Models/Responses/FunctionCallResponseItem.cs +++ b/src/Generated/Models/Responses/FunctionCallResponseItem.cs @@ -5,18 +5,22 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using OpenAI; namespace OpenAI.Responses { [Experimental("OPENAI001")] public partial class FunctionCallResponseItem : ResponseItem { - internal FunctionCallResponseItem(string id, string callId, string functionName, BinaryData functionArguments, FunctionCallStatus? status) : base(InternalItemType.FunctionCall, id) + public FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments) : base(InternalItemType.FunctionCall) { + Argument.AssertNotNull(callId, nameof(callId)); + Argument.AssertNotNull(functionName, nameof(functionName)); + Argument.AssertNotNull(functionArguments, nameof(functionArguments)); + CallId = callId; FunctionName = functionName; FunctionArguments = functionArguments; - Status = status; } internal FunctionCallResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string callId, string functionName, BinaryData functionArguments, FunctionCallStatus? status) : base(kind, id, additionalBinaryDataProperties) @@ -27,6 +31,10 @@ internal FunctionCallResponseItem(InternalItemType kind, string id, IDictionary< Status = status; } - public string CallId { get; } + public string CallId { get; set; } + + public string FunctionName { get; set; } + + public BinaryData FunctionArguments { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalCodeInterpreterToolCallItemResource.cs b/src/Generated/Models/Responses/InternalCodeInterpreterToolCallItemResource.cs index beb0dfbf1..670f6aca2 100644 --- a/src/Generated/Models/Responses/InternalCodeInterpreterToolCallItemResource.cs +++ b/src/Generated/Models/Responses/InternalCodeInterpreterToolCallItemResource.cs @@ -11,8 +11,11 @@ namespace OpenAI.Responses { internal partial class InternalCodeInterpreterToolCallItemResource : ResponseItem { - internal InternalCodeInterpreterToolCallItemResource(string id, InternalCodeInterpreterToolCallItemResourceStatus status, string code, IEnumerable results) : base(InternalItemType.CodeInterpreterCall, id) + internal InternalCodeInterpreterToolCallItemResource(InternalCodeInterpreterToolCallItemResourceStatus status, string code, IEnumerable results) : base(InternalItemType.CodeInterpreterCall) { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(results, nameof(results)); + Status = status; Code = code; Results = results.ToList(); @@ -27,11 +30,11 @@ internal InternalCodeInterpreterToolCallItemResource(InternalItemType kind, stri Results = results ?? new ChangeTrackingList(); } - internal InternalCodeInterpreterToolCallItemResourceStatus Status { get; } + internal InternalCodeInterpreterToolCallItemResourceStatus Status { get; set; } - public string ContainerId { get; } + public string ContainerId { get; set; } - public string Code { get; } + public string Code { get; set; } public IList Results { get; } } diff --git a/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.Serialization.cs b/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.Serialization.cs index 1f024c533..16eade16b 100644 --- a/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.Serialization.cs +++ b/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.Serialization.cs @@ -41,7 +41,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri InternalComputerToolCallOutputItemOutputComputerScreenshot IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalComputerToolCallOutputItemOutputComputerScreenshot)JsonModelCreateCore(ref reader, options); - protected override ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + protected override ComputerCallOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -101,7 +101,7 @@ protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions InternalComputerToolCallOutputItemOutputComputerScreenshot IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalComputerToolCallOutputItemOutputComputerScreenshot)PersistableModelCreateCore(data, options); - protected override ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + protected override ComputerCallOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) { string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) diff --git a/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.cs b/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.cs index 3387000f5..e048cb1e6 100644 --- a/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.cs +++ b/src/Generated/Models/Responses/InternalComputerToolCallOutputItemOutputComputerScreenshot.cs @@ -7,7 +7,7 @@ namespace OpenAI.Responses { - internal partial class InternalComputerToolCallOutputItemOutputComputerScreenshot : ComputerOutput + internal partial class InternalComputerToolCallOutputItemOutputComputerScreenshot : ComputerCallOutput { public InternalComputerToolCallOutputItemOutputComputerScreenshot() : this(InternalComputerUsePreviewToolCallOutputOutputType.Screenshot, null, null, null) { diff --git a/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.Serialization.cs b/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.Serialization.cs index a391d46e6..c1fa12fd2 100644 --- a/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.Serialization.cs +++ b/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.Serialization.cs @@ -76,7 +76,7 @@ internal static InternalComputerUsePreviewToolCallOutputItemParam DeserializeInt IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string callId = default; IList acknowledgedSafetyChecks = default; - ComputerOutput output = default; + ComputerCallOutput output = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("type"u8)) @@ -105,7 +105,7 @@ internal static InternalComputerUsePreviewToolCallOutputItemParam DeserializeInt } if (prop.NameEquals("output"u8)) { - output = ComputerOutput.DeserializeComputerOutput(prop.Value, options); + output = ComputerCallOutput.DeserializeComputerCallOutput(prop.Value, options); continue; } // Plugin customization: remove options.Format != "W" check diff --git a/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.cs b/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.cs index 99ad4128c..2d65be874 100644 --- a/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.cs +++ b/src/Generated/Models/Responses/InternalComputerUsePreviewToolCallOutputItemParam.cs @@ -10,7 +10,7 @@ namespace OpenAI.Responses { internal partial class InternalComputerUsePreviewToolCallOutputItemParam : InternalItemParam { - public InternalComputerUsePreviewToolCallOutputItemParam(string callId, ComputerOutput output) : base(InternalItemType.ComputerCallOutput) + public InternalComputerUsePreviewToolCallOutputItemParam(string callId, ComputerCallOutput output) : base(InternalItemType.ComputerCallOutput) { Argument.AssertNotNull(callId, nameof(callId)); Argument.AssertNotNull(output, nameof(output)); @@ -20,7 +20,7 @@ public InternalComputerUsePreviewToolCallOutputItemParam(string callId, Computer Output = output; } - internal InternalComputerUsePreviewToolCallOutputItemParam(InternalItemType kind, IDictionary additionalBinaryDataProperties, string callId, IList acknowledgedSafetyChecks, ComputerOutput output) : base(kind, additionalBinaryDataProperties) + internal InternalComputerUsePreviewToolCallOutputItemParam(InternalItemType kind, IDictionary additionalBinaryDataProperties, string callId, IList acknowledgedSafetyChecks, ComputerCallOutput output) : base(kind, additionalBinaryDataProperties) { // Plugin customization: ensure initialization of collections CallId = callId; @@ -32,6 +32,6 @@ internal InternalComputerUsePreviewToolCallOutputItemParam(InternalItemType kind public IList AcknowledgedSafetyChecks { get; } - public ComputerOutput Output { get; } + public ComputerCallOutput Output { get; } } } diff --git a/src/Generated/Models/Responses/InternalImageGenToolCallItemResource.cs b/src/Generated/Models/Responses/InternalImageGenToolCallItemResource.cs index e1c6071cc..ca17fd5f1 100644 --- a/src/Generated/Models/Responses/InternalImageGenToolCallItemResource.cs +++ b/src/Generated/Models/Responses/InternalImageGenToolCallItemResource.cs @@ -9,7 +9,7 @@ namespace OpenAI.Responses { internal partial class InternalImageGenToolCallItemResource : ResponseItem { - internal InternalImageGenToolCallItemResource(string id, InternalImageGenToolCallItemResourceStatus status, string result) : base(InternalItemType.ImageGenerationCall, id) + internal InternalImageGenToolCallItemResource(InternalImageGenToolCallItemResourceStatus status, string result) : base(InternalItemType.ImageGenerationCall) { Status = status; Result = result; @@ -21,8 +21,8 @@ internal InternalImageGenToolCallItemResource(InternalItemType kind, string id, Result = result; } - internal InternalImageGenToolCallItemResourceStatus Status { get; } + internal InternalImageGenToolCallItemResourceStatus Status { get; set; } - public string Result { get; } + public string Result { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalLocalShellToolCallItemResource.cs b/src/Generated/Models/Responses/InternalLocalShellToolCallItemResource.cs index d5391817f..161653074 100644 --- a/src/Generated/Models/Responses/InternalLocalShellToolCallItemResource.cs +++ b/src/Generated/Models/Responses/InternalLocalShellToolCallItemResource.cs @@ -4,13 +4,17 @@ using System; using System.Collections.Generic; +using OpenAI; namespace OpenAI.Responses { internal partial class InternalLocalShellToolCallItemResource : ResponseItem { - internal InternalLocalShellToolCallItemResource(string id, InternalLocalShellToolCallItemResourceStatus status, string callId, InternalLocalShellExecAction action) : base(InternalItemType.LocalShellCall, id) + internal InternalLocalShellToolCallItemResource(InternalLocalShellToolCallItemResourceStatus status, string callId, InternalLocalShellExecAction action) : base(InternalItemType.LocalShellCall) { + Argument.AssertNotNull(callId, nameof(callId)); + Argument.AssertNotNull(action, nameof(action)); + Status = status; CallId = callId; Action = action; @@ -23,10 +27,10 @@ internal InternalLocalShellToolCallItemResource(InternalItemType kind, string id Action = action; } - internal InternalLocalShellToolCallItemResourceStatus Status { get; } + internal InternalLocalShellToolCallItemResourceStatus Status { get; set; } - public string CallId { get; } + public string CallId { get; set; } - internal InternalLocalShellExecAction Action { get; } + internal InternalLocalShellExecAction Action { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalLocalShellToolCallOutputItemResource.cs b/src/Generated/Models/Responses/InternalLocalShellToolCallOutputItemResource.cs index bfc1f48ae..32967a25e 100644 --- a/src/Generated/Models/Responses/InternalLocalShellToolCallOutputItemResource.cs +++ b/src/Generated/Models/Responses/InternalLocalShellToolCallOutputItemResource.cs @@ -4,13 +4,16 @@ using System; using System.Collections.Generic; +using OpenAI; namespace OpenAI.Responses { internal partial class InternalLocalShellToolCallOutputItemResource : ResponseItem { - internal InternalLocalShellToolCallOutputItemResource(string id, InternalLocalShellToolCallOutputItemResourceStatus status, string output) : base(InternalItemType.LocalShellCallOutput, id) + internal InternalLocalShellToolCallOutputItemResource(InternalLocalShellToolCallOutputItemResourceStatus status, string output) : base(InternalItemType.LocalShellCallOutput) { + Argument.AssertNotNull(output, nameof(output)); + Status = status; Output = output; } @@ -21,8 +24,8 @@ internal InternalLocalShellToolCallOutputItemResource(InternalItemType kind, str Output = output; } - internal InternalLocalShellToolCallOutputItemResourceStatus Status { get; } + internal InternalLocalShellToolCallOutputItemResourceStatus Status { get; set; } - public string Output { get; } + public string Output { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalMCPApprovalRequestItemResource.cs b/src/Generated/Models/Responses/InternalMCPApprovalRequestItemResource.cs index 6ca908e27..7a7ed43ec 100644 --- a/src/Generated/Models/Responses/InternalMCPApprovalRequestItemResource.cs +++ b/src/Generated/Models/Responses/InternalMCPApprovalRequestItemResource.cs @@ -4,13 +4,18 @@ using System; using System.Collections.Generic; +using OpenAI; namespace OpenAI.Responses { internal partial class InternalMCPApprovalRequestItemResource : ResponseItem { - internal InternalMCPApprovalRequestItemResource(string id, string serverLabel, string name, string arguments) : base(InternalItemType.McpApprovalRequest, id) + public InternalMCPApprovalRequestItemResource(string serverLabel, string name, string arguments) : base(InternalItemType.McpApprovalRequest) { + Argument.AssertNotNull(serverLabel, nameof(serverLabel)); + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(arguments, nameof(arguments)); + ServerLabel = serverLabel; Name = name; Arguments = arguments; @@ -23,10 +28,10 @@ internal InternalMCPApprovalRequestItemResource(InternalItemType kind, string id Arguments = arguments; } - public string ServerLabel { get; } + public string ServerLabel { get; set; } - public string Name { get; } + public string Name { get; set; } - public string Arguments { get; } + public string Arguments { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalMCPApprovalResponseItemResource.cs b/src/Generated/Models/Responses/InternalMCPApprovalResponseItemResource.cs index 8dbd2e28b..8f6f94e74 100644 --- a/src/Generated/Models/Responses/InternalMCPApprovalResponseItemResource.cs +++ b/src/Generated/Models/Responses/InternalMCPApprovalResponseItemResource.cs @@ -4,13 +4,16 @@ using System; using System.Collections.Generic; +using OpenAI; namespace OpenAI.Responses { internal partial class InternalMCPApprovalResponseItemResource : ResponseItem { - internal InternalMCPApprovalResponseItemResource(string id, string approvalRequestId, bool approve) : base(InternalItemType.McpApprovalResponse, id) + public InternalMCPApprovalResponseItemResource(string approvalRequestId, bool approve) : base(InternalItemType.McpApprovalResponse) { + Argument.AssertNotNull(approvalRequestId, nameof(approvalRequestId)); + ApprovalRequestId = approvalRequestId; Approve = approve; } @@ -22,10 +25,10 @@ internal InternalMCPApprovalResponseItemResource(InternalItemType kind, string i Reason = reason; } - public string ApprovalRequestId { get; } + public string ApprovalRequestId { get; set; } - public bool Approve { get; } + public bool Approve { get; set; } - public string Reason { get; } + public string Reason { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalMCPCallItemResource.cs b/src/Generated/Models/Responses/InternalMCPCallItemResource.cs index 4d8d6bf50..b64039246 100644 --- a/src/Generated/Models/Responses/InternalMCPCallItemResource.cs +++ b/src/Generated/Models/Responses/InternalMCPCallItemResource.cs @@ -4,13 +4,18 @@ using System; using System.Collections.Generic; +using OpenAI; namespace OpenAI.Responses { internal partial class InternalMCPCallItemResource : ResponseItem { - internal InternalMCPCallItemResource(string id, string serverLabel, string name, string arguments) : base(InternalItemType.McpCall, id) + public InternalMCPCallItemResource(string serverLabel, string name, string arguments) : base(InternalItemType.McpCall) { + Argument.AssertNotNull(serverLabel, nameof(serverLabel)); + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(arguments, nameof(arguments)); + ServerLabel = serverLabel; Name = name; Arguments = arguments; @@ -25,14 +30,14 @@ internal InternalMCPCallItemResource(InternalItemType kind, string id, IDictiona Error = error; } - public string ServerLabel { get; } + public string ServerLabel { get; set; } - public string Name { get; } + public string Name { get; set; } - public string Arguments { get; } + public string Arguments { get; set; } - public string Output { get; } + public string Output { get; set; } - public string Error { get; } + public string Error { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalMCPListToolsItemResource.cs b/src/Generated/Models/Responses/InternalMCPListToolsItemResource.cs index ea8a046f1..795105633 100644 --- a/src/Generated/Models/Responses/InternalMCPListToolsItemResource.cs +++ b/src/Generated/Models/Responses/InternalMCPListToolsItemResource.cs @@ -11,8 +11,11 @@ namespace OpenAI.Responses { internal partial class InternalMCPListToolsItemResource : ResponseItem { - internal InternalMCPListToolsItemResource(string id, string serverLabel, IEnumerable tools) : base(InternalItemType.McpListTools, id) + internal InternalMCPListToolsItemResource(string serverLabel, IEnumerable tools) : base(InternalItemType.McpListTools) { + Argument.AssertNotNull(serverLabel, nameof(serverLabel)); + Argument.AssertNotNull(tools, nameof(tools)); + ServerLabel = serverLabel; Tools = tools.ToList(); } @@ -25,10 +28,10 @@ internal InternalMCPListToolsItemResource(InternalItemType kind, string id, IDic Error = error; } - public string ServerLabel { get; } + public string ServerLabel { get; set; } internal IList Tools { get; } - public string Error { get; } + public string Error { get; set; } } } diff --git a/src/Generated/Models/Responses/InternalResponsesAssistantMessage.Serialization.cs b/src/Generated/Models/Responses/InternalResponsesAssistantMessage.Serialization.cs index c319fe622..c25c2585d 100644 --- a/src/Generated/Models/Responses/InternalResponsesAssistantMessage.Serialization.cs +++ b/src/Generated/Models/Responses/InternalResponsesAssistantMessage.Serialization.cs @@ -65,8 +65,8 @@ internal static InternalResponsesAssistantMessage DeserializeInternalResponsesAs InternalItemType kind = default; string id = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); - InternalResponsesMessageRole internalRole = default; MessageStatus? status = default; + InternalResponsesMessageRole internalRole = default; IList internalContent = default; foreach (var prop in element.EnumerateObject()) { @@ -80,14 +80,14 @@ internal static InternalResponsesAssistantMessage DeserializeInternalResponsesAs id = prop.Value.GetString(); continue; } - if (prop.NameEquals("role"u8)) + if (prop.NameEquals("status"u8)) { - internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); + status = prop.Value.GetString().ToMessageStatus(); continue; } - if (prop.NameEquals("status"u8)) + if (prop.NameEquals("role"u8)) { - status = prop.Value.GetString().ToMessageStatus(); + internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); continue; } if (prop.NameEquals("content"u8)) @@ -107,8 +107,8 @@ internal static InternalResponsesAssistantMessage DeserializeInternalResponsesAs kind, id, additionalBinaryDataProperties, - internalRole, status, + internalRole, internalContent); } diff --git a/src/Generated/Models/Responses/InternalResponsesAssistantMessage.cs b/src/Generated/Models/Responses/InternalResponsesAssistantMessage.cs index f94641aee..ac1146c93 100644 --- a/src/Generated/Models/Responses/InternalResponsesAssistantMessage.cs +++ b/src/Generated/Models/Responses/InternalResponsesAssistantMessage.cs @@ -11,12 +11,14 @@ namespace OpenAI.Responses { internal partial class InternalResponsesAssistantMessage : MessageResponseItem { - internal InternalResponsesAssistantMessage(string id, MessageStatus? status, IEnumerable internalContent) : base(id, InternalResponsesMessageRole.Assistant, status) + public InternalResponsesAssistantMessage(IEnumerable internalContent) : base(InternalResponsesMessageRole.Assistant) { + Argument.AssertNotNull(internalContent, nameof(internalContent)); + InternalContent = internalContent.ToList(); } - internal InternalResponsesAssistantMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, InternalResponsesMessageRole internalRole, MessageStatus? status, IList internalContent) : base(kind, id, additionalBinaryDataProperties, internalRole, status) + internal InternalResponsesAssistantMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, MessageStatus? status, InternalResponsesMessageRole internalRole, IList internalContent) : base(kind, id, additionalBinaryDataProperties, status, internalRole) { // Plugin customization: ensure initialization of collections InternalContent = internalContent ?? new ChangeTrackingList(); diff --git a/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.Serialization.cs b/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.Serialization.cs index 833a6d6dd..051e5d602 100644 --- a/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.Serialization.cs +++ b/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.Serialization.cs @@ -65,8 +65,8 @@ internal static InternalResponsesDeveloperMessage DeserializeInternalResponsesDe InternalItemType kind = default; string id = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); - InternalResponsesMessageRole internalRole = default; MessageStatus? status = default; + InternalResponsesMessageRole internalRole = default; IList internalContent = default; foreach (var prop in element.EnumerateObject()) { @@ -80,14 +80,14 @@ internal static InternalResponsesDeveloperMessage DeserializeInternalResponsesDe id = prop.Value.GetString(); continue; } - if (prop.NameEquals("role"u8)) + if (prop.NameEquals("status"u8)) { - internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); + status = prop.Value.GetString().ToMessageStatus(); continue; } - if (prop.NameEquals("status"u8)) + if (prop.NameEquals("role"u8)) { - status = prop.Value.GetString().ToMessageStatus(); + internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); continue; } if (prop.NameEquals("content"u8)) @@ -107,8 +107,8 @@ internal static InternalResponsesDeveloperMessage DeserializeInternalResponsesDe kind, id, additionalBinaryDataProperties, - internalRole, status, + internalRole, internalContent); } diff --git a/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.cs b/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.cs index 4bcf715c3..8433d85f3 100644 --- a/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.cs +++ b/src/Generated/Models/Responses/InternalResponsesDeveloperMessage.cs @@ -11,12 +11,14 @@ namespace OpenAI.Responses { internal partial class InternalResponsesDeveloperMessage : MessageResponseItem { - internal InternalResponsesDeveloperMessage(string id, MessageStatus? status, IEnumerable internalContent) : base(id, InternalResponsesMessageRole.Developer, status) + public InternalResponsesDeveloperMessage(IEnumerable internalContent) : base(InternalResponsesMessageRole.Developer) { + Argument.AssertNotNull(internalContent, nameof(internalContent)); + InternalContent = internalContent.ToList(); } - internal InternalResponsesDeveloperMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, InternalResponsesMessageRole internalRole, MessageStatus? status, IList internalContent) : base(kind, id, additionalBinaryDataProperties, internalRole, status) + internal InternalResponsesDeveloperMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, MessageStatus? status, InternalResponsesMessageRole internalRole, IList internalContent) : base(kind, id, additionalBinaryDataProperties, status, internalRole) { // Plugin customization: ensure initialization of collections InternalContent = internalContent ?? new ChangeTrackingList(); diff --git a/src/Generated/Models/Responses/InternalResponsesSystemMessage.Serialization.cs b/src/Generated/Models/Responses/InternalResponsesSystemMessage.Serialization.cs index 9a7e79bf1..b3255b98b 100644 --- a/src/Generated/Models/Responses/InternalResponsesSystemMessage.Serialization.cs +++ b/src/Generated/Models/Responses/InternalResponsesSystemMessage.Serialization.cs @@ -65,8 +65,8 @@ internal static InternalResponsesSystemMessage DeserializeInternalResponsesSyste InternalItemType kind = default; string id = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); - InternalResponsesMessageRole internalRole = default; MessageStatus? status = default; + InternalResponsesMessageRole internalRole = default; IList internalContent = default; foreach (var prop in element.EnumerateObject()) { @@ -80,14 +80,14 @@ internal static InternalResponsesSystemMessage DeserializeInternalResponsesSyste id = prop.Value.GetString(); continue; } - if (prop.NameEquals("role"u8)) + if (prop.NameEquals("status"u8)) { - internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); + status = prop.Value.GetString().ToMessageStatus(); continue; } - if (prop.NameEquals("status"u8)) + if (prop.NameEquals("role"u8)) { - status = prop.Value.GetString().ToMessageStatus(); + internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); continue; } if (prop.NameEquals("content"u8)) @@ -107,8 +107,8 @@ internal static InternalResponsesSystemMessage DeserializeInternalResponsesSyste kind, id, additionalBinaryDataProperties, - internalRole, status, + internalRole, internalContent); } diff --git a/src/Generated/Models/Responses/InternalResponsesSystemMessage.cs b/src/Generated/Models/Responses/InternalResponsesSystemMessage.cs index d47eda57a..c70a54e68 100644 --- a/src/Generated/Models/Responses/InternalResponsesSystemMessage.cs +++ b/src/Generated/Models/Responses/InternalResponsesSystemMessage.cs @@ -11,12 +11,14 @@ namespace OpenAI.Responses { internal partial class InternalResponsesSystemMessage : MessageResponseItem { - internal InternalResponsesSystemMessage(string id, MessageStatus? status, IEnumerable internalContent) : base(id, InternalResponsesMessageRole.System, status) + public InternalResponsesSystemMessage(IEnumerable internalContent) : base(InternalResponsesMessageRole.System) { + Argument.AssertNotNull(internalContent, nameof(internalContent)); + InternalContent = internalContent.ToList(); } - internal InternalResponsesSystemMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, InternalResponsesMessageRole internalRole, MessageStatus? status, IList internalContent) : base(kind, id, additionalBinaryDataProperties, internalRole, status) + internal InternalResponsesSystemMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, MessageStatus? status, InternalResponsesMessageRole internalRole, IList internalContent) : base(kind, id, additionalBinaryDataProperties, status, internalRole) { // Plugin customization: ensure initialization of collections InternalContent = internalContent ?? new ChangeTrackingList(); diff --git a/src/Generated/Models/Responses/InternalResponsesUserMessage.Serialization.cs b/src/Generated/Models/Responses/InternalResponsesUserMessage.Serialization.cs index 2acfb3a1e..88d6350ae 100644 --- a/src/Generated/Models/Responses/InternalResponsesUserMessage.Serialization.cs +++ b/src/Generated/Models/Responses/InternalResponsesUserMessage.Serialization.cs @@ -65,8 +65,8 @@ internal static InternalResponsesUserMessage DeserializeInternalResponsesUserMes InternalItemType kind = default; string id = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); - InternalResponsesMessageRole internalRole = default; MessageStatus? status = default; + InternalResponsesMessageRole internalRole = default; IList internalContent = default; foreach (var prop in element.EnumerateObject()) { @@ -80,14 +80,14 @@ internal static InternalResponsesUserMessage DeserializeInternalResponsesUserMes id = prop.Value.GetString(); continue; } - if (prop.NameEquals("role"u8)) + if (prop.NameEquals("status"u8)) { - internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); + status = prop.Value.GetString().ToMessageStatus(); continue; } - if (prop.NameEquals("status"u8)) + if (prop.NameEquals("role"u8)) { - status = prop.Value.GetString().ToMessageStatus(); + internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); continue; } if (prop.NameEquals("content"u8)) @@ -107,8 +107,8 @@ internal static InternalResponsesUserMessage DeserializeInternalResponsesUserMes kind, id, additionalBinaryDataProperties, - internalRole, status, + internalRole, internalContent); } diff --git a/src/Generated/Models/Responses/InternalResponsesUserMessage.cs b/src/Generated/Models/Responses/InternalResponsesUserMessage.cs index 12a6eceba..62c82475b 100644 --- a/src/Generated/Models/Responses/InternalResponsesUserMessage.cs +++ b/src/Generated/Models/Responses/InternalResponsesUserMessage.cs @@ -11,12 +11,14 @@ namespace OpenAI.Responses { internal partial class InternalResponsesUserMessage : MessageResponseItem { - internal InternalResponsesUserMessage(string id, MessageStatus? status, IEnumerable internalContent) : base(id, InternalResponsesMessageRole.User, status) + public InternalResponsesUserMessage(IEnumerable internalContent) : base(InternalResponsesMessageRole.User) { + Argument.AssertNotNull(internalContent, nameof(internalContent)); + InternalContent = internalContent.ToList(); } - internal InternalResponsesUserMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, InternalResponsesMessageRole internalRole, MessageStatus? status, IList internalContent) : base(kind, id, additionalBinaryDataProperties, internalRole, status) + internal InternalResponsesUserMessage(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, MessageStatus? status, InternalResponsesMessageRole internalRole, IList internalContent) : base(kind, id, additionalBinaryDataProperties, status, internalRole) { // Plugin customization: ensure initialization of collections InternalContent = internalContent ?? new ChangeTrackingList(); diff --git a/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.Serialization.cs b/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.Serialization.cs index 0d20f323e..0c5d8bcef 100644 --- a/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.Serialization.cs +++ b/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.Serialization.cs @@ -10,13 +10,13 @@ namespace OpenAI.Responses { - internal partial class InternalUnknownComputerToolCallOutputItemOutput : IJsonModel + internal partial class InternalUnknownComputerToolCallOutputItemOutput : IJsonModel { internal InternalUnknownComputerToolCallOutputItemOutput() : this(default, null) { } - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -25,25 +25,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ComputerOutput)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - ComputerOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + ComputerCallOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); - protected override ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + protected override ComputerCallOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ComputerOutput)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeComputerOutput(document.RootElement, options); + return DeserializeComputerCallOutput(document.RootElement, options); } internal static InternalUnknownComputerToolCallOutputItemOutput DeserializeInternalUnknownComputerToolCallOutputItemOutput(JsonElement element, ModelReaderWriterOptions options) @@ -67,37 +67,37 @@ internal static InternalUnknownComputerToolCallOutputItemOutput DeserializeInter return new InternalUnknownComputerToolCallOutputItemOutput(kind, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, OpenAIContext.Default); default: - throw new FormatException($"The model {nameof(ComputerOutput)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support writing '{options.Format}' format."); } } - ComputerOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + ComputerCallOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); - protected override ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + protected override ComputerCallOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) { - string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": using (JsonDocument document = JsonDocument.Parse(data)) { - return DeserializeComputerOutput(document.RootElement, options); + return DeserializeComputerCallOutput(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ComputerOutput)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ComputerCallOutput)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.cs b/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.cs index 45d6a02d9..114a82dde 100644 --- a/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.cs +++ b/src/Generated/Models/Responses/InternalUnknownComputerToolCallOutputItemOutput.cs @@ -7,7 +7,7 @@ namespace OpenAI.Responses { - internal partial class InternalUnknownComputerToolCallOutputItemOutput : ComputerOutput + internal partial class InternalUnknownComputerToolCallOutputItemOutput : ComputerCallOutput { internal InternalUnknownComputerToolCallOutputItemOutput(InternalComputerUsePreviewToolCallOutputOutputType kind, IDictionary additionalBinaryDataProperties) : base(kind != default ? kind : "unknown", additionalBinaryDataProperties) { diff --git a/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.Serialization.cs b/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.Serialization.cs index d65184e1d..67adf0679 100644 --- a/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.Serialization.cs +++ b/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.Serialization.cs @@ -55,8 +55,8 @@ internal static InternalUnknownResponsesMessageItemResource DeserializeInternalU InternalItemType kind = default; string id = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); - InternalResponsesMessageRole internalRole = default; MessageStatus? status = default; + InternalResponsesMessageRole internalRole = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("type"u8)) @@ -69,20 +69,20 @@ internal static InternalUnknownResponsesMessageItemResource DeserializeInternalU id = prop.Value.GetString(); continue; } - if (prop.NameEquals("role"u8)) + if (prop.NameEquals("status"u8)) { - internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); + status = prop.Value.GetString().ToMessageStatus(); continue; } - if (prop.NameEquals("status"u8)) + if (prop.NameEquals("role"u8)) { - status = prop.Value.GetString().ToMessageStatus(); + internalRole = new InternalResponsesMessageRole(prop.Value.GetString()); continue; } // Plugin customization: remove options.Format != "W" check additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } - return new InternalUnknownResponsesMessageItemResource(kind, id, additionalBinaryDataProperties, internalRole, status); + return new InternalUnknownResponsesMessageItemResource(kind, id, additionalBinaryDataProperties, status, internalRole); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); diff --git a/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.cs b/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.cs index 73941f3bb..aa8c2b911 100644 --- a/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.cs +++ b/src/Generated/Models/Responses/InternalUnknownResponsesMessageItemResource.cs @@ -9,7 +9,7 @@ namespace OpenAI.Responses { internal partial class InternalUnknownResponsesMessageItemResource : MessageResponseItem { - internal InternalUnknownResponsesMessageItemResource(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, InternalResponsesMessageRole internalRole, MessageStatus? status) : base(kind != default ? kind : "unknown", id, additionalBinaryDataProperties, internalRole != default ? internalRole : "unknown", status) + internal InternalUnknownResponsesMessageItemResource(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, MessageStatus? status, InternalResponsesMessageRole internalRole) : base(kind != default ? kind : "unknown", id, additionalBinaryDataProperties, status, internalRole != default ? internalRole : "unknown") { } } diff --git a/src/Generated/Models/Responses/MessageResponseItem.Serialization.cs b/src/Generated/Models/Responses/MessageResponseItem.Serialization.cs index 2595246db..d482eb1fa 100644 --- a/src/Generated/Models/Responses/MessageResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/MessageResponseItem.Serialization.cs @@ -30,17 +30,18 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(MessageResponseItem)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - if (_additionalBinaryDataProperties?.ContainsKey("role") != true) - { - writer.WritePropertyName("role"u8); - writer.WriteStringValue(InternalRole.ToString()); - } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { writer.WritePropertyName("status"u8); writer.WriteStringValue(Status.Value.ToSerialString()); } + if (_additionalBinaryDataProperties?.ContainsKey("role") != true) + { + writer.WritePropertyName("role"u8); + writer.WriteStringValue(InternalRole.ToString()); + } } MessageResponseItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (MessageResponseItem)JsonModelCreateCore(ref reader, options); diff --git a/src/Generated/Models/Responses/MessageResponseItem.cs b/src/Generated/Models/Responses/MessageResponseItem.cs index 5d6d08567..1c84020c2 100644 --- a/src/Generated/Models/Responses/MessageResponseItem.cs +++ b/src/Generated/Models/Responses/MessageResponseItem.cs @@ -11,16 +11,15 @@ namespace OpenAI.Responses [Experimental("OPENAI001")] public partial class MessageResponseItem : ResponseItem { - internal MessageResponseItem(string id, InternalResponsesMessageRole internalRole, MessageStatus? status) : base(InternalItemType.Message, id) + internal MessageResponseItem(InternalResponsesMessageRole internalRole) : base(InternalItemType.Message) { InternalRole = internalRole; - Status = status; } - internal MessageResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, InternalResponsesMessageRole internalRole, MessageStatus? status) : base(kind, id, additionalBinaryDataProperties) + internal MessageResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, MessageStatus? status, InternalResponsesMessageRole internalRole) : base(kind, id, additionalBinaryDataProperties) { - InternalRole = internalRole; Status = status; + InternalRole = internalRole; } } } diff --git a/src/Generated/Models/Responses/ReasoningResponseItem.Serialization.cs b/src/Generated/Models/Responses/ReasoningResponseItem.Serialization.cs index 1bb70e1bd..8be47c043 100644 --- a/src/Generated/Models/Responses/ReasoningResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/ReasoningResponseItem.Serialization.cs @@ -12,7 +12,7 @@ namespace OpenAI.Responses { public partial class ReasoningResponseItem : IJsonModel { - internal ReasoningResponseItem() : this(InternalItemType.Reasoning, null, null, null, default, null) + internal ReasoningResponseItem() : this(InternalItemType.Reasoning, null, null, null, null, default) { } @@ -36,12 +36,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("encrypted_content"u8); writer.WriteStringValue(EncryptedContent); } - // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup - if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToSerialString()); - } if (_additionalBinaryDataProperties?.ContainsKey("summary") != true) { writer.WritePropertyName("summary"u8); @@ -52,6 +46,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + // Plugin customization: remove options.Format != "W" check + // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup + if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToSerialString()); + } } ReasoningResponseItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ReasoningResponseItem)JsonModelCreateCore(ref reader, options); @@ -77,8 +78,8 @@ internal static ReasoningResponseItem DeserializeReasoningResponseItem(JsonEleme string id = default; IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string encryptedContent = default; + IList summaryParts = default; ReasoningStatus? status = default; - IReadOnlyList summaryParts = default; foreach (var prop in element.EnumerateObject()) { if (prop.NameEquals("type"u8)) @@ -101,11 +102,6 @@ internal static ReasoningResponseItem DeserializeReasoningResponseItem(JsonEleme encryptedContent = prop.Value.GetString(); continue; } - if (prop.NameEquals("status"u8)) - { - status = prop.Value.GetString().ToReasoningStatus(); - continue; - } if (prop.NameEquals("summary"u8)) { List array = new List(); @@ -116,6 +112,11 @@ internal static ReasoningResponseItem DeserializeReasoningResponseItem(JsonEleme summaryParts = array; continue; } + if (prop.NameEquals("status"u8)) + { + status = prop.Value.GetString().ToReasoningStatus(); + continue; + } // Plugin customization: remove options.Format != "W" check additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } @@ -124,8 +125,8 @@ internal static ReasoningResponseItem DeserializeReasoningResponseItem(JsonEleme id, additionalBinaryDataProperties, encryptedContent, - status, - summaryParts); + summaryParts, + status); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); diff --git a/src/Generated/Models/Responses/ReasoningResponseItem.cs b/src/Generated/Models/Responses/ReasoningResponseItem.cs index f62f62987..b138a9288 100644 --- a/src/Generated/Models/Responses/ReasoningResponseItem.cs +++ b/src/Generated/Models/Responses/ReasoningResponseItem.cs @@ -13,20 +13,23 @@ namespace OpenAI.Responses [Experimental("OPENAI001")] public partial class ReasoningResponseItem : ResponseItem { - internal ReasoningResponseItem(string id, ReasoningStatus? status, IEnumerable summaryParts) : base(InternalItemType.Reasoning, id) + public ReasoningResponseItem(IEnumerable summaryParts) : base(InternalItemType.Reasoning) { - Status = status; + Argument.AssertNotNull(summaryParts, nameof(summaryParts)); + SummaryParts = summaryParts.ToList(); } - internal ReasoningResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string encryptedContent, ReasoningStatus? status, IReadOnlyList summaryParts) : base(kind, id, additionalBinaryDataProperties) + internal ReasoningResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, string encryptedContent, IList summaryParts, ReasoningStatus? status) : base(kind, id, additionalBinaryDataProperties) { // Plugin customization: ensure initialization of collections EncryptedContent = encryptedContent; - Status = status; SummaryParts = summaryParts ?? new ChangeTrackingList(); + Status = status; } - public string EncryptedContent { get; } + public string EncryptedContent { get; set; } + + public IList SummaryParts { get; } } } diff --git a/src/Generated/Models/Responses/ReferenceResponseItem.Serialization.cs b/src/Generated/Models/Responses/ReferenceResponseItem.Serialization.cs index 20bbba0ee..c532bc1e3 100644 --- a/src/Generated/Models/Responses/ReferenceResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/ReferenceResponseItem.Serialization.cs @@ -12,10 +12,6 @@ namespace OpenAI.Responses { public partial class ReferenceResponseItem : IJsonModel { - internal ReferenceResponseItem() : this(InternalItemType.ItemReference, null, null) - { - } - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); diff --git a/src/Generated/Models/Responses/ReferenceResponseItem.cs b/src/Generated/Models/Responses/ReferenceResponseItem.cs index 9fa3855c7..c20ec0999 100644 --- a/src/Generated/Models/Responses/ReferenceResponseItem.cs +++ b/src/Generated/Models/Responses/ReferenceResponseItem.cs @@ -11,6 +11,10 @@ namespace OpenAI.Responses [Experimental("OPENAI001")] public partial class ReferenceResponseItem : ResponseItem { + internal ReferenceResponseItem() : this(InternalItemType.ItemReference, null, null) + { + } + internal ReferenceResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties) : base(kind, id, additionalBinaryDataProperties) { } diff --git a/src/Generated/Models/Responses/ResponseItem.Serialization.cs b/src/Generated/Models/Responses/ResponseItem.Serialization.cs index 1b64a14cc..fe98fd12f 100644 --- a/src/Generated/Models/Responses/ResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/ResponseItem.Serialization.cs @@ -35,6 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("type"u8); writer.WriteStringValue(Kind.ToString()); } + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Id) && _additionalBinaryDataProperties?.ContainsKey("id") != true) { diff --git a/src/Generated/Models/Responses/ResponseItem.cs b/src/Generated/Models/Responses/ResponseItem.cs index e70543452..5b7225e5b 100644 --- a/src/Generated/Models/Responses/ResponseItem.cs +++ b/src/Generated/Models/Responses/ResponseItem.cs @@ -13,10 +13,9 @@ public partial class ResponseItem { private protected IDictionary _additionalBinaryDataProperties; - private protected ResponseItem(InternalItemType kind, string id) + private protected ResponseItem(InternalItemType kind) { Kind = kind; - Id = id; } internal ResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties) diff --git a/src/Generated/Models/Responses/WebSearchCallResponseItem.Serialization.cs b/src/Generated/Models/Responses/WebSearchCallResponseItem.Serialization.cs index db5599dad..cf553c375 100644 --- a/src/Generated/Models/Responses/WebSearchCallResponseItem.Serialization.cs +++ b/src/Generated/Models/Responses/WebSearchCallResponseItem.Serialization.cs @@ -12,10 +12,6 @@ namespace OpenAI.Responses { public partial class WebSearchCallResponseItem : IJsonModel { - internal WebSearchCallResponseItem() : this(InternalItemType.WebSearchCall, null, null, default) - { - } - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,6 +27,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(WebSearchCallResponseItem)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); + // Plugin customization: remove options.Format != "W" check // Plugin customization: apply Optional.Is*Defined() check based on type name dictionary lookup if (Optional.IsDefined(Status) && _additionalBinaryDataProperties?.ContainsKey("status") != true) { diff --git a/src/Generated/Models/Responses/WebSearchCallResponseItem.cs b/src/Generated/Models/Responses/WebSearchCallResponseItem.cs index 6eab31fcb..61c4edda0 100644 --- a/src/Generated/Models/Responses/WebSearchCallResponseItem.cs +++ b/src/Generated/Models/Responses/WebSearchCallResponseItem.cs @@ -11,9 +11,8 @@ namespace OpenAI.Responses [Experimental("OPENAI001")] public partial class WebSearchCallResponseItem : ResponseItem { - internal WebSearchCallResponseItem(string id, WebSearchCallStatus? status) : base(InternalItemType.WebSearchCall, id) + public WebSearchCallResponseItem() : this(InternalItemType.WebSearchCall, null, null, default) { - Status = status; } internal WebSearchCallResponseItem(InternalItemType kind, string id, IDictionary additionalBinaryDataProperties, WebSearchCallStatus? status) : base(kind, id, additionalBinaryDataProperties) diff --git a/src/Generated/OpenAIModelFactory.cs b/src/Generated/OpenAIModelFactory.cs index 3f91114d2..8804a62bd 100644 --- a/src/Generated/OpenAIModelFactory.cs +++ b/src/Generated/OpenAIModelFactory.cs @@ -518,7 +518,7 @@ public static ResponseMessageAnnotation ResponseMessageAnnotation(string kind = return new InternalUnknownAnnotation(kind.ToResponseMessageAnnotationKind(), additionalBinaryDataProperties: null); } - public static FileSearchCallResult FileSearchCallResult(string fileId = default, string text = default, string filename = default, float? score = default, IReadOnlyDictionary attributes = default) + public static FileSearchCallResult FileSearchCallResult(string fileId = default, string text = default, string filename = default, IDictionary attributes = default, float? score = default) { attributes ??= new ChangeTrackingDictionary(); @@ -526,8 +526,8 @@ public static FileSearchCallResult FileSearchCallResult(string fileId = default, fileId, text, filename, - score, attributes, + score, additionalBinaryDataProperties: null); } diff --git a/tests/Responses/ResponsesSmokeTests.cs b/tests/Responses/ResponsesSmokeTests.cs index 52e623868..ffacb75fc 100644 --- a/tests/Responses/ResponsesSmokeTests.cs +++ b/tests/Responses/ResponsesSmokeTests.cs @@ -36,8 +36,8 @@ public void ItemSerialization() foreach (ResponseItem item in new ResponseItem[] { ResponseItem.CreateComputerCallItem("call_abcd", ComputerCallAction.CreateScreenshotAction(), []), - ResponseItem.CreateComputerCallOutputItem("call_abcd", [], "file_abcd"), - ResponseItem.CreateFileSearchCallItem(["query1"], []), + ResponseItem.CreateComputerCallOutputItem("call_abcd", ComputerCallOutput.CreateScreenshotOutput("file_abcd")), + ResponseItem.CreateFileSearchCallItem(["query1"]), ResponseItem.CreateFunctionCallItem("call_abcd", "function_name", BinaryData.Empty), ResponseItem.CreateFunctionCallOutputItem("call_abcd", "functionOutput"), ResponseItem.CreateReasoningItem("summary goes here"), diff --git a/tests/Responses/ResponsesTests.cs b/tests/Responses/ResponsesTests.cs index 88f745368..0c0662961 100644 --- a/tests/Responses/ResponsesTests.cs +++ b/tests/Responses/ResponsesTests.cs @@ -155,9 +155,7 @@ public async Task ComputerToolWithScreenshotRoundTrip() BinaryData screenshotBytes = BinaryData.FromBytes(File.ReadAllBytes(screenshotPath)); ResponseItem screenshotReply = ResponseItem.CreateComputerCallOutputItem( computerCall.CallId, - [], - screenshotBytes, - "image/png"); + ComputerCallOutput.CreateScreenshotOutput(screenshotBytes,"image/png")); responseOptions.PreviousResponseId = response.Id; response = await client.CreateResponseAsync([screenshotReply], responseOptions); diff --git a/tspCodeModel.json b/tspCodeModel.json index 47f91fd4f..ba9900deb 100644 --- a/tspCodeModel.json +++ b/tspCodeModel.json @@ -8305,7 +8305,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8364,7 +8364,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8423,7 +8423,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8495,7 +8495,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8554,7 +8554,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8613,7 +8613,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8672,7 +8672,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8744,7 +8744,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8803,7 +8803,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8862,7 +8862,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8921,7 +8921,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -8980,7 +8980,7 @@ "namespace": "", "isFixed": true, "isFlags": false, - "usage": "Output,Json", + "usage": "Input,Output,Json", "decorators": [] }, { @@ -57786,7 +57786,7 @@ "decorators": [] }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -57805,7 +57805,7 @@ "name": "FileSearchToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.FileSearchToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "The results of a file search tool call. See the\n[file search guide](/docs/guides/tools-file-search) for more information.\n", "discriminatorValue": "file_search_call", "decorators": [], @@ -57843,7 +57843,7 @@ "$ref": "673" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -57904,7 +57904,7 @@ "name": "ComputerToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ComputerToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A tool call to a computer use tool. See the\n[computer use guide](/docs/guides/tools-computer-use) for more information.\n", "discriminatorValue": "computer_call", "decorators": [], @@ -57942,7 +57942,7 @@ "$ref": "680" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -58027,7 +58027,7 @@ "name": "ComputerToolCallOutputItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ComputerToolCallOutputItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "The output of a computer tool call.\n", "discriminatorValue": "computer_call_output", "decorators": [], @@ -58065,7 +58065,7 @@ "$ref": "685" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -58150,7 +58150,7 @@ "name": "WebSearchToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.WebSearchToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "The results of a web search tool call. See the\n[web search guide](/docs/guides/tools-web-search) for more information.\n", "discriminatorValue": "web_search_call", "decorators": [], @@ -58188,7 +58188,7 @@ "$ref": "690" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -58207,7 +58207,7 @@ "name": "FunctionToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.FunctionToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A tool call to run a function. See the\n[function calling guide](/docs/guides/function-calling) for more information.\n", "discriminatorValue": "function_call", "decorators": [], @@ -58245,7 +58245,7 @@ "$ref": "696" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -58284,7 +58284,7 @@ { "$id": "4734", "kind": "property", - "name": "name", + "name": "FunctionName", "serializedName": "name", "doc": "The name of the function to run.", "type": { @@ -58309,14 +58309,14 @@ { "$id": "4736", "kind": "property", - "name": "arguments", + "name": "FunctionArguments", "serializedName": "arguments", "doc": "A JSON string of the arguments to pass to the function.", "type": { "$id": "4737", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", "decorators": [] }, "optional": false, @@ -58339,7 +58339,7 @@ "name": "FunctionToolCallOutputItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.FunctionToolCallOutputItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "The output of a function tool call.\n", "discriminatorValue": "function_call_output", "decorators": [], @@ -58377,7 +58377,7 @@ "$ref": "701" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -58416,7 +58416,7 @@ { "$id": "4743", "kind": "property", - "name": "output", + "name": "FunctionOutput", "serializedName": "output", "doc": "A JSON string of the output of the function tool call.", "type": { @@ -58446,7 +58446,7 @@ "name": "ReasoningItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ReasoningItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](/docs/guides/conversation-state).\n", "discriminatorValue": "reasoning", "decorators": [], @@ -58484,7 +58484,7 @@ "$ref": "706" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -58519,7 +58519,7 @@ { "$id": "4749", "kind": "property", - "name": "summary", + "name": "SummaryParts", "serializedName": "summary", "doc": "Reasoning text contents.", "type": { @@ -58545,7 +58545,7 @@ "name": "ImageGenToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ImageGenToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "An image generation request made by the model.\n", "discriminatorValue": "image_generation_call", "decorators": [], @@ -58622,7 +58622,7 @@ "name": "CodeInterpreterToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.CodeInterpreterToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A tool call to run code.\n", "discriminatorValue": "code_interpreter_call", "decorators": [], @@ -58749,7 +58749,7 @@ "name": "LocalShellToolCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.LocalShellToolCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A tool call to run a command on the local shell.\n", "discriminatorValue": "local_shell_call", "decorators": [], @@ -58850,7 +58850,7 @@ "name": "LocalShellToolCallOutputItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.LocalShellToolCallOutputItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "The output of a local shell tool call.\n", "discriminatorValue": "local_shell_call_output", "decorators": [], @@ -58931,7 +58931,7 @@ "name": "MCPListToolsItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.MCPListToolsItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A list of tools available on an MCP server.\n", "discriminatorValue": "mcp_list_tools", "decorators": [], @@ -59034,7 +59034,7 @@ "name": "MCPApprovalRequestItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.MCPApprovalRequestItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A request for human approval of a tool invocation.\n", "discriminatorValue": "mcp_approval_request", "decorators": [], @@ -59145,7 +59145,7 @@ "name": "MCPApprovalResponseItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.MCPApprovalResponseItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A response to an MCP approval request.\n", "discriminatorValue": "mcp_approval_response", "decorators": [], @@ -59252,7 +59252,7 @@ "name": "MCPCallItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.MCPCallItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "An invocation of a tool on an MCP server.\n", "discriminatorValue": "mcp_call", "decorators": [], @@ -59405,7 +59405,7 @@ "name": "ResponsesMessageItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ResponsesMessageItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A response message resource item, representing a role and content, as provided on service responses.", "discriminatorValue": "message", "decorators": [], @@ -59465,7 +59465,7 @@ "$ref": "732" }, "optional": false, - "readOnly": false, + "readOnly": true, "discriminator": false, "flatten": false, "decorators": [], @@ -59487,7 +59487,7 @@ "name": "ResponsesUserMessageItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ResponsesUserMessageItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A message resource item with the `user` role.", "discriminatorValue": "user", "decorators": [], @@ -59545,7 +59545,7 @@ "name": "ResponsesSystemMessageItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ResponsesSystemMessageItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A message resource item with the `system` role.", "discriminatorValue": "system", "decorators": [], @@ -59603,7 +59603,7 @@ "name": "ResponsesDeveloperMessageItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ResponsesDeveloperMessageItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A message resource item with the `developer` role.", "discriminatorValue": "developer", "decorators": [], @@ -59661,7 +59661,7 @@ "name": "ResponsesAssistantMessageItemResource", "namespace": "OpenAI", "crossLanguageDefinitionId": "OpenAI.ResponsesAssistantMessageItemResource", - "usage": "Output,Json", + "usage": "Input,Output,Json", "doc": "A message resource item with the `assistant` role.", "discriminatorValue": "assistant", "decorators": [],