openai 0.35.1 → 0.36.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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +21 -15
  4. data/lib/openai/helpers/structured_output/union_of.rb +5 -1
  5. data/lib/openai/internal/transport/pooled_net_requester.rb +6 -2
  6. data/lib/openai/internal/type/enum.rb +6 -6
  7. data/lib/openai/models/batch_create_params.rb +9 -6
  8. data/lib/openai/models/beta/assistant_create_params.rb +9 -5
  9. data/lib/openai/models/beta/assistant_update_params.rb +9 -5
  10. data/lib/openai/models/beta/threads/run_create_params.rb +10 -6
  11. data/lib/openai/models/chat/completion_create_params.rb +37 -6
  12. data/lib/openai/models/chat_model.rb +5 -0
  13. data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
  14. data/lib/openai/models/conversations/conversation_item.rb +13 -1
  15. data/lib/openai/models/conversations/conversation_item_list.rb +2 -2
  16. data/lib/openai/models/conversations/item_create_params.rb +2 -2
  17. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +9 -5
  18. data/lib/openai/models/evals/run_cancel_response.rb +20 -12
  19. data/lib/openai/models/evals/run_create_params.rb +20 -12
  20. data/lib/openai/models/evals/run_create_response.rb +20 -12
  21. data/lib/openai/models/evals/run_list_response.rb +20 -12
  22. data/lib/openai/models/evals/run_retrieve_response.rb +20 -12
  23. data/lib/openai/models/graders/score_model_grader.rb +9 -5
  24. data/lib/openai/models/reasoning.rb +10 -6
  25. data/lib/openai/models/reasoning_effort.rb +10 -5
  26. data/lib/openai/models/responses/apply_patch_tool.rb +20 -0
  27. data/lib/openai/models/responses/function_shell_tool.rb +20 -0
  28. data/lib/openai/models/responses/input_token_count_params.rb +14 -8
  29. data/lib/openai/models/responses/response.rb +46 -11
  30. data/lib/openai/models/responses/response_apply_patch_tool_call.rb +179 -0
  31. data/lib/openai/models/responses/response_apply_patch_tool_call_output.rb +77 -0
  32. data/lib/openai/models/responses/response_create_params.rb +42 -9
  33. data/lib/openai/models/responses/response_function_shell_call_output_content.rb +88 -0
  34. data/lib/openai/models/responses/response_function_shell_tool_call.rb +109 -0
  35. data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +158 -0
  36. data/lib/openai/models/responses/response_input_item.rb +395 -1
  37. data/lib/openai/models/responses/response_item.rb +13 -1
  38. data/lib/openai/models/responses/response_item_list.rb +2 -2
  39. data/lib/openai/models/responses/response_output_item.rb +13 -1
  40. data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
  41. data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
  42. data/lib/openai/models/responses/tool.rb +7 -1
  43. data/lib/openai/models/responses/tool_choice_apply_patch.rb +20 -0
  44. data/lib/openai/models/responses/tool_choice_shell.rb +20 -0
  45. data/lib/openai/resources/chat/completions.rb +6 -2
  46. data/lib/openai/resources/conversations/items.rb +3 -3
  47. data/lib/openai/resources/conversations.rb +1 -1
  48. data/lib/openai/resources/responses/input_items.rb +1 -1
  49. data/lib/openai/resources/responses/input_tokens.rb +3 -3
  50. data/lib/openai/resources/responses.rb +12 -8
  51. data/lib/openai/version.rb +1 -1
  52. data/lib/openai.rb +10 -0
  53. data/manifest.yaml +1 -0
  54. data/rbi/openai/internal/transport/pooled_net_requester.rbi +6 -2
  55. data/rbi/openai/models/batch_create_params.rbi +17 -9
  56. data/rbi/openai/models/beta/assistant_create_params.rbi +18 -10
  57. data/rbi/openai/models/beta/assistant_update_params.rbi +18 -10
  58. data/rbi/openai/models/beta/threads/run_create_params.rbi +18 -10
  59. data/rbi/openai/models/chat/completion_create_params.rbi +82 -10
  60. data/rbi/openai/models/chat_model.rbi +7 -0
  61. data/rbi/openai/models/conversations/conversation_create_params.rbi +12 -0
  62. data/rbi/openai/models/conversations/conversation_item.rbi +4 -0
  63. data/rbi/openai/models/conversations/conversation_item_list.rbi +4 -0
  64. data/rbi/openai/models/conversations/item_create_params.rbi +12 -0
  65. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +18 -10
  66. data/rbi/openai/models/evals/run_cancel_response.rbi +40 -20
  67. data/rbi/openai/models/evals/run_create_params.rbi +44 -20
  68. data/rbi/openai/models/evals/run_create_response.rbi +40 -20
  69. data/rbi/openai/models/evals/run_list_response.rbi +40 -20
  70. data/rbi/openai/models/evals/run_retrieve_response.rbi +40 -20
  71. data/rbi/openai/models/graders/score_model_grader.rbi +18 -10
  72. data/rbi/openai/models/reasoning.rbi +18 -10
  73. data/rbi/openai/models/reasoning_effort.rbi +10 -5
  74. data/rbi/openai/models/responses/apply_patch_tool.rbi +30 -0
  75. data/rbi/openai/models/responses/function_shell_tool.rbi +33 -0
  76. data/rbi/openai/models/responses/input_token_count_params.rbi +18 -4
  77. data/rbi/openai/models/responses/response.rbi +73 -2
  78. data/rbi/openai/models/responses/response_apply_patch_tool_call.rbi +300 -0
  79. data/rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi +129 -0
  80. data/rbi/openai/models/responses/response_create_params.rbi +87 -5
  81. data/rbi/openai/models/responses/response_function_shell_call_output_content.rbi +157 -0
  82. data/rbi/openai/models/responses/response_function_shell_tool_call.rbi +198 -0
  83. data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +254 -0
  84. data/rbi/openai/models/responses/response_input_item.rbi +675 -0
  85. data/rbi/openai/models/responses/response_item.rbi +4 -0
  86. data/rbi/openai/models/responses/response_item_list.rbi +4 -0
  87. data/rbi/openai/models/responses/response_output_item.rbi +4 -0
  88. data/rbi/openai/models/responses/response_output_item_added_event.rbi +4 -0
  89. data/rbi/openai/models/responses/response_output_item_done_event.rbi +4 -0
  90. data/rbi/openai/models/responses/tool.rbi +2 -0
  91. data/rbi/openai/models/responses/tool_choice_apply_patch.rbi +33 -0
  92. data/rbi/openai/models/responses/tool_choice_shell.rbi +30 -0
  93. data/rbi/openai/resources/batches.rbi +4 -3
  94. data/rbi/openai/resources/beta/assistants.rbi +18 -10
  95. data/rbi/openai/resources/beta/threads/runs.rbi +18 -10
  96. data/rbi/openai/resources/chat/completions.rbi +38 -12
  97. data/rbi/openai/resources/conversations/items.rbi +4 -0
  98. data/rbi/openai/resources/conversations.rbi +4 -0
  99. data/rbi/openai/resources/responses/input_tokens.rbi +5 -1
  100. data/rbi/openai/resources/responses.rbi +28 -2
  101. data/sig/openai/internal/transport/pooled_net_requester.rbs +4 -1
  102. data/sig/openai/models/batch_create_params.rbs +2 -0
  103. data/sig/openai/models/chat/completion_create_params.rbs +16 -0
  104. data/sig/openai/models/chat_model.rbs +11 -1
  105. data/sig/openai/models/conversations/conversation_item.rbs +4 -0
  106. data/sig/openai/models/reasoning_effort.rbs +2 -1
  107. data/sig/openai/models/responses/apply_patch_tool.rbs +15 -0
  108. data/sig/openai/models/responses/function_shell_tool.rbs +15 -0
  109. data/sig/openai/models/responses/input_token_count_params.rbs +2 -0
  110. data/sig/openai/models/responses/response.rbs +18 -0
  111. data/sig/openai/models/responses/response_apply_patch_tool_call.rbs +123 -0
  112. data/sig/openai/models/responses/response_apply_patch_tool_call_output.rbs +60 -0
  113. data/sig/openai/models/responses/response_create_params.rbs +18 -0
  114. data/sig/openai/models/responses/response_function_shell_call_output_content.rbs +64 -0
  115. data/sig/openai/models/responses/response_function_shell_tool_call.rbs +88 -0
  116. data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +115 -0
  117. data/sig/openai/models/responses/response_input_item.rbs +276 -0
  118. data/sig/openai/models/responses/response_item.rbs +4 -0
  119. data/sig/openai/models/responses/response_output_item.rbs +4 -0
  120. data/sig/openai/models/responses/tool.rbs +2 -0
  121. data/sig/openai/models/responses/tool_choice_apply_patch.rbs +15 -0
  122. data/sig/openai/models/responses/tool_choice_shell.rbs +15 -0
  123. data/sig/openai/resources/chat/completions.rbs +2 -0
  124. data/sig/openai/resources/responses.rbs +2 -0
  125. metadata +29 -2
