openai 0.99.0 → 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +1 -1
  4. data/bedrock.md +17 -1
  5. data/lib/openai/client.rb +9 -0
  6. data/lib/openai/helpers/agents/session_stream.rb +11 -36
  7. data/lib/openai/helpers/agents/tools.rb +34 -4
  8. data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
  9. data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
  10. data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
  11. data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
  12. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +125 -3
  13. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +125 -3
  14. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +125 -3
  15. data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
  16. data/lib/openai/models/admin/organization/usage_completions_response.rb +125 -3
  17. data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
  18. data/lib/openai/models/admin/organization/usage_costs_response.rb +125 -3
  19. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +125 -3
  20. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +125 -3
  21. data/lib/openai/models/admin/organization/usage_images_response.rb +125 -3
  22. data/lib/openai/models/admin/organization/usage_moderations_response.rb +125 -3
  23. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +125 -3
  24. data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
  25. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +125 -3
  26. data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
  27. data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
  28. data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
  29. data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
  30. data/lib/openai/models/beta/beta_response_error.rb +12 -1
  31. data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
  32. data/lib/openai/models/beta/beta_tool.rb +12 -9
  33. data/lib/openai/models/beta/environment_param.rb +6 -6
  34. data/lib/openai/models/beta/session_turn_error.rb +9 -0
  35. data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
  36. data/lib/openai/models/error_object.rb +12 -1
  37. data/lib/openai/models/eval_create_params.rb +1 -1
  38. data/lib/openai/models/eval_create_response.rb +1 -1
  39. data/lib/openai/models/eval_list_response.rb +1 -1
  40. data/lib/openai/models/eval_retrieve_response.rb +1 -1
  41. data/lib/openai/models/eval_update_response.rb +1 -1
  42. data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
  43. data/lib/openai/models/graders/score_model_grader.rb +2 -2
  44. data/lib/openai/models/image_edit_params.rb +12 -9
  45. data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
  46. data/lib/openai/models/realtime/session_update_event.rb +16 -0
  47. data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
  48. data/lib/openai/models/responses/response_error.rb +12 -1
  49. data/lib/openai/models/responses/responses_server_event.rb +12 -1
  50. data/lib/openai/models/responses/tool.rb +12 -9
  51. data/lib/openai/models/video_create_error.rb +12 -1
  52. data/lib/openai/providers/bedrock.rb +20 -1
  53. data/lib/openai/resources/admin/organization/usage.rb +15 -6
  54. data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
  55. data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
  56. data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
  57. data/lib/openai/resources/beta/agents/sessions.rb +22 -2
  58. data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
  59. data/lib/openai/resources/images.rb +8 -6
  60. data/lib/openai/version.rb +1 -1
  61. data/lib/openai.rb +2 -0
  62. data/rbi/openai/helpers/agents.rbi +2 -0
  63. data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
  64. data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
  65. data/rbi/openai/helpers/beta/agents.rbi +12 -0
  66. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +194 -1
  67. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +194 -1
  68. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +194 -1
  69. data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
  70. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +194 -1
  71. data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
  72. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +194 -1
  73. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +194 -1
  74. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +194 -1
  75. data/rbi/openai/models/admin/organization/usage_images_response.rbi +194 -1
  76. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +194 -1
  77. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +194 -1
  78. data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
  79. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +194 -1
  80. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
  81. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
  82. data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
  83. data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
  84. data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
  85. data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
  86. data/rbi/openai/models/beta/beta_tool.rbi +12 -9
  87. data/rbi/openai/models/beta/environment_param.rbi +6 -6
  88. data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
  89. data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
  90. data/rbi/openai/models/error_object.rbi +12 -0
  91. data/rbi/openai/models/eval_create_params.rbi +1 -1
  92. data/rbi/openai/models/eval_create_response.rbi +1 -1
  93. data/rbi/openai/models/eval_list_response.rbi +1 -1
  94. data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
  95. data/rbi/openai/models/eval_update_response.rbi +1 -1
  96. data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
  97. data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
  98. data/rbi/openai/models/image_edit_params.rbi +12 -9
  99. data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
  100. data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
  101. data/rbi/openai/models/responses/response_error.rbi +12 -0
  102. data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
  103. data/rbi/openai/models/responses/tool.rbi +12 -9
  104. data/rbi/openai/models/video_create_error.rbi +12 -0
  105. data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
  106. data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
  107. data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
  108. data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
  109. data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
  110. data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
  111. data/rbi/openai/resources/images.rbi +8 -6
  112. data/sig/openai/helpers/agents.rbs +3 -0
  113. data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
  114. data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
  115. data/sig/openai/helpers/beta/agents.rbs +5 -0
  116. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +87 -2
  117. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +87 -2
  118. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +87 -2
  119. data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
  120. data/sig/openai/models/admin/organization/usage_completions_response.rbs +87 -2
  121. data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
  122. data/sig/openai/models/admin/organization/usage_costs_response.rbs +87 -2
  123. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +87 -2
  124. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +87 -2
  125. data/sig/openai/models/admin/organization/usage_images_response.rbs +87 -2
  126. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +87 -2
  127. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +87 -2
  128. data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
  129. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +87 -2
  130. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
  131. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
  132. data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
  133. data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
  134. data/sig/openai/models/beta/beta_response_error.rbs +10 -0
  135. data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
  136. data/sig/openai/models/beta/beta_tool.rbs +8 -6
  137. data/sig/openai/models/beta/environment_param.rbs +4 -4
  138. data/sig/openai/models/beta/session_turn_error.rbs +12 -0
  139. data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
  140. data/sig/openai/models/error_object.rbs +10 -0
  141. data/sig/openai/models/eval_create_params.rbs +1 -1
  142. data/sig/openai/models/eval_create_response.rbs +1 -1
  143. data/sig/openai/models/eval_list_response.rbs +1 -1
  144. data/sig/openai/models/eval_retrieve_response.rbs +1 -1
  145. data/sig/openai/models/eval_update_response.rbs +1 -1
  146. data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
  147. data/sig/openai/models/graders/score_model_grader.rbs +3 -3
  148. data/sig/openai/models/image_edit_params.rbs +8 -6
  149. data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
  150. data/sig/openai/models/responses/response_error.rbs +10 -0
  151. data/sig/openai/models/responses/responses_server_event.rbs +10 -0
  152. data/sig/openai/models/responses/tool.rbs +8 -6
  153. data/sig/openai/models/video_create_error.rbs +10 -0
  154. data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
  155. data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
  156. data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
  157. metadata +11 -1
