openai 0.36.0 → 0.37.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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/all_models.rb +1 -0
  5. data/lib/openai/models/beta/assistant_create_params.rb +4 -3
  6. data/lib/openai/models/beta/assistant_update_params.rb +4 -3
  7. data/lib/openai/models/beta/threads/run_create_params.rb +4 -3
  8. data/lib/openai/models/chat/completion_create_params.rb +4 -3
  9. data/lib/openai/models/container_create_params.rb +22 -1
  10. data/lib/openai/models/container_create_response.rb +32 -1
  11. data/lib/openai/models/container_list_response.rb +32 -1
  12. data/lib/openai/models/container_retrieve_response.rb +32 -1
  13. data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
  14. data/lib/openai/models/conversations/item_create_params.rb +2 -2
  15. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +4 -3
  16. data/lib/openai/models/evals/run_cancel_response.rb +8 -6
  17. data/lib/openai/models/evals/run_create_params.rb +8 -6
  18. data/lib/openai/models/evals/run_create_response.rb +8 -6
  19. data/lib/openai/models/evals/run_list_response.rb +8 -6
  20. data/lib/openai/models/evals/run_retrieve_response.rb +8 -6
  21. data/lib/openai/models/graders/score_model_grader.rb +4 -3
  22. data/lib/openai/models/realtime/input_audio_buffer_dtmf_event_received_event.rb +43 -0
  23. data/lib/openai/models/realtime/output_audio_buffer_clear_event.rb +4 -4
  24. data/lib/openai/models/realtime/realtime_audio_input_turn_detection.rb +13 -5
  25. data/lib/openai/models/realtime/realtime_client_event.rb +1 -1
  26. data/lib/openai/models/realtime/realtime_server_event.rb +16 -9
  27. data/lib/openai/models/realtime/realtime_session.rb +13 -5
  28. data/lib/openai/models/realtime/realtime_session_create_request.rb +14 -9
  29. data/lib/openai/models/realtime/realtime_session_create_response.rb +27 -14
  30. data/lib/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rb +13 -5
  31. data/lib/openai/models/realtime/realtime_truncation.rb +14 -9
  32. data/lib/openai/models/reasoning.rb +4 -3
  33. data/lib/openai/models/reasoning_effort.rb +5 -3
  34. data/lib/openai/models/responses/compacted_response.rb +56 -0
  35. data/lib/openai/models/responses/input_token_count_params.rb +4 -4
  36. data/lib/openai/models/responses/response.rb +6 -6
  37. data/lib/openai/models/responses/response_apply_patch_tool_call.rb +23 -23
  38. data/lib/openai/models/responses/response_apply_patch_tool_call_output.rb +9 -9
  39. data/lib/openai/models/responses/response_compact_params.rb +344 -0
  40. data/lib/openai/models/responses/response_compaction_item.rb +43 -0
  41. data/lib/openai/models/responses/response_compaction_item_param.rb +36 -0
  42. data/lib/openai/models/responses/response_create_params.rb +4 -4
  43. data/lib/openai/models/responses/response_function_shell_call_output_content.rb +10 -10
  44. data/lib/openai/models/responses/response_function_shell_tool_call.rb +5 -5
  45. data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +2 -2
  46. data/lib/openai/models/responses/response_input_item.rb +22 -19
  47. data/lib/openai/models/responses/response_output_item.rb +4 -1
  48. data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
  49. data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
  50. data/lib/openai/models/responses/tool.rb +4 -2
  51. data/lib/openai/models/responses/tool_choice_shell.rb +1 -1
  52. data/lib/openai/models/responses_model.rb +1 -0
  53. data/lib/openai/models/video_create_params.rb +11 -6
  54. data/lib/openai/resources/containers.rb +3 -1
  55. data/lib/openai/resources/conversations/items.rb +1 -1
  56. data/lib/openai/resources/conversations.rb +1 -1
  57. data/lib/openai/resources/responses/input_tokens.rb +1 -1
  58. data/lib/openai/resources/responses.rb +33 -2
  59. data/lib/openai/resources/videos.rb +6 -3
  60. data/lib/openai/resources/webhooks.rb +0 -3
  61. data/lib/openai/version.rb +1 -1
  62. data/lib/openai.rb +6 -0
  63. data/manifest.yaml +1 -0
  64. data/rbi/openai/models/all_models.rbi +5 -0
  65. data/rbi/openai/models/beta/assistant_create_params.rbi +8 -6
  66. data/rbi/openai/models/beta/assistant_update_params.rbi +8 -6
  67. data/rbi/openai/models/beta/threads/run_create_params.rbi +8 -6
  68. data/rbi/openai/models/chat/completion_create_params.rbi +8 -6
  69. data/rbi/openai/models/container_create_params.rbi +51 -0
  70. data/rbi/openai/models/container_create_response.rbi +81 -3
  71. data/rbi/openai/models/container_list_response.rbi +80 -3
  72. data/rbi/openai/models/container_retrieve_response.rbi +83 -3
  73. data/rbi/openai/models/conversations/conversation_create_params.rbi +3 -0
  74. data/rbi/openai/models/conversations/item_create_params.rbi +3 -0
  75. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +8 -6
  76. data/rbi/openai/models/evals/run_cancel_response.rbi +16 -12
  77. data/rbi/openai/models/evals/run_create_params.rbi +16 -12
  78. data/rbi/openai/models/evals/run_create_response.rbi +16 -12
  79. data/rbi/openai/models/evals/run_list_response.rbi +16 -12
  80. data/rbi/openai/models/evals/run_retrieve_response.rbi +16 -12
  81. data/rbi/openai/models/graders/score_model_grader.rbi +8 -6
  82. data/rbi/openai/models/realtime/input_audio_buffer_dtmf_event_received_event.rbi +56 -0
  83. data/rbi/openai/models/realtime/output_audio_buffer_clear_event.rbi +4 -4
  84. data/rbi/openai/models/realtime/realtime_audio_input_turn_detection.rbi +24 -8
  85. data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -5
  86. data/rbi/openai/models/realtime/realtime_session.rbi +24 -8
  87. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +28 -18
  88. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +52 -26
  89. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbi +24 -8
  90. data/rbi/openai/models/realtime/realtime_truncation.rbi +14 -9
  91. data/rbi/openai/models/reasoning.rbi +8 -6
  92. data/rbi/openai/models/reasoning_effort.rbi +5 -3
  93. data/rbi/openai/models/responses/compacted_response.rbi +105 -0
  94. data/rbi/openai/models/responses/response.rbi +1 -0
  95. data/rbi/openai/models/responses/response_apply_patch_tool_call.rbi +53 -67
  96. data/rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi +9 -9
  97. data/rbi/openai/models/responses/response_compact_params.rbi +593 -0
  98. data/rbi/openai/models/responses/response_compaction_item.rbi +67 -0
  99. data/rbi/openai/models/responses/response_compaction_item_param.rbi +54 -0
  100. data/rbi/openai/models/responses/response_function_shell_call_output_content.rbi +9 -9
  101. data/rbi/openai/models/responses/response_function_shell_tool_call.rbi +6 -6
  102. data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +1 -1
  103. data/rbi/openai/models/responses/response_input_item.rbi +21 -23
  104. data/rbi/openai/models/responses/response_output_item.rbi +1 -0
  105. data/rbi/openai/models/responses/response_output_item_added_event.rbi +1 -0
  106. data/rbi/openai/models/responses/response_output_item_done_event.rbi +1 -0
  107. data/rbi/openai/models/responses/tool.rbi +6 -3
  108. data/rbi/openai/models/responses/tool_choice_shell.rbi +1 -1
  109. data/rbi/openai/models/responses_model.rbi +5 -0
  110. data/rbi/openai/models/video_create_params.rbi +10 -6
  111. data/rbi/openai/resources/beta/assistants.rbi +8 -6
  112. data/rbi/openai/resources/beta/threads/runs.rbi +8 -6
  113. data/rbi/openai/resources/chat/completions.rbi +8 -6
  114. data/rbi/openai/resources/containers.rbi +3 -0
  115. data/rbi/openai/resources/conversations/items.rbi +1 -0
  116. data/rbi/openai/resources/conversations.rbi +1 -0
  117. data/rbi/openai/resources/realtime/calls.rbi +14 -9
  118. data/rbi/openai/resources/responses.rbi +42 -0
  119. data/rbi/openai/resources/videos.rbi +5 -3
  120. data/sig/openai/models/all_models.rbs +2 -0
  121. data/sig/openai/models/container_create_params.rbs +23 -1
  122. data/sig/openai/models/container_create_response.rbs +32 -3
  123. data/sig/openai/models/container_list_response.rbs +32 -3
  124. data/sig/openai/models/container_retrieve_response.rbs +32 -3
  125. data/sig/openai/models/realtime/input_audio_buffer_dtmf_event_received_event.rbs +32 -0
  126. data/sig/openai/models/realtime/realtime_server_event.rbs +1 -0
  127. data/sig/openai/models/reasoning_effort.rbs +2 -1
  128. data/sig/openai/models/responses/compacted_response.rbs +42 -0
  129. data/sig/openai/models/responses/response_apply_patch_tool_call.rbs +18 -22
  130. data/sig/openai/models/responses/response_apply_patch_tool_call_output.rbs +7 -7
  131. data/sig/openai/models/responses/response_compact_params.rbs +226 -0
  132. data/sig/openai/models/responses/response_compaction_item.rbs +39 -0
  133. data/sig/openai/models/responses/response_compaction_item_param.rbs +28 -0
  134. data/sig/openai/models/responses/response_input_item.rbs +5 -6
  135. data/sig/openai/models/responses/response_output_item.rbs +1 -0
  136. data/sig/openai/models/responses_model.rbs +2 -0
  137. data/sig/openai/resources/containers.rbs +1 -0
  138. data/sig/openai/resources/responses.rbs +8 -0
  139. metadata +31 -2