@@ -28,6 +28,10 @@ module OpenAI
28
28
  OpenAI::Responses::ResponseCodeInterpreterToolCall,
29
29
  OpenAI::Responses::ResponseInputItem::LocalShellCall,
30
30
  OpenAI::Responses::ResponseInputItem::LocalShellCallOutput,
31
+ OpenAI::Responses::ResponseInputItem::ShellCall,
32
+ OpenAI::Responses::ResponseInputItem::ShellCallOutput,
33
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall,
34
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput,
31
35
  OpenAI::Responses::ResponseInputItem::McpListTools,
32
36
  OpenAI::Responses::ResponseInputItem::McpApprovalRequest,
33
37
  OpenAI::Responses::ResponseInputItem::McpApprovalResponse,
@@ -1075,6 +1079,677 @@ module OpenAI
1075
1079
  end
1076
1080
  end
1077
1081
 
1082
+ class ShellCall < OpenAI::Internal::Type::BaseModel
1083
+ OrHash =
1084
+ T.type_alias do
1085
+ T.any(
1086
+ OpenAI::Responses::ResponseInputItem::ShellCall,
1087
+ OpenAI::Internal::AnyHash
1088
+ )
1089
+ end
1090
+
1091
+ # The shell commands and limits that describe how to run the tool call.
1092
+ sig do
1093
+ returns(OpenAI::Responses::ResponseInputItem::ShellCall::Action)
1094
+ end
1095
+ attr_reader :action
1096
+
1097
+ sig do
1098
+ params(
1099
+ action:
1100
+ OpenAI::Responses::ResponseInputItem::ShellCall::Action::OrHash
1101
+ ).void
1102
+ end
1103
+ attr_writer :action
1104
+
1105
+ # The unique ID of the function shell tool call generated by the model.
1106
+ sig { returns(String) }
1107
+ attr_accessor :call_id
1108
+
1109
+ # The type of the item. Always `function_shell_call`.
1110
+ sig { returns(Symbol) }
1111
+ attr_accessor :type
1112
+
1113
+ # The unique ID of the function shell tool call. Populated when this item is
1114
+ # returned via API.
1115
+ sig { returns(T.nilable(String)) }
1116
+ attr_accessor :id
1117
+
1118
+ # The status of the shell call. One of `in_progress`, `completed`, or
1119
+ # `incomplete`.
1120
+ sig do
1121
+ returns(
1122
+ T.nilable(
1123
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::OrSymbol
1124
+ )
1125
+ )
1126
+ end
1127
+ attr_accessor :status
1128
+
1129
+ # A tool representing a request to execute one or more shell commands.
1130
+ sig do
1131
+ params(
1132
+ action:
1133
+ OpenAI::Responses::ResponseInputItem::ShellCall::Action::OrHash,
1134
+ call_id: String,
1135
+ id: T.nilable(String),
1136
+ status:
1137
+ T.nilable(
1138
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::OrSymbol
1139
+ ),
1140
+ type: Symbol
1141
+ ).returns(T.attached_class)
1142
+ end
1143
+ def self.new(
1144
+ # The shell commands and limits that describe how to run the tool call.
1145
+ action:,
1146
+ # The unique ID of the function shell tool call generated by the model.
1147
+ call_id:,
1148
+ # The unique ID of the function shell tool call. Populated when this item is
1149
+ # returned via API.
1150
+ id: nil,
1151
+ # The status of the shell call. One of `in_progress`, `completed`, or
1152
+ # `incomplete`.
1153
+ status: nil,
1154
+ # The type of the item. Always `function_shell_call`.
1155
+ type: :shell_call
1156
+ )
1157
+ end
1158
+
1159
+ sig do
1160
+ override.returns(
1161
+ {
1162
+ action: OpenAI::Responses::ResponseInputItem::ShellCall::Action,
1163
+ call_id: String,
1164
+ type: Symbol,
1165
+ id: T.nilable(String),
1166
+ status:
1167
+ T.nilable(
1168
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::OrSymbol
1169
+ )
1170
+ }
1171
+ )
1172
+ end
1173
+ def to_hash
1174
+ end
1175
+
1176
+ class Action < OpenAI::Internal::Type::BaseModel
1177
+ OrHash =
1178
+ T.type_alias do
1179
+ T.any(
1180
+ OpenAI::Responses::ResponseInputItem::ShellCall::Action,
1181
+ OpenAI::Internal::AnyHash
1182
+ )
1183
+ end
1184
+
1185
+ # Ordered shell commands for the execution environment to run.
1186
+ sig { returns(T::Array[String]) }
1187
+ attr_accessor :commands
1188
+
1189
+ # Maximum number of UTF-8 characters to capture from combined stdout and stderr
1190
+ # output.
1191
+ sig { returns(T.nilable(Integer)) }
1192
+ attr_accessor :max_output_length
1193
+
1194
+ # Maximum wall-clock time in milliseconds to allow the shell commands to run.
1195
+ sig { returns(T.nilable(Integer)) }
1196
+ attr_accessor :timeout_ms
1197
+
1198
+ # The shell commands and limits that describe how to run the tool call.
1199
+ sig do
1200
+ params(
1201
+ commands: T::Array[String],
1202
+ max_output_length: T.nilable(Integer),
1203
+ timeout_ms: T.nilable(Integer)
1204
+ ).returns(T.attached_class)
1205
+ end
1206
+ def self.new(
1207
+ # Ordered shell commands for the execution environment to run.
1208
+ commands:,
1209
+ # Maximum number of UTF-8 characters to capture from combined stdout and stderr
1210
+ # output.
1211
+ max_output_length: nil,
1212
+ # Maximum wall-clock time in milliseconds to allow the shell commands to run.
1213
+ timeout_ms: nil
1214
+ )
1215
+ end
1216
+
1217
+ sig do
1218
+ override.returns(
1219
+ {
1220
+ commands: T::Array[String],
1221
+ max_output_length: T.nilable(Integer),
1222
+ timeout_ms: T.nilable(Integer)
1223
+ }
1224
+ )
1225
+ end
1226
+ def to_hash
1227
+ end
1228
+ end
1229
+
1230
+ # The status of the shell call. One of `in_progress`, `completed`, or
1231
+ # `incomplete`.
1232
+ module Status
1233
+ extend OpenAI::Internal::Type::Enum
1234
+
1235
+ TaggedSymbol =
1236
+ T.type_alias do
1237
+ T.all(
1238
+ Symbol,
1239
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status
1240
+ )
1241
+ end
1242
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1243
+
1244
+ IN_PROGRESS =
1245
+ T.let(
1246
+ :in_progress,
1247
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::TaggedSymbol
1248
+ )
1249
+ COMPLETED =
1250
+ T.let(
1251
+ :completed,
1252
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::TaggedSymbol
1253
+ )
1254
+ INCOMPLETE =
1255
+ T.let(
1256
+ :incomplete,
1257
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::TaggedSymbol
1258
+ )
1259
+
1260
+ sig do
1261
+ override.returns(
1262
+ T::Array[
1263
+ OpenAI::Responses::ResponseInputItem::ShellCall::Status::TaggedSymbol
1264
+ ]
1265
+ )
1266
+ end
1267
+ def self.values
1268
+ end
1269
+ end
1270
+ end
1271
+
1272
+ class ShellCallOutput < OpenAI::Internal::Type::BaseModel
1273
+ OrHash =
1274
+ T.type_alias do
1275
+ T.any(
1276
+ OpenAI::Responses::ResponseInputItem::ShellCallOutput,
1277
+ OpenAI::Internal::AnyHash
1278
+ )
1279
+ end
1280
+
1281
+ # The unique ID of the function shell tool call generated by the model.
1282
+ sig { returns(String) }
1283
+ attr_accessor :call_id
1284
+
1285
+ # Captured chunks of stdout and stderr output, along with their associated
1286
+ # outcomes.
1287
+ sig do
1288
+ returns(
1289
+ T::Array[
1290
+ OpenAI::Responses::ResponseFunctionShellCallOutputContent
1291
+ ]
1292
+ )
1293
+ end
1294
+ attr_accessor :output
1295
+
1296
+ # The type of the item. Always `function_shell_call_output`.
1297
+ sig { returns(Symbol) }
1298
+ attr_accessor :type
1299
+
1300
+ # The unique ID of the function shell tool call output. Populated when this item
1301
+ # is returned via API.
1302
+ sig { returns(T.nilable(String)) }
1303
+ attr_accessor :id
1304
+
1305
+ # The maximum number of UTF-8 characters captured for this shell call's combined
1306
+ # output.
1307
+ sig { returns(T.nilable(Integer)) }
1308
+ attr_accessor :max_output_length
1309
+
1310
+ # The streamed output items emitted by a function shell tool call.
1311
+ sig do
1312
+ params(
1313
+ call_id: String,
1314
+ output:
1315
+ T::Array[
1316
+ OpenAI::Responses::ResponseFunctionShellCallOutputContent::OrHash
1317
+ ],
1318
+ id: T.nilable(String),
1319
+ max_output_length: T.nilable(Integer),
1320
+ type: Symbol
1321
+ ).returns(T.attached_class)
1322
+ end
1323
+ def self.new(
1324
+ # The unique ID of the function shell tool call generated by the model.
1325
+ call_id:,
1326
+ # Captured chunks of stdout and stderr output, along with their associated
1327
+ # outcomes.
1328
+ output:,
1329
+ # The unique ID of the function shell tool call output. Populated when this item
1330
+ # is returned via API.
1331
+ id: nil,
1332
+ # The maximum number of UTF-8 characters captured for this shell call's combined
1333
+ # output.
1334
+ max_output_length: nil,
1335
+ # The type of the item. Always `function_shell_call_output`.
1336
+ type: :shell_call_output
1337
+ )
1338
+ end
1339
+
1340
+ sig do
1341
+ override.returns(
1342
+ {
1343
+ call_id: String,
1344
+ output:
1345
+ T::Array[
1346
+ OpenAI::Responses::ResponseFunctionShellCallOutputContent
1347
+ ],
1348
+ type: Symbol,
1349
+ id: T.nilable(String),
1350
+ max_output_length: T.nilable(Integer)
1351
+ }
1352
+ )
1353
+ end
1354
+ def to_hash
1355
+ end
1356
+ end
1357
+
1358
+ class ApplyPatchCall < OpenAI::Internal::Type::BaseModel
1359
+ OrHash =
1360
+ T.type_alias do
1361
+ T.any(
1362
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall,
1363
+ OpenAI::Internal::AnyHash
1364
+ )
1365
+ end
1366
+
1367
+ # The unique ID of the apply patch tool call generated by the model.
1368
+ sig { returns(String) }
1369
+ attr_accessor :call_id
1370
+
1371
+ # The specific create, delete, or update instruction for the apply_patch tool
1372
+ # call.
1373
+ sig do
1374
+ returns(
1375
+ T.any(
1376
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile,
1377
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile,
1378
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile
1379
+ )
1380
+ )
1381
+ end
1382
+ attr_accessor :operation
1383
+
1384
+ # The status of the apply patch tool call. One of `in_progress` or `completed`.
1385
+ sig do
1386
+ returns(
1387
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status::OrSymbol
1388
+ )
1389
+ end
1390
+ attr_accessor :status
1391
+
1392
+ # The type of the item. Always `apply_patch_call`.
1393
+ sig { returns(Symbol) }
1394
+ attr_accessor :type
1395
+
1396
+ # The unique ID of the apply patch tool call. Populated when this item is returned
1397
+ # via API.
1398
+ sig { returns(T.nilable(String)) }
1399
+ attr_accessor :id
1400
+
1401
+ # A tool call representing a request to create, delete, or update files using diff
1402
+ # patches.
1403
+ sig do
1404
+ params(
1405
+ call_id: String,
1406
+ operation:
1407
+ T.any(
1408
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile::OrHash,
1409
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile::OrHash,
1410
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile::OrHash
1411
+ ),
1412
+ status:
1413
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status::OrSymbol,
1414
+ id: T.nilable(String),
1415
+ type: Symbol
1416
+ ).returns(T.attached_class)
1417
+ end
1418
+ def self.new(
1419
+ # The unique ID of the apply patch tool call generated by the model.
1420
+ call_id:,
1421
+ # The specific create, delete, or update instruction for the apply_patch tool
1422
+ # call.
1423
+ operation:,
1424
+ # The status of the apply patch tool call. One of `in_progress` or `completed`.
1425
+ status:,
1426
+ # The unique ID of the apply patch tool call. Populated when this item is returned
1427
+ # via API.
1428
+ id: nil,
1429
+ # The type of the item. Always `apply_patch_call`.
1430
+ type: :apply_patch_call
1431
+ )
1432
+ end
1433
+
1434
+ sig do
1435
+ override.returns(
1436
+ {
1437
+ call_id: String,
1438
+ operation:
1439
+ T.any(
1440
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile,
1441
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile,
1442
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile
1443
+ ),
1444
+ status:
1445
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status::OrSymbol,
1446
+ type: Symbol,
1447
+ id: T.nilable(String)
1448
+ }
1449
+ )
1450
+ end
1451
+ def to_hash
1452
+ end
1453
+
1454
+ # The specific create, delete, or update instruction for the apply_patch tool
1455
+ # call.
1456
+ module Operation
1457
+ extend OpenAI::Internal::Type::Union
1458
+
1459
+ Variants =
1460
+ T.type_alias do
1461
+ T.any(
1462
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile,
1463
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile,
1464
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile
1465
+ )
1466
+ end
1467
+
1468
+ class CreateFile < OpenAI::Internal::Type::BaseModel
1469
+ OrHash =
1470
+ T.type_alias do
1471
+ T.any(
1472
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile,
1473
+ OpenAI::Internal::AnyHash
1474
+ )
1475
+ end
1476
+
1477
+ # Unified diff content to apply when creating the file.
1478
+ sig { returns(String) }
1479
+ attr_accessor :diff
1480
+
1481
+ # Path of the file to create relative to the workspace root.
1482
+ sig { returns(String) }
1483
+ attr_accessor :path
1484
+
1485
+ # The operation type. Always `create_file`.
1486
+ sig { returns(Symbol) }
1487
+ attr_accessor :type
1488
+
1489
+ # Instruction for creating a new file via the apply_patch tool.
1490
+ sig do
1491
+ params(diff: String, path: String, type: Symbol).returns(
1492
+ T.attached_class
1493
+ )
1494
+ end
1495
+ def self.new(
1496
+ # Unified diff content to apply when creating the file.
1497
+ diff:,
1498
+ # Path of the file to create relative to the workspace root.
1499
+ path:,
1500
+ # The operation type. Always `create_file`.
1501
+ type: :create_file
1502
+ )
1503
+ end
1504
+
1505
+ sig do
1506
+ override.returns({ diff: String, path: String, type: Symbol })
1507
+ end
1508
+ def to_hash
1509
+ end
1510
+ end
1511
+
1512
+ class DeleteFile < OpenAI::Internal::Type::BaseModel
1513
+ OrHash =
1514
+ T.type_alias do
1515
+ T.any(
1516
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile,
1517
+ OpenAI::Internal::AnyHash
1518
+ )
1519
+ end
1520
+
1521
+ # Path of the file to delete relative to the workspace root.
1522
+ sig { returns(String) }
1523
+ attr_accessor :path
1524
+
1525
+ # The operation type. Always `delete_file`.
1526
+ sig { returns(Symbol) }
1527
+ attr_accessor :type
1528
+
1529
+ # Instruction for deleting an existing file via the apply_patch tool.
1530
+ sig do
1531
+ params(path: String, type: Symbol).returns(T.attached_class)
1532
+ end
1533
+ def self.new(
1534
+ # Path of the file to delete relative to the workspace root.
1535
+ path:,
1536
+ # The operation type. Always `delete_file`.
1537
+ type: :delete_file
1538
+ )
1539
+ end
1540
+
1541
+ sig { override.returns({ path: String, type: Symbol }) }
1542
+ def to_hash
1543
+ end
1544
+ end
1545
+
1546
+ class UpdateFile < OpenAI::Internal::Type::BaseModel
1547
+ OrHash =
1548
+ T.type_alias do
1549
+ T.any(
1550
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile,
1551
+ OpenAI::Internal::AnyHash
1552
+ )
1553
+ end
1554
+
1555
+ # Unified diff content to apply to the existing file.
1556
+ sig { returns(String) }
1557
+ attr_accessor :diff
1558
+
1559
+ # Path of the file to update relative to the workspace root.
1560
+ sig { returns(String) }
1561
+ attr_accessor :path
1562
+
1563
+ # The operation type. Always `update_file`.
1564
+ sig { returns(Symbol) }
1565
+ attr_accessor :type
1566
+
1567
+ # Instruction for updating an existing file via the apply_patch tool.
1568
+ sig do
1569
+ params(diff: String, path: String, type: Symbol).returns(
1570
+ T.attached_class
1571
+ )
1572
+ end
1573
+ def self.new(
1574
+ # Unified diff content to apply to the existing file.
1575
+ diff:,
1576
+ # Path of the file to update relative to the workspace root.
1577
+ path:,
1578
+ # The operation type. Always `update_file`.
1579
+ type: :update_file
1580
+ )
1581
+ end
1582
+
1583
+ sig do
1584
+ override.returns({ diff: String, path: String, type: Symbol })
1585
+ end
1586
+ def to_hash
1587
+ end
1588
+ end
1589
+
1590
+ sig do
1591
+ override.returns(
1592
+ T::Array[
1593
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::Variants
1594
+ ]
1595
+ )
1596
+ end
1597
+ def self.variants
1598
+ end
1599
+ end
1600
+
1601
+ # The status of the apply patch tool call. One of `in_progress` or `completed`.
1602
+ module Status
1603
+ extend OpenAI::Internal::Type::Enum
1604
+
1605
+ TaggedSymbol =
1606
+ T.type_alias do
1607
+ T.all(
1608
+ Symbol,
1609
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status
1610
+ )
1611
+ end
1612
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1613
+
1614
+ IN_PROGRESS =
1615
+ T.let(
1616
+ :in_progress,
1617
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status::TaggedSymbol
1618
+ )
1619
+ COMPLETED =
1620
+ T.let(
1621
+ :completed,
1622
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status::TaggedSymbol
1623
+ )
1624
+
1625
+ sig do
1626
+ override.returns(
1627
+ T::Array[
1628
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status::TaggedSymbol
1629
+ ]
1630
+ )
1631
+ end
1632
+ def self.values
1633
+ end
1634
+ end
1635
+ end
1636
+
1637
+ class ApplyPatchCallOutput < OpenAI::Internal::Type::BaseModel
1638
+ OrHash =
1639
+ T.type_alias do
1640
+ T.any(
1641
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput,
1642
+ OpenAI::Internal::AnyHash
1643
+ )
1644
+ end
1645
+
1646
+ # The unique ID of the apply patch tool call generated by the model.
1647
+ sig { returns(String) }
1648
+ attr_accessor :call_id
1649
+
1650
+ # The status of the apply patch tool call output. One of `completed` or `failed`.
1651
+ sig do
1652
+ returns(
1653
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status::OrSymbol
1654
+ )
1655
+ end
1656
+ attr_accessor :status
1657
+
1658
+ # The type of the item. Always `apply_patch_call_output`.
1659
+ sig { returns(Symbol) }
1660
+ attr_accessor :type
1661
+
1662
+ # The unique ID of the apply patch tool call output. Populated when this item is
1663
+ # returned via API.
1664
+ sig { returns(T.nilable(String)) }
1665
+ attr_accessor :id
1666
+
1667
+ # Optional human-readable log text from the apply patch tool (e.g., patch results
1668
+ # or errors).
1669
+ sig { returns(T.nilable(String)) }
1670
+ attr_reader :output
1671
+
1672
+ sig { params(output: String).void }
1673
+ attr_writer :output
1674
+
1675
+ # The streamed output emitted by an apply patch tool call.
1676
+ sig do
1677
+ params(
1678
+ call_id: String,
1679
+ status:
1680
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status::OrSymbol,
1681
+ id: T.nilable(String),
1682
+ output: String,
1683
+ type: Symbol
1684
+ ).returns(T.attached_class)
1685
+ end
1686
+ def self.new(
1687
+ # The unique ID of the apply patch tool call generated by the model.
1688
+ call_id:,
1689
+ # The status of the apply patch tool call output. One of `completed` or `failed`.
1690
+ status:,
1691
+ # The unique ID of the apply patch tool call output. Populated when this item is
1692
+ # returned via API.
1693
+ id: nil,
1694
+ # Optional human-readable log text from the apply patch tool (e.g., patch results
1695
+ # or errors).
1696
+ output: nil,
1697
+ # The type of the item. Always `apply_patch_call_output`.
1698
+ type: :apply_patch_call_output
1699
+ )
1700
+ end
1701
+
1702
+ sig do
1703
+ override.returns(
1704
+ {
1705
+ call_id: String,
1706
+ status:
1707
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status::OrSymbol,
1708
+ type: Symbol,
1709
+ id: T.nilable(String),
1710
+ output: String
1711
+ }
1712
+ )
1713
+ end
1714
+ def to_hash
1715
+ end
1716
+
1717
+ # The status of the apply patch tool call output. One of `completed` or `failed`.
1718
+ module Status
1719
+ extend OpenAI::Internal::Type::Enum
1720
+
1721
+ TaggedSymbol =
1722
+ T.type_alias do
1723
+ T.all(
1724
+ Symbol,
1725
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status
1726
+ )
1727
+ end
1728
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1729
+
1730
+ COMPLETED =
1731
+ T.let(
1732
+ :completed,
1733
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status::TaggedSymbol
1734
+ )
1735
+ FAILED =
1736
+ T.let(
1737
+ :failed,
1738
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status::TaggedSymbol
1739
+ )
1740
+
1741
+ sig do
1742
+ override.returns(
1743
+ T::Array[
1744
+ OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status::TaggedSymbol
1745
+ ]
1746
+ )
1747
+ end
1748
+ def self.values
1749
+ end
1750
+ end
1751
+ end
1752
+
1078
1753
  class McpListTools < OpenAI::Internal::Type::BaseModel