@@ -1021,7 +1021,7 @@ module OpenAI
1021
1021
  # The name of the grader.
1022
1022
  name:,
1023
1023
 
1024
- # The range of the score. Defaults to `[0, 1]`.
1024
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
1025
1025
  range: nil,
1026
1026
 
1027
1027
  # The sampling parameters for the model.
@@ -413,7 +413,7 @@ module OpenAI
413
413
  # The name of the grader.
414
414
  name:,
415
415
 
416
- # The range of the score. Defaults to `[0, 1]`.
416
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
417
417
  range: nil,
418
418
 
419
419
  # The sampling parameters for the model.
@@ -413,7 +413,7 @@ module OpenAI
413
413
  # The name of the grader.
414
414
  name:,
415
415
 
416
- # The range of the score. Defaults to `[0, 1]`.
416
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
417
417
  range: nil,
418
418
 
419
419
  # The sampling parameters for the model.
@@ -413,7 +413,7 @@ module OpenAI
413
413
  # The name of the grader.
414
414
  name:,
415
415
 
416
- # The range of the score. Defaults to `[0, 1]`.
416
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
417
417
  range: nil,
418
418
 
419
419
  # The sampling parameters for the model.
@@ -413,7 +413,7 @@ module OpenAI
413
413
  # The name of the grader.
414
414
  name:,
415
415
 
416
- # The range of the score. Defaults to `[0, 1]`.
416
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
417
417
  range: nil,
418
418
 
