openai 0.99.0 → 0.101.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 (195) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/bedrock.md +17 -1
  5. data/lib/openai/client.rb +13 -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_response_tool_search_output_item_param.rb +1166 -3
  32. data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
  33. data/lib/openai/models/beta/beta_tool.rb +12 -9
  34. data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
  35. data/lib/openai/models/beta/environment_param.rb +6 -6
  36. data/lib/openai/models/beta/session_turn_error.rb +9 -0
  37. data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
  38. data/lib/openai/models/decision.rb +313 -0
  39. data/lib/openai/models/decision_create_params.rb +233 -0
  40. data/lib/openai/models/decision_input_image.rb +53 -0
  41. data/lib/openai/models/decision_input_message.rb +60 -0
  42. data/lib/openai/models/decision_input_part.rb +20 -0
  43. data/lib/openai/models/decision_input_text.rb +21 -0
  44. data/lib/openai/models/error_object.rb +12 -1
  45. data/lib/openai/models/eval_create_params.rb +1 -1
  46. data/lib/openai/models/eval_create_response.rb +1 -1
  47. data/lib/openai/models/eval_list_response.rb +1 -1
  48. data/lib/openai/models/eval_retrieve_response.rb +1 -1
  49. data/lib/openai/models/eval_update_response.rb +1 -1
  50. data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
  51. data/lib/openai/models/graders/score_model_grader.rb +2 -2
  52. data/lib/openai/models/image_edit_params.rb +12 -9
  53. data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
  54. data/lib/openai/models/realtime/session_update_event.rb +16 -0
  55. data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
  56. data/lib/openai/models/responses/response_error.rb +12 -1
  57. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +1166 -3
  58. data/lib/openai/models/responses/responses_server_event.rb +12 -1
  59. data/lib/openai/models/responses/tool.rb +12 -9
  60. data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
  61. data/lib/openai/models/video_create_error.rb +12 -1
  62. data/lib/openai/models.rb +12 -0
  63. data/lib/openai/providers/bedrock.rb +20 -1
  64. data/lib/openai/resources/admin/organization/usage.rb +15 -6
  65. data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
  66. data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
  67. data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
  68. data/lib/openai/resources/beta/agents/sessions.rb +22 -2
  69. data/lib/openai/resources/decisions.rb +59 -0
  70. data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
  71. data/lib/openai/resources/images.rb +8 -6
  72. data/lib/openai/version.rb +1 -1
  73. data/lib/openai.rb +11 -0
  74. data/rbi/openai/client.rbi +3 -0
  75. data/rbi/openai/helpers/agents.rbi +2 -0
  76. data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
  77. data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
  78. data/rbi/openai/helpers/beta/agents.rbi +12 -0
  79. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +194 -1
  80. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +194 -1
  81. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +194 -1
  82. data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
  83. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +194 -1
  84. data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
  85. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +194 -1
  86. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +194 -1
  87. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +194 -1
  88. data/rbi/openai/models/admin/organization/usage_images_response.rbi +194 -1
  89. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +194 -1
  90. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +194 -1
  91. data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
  92. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +194 -1
  93. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
  94. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
  95. data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
  96. data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
  97. data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
  98. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +1893 -18
  99. data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
  100. data/rbi/openai/models/beta/beta_tool.rbi +12 -9
  101. data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
  102. data/rbi/openai/models/beta/environment_param.rbi +6 -6
  103. data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
  104. data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
  105. data/rbi/openai/models/decision.rbi +586 -0
  106. data/rbi/openai/models/decision_create_params.rbi +435 -0
  107. data/rbi/openai/models/decision_input_image.rbi +81 -0
  108. data/rbi/openai/models/decision_input_message.rbi +96 -0
  109. data/rbi/openai/models/decision_input_part.rbi +24 -0
  110. data/rbi/openai/models/decision_input_text.rbi +49 -0
  111. data/rbi/openai/models/error_object.rbi +12 -0
  112. data/rbi/openai/models/eval_create_params.rbi +1 -1
  113. data/rbi/openai/models/eval_create_response.rbi +1 -1
  114. data/rbi/openai/models/eval_list_response.rbi +1 -1
  115. data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
  116. data/rbi/openai/models/eval_update_response.rbi +1 -1
  117. data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
  118. data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
  119. data/rbi/openai/models/image_edit_params.rbi +12 -9
  120. data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
  121. data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
  122. data/rbi/openai/models/responses/response_error.rbi +12 -0
  123. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +1901 -18
  124. data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
  125. data/rbi/openai/models/responses/tool.rbi +12 -9
  126. data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
  127. data/rbi/openai/models/video_create_error.rbi +12 -0
  128. data/rbi/openai/models.rbi +12 -0
  129. data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
  130. data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
  131. data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
  132. data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
  133. data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
  134. data/rbi/openai/resources/decisions.rbi +57 -0
  135. data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
  136. data/rbi/openai/resources/images.rbi +8 -6
  137. data/sig/openai/client.rbs +2 -0
  138. data/sig/openai/helpers/agents.rbs +3 -0
  139. data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
  140. data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
  141. data/sig/openai/helpers/beta/agents.rbs +5 -0
  142. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +87 -2
  143. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +87 -2
  144. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +87 -2
  145. data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
  146. data/sig/openai/models/admin/organization/usage_completions_response.rbs +87 -2
  147. data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
  148. data/sig/openai/models/admin/organization/usage_costs_response.rbs +87 -2
  149. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +87 -2
  150. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +87 -2
  151. data/sig/openai/models/admin/organization/usage_images_response.rbs +87 -2
  152. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +87 -2
  153. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +87 -2
  154. data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
  155. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +87 -2
  156. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
  157. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
  158. data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
  159. data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
  160. data/sig/openai/models/beta/beta_response_error.rbs +10 -0
  161. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +993 -4
  162. data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
  163. data/sig/openai/models/beta/beta_tool.rbs +8 -6
  164. data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
  165. data/sig/openai/models/beta/environment_param.rbs +4 -4
  166. data/sig/openai/models/beta/session_turn_error.rbs +12 -0
  167. data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
  168. data/sig/openai/models/decision.rbs +296 -0
  169. data/sig/openai/models/decision_create_params.rbs +227 -0
  170. data/sig/openai/models/decision_input_image.rbs +51 -0
  171. data/sig/openai/models/decision_input_message.rbs +57 -0
  172. data/sig/openai/models/decision_input_part.rbs +12 -0
  173. data/sig/openai/models/decision_input_text.rbs +15 -0
  174. data/sig/openai/models/error_object.rbs +10 -0
  175. data/sig/openai/models/eval_create_params.rbs +1 -1
  176. data/sig/openai/models/eval_create_response.rbs +1 -1
  177. data/sig/openai/models/eval_list_response.rbs +1 -1
  178. data/sig/openai/models/eval_retrieve_response.rbs +1 -1
  179. data/sig/openai/models/eval_update_response.rbs +1 -1
  180. data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
  181. data/sig/openai/models/graders/score_model_grader.rbs +3 -3
  182. data/sig/openai/models/image_edit_params.rbs +8 -6
  183. data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
  184. data/sig/openai/models/responses/response_error.rbs +10 -0
  185. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +993 -4
  186. data/sig/openai/models/responses/responses_server_event.rbs +10 -0
  187. data/sig/openai/models/responses/tool.rbs +8 -6
  188. data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
  189. data/sig/openai/models/video_create_error.rbs +10 -0
  190. data/sig/openai/models.rbs +12 -0
  191. data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
  192. data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
  193. data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
  194. data/sig/openai/resources/decisions.rbs +15 -0
  195. metadata +38 -1