1079
1754
  OrHash =
1080
1755
  T.type_alias do
@@ -22,6 +22,10 @@ module OpenAI
22
22
  OpenAI::Responses::ResponseCodeInterpreterToolCall,
23
23
  OpenAI::Responses::ResponseItem::LocalShellCall,
24
24
  OpenAI::Responses::ResponseItem::LocalShellCallOutput,
25
+ OpenAI::Responses::ResponseFunctionShellToolCall,
26
+ OpenAI::Responses::ResponseFunctionShellToolCallOutput,
27
+ OpenAI::Responses::ResponseApplyPatchToolCall,
28
+ OpenAI::Responses::ResponseApplyPatchToolCallOutput,
25
29
  OpenAI::Responses::ResponseItem::McpListTools,
26
30
  OpenAI::Responses::ResponseItem::McpApprovalRequest,
27
31
  OpenAI::Responses::ResponseItem::McpApprovalResponse,
@@ -52,6 +52,10 @@ module OpenAI
52
52
  OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash,
53
53
  OpenAI::Responses::ResponseItem::LocalShellCall::OrHash,
54
54
  OpenAI::Responses::ResponseItem::LocalShellCallOutput::OrHash,
55
+ OpenAI::Responses::ResponseFunctionShellToolCall::OrHash,
56
+ OpenAI::Responses::ResponseFunctionShellToolCallOutput::OrHash,
57
+ OpenAI::Responses::ResponseApplyPatchToolCall::OrHash,
58
+ OpenAI::Responses::ResponseApplyPatchToolCallOutput::OrHash,
55
59
  OpenAI::Responses::ResponseItem::McpListTools::OrHash,
56
60
  OpenAI::Responses::ResponseItem::McpApprovalRequest::OrHash,
57
61
  OpenAI::Responses::ResponseItem::McpApprovalResponse::OrHash,