@@ -0,0 +1,105 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Responses
6
+ class CompactedResponse < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Responses::CompactedResponse,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The unique identifier for the compacted response.
16
+ sig { returns(String) }
17
+ attr_accessor :id
18
+
19
+ # Unix timestamp (in seconds) when the compacted conversation was created.
20
+ sig { returns(Integer) }
21
+ attr_accessor :created_at
22
+
23
+ # The object type. Always `response.compaction`.
24
+ sig { returns(Symbol) }
25
+ attr_accessor :object
26
+
27
+ # The compacted list of output items. This is a list of all user messages,
28
+ # followed by a single compaction item.
29
+ sig do
30
+ returns(T::Array[OpenAI::Responses::ResponseOutputItem::Variants])
31
+ end
32
+ attr_accessor :output
33
+
34
+ # Token accounting for the compaction pass, including cached, reasoning, and total
35
+ # tokens.
36
+ sig { returns(OpenAI::Responses::ResponseUsage) }
37
+ attr_reader :usage
38
+
39
+ sig { params(usage: OpenAI::Responses::ResponseUsage::OrHash).void }
40
+ attr_writer :usage
41
+
42
+ sig do
43
+ params(
44
+ id: String,
45
+ created_at: Integer,
46
+ output:
47
+ T::Array[
48
+ T.any(
49
+ OpenAI::Responses::ResponseOutputMessage::OrHash,
50
+ OpenAI::Responses::ResponseFileSearchToolCall::OrHash,
51
+ OpenAI::Responses::ResponseFunctionToolCall::OrHash,
52
+ OpenAI::Responses::ResponseFunctionWebSearch::OrHash,
53
+ OpenAI::Responses::ResponseComputerToolCall::OrHash,
54
+ OpenAI::Responses::ResponseReasoningItem::OrHash,
55
+ OpenAI::Responses::ResponseCompactionItem::OrHash,
56
+ OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::OrHash,
57
+ OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash,
58
+ OpenAI::Responses::ResponseOutputItem::LocalShellCall::OrHash,
59
+ OpenAI::Responses::ResponseFunctionShellToolCall::OrHash,
60
+ OpenAI::Responses::ResponseFunctionShellToolCallOutput::OrHash,
61
+ OpenAI::Responses::ResponseApplyPatchToolCall::OrHash,
62
+ OpenAI::Responses::ResponseApplyPatchToolCallOutput::OrHash,
63
+ OpenAI::Responses::ResponseOutputItem::McpCall::OrHash,
64
+ OpenAI::Responses::ResponseOutputItem::McpListTools::OrHash,
65
+ OpenAI::Responses::ResponseOutputItem::McpApprovalRequest::OrHash,
66
+ OpenAI::Responses::ResponseCustomToolCall::OrHash
67
+ )
68
+ ],
69
+ usage: OpenAI::Responses::ResponseUsage::OrHash,
70
+ object: Symbol
71
+ ).returns(T.attached_class)
72
+ end
73
+ def self.new(
74
+ # The unique identifier for the compacted response.
75
+ id:,
76
+ # Unix timestamp (in seconds) when the compacted conversation was created.
77
+ created_at:,
78
+ # The compacted list of output items. This is a list of all user messages,
79
+ # followed by a single compaction item.
80
+ output:,
81
+ # Token accounting for the compaction pass, including cached, reasoning, and total
82
+ # tokens.
83
+ usage:,
84
+ # The object type. Always `response.compaction`.
85
+ object: :"response.compaction"
86
+ )
87
+ end
88
+
89
+ sig do
90
+ override.returns(
91
+ {
92
+ id: String,
93
+ created_at: Integer,
94
+ object: Symbol,
95
+ output: T::Array[OpenAI::Responses::ResponseOutputItem::Variants],
96
+ usage: OpenAI::Responses::ResponseUsage
97
+ }
98
+ )
99
+ end
100
+ def to_hash
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -334,6 +334,7 @@ module OpenAI
334
334
  OpenAI::Responses::ResponseFunctionWebSearch::OrHash,