419
419
  # The sampling parameters for the model.
@@ -31,8 +31,13 @@ module OpenAI
31
31
  sig { params(limit: Integer).void }
32
32
  attr_writer :limit
33
33
 
34
- # Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
35
- # Alternatively, set `metadata=null` to indicate no metadata.
34
+ # Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Omitting
35
+ # the parameter or passing an empty object applies no metadata filter. An empty
36
+ # value, such as `metadata[k]=`, filters for that key with an empty string value.
37
+ # To select jobs with null metadata, send the literal query string
38
+ # `metadata=null`. Nullable caller types do not specify how a client serializes
39
+ # null for a deep-object parameter. Use a raw query parameter if the client omits
40
+ # null. Do not combine the two query forms.
36
41
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
37
42
  attr_accessor :metadata
38
43
 
@@ -57,8 +62,13 @@ module OpenAI
57
62
  # Number of fine-tuning jobs to retrieve.
58
63
  limit: nil,
59
64
 
60
- # Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
61
- # Alternatively, set `metadata=null` to indicate no metadata.
65
+ # Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Omitting
66
+ # the parameter or passing an empty object applies no metadata filter. An empty
67
+ # value, such as `metadata[k]=`, filters for that key with an empty string value.
68
+ # To select jobs with null metadata, send the literal query string
69
+ # `metadata=null`. Nullable caller types do not specify how a client serializes
70
+ # null for a deep-object parameter. Use a raw query parameter if the client omits
71
+ # null. Do not combine the two query forms.
62
72
  metadata: nil,
63
73
 
64
74
  request_options: {}
@@ -33,7 +33,7 @@ module OpenAI
33
33
  sig { returns(Symbol) }
34
34
  attr_accessor :type
35
35
 
36
- # The range of the score. Defaults to `[0, 1]`.
36
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
37
37
  sig { returns(T.nilable(T::Array[Float])) }
38
38
  attr_reader :range
39
39
 
@@ -77,7 +77,7 @@ module OpenAI
77
77
  # The name of the grader.
78
78
  name:,
79
79
 
80
- # The range of the score. Defaults to `[0, 1]`.
80
+ # The service requires two numbers for the score range. Defaults to `[0, 1]`.
81
81
  range: nil,
82
82
 
83
83
  # The sampling parameters for the model.
@@ -47,9 +47,10 @@ module OpenAI
47
47
  sig { returns(T.nilable(OpenAI::ImageEditParams::Background::OrSymbol)) }
48
48
  attr_accessor :background
49
49
 
50
- # Controls fidelity to the original input image(s). This parameter is supported
51
- # for GPT image models that support input fidelity. `gpt-image-2` and
52
- # `gpt-image-2-2026-04-21` ignore this parameter.
50
+ # Control how much effort the model will exert to match the style and features,
51
+ # especially facial features, of input images. Supports `high` and `low` on
52
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
53
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
53
54
  sig { returns(T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol)) }
54
55
  attr_accessor :input_fidelity
55
56
 
@@ -201,9 +202,10 @@ module OpenAI
201
202
  # set the output format to `png` or `webp`.
202
203
  background: nil,
203
204
 
204
- # Controls fidelity to the original input image(s). This parameter is supported
205
- # for GPT image models that support input fidelity. `gpt-image-2` and
206
- # `gpt-image-2-2026-04-21` ignore this parameter.
205
+ # Control how much effort the model will exert to match the style and features,
206
+ # especially facial features, of input images. Supports `high` and `low` on
207
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
208
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
207
209
  input_fidelity: nil,
208
210
 
209
211
  # An additional image whose fully transparent areas (e.g. where alpha is zero)
@@ -348,9 +350,10 @@ module OpenAI
348
350
  end
349
351
  end
350
352
 
351
- # Controls fidelity to the original input image(s). This parameter is supported
352
- # for GPT image models that support input fidelity. `gpt-image-2` and
353
- # `gpt-image-2-2026-04-21` ignore this parameter.
353
+ # Control how much effort the model will exert to match the style and features,
354
+ # especially facial features, of input images. Supports `high` and `low` on
355
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
356
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
354
357
  module InputFidelity
