Skip to content

Commit f77f26e

Browse files
authored
Rename Response's Background to BackgroundModeEnabled (#622)
1 parent d893a79 commit f77f26e

File tree

11 files changed

+78
-54
lines changed

11 files changed

+78
-54
lines changed

api/OpenAI.net8.0.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4991,7 +4991,7 @@ public enum MessageStatus {
49914991
}
49924992
[Experimental("OPENAI001")]
49934993
public class OpenAIResponse : IJsonModel<OpenAIResponse>, IPersistableModel<OpenAIResponse> {
4994-
public bool? Background { get; }
4994+
public bool? BackgroundModeEnabled { get; }
49954995
public DateTimeOffset CreatedAt { get; }
49964996
public string EndUserId { get; }
49974997
public ResponseError Error { get; }
@@ -5069,7 +5069,7 @@ public class OpenAIResponseClient {
50695069
[Experimental("OPENAI001")]
50705070
public static class OpenAIResponsesModelFactory {
50715071
public static MessageResponseItem MessageResponseItem(string id = null, MessageRole role = MessageRole.Assistant, MessageStatus? status = null);
5072-
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, ResponseServiceTier? serviceTier = null, string previousResponseId = null, bool? background = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
5072+
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, ResponseServiceTier? serviceTier = null, string previousResponseId = null, bool? backgroundModeEnabled = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
50735073
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, IEnumerable<ReasoningSummaryPart> summaryParts = null);
50745074
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, string summaryText = null);
50755075
public static ReferenceResponseItem ReferenceResponseItem(string id = null);
@@ -5154,7 +5154,7 @@ public enum ResponseContentPartKind {
51545154
}
51555155
[Experimental("OPENAI001")]
51565156
public class ResponseCreationOptions : IJsonModel<ResponseCreationOptions>, IPersistableModel<ResponseCreationOptions> {
5157-
public bool? Background { get; set; }
5157+
public bool? BackgroundModeEnabled { get; set; }
51585158
public string EndUserId { get; set; }
51595159
public string Instructions { get; set; }
51605160
public int? MaxOutputTokenCount { get; set; }

api/OpenAI.netstandard2.0.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4390,7 +4390,7 @@ public enum MessageStatus {
43904390
Incomplete = 2
43914391
}
43924392
public class OpenAIResponse : IJsonModel<OpenAIResponse>, IPersistableModel<OpenAIResponse> {
4393-
public bool? Background { get; }
4393+
public bool? BackgroundModeEnabled { get; }
43944394
public DateTimeOffset CreatedAt { get; }
43954395
public string EndUserId { get; }
43964396
public ResponseError Error { get; }
@@ -4465,7 +4465,7 @@ public class OpenAIResponseClient {
44654465
}
44664466
public static class OpenAIResponsesModelFactory {
44674467
public static MessageResponseItem MessageResponseItem(string id = null, MessageRole role = MessageRole.Assistant, MessageStatus? status = null);
4468-
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, ResponseServiceTier? serviceTier = null, string previousResponseId = null, bool? background = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
4468+
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, ResponseServiceTier? serviceTier = null, string previousResponseId = null, bool? backgroundModeEnabled = null, string instructions = null, IEnumerable<ResponseTool> tools = null);
44694469
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, IEnumerable<ReasoningSummaryPart> summaryParts = null);
44704470
public static ReasoningResponseItem ReasoningResponseItem(string id = null, string encryptedContent = null, ReasoningStatus? status = null, string summaryText = null);
44714471
public static ReferenceResponseItem ReferenceResponseItem(string id = null);
@@ -4542,7 +4542,7 @@ public enum ResponseContentPartKind {
45424542
Refusal = 5
45434543
}
45444544
public class ResponseCreationOptions : IJsonModel<ResponseCreationOptions>, IPersistableModel<ResponseCreationOptions> {
4545-
public bool? Background { get; set; }
4545+
public bool? BackgroundModeEnabled { get; set; }
45464546
public string EndUserId { get; set; }
45474547
public string Instructions { get; set; }
45484548
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
@@ -32,7 +32,7 @@ public static OpenAIResponse OpenAIResponse(
3232
float? topP = null,
3333
ResponseServiceTier? serviceTier = null,
3434
string previousResponseId = null,
35-
bool? background = null,
35+
bool? backgroundModeEnabled = null,
3636
string instructions = null,
3737
IEnumerable<ResponseTool> tools = null)
3838
{
@@ -46,7 +46,7 @@ public static OpenAIResponse OpenAIResponse(
4646
topP: topP,
4747
serviceTier: serviceTier,
4848
previousResponseId: previousResponseId,
49-
background: background,
49+
backgroundModeEnabled: backgroundModeEnabled,
5050
instructions: instructions,
5151
tools: tools.ToList(),
5252
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
110110
writer.WritePropertyName("reasoning"u8);
111111
writer.WriteObjectValue(ReasoningOptions, options);
112112
}
113-
if (Optional.IsDefined(Background) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
113+
if (Optional.IsDefined(BackgroundModeEnabled) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
114114
{
115115
writer.WritePropertyName("background"u8);
116-
writer.WriteBooleanValue(Background.Value);
116+
writer.WriteBooleanValue(BackgroundModeEnabled.Value);
117117
}
118118
if (Optional.IsDefined(MaxOutputTokenCount) && _additionalBinaryDataProperties?.ContainsKey("max_output_tokens") != true)
119119
{
@@ -263,7 +263,7 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
263263
string previousResponseId = default;
264264
string model = default;
265265
ResponseReasoningOptions reasoningOptions = default;
266-
bool? background = default;
266+
bool? backgroundModeEnabled = default;
267267
int? maxOutputTokenCount = default;
268268
string instructions = default;
269269
ResponseTextOptions textOptions = default;
@@ -372,10 +372,10 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
372372
{
373373
if (prop.Value.ValueKind == JsonValueKind.Null)
374374
{
375-
background = null;
375+
backgroundModeEnabled = null;
376376
continue;
377377
}
378-
background = prop.Value.GetBoolean();
378+
backgroundModeEnabled = prop.Value.GetBoolean();
379379
continue;
380380
}
381381
if (prop.NameEquals("max_output_tokens"u8))
@@ -520,7 +520,7 @@ internal static OpenAIResponse DeserializeOpenAIResponse(JsonElement element, Mo
520520
previousResponseId,
521521
model,
522522
reasoningOptions,
523-
background,
523+
backgroundModeEnabled,
524524
maxOutputTokenCount,
525525
instructions,
526526
textOptions,

src/Generated/Models/Responses/OpenAIResponse.cs

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

34-
internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature, float? topP, string endUserId, ResponseServiceTier? serviceTier, string previousResponseId, string model, ResponseReasoningOptions reasoningOptions, bool? background, int? maxOutputTokenCount, string instructions, ResponseTextOptions textOptions, IList<ResponseTool> tools, ResponseToolChoice toolChoice, ResponseTruncationMode? truncationMode, string id, string @object, ResponseStatus? status, DateTimeOffset createdAt, ResponseError error, ResponseIncompleteStatusDetails incompleteStatusDetails, IList<ResponseItem> outputItems, ResponseTokenUsage usage, bool parallelToolCallsEnabled, IDictionary<string, BinaryData> additionalBinaryDataProperties)
34+
internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature, float? topP, string endUserId, ResponseServiceTier? serviceTier, string previousResponseId, string model, ResponseReasoningOptions reasoningOptions, bool? backgroundModeEnabled, int? maxOutputTokenCount, string instructions, ResponseTextOptions textOptions, IList<ResponseTool> tools, ResponseToolChoice toolChoice, ResponseTruncationMode? truncationMode, string id, string @object, ResponseStatus? status, DateTimeOffset createdAt, ResponseError error, ResponseIncompleteStatusDetails incompleteStatusDetails, IList<ResponseItem> outputItems, ResponseTokenUsage usage, bool parallelToolCallsEnabled, IDictionary<string, BinaryData> additionalBinaryDataProperties)
3535
{
3636
// Plugin customization: ensure initialization of collections
3737
Metadata = metadata ?? new ChangeTrackingDictionary<string, string>();
@@ -42,7 +42,7 @@ internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature
4242
PreviousResponseId = previousResponseId;
4343
Model = model;
4444
ReasoningOptions = reasoningOptions;
45-
Background = background;
45+
BackgroundModeEnabled = backgroundModeEnabled;
4646
MaxOutputTokenCount = maxOutputTokenCount;
4747
Instructions = instructions;
4848
TextOptions = textOptions;
@@ -71,8 +71,6 @@ internal OpenAIResponse(IDictionary<string, string> metadata, float? temperature
7171

7272
public string PreviousResponseId { get; }
7373

74-
public bool? Background { get; }
75-
7674
public string Instructions { get; }
7775

7876
public IList<ResponseTool> Tools { get; }

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
8181
writer.WritePropertyName("reasoning"u8);
8282
writer.WriteObjectValue(ReasoningOptions, options);
8383
}
84-
if (Optional.IsDefined(Background) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
84+
if (Optional.IsDefined(BackgroundModeEnabled) && _additionalBinaryDataProperties?.ContainsKey("background") != true)
8585
{
8686
writer.WritePropertyName("background"u8);
87-
writer.WriteBooleanValue(Background.Value);
87+
writer.WriteBooleanValue(BackgroundModeEnabled.Value);
8888
}
8989
if (Optional.IsDefined(MaxOutputTokenCount) && _additionalBinaryDataProperties?.ContainsKey("max_output_tokens") != true)
9090
{
@@ -205,7 +205,7 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
205205
string previousResponseId = default;
206206
string model = default;
207207
ResponseReasoningOptions reasoningOptions = default;
208-
bool? background = default;
208+
bool? backgroundModeEnabled = default;
209209
int? maxOutputTokenCount = default;
210210
string instructions = default;
211211
ResponseTextOptions textOptions = default;
@@ -304,10 +304,10 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
304304
{
305305
if (prop.Value.ValueKind == JsonValueKind.Null)
306306
{
307-
background = null;
307+
backgroundModeEnabled = null;
308308
continue;
309309
}
310-
background = prop.Value.GetBoolean();
310+
backgroundModeEnabled = prop.Value.GetBoolean();
311311
continue;
312312
}
313313
if (prop.NameEquals("max_output_tokens"u8))
@@ -438,7 +438,7 @@ internal static ResponseCreationOptions DeserializeResponseCreationOptions(JsonE
438438
previousResponseId,
439439
model,
440440
reasoningOptions,
441-
background,
441+
backgroundModeEnabled,
442442
maxOutputTokenCount,
443443
instructions,
444444
textOptions,

src/Generated/Models/Responses/ResponseCreationOptions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class ResponseCreationOptions
1414
{
1515
private protected IDictionary<string, BinaryData> _additionalBinaryDataProperties;
1616

17-
internal ResponseCreationOptions(IDictionary<string, string> metadata, float? temperature, float? topP, string endUserId, ResponseServiceTier? serviceTier, string previousResponseId, string model, ResponseReasoningOptions reasoningOptions, bool? background, int? maxOutputTokenCount, string instructions, ResponseTextOptions textOptions, IList<ResponseTool> tools, ResponseToolChoice toolChoice, ResponseTruncationMode? truncationMode, IList<ResponseItem> input, IList<InternalIncludable> include, bool? parallelToolCallsEnabled, bool? storedOutputEnabled, bool? stream, IDictionary<string, BinaryData> additionalBinaryDataProperties)
17+
internal ResponseCreationOptions(IDictionary<string, string> metadata, float? temperature, float? topP, string endUserId, ResponseServiceTier? serviceTier, string previousResponseId, string model, ResponseReasoningOptions reasoningOptions, bool? backgroundModeEnabled, int? maxOutputTokenCount, string instructions, ResponseTextOptions textOptions, IList<ResponseTool> tools, ResponseToolChoice toolChoice, ResponseTruncationMode? truncationMode, IList<ResponseItem> input, IList<InternalIncludable> include, bool? parallelToolCallsEnabled, bool? storedOutputEnabled, bool? stream, IDictionary<string, BinaryData> additionalBinaryDataProperties)
1818
{
1919
// Plugin customization: ensure initialization of collections
2020
Metadata = metadata ?? new ChangeTrackingDictionary<string, string>();
@@ -25,7 +25,7 @@ internal ResponseCreationOptions(IDictionary<string, string> metadata, float? te
2525
PreviousResponseId = previousResponseId;
2626
Model = model;
2727
ReasoningOptions = reasoningOptions;
28-
Background = background;
28+
BackgroundModeEnabled = backgroundModeEnabled;
2929
MaxOutputTokenCount = maxOutputTokenCount;
3030
Instructions = instructions;
3131
TextOptions = textOptions;
@@ -50,8 +50,6 @@ internal ResponseCreationOptions(IDictionary<string, string> metadata, float? te
5050

5151
public string PreviousResponseId { get; set; }
5252

53-
public bool? Background { get; set; }
54-
5553
public string Instructions { get; set; }
5654

5755
internal IDictionary<string, BinaryData> SerializedAdditionalRawData

0 commit comments

Comments
 (0)