335
335
  OpenAI::Responses::ResponseComputerToolCall::OrHash,
336
336
  OpenAI::Responses::ResponseReasoningItem::OrHash,
337
+ OpenAI::Responses::ResponseCompactionItem::OrHash,
337
338
  OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::OrHash,
338
339
  OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash,
339
340
  OpenAI::Responses::ResponseOutputItem::LocalShellCall::OrHash,
@@ -21,6 +21,15 @@ module OpenAI
21
21
  sig { returns(String) }
22
22
  attr_accessor :call_id
23
23
 
24
+ # One of the create_file, delete_file, or update_file operations applied via
25
+ # apply_patch.
26
+ sig do
27
+ returns(
28
+ OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants
29
+ )
30
+ end
31
+ attr_accessor :operation
32
+
24
33
  # The status of the apply patch tool call. One of `in_progress` or `completed`.
25
34
  sig do
26
35
  returns(
@@ -40,43 +49,20 @@ module OpenAI
40
49
  sig { params(created_by: String).void }
41
50
  attr_writer :created_by
42
51
 
43
- # One of the create_file, delete_file, or update_file operations applied via
44
- # apply_patch.
45
- sig do
46
- returns(
47
- T.nilable(
48
- OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants
49
- )
50
- )
51
- end
52
- attr_reader :operation
53
-
54
- sig do
55
- params(
56
- operation:
57
- T.any(
58
- OpenAI::Responses::ResponseApplyPatchToolCall::Operation::CreateFile::OrHash,
59
- OpenAI::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile::OrHash,
60
- OpenAI::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile::OrHash
61
- )
62
- ).void
63
- end
64
- attr_writer :operation
65
-
66
52
  # A tool call that applies file diffs by creating, deleting, or updating files.
67
53
  sig do
68
54
  params(
69
55
  id: String,
70
56
  call_id: String,
71
- status:
72
- OpenAI::Responses::ResponseApplyPatchToolCall::Status::OrSymbol,
73
- created_by: String,
74
57
  operation:
75
58
  T.any(
76
59
  OpenAI::Responses::ResponseApplyPatchToolCall::Operation::CreateFile::OrHash,
77
60
  OpenAI::Responses::ResponseApplyPatchToolCall::Operation::DeleteFile::OrHash,
78
61
  OpenAI::Responses::ResponseApplyPatchToolCall::Operation::UpdateFile::OrHash
79
62
  ),
63
+ status:
64
+ OpenAI::Responses::ResponseApplyPatchToolCall::Status::OrSymbol,
65
+ created_by: String,
80
66
  type: Symbol
81
67
  ).returns(T.attached_class)
82
68
  end
@@ -86,13 +72,13 @@ module OpenAI
86
72
  id:,
87
73
  # The unique ID of the apply patch tool call generated by the model.
88
74
  call_id:,
75
+ # One of the create_file, delete_file, or update_file operations applied via
76
+ # apply_patch.
77
+ operation:,
89
78
  # The status of the apply patch tool call. One of `in_progress` or `completed`.
90
79
  status:,
91
80
  # The ID of the entity that created this tool call.
92
81
  created_by: nil,
93
- # One of the create_file, delete_file, or update_file operations applied via
94
- # apply_patch.
95
- operation: nil,
96
82
  # The type of the item. Always `apply_patch_call`.
97
83
  type: :apply_patch_call
98
84
  )