355
358
  extend OpenAI::Internal::Type::Enum
356
359
 
@@ -49,6 +49,22 @@ module OpenAI
49
49
  # fields that are present in the `session.update` are updated. To clear a field
50
50
  # like `instructions`, pass an empty string. To clear a field like `tools`, pass
51
51
  # an empty array. To clear a field like `turn_detection`, pass `null`.
52
+ #
53
+ # To turn off input audio noise reduction, send this Realtime event:
54
+ #
55
+ # ```json
56
+ # {
57
+ # "type": "session.update",
58
+ # "session": {
59
+ # "type": "realtime",
60
+ # "audio": { "input": { "noise_reduction": null } }
61
+ # }
62
+ # }
63
+ # ```
64
+ #
65
+ # For a transcription session, use `"type":"transcription"` inside `session`.
66
+ # Omitting `audio.input.noise_reduction` from an update leaves its current setting
67
+ # unchanged.
52
68
  sig do
53
69
  params(
54
70
 
@@ -14,7 +14,7 @@ module OpenAI
14
14
  )
15
15
  end
16
16
 
17
- # The unique ID of the computer call tool output.
17
+ # The ID of the computer tool call output.
18
18
  sig { returns(String) }
19
19
  attr_accessor :id
20
20
 
@@ -85,7 +85,7 @@ module OpenAI
85
85
  end
86
86
  def self.new(
87
87
 
88
- # The unique ID of the computer call tool output.
88
+ # The ID of the computer tool call output.
89
89
  id:,
90
90
 
91
91
  # The ID of the computer tool call that produced the output.
@@ -137,6 +137,11 @@ module OpenAI
137
137
  }
138
138
  attr_writer :error_type
139
139
 
140
+ # An opaque target for explicitly continuing this review, or null when
141
+ # unavailable.
142
+ sig { returns(T.nilable(String)) }
143
+ attr_accessor :review_target
144
+
140
145
  # An optional public continuation instruction.
141
146
  sig { returns(T.nilable(OpenAI::Responses::ResponseError::Misalignment::Steer)) }
142
147
  attr_reader :steer
@@ -151,6 +156,8 @@ module OpenAI
151
156
 
152
157
  error_type: T.any(String, OpenAI::Responses::ResponseError::Misalignment::ErrorType::OrSymbol),
153
158
 
159
+ review_target: T.nilable(String),
160
+
154
161
  steer: OpenAI::Responses::ResponseError::Misalignment::Steer::OrHash
155
162
  )
156
163
  .returns(T.attached_class)
@@ -163,6 +170,10 @@ module OpenAI
163
170
  # An optional classification; clients must accept additional values.
164
171
  error_type: nil,
165
172
 
173
+ # An opaque target for explicitly continuing this review, or null when
174
+ # unavailable.
175
+ review_target: nil,
176
+
166
177
  # An optional public continuation instruction.
167
178
 
168
179
  steer: nil
@@ -174,6 +185,7 @@ module OpenAI
174
185
  {
175
186
  detailed_explanation: String,
176
187
  error_type: OpenAI::Responses::ResponseError::Misalignment::ErrorType::Variants,
188
+ review_target: T.nilable(String),
177
189
  steer: OpenAI::Responses::ResponseError::Misalignment::Steer
178
190
  }
179
191
  )
@@ -4614,6 +4614,11 @@ module OpenAI
4614
4614
  }
4615
4615
  attr_writer :error_type
4616
4616
 
4617
+ # An opaque target for explicitly continuing this review, or null when
4618
+ # unavailable.
4619
+ sig { returns(T.nilable(String)) }
4620
+ attr_accessor :review_target
4621
+
4617
4622
  # An optional public continuation instruction.
