Skip to content

Commit fb7b70f

Browse files
committed
Add ResponseItem constructors
1 parent 2237506 commit fb7b70f

File tree

101 files changed

+569
-660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+569
-660
lines changed

api/OpenAI.net8.0.cs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4504,10 +4504,21 @@ public enum ComputerCallActionMouseButton {
45044504
Forward = 4
45054505
}
45064506
[Experimental("OPENAICUA001")]
4507+
public class ComputerCallOutput : IJsonModel<ComputerCallOutput>, IPersistableModel<ComputerCallOutput> {
4508+
public static ComputerCallOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType);
4509+
public static ComputerCallOutput CreateScreenshotOutput(string screenshotImageFileId);
4510+
public static ComputerCallOutput CreateScreenshotOutput(Uri screenshotImageUri);
4511+
protected virtual ComputerCallOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
4512+
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
4513+
protected virtual ComputerCallOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
4514+
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
4515+
}
4516+
[Experimental("OPENAICUA001")]
45074517
public class ComputerCallOutputResponseItem : ResponseItem, IJsonModel<ComputerCallOutputResponseItem>, IPersistableModel<ComputerCallOutputResponseItem> {
4518+
public ComputerCallOutputResponseItem(string callId, ComputerCallOutput output);
45084519
public IList<ComputerCallSafetyCheck> AcknowledgedSafetyChecks { get; }
4509-
public string CallId { get; }
4510-
public ComputerOutput Output { get; }
4520+
public string CallId { get; set; }
4521+
public ComputerCallOutput Output { get; set; }
45114522
public ComputerCallOutputStatus? Status { get; }
45124523
protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
45134524
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
@@ -4523,8 +4534,8 @@ public enum ComputerCallOutputStatus {
45234534
[Experimental("OPENAICUA001")]
45244535
public class ComputerCallResponseItem : ResponseItem, IJsonModel<ComputerCallResponseItem>, IPersistableModel<ComputerCallResponseItem> {
45254536
public ComputerCallResponseItem(string callId, ComputerCallAction action, IEnumerable<ComputerCallSafetyCheck> pendingSafetyChecks);
4526-
public ComputerCallAction Action { get; }
4527-
public string CallId { get; }
4537+
public ComputerCallAction Action { get; set; }
4538+
public string CallId { get; set; }
45284539
public IList<ComputerCallSafetyCheck> PendingSafetyChecks { get; }
45294540
public ComputerCallStatus? Status { get; }
45304541
protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
@@ -4550,16 +4561,6 @@ public enum ComputerCallStatus {
45504561
Incomplete = 2
45514562
}
45524563
[Experimental("OPENAICUA001")]
4553-
public class ComputerOutput : IJsonModel<ComputerOutput>, IPersistableModel<ComputerOutput> {
4554-
public static ComputerOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType);
4555-
public static ComputerOutput CreateScreenshotOutput(string screenshotImageFileId);
4556-
public static ComputerOutput CreateScreenshotOutput(Uri screenshotImageUri);
4557-
protected virtual ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
4558-
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
4559-
protected virtual ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
4560-
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
4561-
}
4562-
[Experimental("OPENAICUA001")]
45634564
public readonly partial struct ComputerToolEnvironment : IEquatable<ComputerToolEnvironment> {
45644565
public ComputerToolEnvironment(string value);
45654566
public static ComputerToolEnvironment Browser { get; }
@@ -4580,8 +4581,9 @@ public class ComputerOutput : IJsonModel<ComputerOutput>, IPersistableModel<Comp
45804581
}
45814582
[Experimental("OPENAI001")]
45824583
public class FileSearchCallResponseItem : ResponseItem, IJsonModel<FileSearchCallResponseItem>, IPersistableModel<FileSearchCallResponseItem> {
4584+
public FileSearchCallResponseItem(IEnumerable<string> queries);
45834585
public IList<string> Queries { get; }
4584-
public IList<FileSearchCallResult> Results { get; }
4586+
public IList<FileSearchCallResult> Results { get; set; }
45854587
public FileSearchCallStatus? Status { get; }
45864588
protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
45874589
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
@@ -4590,7 +4592,7 @@ public class FileSearchCallResponseItem : ResponseItem, IJsonModel<FileSearchCal
45904592
}
45914593
[Experimental("OPENAI001")]
45924594
public class FileSearchCallResult : IJsonModel<FileSearchCallResult>, IPersistableModel<FileSearchCallResult> {
4593-
public IReadOnlyDictionary<string, BinaryData> Attributes { get; }
4595+
public IDictionary<string, BinaryData> Attributes { get; }
45944596
public string FileId { get; set; }
45954597
public string Filename { get; set; }
45964598
public float? Score { get; set; }
@@ -4635,7 +4637,8 @@ public class FileSearchToolRankingOptions : IJsonModel<FileSearchToolRankingOpti
46354637
}
46364638
[Experimental("OPENAI001")]
46374639
public class FunctionCallOutputResponseItem : ResponseItem, IJsonModel<FunctionCallOutputResponseItem>, IPersistableModel<FunctionCallOutputResponseItem> {
4638-
public string CallId { get; }
4640+
public FunctionCallOutputResponseItem(string callId, string functionOutput);
4641+
public string CallId { get; set; }
46394642
public string FunctionOutput { get; set; }
46404643
public FunctionCallOutputStatus? Status { get; }
46414644
protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
@@ -4651,7 +4654,8 @@ public enum FunctionCallOutputStatus {
46514654
}
46524655
[Experimental("OPENAI001")]
46534656
public class FunctionCallResponseItem : ResponseItem, IJsonModel<FunctionCallResponseItem>, IPersistableModel<FunctionCallResponseItem> {
4654-
public string CallId { get; }
4657+
public FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments);
4658+
public string CallId { get; set; }
46554659
public BinaryData FunctionArguments { get; set; }
46564660
public string FunctionName { get; set; }
46574661
public FunctionCallStatus? Status { get; }
@@ -4771,9 +4775,9 @@ public static class OpenAIResponsesModelFactory {
47714775
public class ReasoningResponseItem : ResponseItem, IJsonModel<ReasoningResponseItem>, IPersistableModel<ReasoningResponseItem> {
47724776
public ReasoningResponseItem(IEnumerable<ReasoningSummaryPart> summaryParts);
47734777
public ReasoningResponseItem(string summaryText);
4774-
public string EncryptedContent { get; }
4778+
public string EncryptedContent { get; set; }
47754779
public ReasoningStatus? Status { get; }
4776-
public IReadOnlyList<ReasoningSummaryPart> SummaryParts { get; }
4780+
public IList<ReasoningSummaryPart> SummaryParts { get; }
47774781
public string GetSummaryText();
47784782
protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
47794783
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
@@ -4974,14 +4978,10 @@ public class ResponseItem : IJsonModel<ResponseItem>, IPersistableModel<Response
49744978
[Experimental("OPENAICUA001")]
49754979
public static ComputerCallResponseItem CreateComputerCallItem(string callId, ComputerCallAction action, IEnumerable<ComputerCallSafetyCheck> pendingSafetyChecks);
49764980
[Experimental("OPENAICUA001")]
4977-
public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList<ComputerCallSafetyCheck> acknowledgedSafetyChecks, BinaryData screenshotImageBytes, string screenshotImageBytesMediaType);
4978-
[Experimental("OPENAICUA001")]
4979-
public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList<ComputerCallSafetyCheck> acknowledgedSafetyChecks, string screenshotImageFileId);
4980-
[Experimental("OPENAICUA001")]
4981-
public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList<ComputerCallSafetyCheck> acknowledgedSafetyChecks, Uri screenshotImageUri);
4981+
public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, ComputerCallOutput output);
49824982
public static MessageResponseItem CreateDeveloperMessageItem(IEnumerable<ResponseContentPart> contentParts);
49834983
public static MessageResponseItem CreateDeveloperMessageItem(string inputTextContent);
4984-
public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable<string> queries, IEnumerable<FileSearchCallResult> results);
4984+
public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable<string> queries);
49854985
public static FunctionCallResponseItem CreateFunctionCallItem(string callId, string functionName, BinaryData functionArguments);
49864986
public static FunctionCallOutputResponseItem CreateFunctionCallOutputItem(string callId, string functionOutput);
49874987
public static ReasoningResponseItem CreateReasoningItem(IEnumerable<ReasoningSummaryPart> summaryParts);
@@ -5430,6 +5430,7 @@ public class StreamingResponseWebSearchCallSearchingUpdate : StreamingResponseUp
54305430
}
54315431
[Experimental("OPENAI001")]
54325432
public class WebSearchCallResponseItem : ResponseItem, IJsonModel<WebSearchCallResponseItem>, IPersistableModel<WebSearchCallResponseItem> {
5433+
public WebSearchCallResponseItem();
54335434
public WebSearchCallStatus? Status { get; }
54345435
protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
54355436
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);

0 commit comments

Comments
 (0)