@@ -103,53 +89,18 @@ module OpenAI
103
89
  {
104
90
  id: String,
105
91
  call_id: String,
92
+ operation:
93
+ OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants,
106
94
  status:
107
95
  OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol,
108
96
  type: Symbol,
109
- created_by: String,
110
- operation:
111
- OpenAI::Responses::ResponseApplyPatchToolCall::Operation::Variants
97
+ created_by: String
112
98
  }
113
99
  )
114
100
  end
115
101
  def to_hash
116
102
  end
117
103
 
118
- # The status of the apply patch tool call. One of `in_progress` or `completed`.
119
- module Status
120
- extend OpenAI::Internal::Type::Enum
121
-
122
- TaggedSymbol =
123
- T.type_alias do
124
- T.all(
125
- Symbol,
126
- OpenAI::Responses::ResponseApplyPatchToolCall::Status
127
- )
128
- end
129
- OrSymbol = T.type_alias { T.any(Symbol, String) }
130
-
131
- IN_PROGRESS =
132
- T.let(
133
- :in_progress,
134
- OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
135
- )
136
- COMPLETED =
137
- T.let(
138
- :completed,
139
- OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
140
- )
141
-
142
- sig do
143
- override.returns(
144
- T::Array[
145
- OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
146
- ]
147
- )
148
- end
149
- def self.values
150
- end
151
- end
152
-
153
104
  # One of the create_file, delete_file, or update_file operations applied via