4618
4623
  sig {
4619
4624
  returns(T.nilable(OpenAI::Responses::ResponsesServerEvent::ResponseWsError::Error::Misalignment::Steer))
@@ -4638,6 +4643,8 @@ module OpenAI
4638
4643
  OpenAI::Responses::ResponsesServerEvent::ResponseWsError::Error::Misalignment::ErrorType::OrSymbol
4639
4644
  ),
4640
4645
 
4646
+ review_target: T.nilable(String),
4647
+
4641
4648
  steer: OpenAI::Responses::ResponsesServerEvent::ResponseWsError::Error::Misalignment::Steer::OrHash
4642
4649
  )
4643
4650
  .returns(T.attached_class)
@@ -4650,6 +4657,10 @@ module OpenAI
4650
4657
  # An optional classification; clients must accept additional values.
4651
4658
  error_type: nil,
4652
4659
 
4660
+ # An opaque target for explicitly continuing this review, or null when
4661
+ # unavailable.
4662
+ review_target: nil,
4663
+
4653
4664
  # An optional public continuation instruction.
4654
4665
 
4655
4666
  steer: nil
@@ -4663,6 +4674,7 @@ module OpenAI
4663
4674
  error_type: T.nilable(
4664
4675
  OpenAI::Responses::ResponsesServerEvent::ResponseWsError::Error::Misalignment::ErrorType::Variants
4665
4676
  ),
4677
+ review_target: T.nilable(String),
4666
4678
  steer: T.nilable(
4667
4679
  OpenAI::Responses::ResponsesServerEvent::ResponseWsError::Error::Misalignment::Steer
4668
4680
  )
@@ -977,9 +977,10 @@ module OpenAI
977
977
  sig { params(background: OpenAI::Responses::Tool::ImageGeneration::Background::OrSymbol).void }
978
978
  attr_writer :background
979
979
 
980
- # Controls fidelity to the original input image(s). This parameter is supported
981
- # for GPT image models that support input fidelity. `gpt-image-2` and
982
- # `gpt-image-2-2026-04-21` ignore this parameter.
980
+ # Control how much effort the model will exert to match the style and features,
981
+ # especially facial features, of input images. Supports `high` and `low` on
982
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
983
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
983
984
  sig { returns(T.nilable(OpenAI::Responses::Tool::ImageGeneration::InputFidelity::OrSymbol)) }
984
985
  attr_accessor :input_fidelity
985
986
 
@@ -1104,9 +1105,10 @@ module OpenAI
1104
1105
  # set the output format to `png` or `webp`.
1105
1106
  background: nil,
1106
1107
 
1107
- # Controls fidelity to the original input image(s). This parameter is supported
1108
- # for GPT image models that support input fidelity. `gpt-image-2` and
1109
- # `gpt-image-2-2026-04-21` ignore this parameter.
1108
+ # Control how much effort the model will exert to match the style and features,
1109
+ # especially facial features, of input images. Supports `high` and `low` on
1110
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
1111
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
1110
1112
  input_fidelity: nil,
1111
1113
 
1112
1114
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
@@ -1219,9 +1221,10 @@ module OpenAI
1219
1221
  end
1220
1222
  end
1221
1223
 
1222
- # Controls fidelity to the original input image(s). This parameter is supported
1223
- # for GPT image models that support input fidelity. `gpt-image-2` and
1224
- # `gpt-image-2-2026-04-21` ignore this parameter.
1224
+ # Control how much effort the model will exert to match the style and features,
1225
+ # especially facial features, of input images. Supports `high` and `low` on
1226
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
1227
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
1225
1228
  module InputFidelity
1226
1229
  extend OpenAI::Internal::Type::Enum
1227
1230
 
@@ -99,6 +99,11 @@ module OpenAI
99
99
  sig { params(error_type: T.any(String, OpenAI::VideoCreateError::Misalignment::ErrorType::OrSymbol)).void }
100
100
  attr_writer :error_type
101
101
 
102
+ # An opaque target for explicitly continuing this review, or null when
103
+ # unavailable.
104
+ sig { returns(T.nilable(String)) }
105
+ attr_accessor :review_target
106
+
102
107
  # An optional public continuation instruction.