@@ -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
 
@@ -0,0 +1,272 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Responses
7
+
8
+ class ToolSearchOutputNamespaceTool < OpenAI::Internal::Type::BaseModel
9
+
10
+ OrHash = T.type_alias do
11
+ T.any(
12
+ OpenAI::Responses::ToolSearchOutputNamespaceTool,
13
+ OpenAI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # A description of the namespace shown to the model.
18
+ sig { returns(String) }
19
+ attr_accessor :description
20
+
21
+ # The namespace name used in tool calls (for example, `crm`).
22
+ sig { returns(String) }
23
+ attr_accessor :name
24
+
25
+ # The function/custom tools loaded inside this namespace.
26
+ sig {
27
+ returns(
28
+ T::Array[
29
+ T.any(OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Responses::CustomTool)
30
+ ]
31
+ )
32
+ }
33
+ attr_accessor :tools
34
+
35
+ # The type of the tool. Always `namespace`.
36
+ sig { returns(Symbol) }
37
+ attr_accessor :type
38
+
39
+ # Groups function/custom tools under a shared namespace.
40
+ sig do
41
+ params(
42
+
43
+ description: String,
44
+
45
+ name: String,
46
+
47
+ tools: T::Array[
48
+ T.any(
49
+ OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::OrHash,
50
+ OpenAI::Responses::CustomTool::OrHash
51
+ )
52
+ ],
53
+
54
+ type: Symbol
55
+ )
56
+ .returns(T.attached_class)
57
+ end
58
+ def self.new(
59
+
60
+ # A description of the namespace shown to the model.
61
+ description:,
62
+
63
+ # The namespace name used in tool calls (for example, `crm`).
64
+ name:,
65
+
66
+ # The function/custom tools loaded inside this namespace.
67
+ tools:,
68
+
69
+ # The type of the tool. Always `namespace`.
70
+
71
+ type: :namespace
72
+ )
73
+ end
74
+
75
+ sig do
76
+ override.returns(
77
+ {
78
+ description: String,
79
+ name: String,
80
+ tools: T::Array[
81
+ T.any(OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Responses::CustomTool)
82
+ ],
83
+ type: Symbol
84
+ }
85
+ )
86
+ end
87
+ def to_hash
88
+ end
89
+
90
+ # A function or custom tool loaded into a namespace by tool search.
91
+ module Tool
92
+ extend OpenAI::Internal::Type::Union
93
+
94
+ Variants = T.type_alias {
95
+ T.any(OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Responses::CustomTool)
96
+ }
97
+
98
+ class Function < OpenAI::Internal::Type::BaseModel
99
+ OrHash = T.type_alias do
100
+ T.any(
101
+ OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function,
102
+ OpenAI::Internal::AnyHash
103
+ )
104
+ end
105
+
106
+ # The name of the loaded function tool.
107
+ sig { returns(String) }
108
+ attr_accessor :name
109
+
110
+ sig { returns(Symbol) }
111
+ attr_accessor :type
112
+
113
+ # The tool invocation context(s).
114
+ sig {
115
+ returns(
116
+ T.nilable(
117
+ T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
118
+ )
119
+ )
120
+ }
121
+ attr_accessor :allowed_callers
122
+
123
+ # Whether the tool response can be returned asynchronously versus immediately
124
+ # returned on next response creation.
125
+ sig { returns(T.nilable(T::Boolean)) }
126
+ attr_reader :async
127
+
128
+ sig { params(async: T::Boolean).void }
129
+ attr_writer :async
130
+
131
+ # Whether this function should be deferred and discovered via tool search.
132
+ sig { returns(T.nilable(T::Boolean)) }
133
+ attr_reader :defer_loading
134
+
135
+ sig { params(defer_loading: T::Boolean).void }
136
+ attr_writer :defer_loading
137
+
138
+ sig { returns(T.nilable(String)) }
139
+ attr_accessor :description
140
+
141
+ # A JSON Schema describing the JSON value encoded in string outputs for this
142
+ # function tool. This does not describe content-array outputs.
143
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
144
+ attr_accessor :output_schema
145
+
146
+ sig { returns(T.nilable(T.anything)) }
147
+ attr_accessor :parameters
148
+
149
+ # Whether to enforce strict parameter validation. If omitted, Responses attempts
150
+ # to use strict validation when the schema is compatible, and falls back to
151
+ # non-strict validation otherwise.
152
+ sig { returns(T.nilable(T::Boolean)) }
153
+ attr_accessor :strict
154
+
155
+ sig do
156
+ params(
157
+
158
+ name: String,
159
+
160
+ allowed_callers: T.nilable(
161
+ T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
162
+ ),
163
+
164
+ async: T::Boolean,
165
+
166
+ defer_loading: T::Boolean,
167
+
168
+ description: T.nilable(String),
169
+
170
+ output_schema: T.nilable(T::Hash[Symbol, T.anything]),
171
+
172
+ parameters: T.nilable(T.anything),
173
+
174
+ strict: T.nilable(T::Boolean),
175
+
176
+ type: Symbol
177
+ )
178
+ .returns(T.attached_class)
179
+ end
180
+ def self.new(
181
+
182
+ # The name of the loaded function tool.
183
+ name:,
184
+
185
+ # The tool invocation context(s).
186
+ allowed_callers: nil,
187
+
188
+ # Whether the tool response can be returned asynchronously versus immediately
189
+ # returned on next response creation.
190
+ async: nil,
191
+
192
+ # Whether this function should be deferred and discovered via tool search.
193
+ defer_loading: nil,
194
+
195
+ description: nil,
196
+
197
+ # A JSON Schema describing the JSON value encoded in string outputs for this
198
+ # function tool. This does not describe content-array outputs.
199
+ output_schema: nil,
200
+
201
+ parameters: nil,
202
+
203
+ # Whether to enforce strict parameter validation. If omitted, Responses attempts
204
+ # to use strict validation when the schema is compatible, and falls back to
205
+ # non-strict validation otherwise.
206
+ strict: nil,
207
+
208
+ type: :function
209
+ )
210
+ end
211
+
212
+ sig do
213
+ override.returns(
214
+ {
215
+ name: String,
216
+ type: Symbol,
217
+ allowed_callers: T.nilable(
218
+ T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
219
+ ),
220
+ async: T::Boolean,
221
+ defer_loading: T::Boolean,
222
+ description: T.nilable(String),
223
+ output_schema: T.nilable(T::Hash[Symbol, T.anything]),
224
+ parameters: T.nilable(T.anything),
225
+ strict: T.nilable(T::Boolean)
226
+ }
227
+ )
228
+ end
229
+ def to_hash
230
+ end
231
+
232
+ module AllowedCaller
233
+ extend OpenAI::Internal::Type::Enum
234
+
235
+ TaggedSymbol = T.type_alias {
236
+ T.all(Symbol, OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller)
237
+ }
238
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
239
+
240
+ DIRECT = T.let(
241
+ :direct,
242
+ OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
243
+ )
244
+ PROGRAMMATIC = T.let(
245
+ :programmatic,
246
+ OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
247
+ )
248
+
249
+ sig {
250
+ override.returns(
251
+ T::Array[
252
+ OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
253
+ ]
254
+ )
255
+ }
256
+ def self.values
257
+ end
258
+ end
259
+ end
260
+
261
+ sig { override.returns(T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Variants]) }
262
+ def self.variants
263
+ end
264
+
265
+ end
266
+
267
+ end
268
+
269
+ end
270
+
271
+ end
272
+ end
@@ -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
  )
