Skip to content

Commit 784bb02

Browse files
committed
Rename Response's Background to BackgroundModeEnabled
1 parent 2237506 commit 784bb02

File tree

10 files changed

+100
-76
lines changed

10 files changed

+100
-76
lines changed

api/OpenAI.net8.0.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4692,7 +4692,7 @@ public enum MessageStatus {
46924692
}
46934693
[Experimental("OPENAI001")]
46944694
public class OpenAIResponse : IJsonModel<OpenAIResponse>, IPersistableModel<OpenAIResponse> {
4695-
public bool? Background { get; }
4695+
public bool? BackgroundModeEnabled { get; }
46964696
public DateTimeOffset CreatedAt { get; }
46974697
public string EndUserId { get; }
46984698
public ResponseError Error { get; }
@@ -4762,7 +4762,7 @@ public class OpenAIResponseClient {
47624762
[Experimental("OPENAI001")]
47634763
public static class OpenAIResponsesModelFactory {
47644764
public static MessageResponseItem MessageResponseItem(string id = null, MessageRole role = MessageRole.Assistant, MessageStatus? status = null);
4765-
public static OpenAIResponse OpenAIResponse(string id = null, DateTimeOffset createdAt = default, ResponseStatus? status = null, ResponseError error = null, ResponseTokenUsage usage = null, string endUserId = null, ResponseReasoningOptions reasoningOptions = null, int? maxOutputTokenCount = null, ResponseTextOptions textOptions = null, ResponseTruncationMode? truncationMode = null, ResponseIncompleteStatusDetails incompleteStatusDetails = null, IEnumerable<ResponseItem> outputItems = null, bool parallelToolCallsEnabled = false, ResponseToolChoice toolChoice = null, string model = null, IDictionary<string, string> metadata = null, float? temperature = null, float? topP = null, string previousResponseId = null, bool? background = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
4765+
public static OpenAIResponse OpenAIResponse(string id = null, DateTimeOffset createdAt = default, ResponseStatus? status = null, ResponseError error = null, ResponseTokenUsage usage = null, string endUserId = null, ResponseReasoningOptions reasoningOptions = null, int? maxOutputTokenCount = null, ResponseTextOptions textOptions = null, ResponseTruncationMode? truncationMode = null, ResponseIncompleteStatusDetails incompleteStatusDetails = null, IEnumerable<ResponseItem> outputItems = null, bool parallelToolCallsEnabled = false, ResponseToolChoice toolChoice = null, string model = null, IDictionary<string, string> metadata = null, float? temperature = null, float? topP = null, string previousResponseId = null, bool? backgroundModeEnabled = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
47664766
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, IEnumerable<ReasoningSummaryPart> summaryParts = null);
47674767
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, string summaryText = null);
47684768
public static ReferenceResponseItem ReferenceResponseItem(string id = null);
@@ -4847,7 +4847,7 @@ public enum ResponseContentPartKind {
48474847
}
48484848
[Experimental("OPENAI001")]
48494849
public class ResponseCreationOptions : IJsonModel<ResponseCreationOptions>, IPersistableModel<ResponseCreationOptions> {
4850-
public bool? Background { get; set; }
4850+
public bool? BackgroundModeEnabled { get; set; }
48514851
public string EndUserId { get; set; }
48524852
public string Instructions { get; set; }
48534853
public int? MaxOutputTokenCount { get; set; }

api/OpenAI.netstandard2.0.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,7 +4138,7 @@ public enum MessageStatus {
41384138
Incomplete = 2
41394139
}
41404140
public class OpenAIResponse : IJsonModel<OpenAIResponse>, IPersistableModel<OpenAIResponse> {
4141-
public bool? Background { get; }
4141+
public bool? BackgroundModeEnabled { get; }
41424142
public DateTimeOffset CreatedAt { get; }
41434143
public string EndUserId { get; }
41444144
public ResponseError Error { get; }
@@ -4206,7 +4206,7 @@ public class OpenAIResponseClient {
42064206
}
42074207
public static class OpenAIResponsesModelFactory {
42084208
public static MessageResponseItem MessageResponseItem(string id = null, MessageRole role = MessageRole.Assistant, MessageStatus? status = null);
4209-
public static OpenAIResponse OpenAIResponse(string id = null, DateTimeOffset createdAt = default, ResponseStatus? status = null, ResponseError error = null, ResponseTokenUsage usage = null, string endUserId = null, ResponseReasoningOptions reasoningOptions = null, int? maxOutputTokenCount = null, ResponseTextOptions textOptions = null, ResponseTruncationMode? truncationMode = null, ResponseIncompleteStatusDetails incompleteStatusDetails = null, IEnumerable<ResponseItem> outputItems = null, bool parallelToolCallsEnabled = false, ResponseToolChoice toolChoice = null, string model = null, IDictionary<string, string> metadata = null, float? temperature = null, float? topP = null, string previousResponseId = null, bool? background = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
4209+
public static OpenAIResponse OpenAIResponse(string id = null, DateTimeOffset createdAt = default, ResponseStatus? status = null, ResponseError error = null, ResponseTokenUsage usage = null, string endUserId = null, ResponseReasoningOptions reasoningOptions = null, int? maxOutputTokenCount = null, ResponseTextOptions textOptions = null, ResponseTruncationMode? truncationMode = null, ResponseIncompleteStatusDetails incompleteStatusDetails = null, IEnumerable<ResponseItem> outputItems = null, bool parallelToolCallsEnabled = false, ResponseToolChoice toolChoice = null, string model = null, IDictionary<string, string> metadata = null, float? temperature = null, float? topP = null, string previousResponseId = null, bool? backgroundModeEnabled = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
42104210
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, IEnumerable<ReasoningSummaryPart> summaryParts = null);
42114211
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, string summaryText = null);
42124212
public static ReferenceResponseItem ReferenceResponseItem(string id = null);
@@ -4283,7 +4283,7 @@ public enum ResponseContentPartKind {
42834283
Refusal = 5
42844284
}
42854285
public class ResponseCreationOptions : IJsonModel<ResponseCreationOptions>, IPersistableModel<ResponseCreationOptions> {
4286-
public bool? Background { get; set; }
4286+
public bool? BackgroundModeEnabled { get; set; }
42874287
public string EndUserId { get; set; }
42884288
public string Instructions { get; set; }
42894289
public int? MaxOutputTokenCount { get; set; }

src/Custom/Responses/OpenAIResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ namespace OpenAI.Responses;
1414
[CodeGenSuppress("OutputText")]
1515
public partial class OpenAIResponse
1616
{
17+
// CUSTOM: Renamed.
18+
[CodeGenMember("Background")]
19+
public bool? BackgroundModeEnabled { get; }
20+
1721
// CUSTOM: Renamed.
1822
[CodeGenMember("User")]
1923
public string EndUserId { get; }

src/Custom/Responses/OpenAIResponsesModelFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static OpenAIResponse OpenAIResponse(
3131
float? temperature = null,
3232
float? topP = null,
3333
string previousResponseId = null,
34-
bool? background = null,
34+
bool? backgroundModeEnabled = null,
3535
string instructions = null,
3636
IEnumerable<ResponseTool> tools = null)
3737
{
@@ -45,7 +45,7 @@ public static OpenAIResponse OpenAIResponse(
4545
topP: topP,
4646
serviceTier: null,
4747
previousResponseId: previousResponseId,
48-
background: background,
48+
backgroundModeEnabled: backgroundModeEnabled,
4949
instructions: instructions,
5050
tools: tools.ToList(),
5151
id: id,

src/Custom/Responses/ResponseCreationOptions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public partial class ResponseCreationOptions
3333
// CUSTOM: Made internal. This value comes from a parameter on the client method.
3434
internal bool? Stream { get; set; }
3535

36+
// CUSTOM: Renamed.
37+
[CodeGenMember("Background")]
38+
public bool? BackgroundModeEnabled { get; set; }
39+
3640
// CUSTOM: Renamed.
3741
[CodeGenMember("User")]
3842
public string EndUserId { get; set; }

src/Generated/Models/Responses/OpenAIResponse.Serialization.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace OpenAI.Responses
1313
{
1414
public partial class OpenAIResponse : IJsonModel<OpenAIResponse>
1515
{
16-
internal OpenAIResponse() : this(null, default, default, default, null, default, null, null, null, default, default, null, null, null, null, default, null, default, null, null, default, null, null, null, null)
16+
internal OpenAIResponse() : this(null, default, default, default, null, null, null, null, default, default, null, null, default, null, null, default, null, default, null, null, default, null, null, null, null)
1717
{
1818
}
1919

@@ -88,11 +88,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
8888
writer.WritePropertyName("previous_response_id"u8);
8989
writer.WriteStringValue(PreviousResponseId);
9090
}
91-
if (Optional.IsDefined(Background) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
92-
{
93-
writer.WritePropertyName("background"u8);
94-
writer.WriteBooleanValue(Background.Value);
95-
}
9691
if (Optional.IsDefined(Instructions) && _additionalBinaryDataProperties?.ContainsKey("instructions") != true)
9792
{
9893
writer.WritePropertyName("instructions"u8);
@@ -140,6 +135,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
140135
writer.WritePropertyName("usage"u8);
141136
writer.WriteObjectValue(Usage, options);
142137
}
138+
if (Optional.IsDefined(BackgroundModeEnabled) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
139+
{
140+
writer.WritePropertyName("background"u8);
141+
writer.WriteBooleanValue(BackgroundModeEnabled.Value);
142+
}
143143
if (_additionalBinaryDataProperties?.ContainsKey("user") != true)
144144
{
145145
if (Optional.IsDefined(EndUserId))
@@ -260,14 +260,14 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
260260
float? topP = default;
261261
InternalServiceTier? serviceTier = default;
262262
string previousResponseId = default;
263-
bool? background = default;
264263
string instructions = default;
265264
IList<ResponseTool> tools = default;
266265
string id = default;
267266
ResponseStatus? status = default;
268267
DateTimeOffset createdAt = default;
269268
ResponseError error = default;
270269
ResponseTokenUsage usage = default;
270+
bool? backgroundModeEnabled = default;
271271
string endUserId = default;
272272
ResponseReasoningOptions reasoningOptions = default;
273273
int? maxOutputTokenCount = default;
@@ -343,16 +343,6 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
343343
previousResponseId = prop.Value.GetString();
344344
continue;
345345
}
346-
if (prop.NameEquals("background"u8))
347-
{
348-
if (prop.Value.ValueKind == JsonValueKind.Null)
349-
{
350-
background = null;
351-
continue;
352-
}
353-
background = prop.Value.GetBoolean();
354-
continue;
355-
}
356346
if (prop.NameEquals("instructions"u8))
357347
{
358348
if (prop.Value.ValueKind == JsonValueKind.Null)
@@ -415,6 +405,16 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
415405
usage = ResponseTokenUsage.DeserializeResponseTokenUsage(prop.Value, options);
416406
continue;
417407
}
408+
if (prop.NameEquals("background"u8))
409+
{
410+
if (prop.Value.ValueKind == JsonValueKind.Null)
411+
{
412+
backgroundModeEnabled = null;
413+
continue;
414+
}
415+
backgroundModeEnabled = prop.Value.GetBoolean();
416+
continue;
417+
}
418418
if (prop.NameEquals("user"u8))
419419
{
420420
if (prop.Value.ValueKind == JsonValueKind.Null)
@@ -517,14 +517,14 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
517517
topP,
518518
serviceTier,
519519
previousResponseId,
520-
background,
521520
instructions,
522521
tools ?? new ChangeTrackingList<ResponseTool>(),
523522
id,
524523
status,
525524
createdAt,
526525
error,
527526
usage,
527+
backgroundModeEnabled,
528528
endUserId,
529529
reasoningOptions,
530530
maxOutputTokenCount,

src/Generated/Models/Responses/OpenAIResponse.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature
3232
ParallelToolCallsEnabled = parallelToolCallsEnabled;
3333
}
3434

35-
internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature, float? topP, InternalServiceTier? serviceTier, string previousResponseId, bool? background, string instructions, IList<ResponseTool> tools, string id, ResponseStatus? status, DateTimeOffset createdAt, ResponseError error, ResponseTokenUsage usage, string endUserId, ResponseReasoningOptions reasoningOptions, int? maxOutputTokenCount, ResponseTextOptions textOptions, ResponseTruncationMode? truncationMode, ResponseIncompleteStatusDetails incompleteStatusDetails, IList<ResponseItem> outputItems, bool parallelToolCallsEnabled, ResponseToolChoice toolChoice, string model, string @object, IDictionary<string, BinaryData> additionalBinaryDataProperties)
35+
internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature, float? topP, InternalServiceTier? serviceTier, string previousResponseId, string instructions, IList<ResponseTool> tools, string id, ResponseStatus? status, DateTimeOffset createdAt, ResponseError error, ResponseTokenUsage usage, bool? backgroundModeEnabled, string endUserId, ResponseReasoningOptions reasoningOptions, int? maxOutputTokenCount, ResponseTextOptions textOptions, ResponseTruncationMode? truncationMode, ResponseIncompleteStatusDetails incompleteStatusDetails, IList<ResponseItem> outputItems, bool parallelToolCallsEnabled, ResponseToolChoice toolChoice, string model, string @object, IDictionary<string, BinaryData> additionalBinaryDataProperties)
3636
{
3737
// Plugin customization: ensure initialization of collections
3838
Metadata = metadata ?? new ChangeTrackingDictionary<string, string>();
3939
Temperature = temperature;
4040
TopP = topP;
4141
ServiceTier = serviceTier;
4242
PreviousResponseId = previousResponseId;
43-
Background = background;
4443
Instructions = instructions;
4544
Tools = tools ?? new ChangeTrackingList<ResponseTool>();
4645
Id = id;
4746
Status = status;
4847
CreatedAt = createdAt;
4948
Error = error;
5049
Usage = usage;
50+
BackgroundModeEnabled = backgroundModeEnabled;
5151
EndUserId = endUserId;
5252
ReasoningOptions = reasoningOptions;
5353
MaxOutputTokenCount = maxOutputTokenCount;
@@ -72,8 +72,6 @@ internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature
7272

7373
public string PreviousResponseId { get; }
7474

75-
public bool? Background { get; }
76-
7775
public string Instructions { get; }
7876

7977
public IList<ResponseTool> Tools { get; }

src/Generated/Models/Responses/ResponseCreationOptions.Serialization.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace OpenAI.Responses
1313
{
1414
public partial class ResponseCreationOptions : IJsonModel<ResponseCreationOptions>
1515
{
16-
public ResponseCreationOptions() : this(null, default, default, default, null, default, null, null, null, null, default, null, null, default, null, default, default, default, null, null, null)
16+
public ResponseCreationOptions() : this(null, default, default, default, null, null, null, null, null, default, default, null, null, default, null, default, default, default, null, null, null)
1717
{
1818
}
1919

@@ -67,11 +67,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
6767
writer.WritePropertyName("previous_response_id"u8);
6868
writer.WriteStringValue(PreviousResponseId);
6969
}
70-
if (Optional.IsDefined(Background) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
71-
{
72-
writer.WritePropertyName("background"u8);
73-
writer.WriteBooleanValue(Background.Value);
74-
}
7570
if (Optional.IsDefined(Instructions) && _additionalBinaryDataProperties?.ContainsKey("instructions") != true)
7671
{
7772
writer.WritePropertyName("instructions"u8);
@@ -107,6 +102,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
107102
writer.WritePropertyName("stream"u8);
108103
writer.WriteBooleanValue(Stream.Value);
109104
}
105+
if (Optional.IsDefined(BackgroundModeEnabled) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
106+
{
107+
writer.WritePropertyName("background"u8);
108+
writer.WriteBooleanValue(BackgroundModeEnabled.Value);
109+
}
110110
if (Optional.IsDefined(EndUserId) && _additionalBinaryDataProperties?.ContainsKey("user") != true)
111111
{
112112
writer.WritePropertyName("user"u8);
@@ -203,12 +203,12 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
203203
float? topP = default;
204204
InternalServiceTier? serviceTier = default;
205205
string previousResponseId = default;
206-
bool? background = default;
207206
string instructions = default;
208207
IList<InternalIncludable> include = default;
209208
string model = default;
210209
IList<ResponseItem> input = default;
211210
bool? stream = default;
211+
bool? backgroundModeEnabled = default;
212212
string endUserId = default;
213213
ResponseReasoningOptions reasoningOptions = default;
214214
int? maxOutputTokenCount = default;
@@ -281,16 +281,6 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
281281
previousResponseId = prop.Value.GetString();
282282
continue;
283283
}
284-
if (prop.NameEquals("background"u8))
285-
{
286-
if (prop.Value.ValueKind == JsonValueKind.Null)
287-
{
288-
background = null;
289-
continue;
290-
}
291-
background = prop.Value.GetBoolean();
292-
continue;
293-
}
294284
if (prop.NameEquals("instructions"u8))
295285
{
296286
if (prop.Value.ValueKind == JsonValueKind.Null)
@@ -340,6 +330,16 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
340330
stream = prop.Value.GetBoolean();
341331
continue;
342332
}
333+
if (prop.NameEquals("background"u8))
334+
{
335+
if (prop.Value.ValueKind == JsonValueKind.Null)
336+
{
337+
backgroundModeEnabled = null;
338+
continue;
339+
}
340+
backgroundModeEnabled = prop.Value.GetBoolean();
341+
continue;
342+
}
343343
if (prop.NameEquals("user"u8))
344344
{
345345
endUserId = prop.Value.GetString();
@@ -436,12 +436,12 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
436436
topP,
437437
serviceTier,
438438
previousResponseId,
439-
background,
440439
instructions,
441440
include ?? new ChangeTrackingList<InternalIncludable>(),
442441
model,
443442
input,
444443
stream,
444+
backgroundModeEnabled,
445445
endUserId,
446446
reasoningOptions,
447447
maxOutputTokenCount,

0 commit comments

Comments
 (0)