103
108
  sig { returns(T.nilable(OpenAI::VideoCreateError::Misalignment::Steer)) }
104
109
  attr_reader :steer
@@ -113,6 +118,8 @@ module OpenAI
113
118
 
114
119
  error_type: T.any(String, OpenAI::VideoCreateError::Misalignment::ErrorType::OrSymbol),
115
120
 
121
+ review_target: T.nilable(String),
122
+
116
123
  steer: OpenAI::VideoCreateError::Misalignment::Steer::OrHash
117
124
  )
118
125
  .returns(T.attached_class)
@@ -125,6 +132,10 @@ module OpenAI
125
132
  # An optional classification; clients must accept additional values.
126
133
  error_type: nil,
127
134
 
135
+ # An opaque target for explicitly continuing this review, or null when
136
+ # unavailable.
137
+ review_target: nil,
138
+
128
139
  # An optional public continuation instruction.
129
140
 
130
141
  steer: nil
@@ -136,6 +147,7 @@ module OpenAI
136
147
  {
137
148
  detailed_explanation: String,
138
149
  error_type: OpenAI::VideoCreateError::Misalignment::ErrorType::Variants,
150
+ review_target: T.nilable(String),
139
151
  steer: OpenAI::VideoCreateError::Misalignment::Steer
140
152
  }
141
153
  )
@@ -179,8 +179,10 @@ module OpenAI
179
179
  # End time (Unix seconds) of the query time range, exclusive.
180
180
  end_time: nil,
181
181
  # Group the usage data by the specified fields. Support fields include
182
- # `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier` or any
183
- # combination of them.
182
+ # `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
183
+ # `api_source` or any combination of them. When grouped by `api_source`, results
184
+ # use `agents_api` for attributed Agents API activity and `unlabeled` for all
185
+ # other activity. Without source grouping, `api_source` is null.
184
186
  group_by: nil,
185
187
  # Specifies the number of buckets to return.
186
188
  #
@@ -227,8 +229,13 @@ module OpenAI
227
229
  bucket_width: nil,
228
230
  # End time (Unix seconds) of the query time range, exclusive.
229
231
  end_time: nil,
230
- # Group the costs by the specified fields. Support fields include `project_id`,
231
- # `line_item`, `api_key_id` and any combination of them.
232
+ # Group the costs by the specified fields. Supported fields include `project_id`,
233
+ # `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
234
+ # `user_id` with `project_id` grouping or the `project_ids` filter depends on the
235
+ # organization and requested time range. Unsupported combinations return HTTP 400.
236
+ # When grouped by `api_source`, results use `agents_api` for attributed Agents API
237
+ # activity and `unlabeled` for all other activity. Without source grouping,
238
+ # `api_source` is null.
232
239
  group_by: nil,
233
240
  # A limit on the number of buckets to be returned. Limit can range between 1 and
234
241
  # 180, and the default is 7.
@@ -522,8 +529,10 @@ module OpenAI
522
529
  # End time (Unix seconds) of the query time range, exclusive.
523
530
  end_time: nil,
524
531
  # Group the usage data by the specified fields. Support fields include
525
- # `project_id`, `user_id`, `api_key_id`, `model`, `context_level` or any
526
- # combination of them.
532
+ # `project_id`, `user_id`, `api_key_id`, `model`, `context_level`, `api_source` or
533
+ # any combination of them. When grouped by `api_source`, results use `agents_api`
534
+ # for attributed Agents API activity and `unlabeled` for all other activity.
535
+ # Without source grouping, `api_source` is null.
527
536
  group_by: nil,
528
537
  # Specifies the number of buckets to return.
529
538
  #
@@ -57,8 +57,8 @@ module OpenAI
57
57
  files: nil,
58
58
  # An optional human-readable display name for the template.
59
59
  name: nil,
60
- # Network access policy for the environment. Defaults to disabled for GA requests
61
- # and enabled for beta requests.
60
+ # Network access policy for the environment. If omitted, the API version
61
+ # determines whether network access is enabled or disabled.
62
62
  network: nil,