@@ -68,6 +68,18 @@ module OpenAI
68
68
 
69
69
  CustomToolInputFormat = OpenAI::Models::CustomToolInputFormat
70
70
 
71
+ Decision = OpenAI::Models::Decision
72
+
73
+ DecisionCreateParams = OpenAI::Models::DecisionCreateParams
74
+
75
+ DecisionInputImage = OpenAI::Models::DecisionInputImage
76
+
77
+ DecisionInputMessage = OpenAI::Models::DecisionInputMessage
78
+
79
+ DecisionInputPart = OpenAI::Models::DecisionInputPart
80
+
81
+ DecisionInputText = OpenAI::Models::DecisionInputText
82
+
71
83
  DeletedSkill = OpenAI::Models::DeletedSkill
72
84
 
73
85
  Embedding = OpenAI::Models::Embedding
@@ -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
@@ -0,0 +1,57 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+
6
+ class Decisions
7
+
8
+ # Evaluate ordered classification and scoring questions against shared input.
9
+ # Answers are returned in question order.
10
+ #
11
+ # Supply input as a string or user messages containing text and inline images.
12
+ # Only user messages with `input_text` and `input_image` parts are supported;
13
+ # non-user roles, function calls, files, audio, and item references are not
14
+ # supported. Images require a data URL, not an external URL or file ID. At most
15
+ # 128 images are allowed across the request.
16
+ #
17
+ # Each question can return a refusal instead of a scored answer. A refusal has
18
+ # type `refusal` and the corresponding question name, or null if unnamed.
19
+ sig {
20
+ params(
21
+ input: OpenAI::DecisionCreateParams::Input::Variants,
22
+ model: String,
23
+ questions: T::Array[
24
+ T.any(
25
+ OpenAI::DecisionCreateParams::Question::Predicate::OrHash,
26
+ OpenAI::DecisionCreateParams::Question::Choice::OrHash,
27
+ OpenAI::DecisionCreateParams::Question::Score::OrHash
28
+ )
29
+ ],
30
+ safety_identifier: T.nilable(String),
31
+ request_options: OpenAI::RequestOptions::OrHash
32
+ )
33
+ .returns(OpenAI::Decision)
34
+ }
35
+ def create(
36
+ # Shared evidence, as a string or an array of user messages containing text and
37
+ # inline images. Non-user roles, function calls, function-call outputs, files,
38
+ # audio, and item references are not supported. At most 128 image parts are
39
+ # allowed across all messages in one request.
40
+ input:,
41
+ model:,
42
+ questions:,
43
+ # Opaque caller-provided end-user identifier, scoped by the verified org. Match
44
+ # Responses' limit; this is never the authenticated user identity.
45
+ safety_identifier: nil,
46
+ request_options: {}
47
+ )
48
+ end
49
+
50
+ # @api private
51
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
52
+ def self.new(client:)
53
+ end
54
+ end
55
+
56
+ end
57
+ end
@@ -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,