154
105
  # apply_patch.
155
106
  module Operation
@@ -294,6 +245,41 @@ module OpenAI
294
245
  def self.variants
295
246
  end
296
247
  end
248
+
249
+ # The status of the apply patch tool call. One of `in_progress` or `completed`.
250
+ module Status
251
+ extend OpenAI::Internal::Type::Enum
252
+
253
+ TaggedSymbol =
254
+ T.type_alias do
255
+ T.all(
256
+ Symbol,
257
+ OpenAI::Responses::ResponseApplyPatchToolCall::Status
258
+ )
259
+ end
260
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
261
+
262
+ IN_PROGRESS =
263
+ T.let(
264
+ :in_progress,
265
+ OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
266
+ )
267
+ COMPLETED =
268
+ T.let(
269
+ :completed,
270
+ OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
271
+ )
272
+
273
+ sig do
274
+ override.returns(
275
+ T::Array[
276
+ OpenAI::Responses::ResponseApplyPatchToolCall::Status::TaggedSymbol
277
+ ]
278
+ )
279
+ end
280
+ def self.values
281
+ end
282
+ end
297
283
  end
298
284
  end
299
285
  end
@@ -21,10 +21,6 @@ module OpenAI
21
21
  sig { returns(String) }
22
22
  attr_accessor :call_id
23
23
 
24
- # Optional textual output returned by the apply patch tool.
25
- sig { returns(T.nilable(String)) }
26
- attr_accessor :output
27
-
28
24
  # The status of the apply patch tool call output. One of `completed` or `failed`.
29
25
  sig do
30
26
  returns(
@@ -44,15 +40,19 @@ module OpenAI
44
40
  sig { params(created_by: String).void }
45
41
  attr_writer :created_by
46
42
 
43
+ # Optional textual output returned by the apply patch tool.
44
+ sig { returns(T.nilable(String)) }
45
+ attr_accessor :output
46
+
47
47
  # The output emitted by an apply patch tool call.
48
48
  sig do
49
49
  params(
50
50
  id: String,
51
51
  call_id: String,
52
- output: T.nilable(String),
53
52
  status:
54
53
  OpenAI::Responses::ResponseApplyPatchToolCallOutput::Status::OrSymbol,
55
54
  created_by: String,
55
+ output: T.nilable(String),
56
56
  type: Symbol
57
57
  ).returns(T.attached_class)
58
58
  end
@@ -62,12 +62,12 @@ module OpenAI
62
62
  id:,
63
63
  # The unique ID of the apply patch tool call generated by the model.
64
64
  call_id:,
65
- # Optional textual output returned by the apply patch tool.
66
- output:,
67
65
  # The status of the apply patch tool call output. One of `completed` or `failed`.
68
66
  status:,
69
67
  # The ID of the entity that created this tool call output.
70
68
  created_by: nil,
69
+ # Optional textual output returned by the apply patch tool.
70
+ output: nil,
71
71
  # The type of the item. Always `apply_patch_call_output`.
72
72
  type: :apply_patch_call_output
73
73
  )
@@ -78,11 +78,11 @@ module OpenAI
78
78
  {
79
79
  id: String,
80
80
  call_id: String,
81
- output: T.nilable(String),
82
81
  status:
83
82
  OpenAI::Responses::ResponseApplyPatchToolCallOutput::Status::TaggedSymbol,
84
83
  type: Symbol,
85
- created_by: String
84
+ created_by: String,
85
+ output: T.nilable(String)
86
86
  }
87
87
  )
88
88
  end