63
63
  # Packages to install in the environment. Defaults to empty package lists.
64
64
  packages: nil,
@@ -136,8 +136,7 @@ module OpenAI
136
136
  # A replacement human-readable display name, or `null` to clear the name.
137
137
  name: nil,
138
138
  # Network access available after setup completes. Omit to preserve the current
139
- # policy, or pass `null` to reset to disabled for GA requests or enabled for beta
140
- # requests.
139
+ # policy, or pass `null` to reset to the default policy.
141
140
  network: nil,
142
141
  # Packages installed before the runtime network policy applies.
143
142
  packages: nil,
@@ -0,0 +1,62 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+
6
+ class Beta
7
+
8
+ class Agents
9
+
10
+ class Sessions
11
+
12
+ class Turns
13
+
14
+ class Items
15
+
16
+ # Lists items belonging to one root-agent turn, including its interactions with
17
+ # subagents. See
18
+ # [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability).
19
+ sig {
20
+ params(
21
+ turn_id: String,
22
+ session_id: String,
23
+ after: String,
24
+ limit: Integer,
25
+ order: OpenAI::Beta::Agents::Sessions::Turns::ItemListParams::Order::OrSymbol,
26
+ request_options: OpenAI::RequestOptions::OrHash
27
+ )
28
+ .returns(OpenAI::Internal::ConversationCursorPage[OpenAI::Beta::AgentSessionItem::Variants])
29
+ }
30
+ def list(
31
+ # Path param: The ID of the turn.
32
+ turn_id,
33
+ # Path param: The ID of the session that owns the turn.
34
+ session_id:,
35
+ # Query param: Return items after this cursor in the selected order. Pass the
36
+ # previous response's last_id, which can differ from the last item's ID.
37
+ after: nil,
38
+ # Query param: The maximum number of resources to return, between 1 and 100.
39
+ # Defaults to 20.
40
+ limit: nil,
41
+ # Query param: The order in which resources are returned. Defaults to `desc`.
42
+ order: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
47
+ # @api private
48
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
49
+ def self.new(client:)
50
+ end
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+ end
@@ -11,6 +11,9 @@ module OpenAI
11
11
 
12
12
  class Turns
13
13
 
14
+ sig { returns(OpenAI::Resources::Beta::Agents::Sessions::Turns::Items) }
15
+ attr_reader :items
16
+
14
17
  # Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if
15
18
  # the turn does not belong to the session. See
16
19
  # [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns).
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ),
92
92
  agent: OpenAI::Beta::Agents::SessionCreateParams::Agent::OrHash,
93
93
  agent_id: String,
94
+ tool_handlers: T::Hash[String, OpenAI::Helpers::Agents::ToolHandler],
94
95
  output_type: T.nilable(T.class_of(OpenAI::Helpers::StructuredOutput::BaseModel)),
95
96
  input: T.nilable(OpenAI::Beta::Agents::SessionCreateParams::Input::Variants),
96
97
  metadata: T.nilable(T::Hash[Symbol, String]),
@@ -109,6 +110,7 @@ module OpenAI
109
110
  # The ID of a saved reusable agent. Omit `agent` to use its configuration
110
111
  # unchanged.
111
112
  agent_id: nil,
113
+ tool_handlers: {},
112
114
  output_type: nil,
113
115
  # Initial input to submit when the session is created. A string is shorthand for a
114
116
  # single user message. Required when `environment.type` is `none`, or when
@@ -130,8 +130,13 @@ module OpenAI
130
130
  after: nil,
131
131
  # Number of fine-tuning jobs to retrieve.
132
132
  limit: nil,
133
- # Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
134
- # Alternatively, set `metadata=null` to indicate no metadata.
133
+ # Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Omitting
134
+ # the parameter or passing an empty object applies no metadata filter. An empty
135
+ # value, such as `metadata[k]=`, filters for that key with an empty string value.
136
+ # To select jobs with null metadata, send the literal query string
137
+ # `metadata=null`. Nullable caller types do not specify how a client serializes
138
+ # null for a deep-object parameter. Use a raw query parameter if the client omits
139
+ # null. Do not combine the two query forms.
135
140
  metadata: nil,
136
141
  request_options: {}
137
142
  )
@@ -101,9 +101,10 @@ module OpenAI
101
101
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
102
102
  # set the output format to `png` or `webp`.
103
103
  background: nil,
104
- # Controls fidelity to the original input image(s). This parameter is supported
105
- # for GPT image models that support input fidelity. `gpt-image-2` and
106
- # `gpt-image-2-2026-04-21` ignore this parameter.
104
+ # Control how much effort the model will exert to match the style and features,
105
+ # especially facial features, of input images. Supports `high` and `low` on
106
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
107
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
107
108
  input_fidelity: nil,
108
109
  # An additional image whose fully transparent areas (e.g. where alpha is zero)
109
110
  # indicate where `image` should be edited. If there are multiple images provided,
@@ -220,9 +221,10 @@ module OpenAI
220
221
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
221
222
  # set the output format to `png` or `webp`.
222
223
  background: nil,
223
- # Controls fidelity to the original input image(s). This parameter is supported
224
- # for GPT image models that support input fidelity. `gpt-image-2` and
225
- # `gpt-image-2-2026-04-21` ignore this parameter.
224
+ # Control how much effort the model will exert to match the style and features,
225
+ # especially facial features, of input images. Supports `high` and `low` on
226
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
227
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
226
228
  input_fidelity: nil,
227
229
  # An additional image whose fully transparent areas (e.g. where alpha is zero)
228
230
  # indicate where `image` should be edited. If there are multiple images provided,
@@ -35,6 +35,9 @@ module OpenAI
35
35
  | Array[OpenAI::Beta::AgentSessionInputMessageParam
36
36
  | Hash[Symbol, untyped]],
37
37
  ?tool_handlers: Hash[String, OpenAI::Helpers::Agents::tool_handler],
38
+ ?on_tool_error: (^(
39
+ OpenAI::Helpers::Beta::Agents::ToolError
40
+ ) -> void)?,
38
41
  ?idempotency_key: String?,
39
42
  ?output_type: singleton(OpenAI::Helpers::StructuredOutput::BaseModel)?,
40
43
  ?request_options: OpenAI::RequestOptions
@@ -8,7 +8,8 @@ module OpenAI
8
8
  def initialize: (
9
9
  name: String,
10
10
  arguments: Class,
11
- ?description: String
11
+ ?description: String,
12
+ ?defer_loading: bool?
12
13
  ) {
13
14
  (untyped) -> OpenAI::Helpers::Agents::tool_output
14
15
  } -> void
@@ -16,7 +17,9 @@ module OpenAI
16
17
  def handlers: -> Hash[String, OpenAI::Helpers::Agents::tool_handler]
17
18
  def call: (
18
19
  String | Hash[String | Symbol, untyped]
19
- ) -> OpenAI::Helpers::Agents::tool_output
20
+ ) ?{
21
+ (:arguments | :execution) -> void
22
+ } -> OpenAI::Helpers::Agents::tool_output
20
23
  end
21
24
  end
22
25
  end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Helpers
3
+ module Beta
4
+ module Agents
5
+ # Beta, local-only tool failure diagnostic.
6
+ class ToolError
7
+ attr_reader error: StandardError
8
+ attr_reader tool_name: String
9
+ attr_reader session_id: String
10
+ attr_reader turn_id: String
11
+ attr_reader call_id: String
12
+ attr_reader stage: :arguments | :execution | :output
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -64,6 +64,11 @@ module OpenAI
64
64
 
65
65
  # @api private
66
66
  def configure_output_parser: (OutputParser? parser) -> self
67
+ def configure_tool_handlers: (
68
+ sessions: OpenAI::Resources::Beta::Agents::Sessions,
69
+ tool_handlers: Hash[String, OpenAI::Helpers::Agents::tool_handler],
70
+ request_options: untyped
71
+ ) -> self
67
72
  end
68
73
  end
69
74
  end