openai 0.78.0 → 0.80.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +99 -0
- data/README.md +241 -8
- data/SECURITY.md +6 -22
- data/azure.md +110 -0
- data/bedrock.md +197 -0
- data/examples/mtls_custom_http_client.rb +61 -0
- data/lib/openai/auth/workload_identity.rb +13 -2
- data/lib/openai/auth/workload_identity_auth.rb +2 -1
- data/lib/openai/client.rb +29 -6
- data/lib/openai/errors.rb +11 -1
- data/lib/openai/helpers/streaming/chat_completion_stream.rb +3 -3
- data/lib/openai/helpers/streaming/response_stream.rb +5 -6
- data/lib/openai/helpers/structured_output/base_model.rb +20 -19
- data/lib/openai/helpers/structured_output/json_schema_converter.rb +12 -5
- data/lib/openai/http_client.rb +99 -7
- data/lib/openai/internal/conversation_cursor_page.rb +5 -6
- data/lib/openai/internal/cursor_page.rb +3 -3
- data/lib/openai/internal/logging.rb +419 -0
- data/lib/openai/internal/next_cursor_page.rb +5 -6
- data/lib/openai/internal/page.rb +2 -2
- data/lib/openai/internal/provider.rb +7 -1
- data/lib/openai/internal/read_io_adapter.rb +42 -18
- data/lib/openai/internal/stream.rb +2 -2
- data/lib/openai/internal/transport/base_client.rb +137 -37
- data/lib/openai/internal/type/array_of.rb +6 -4
- data/lib/openai/internal/type/base_model.rb +39 -1
- data/lib/openai/internal/type/base_page.rb +19 -2
- data/lib/openai/internal/type/base_stream.rb +39 -7
- data/lib/openai/internal/type/hash_of.rb +3 -3
- data/lib/openai/internal/util.rb +52 -27
- data/lib/openai/models/admin/organization/audit_log_list_params.rb +3 -1
- data/lib/openai/models/admin/organization/audit_log_list_response.rb +33 -11
- data/lib/openai/models/admin/organization/groups/role_list_response.rb +5 -1
- data/lib/openai/models/admin/organization/groups/role_retrieve_response.rb +5 -1
- data/lib/openai/models/admin/organization/projects/groups/role_list_response.rb +6 -1
- data/lib/openai/models/admin/organization/projects/groups/role_retrieve_response.rb +6 -1
- data/lib/openai/models/admin/organization/projects/service_account_create_response.rb +3 -1
- data/lib/openai/models/admin/organization/projects/users/role_list_response.rb +6 -1
- data/lib/openai/models/admin/organization/projects/users/role_retrieve_response.rb +6 -1
- data/lib/openai/models/admin/organization/users/role_list_response.rb +5 -1
- data/lib/openai/models/admin/organization/users/role_retrieve_response.rb +5 -1
- data/lib/openai/models/all_models.rb +5 -0
- data/lib/openai/models/audio/transcription_create_params.rb +7 -1
- data/lib/openai/models/audio/translation_create_params.rb +7 -1
- data/lib/openai/models/beta/beta_mcp_tool_call_error.rb +84 -0
- data/lib/openai/models/beta/beta_response.rb +27 -0
- data/lib/openai/models/beta/beta_response_input_item.rb +3 -3
- data/lib/openai/models/beta/beta_response_item.rb +3 -3
- data/lib/openai/models/beta/beta_response_output_item.rb +3 -3
- data/lib/openai/models/beta/beta_response_output_item_added_event.rb +5 -2
- data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +201 -4
- data/lib/openai/models/beta/beta_response_reasoning_item.rb +5 -0
- data/lib/openai/models/beta/beta_response_stream_event.rb +1 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +46 -3
- data/lib/openai/models/beta/beta_responses_server_event.rb +1143 -63
- data/lib/openai/models/beta/beta_web_search_tool.rb +11 -1
- data/lib/openai/models/beta/response_compact_params.rb +18 -0
- data/lib/openai/models/beta/response_create_params.rb +27 -0
- data/lib/openai/models/chat_model.rb +1 -0
- data/lib/openai/models/completion_usage.rb +26 -2
- data/lib/openai/models/containers/file_create_params.rb +4 -0
- data/lib/openai/models/content_provenance_check_create_params.rb +4 -0
- data/lib/openai/models/conversations/conversation_item.rb +3 -3
- data/lib/openai/models/file_create_params.rb +4 -0
- data/lib/openai/models/image_create_variation_params.rb +4 -0
- data/lib/openai/models/image_edit_params.rb +8 -0
- data/lib/openai/models/model.rb +9 -1
- data/lib/openai/models/responses/mcp_tool_call_error.rb +82 -0
- data/lib/openai/models/responses/response.rb +9 -0
- data/lib/openai/models/responses/response_compact_params.rb +18 -0
- data/lib/openai/models/responses/response_create_params.rb +9 -0
- data/lib/openai/models/responses/response_input_item.rb +3 -3
- data/lib/openai/models/responses/response_item.rb +3 -3
- data/lib/openai/models/responses/response_output_item.rb +3 -3
- data/lib/openai/models/responses/response_output_item_added_event.rb +5 -2
- data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +201 -4
- data/lib/openai/models/responses/response_reasoning_item.rb +5 -0
- data/lib/openai/models/responses/response_stream_event.rb +1 -1
- data/lib/openai/models/responses/responses_client_event.rb +22 -1
- data/lib/openai/models/responses/responses_server_event.rb +1107 -56
- data/lib/openai/models/responses/web_search_tool.rb +11 -1
- data/lib/openai/models/responses_model.rb +5 -0
- data/lib/openai/models/skill_create_params.rb +4 -0
- data/lib/openai/models/skills/version_create_params.rb +4 -0
- data/lib/openai/models/uploads/part_create_params.rb +4 -0
- data/lib/openai/models/vector_store_search_response.rb +3 -1
- data/lib/openai/models/video_create_character_params.rb +4 -0
- data/lib/openai/models/video_create_params.rb +4 -0
- data/lib/openai/models/video_edit_params.rb +4 -0
- data/lib/openai/models/video_extend_params.rb +4 -0
- data/lib/openai/models.rb +9 -1
- data/lib/openai/net_http_client.rb +20 -6
- data/lib/openai/providers/azure.rb +216 -0
- data/lib/openai/providers/bedrock.rb +130 -17
- data/lib/openai/resources/admin/organization/projects/groups/roles.rb +1 -1
- data/lib/openai/resources/admin/organization/projects/groups.rb +1 -1
- data/lib/openai/resources/admin/organization/projects/users/roles.rb +1 -1
- data/lib/openai/resources/admin/organization/projects.rb +4 -2
- data/lib/openai/resources/audio/transcriptions.rb +8 -0
- data/lib/openai/resources/audio/translations.rb +4 -0
- data/lib/openai/resources/beta/responses.rb +1 -1
- data/lib/openai/resources/beta/threads/runs/steps.rb +2 -2
- data/lib/openai/resources/containers/files.rb +4 -0
- data/lib/openai/resources/content_provenance_checks.rb +4 -0
- data/lib/openai/resources/conversations/items.rb +1 -1
- data/lib/openai/resources/evals/runs/output_items.rb +1 -1
- data/lib/openai/resources/files.rb +5 -1
- data/lib/openai/resources/images.rb +12 -0
- data/lib/openai/resources/responses.rb +3 -2
- data/lib/openai/resources/skills/versions.rb +4 -0
- data/lib/openai/resources/skills.rb +4 -0
- data/lib/openai/resources/uploads/parts.rb +4 -0
- data/lib/openai/resources/vector_stores/file_batches.rb +1 -1
- data/lib/openai/resources/videos.rb +38 -0
- data/lib/openai/resources/webhooks.rb +18 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +111 -105
- data/rbi/openai/auth.rbi +4 -4
- data/rbi/openai/client.rbi +13 -3
- data/rbi/openai/errors.rbi +7 -0
- data/rbi/openai/helpers/streaming/events.rbi +12 -0
- data/rbi/openai/http_client.rbi +62 -2
- data/rbi/openai/internal/logging.rbi +192 -0
- data/rbi/openai/internal/provider.rbi +3 -0
- data/rbi/openai/internal/read_io_adapter.rbi +6 -1
- data/rbi/openai/internal/transport/base_client.rbi +61 -7
- data/rbi/openai/internal/type/base_model.rbi +24 -1
- data/rbi/openai/internal/type/base_page.rbi +13 -2
- data/rbi/openai/internal/type/base_stream.rbi +15 -4
- data/rbi/openai/internal/util.rbi +26 -2
- data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +5 -0
- data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +5 -0
- data/rbi/openai/models/all_models.rbi +25 -0
- data/rbi/openai/models/audio/transcription_create_params.rbi +14 -2
- data/rbi/openai/models/audio/translation_create_params.rbi +14 -2
- data/rbi/openai/models/beta/beta_mcp_tool_call_error.rbi +122 -0
- data/rbi/openai/models/beta/beta_response.rbi +47 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +27 -3
- data/rbi/openai/models/beta/beta_response_item.rbi +27 -3
- data/rbi/openai/models/beta/beta_response_output_item.rbi +27 -3
- data/rbi/openai/models/beta/beta_response_output_item_added_event.rbi +8 -2
- data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +297 -5
- data/rbi/openai/models/beta/beta_response_reasoning_item.rbi +10 -0
- data/rbi/openai/models/beta/beta_response_stream_event.rbi +1 -1
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +69 -1
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +3945 -54
- data/rbi/openai/models/beta/beta_web_search_tool.rbi +15 -0
- data/rbi/openai/models/beta/response_compact_params.rbi +30 -0
- data/rbi/openai/models/beta/response_create_params.rbi +47 -0
- data/rbi/openai/models/chat_model.rbi +2 -0
- data/rbi/openai/models/completion_usage.rbi +39 -6
- data/rbi/openai/models/containers/file_create_params.rbi +8 -0
- data/rbi/openai/models/content_provenance_check_create_params.rbi +8 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +12 -3
- data/rbi/openai/models/file_create_params.rbi +8 -0
- data/rbi/openai/models/image_create_variation_params.rbi +8 -0
- data/rbi/openai/models/image_edit_params.rbi +16 -0
- data/rbi/openai/models/model.rbi +14 -1
- data/rbi/openai/models/responses/mcp_tool_call_error.rbi +120 -0
- data/rbi/openai/models/responses/response.rbi +17 -0
- data/rbi/openai/models/responses/response_compact_params.rbi +30 -0
- data/rbi/openai/models/responses/response_create_params.rbi +17 -0
- data/rbi/openai/models/responses/response_input_item.rbi +27 -3
- data/rbi/openai/models/responses/response_item.rbi +27 -3
- data/rbi/openai/models/responses/response_output_item.rbi +27 -3
- data/rbi/openai/models/responses/response_output_item_added_event.rbi +8 -2
- data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +297 -5
- data/rbi/openai/models/responses/response_reasoning_item.rbi +10 -0
- data/rbi/openai/models/responses/response_stream_event.rbi +1 -1
- data/rbi/openai/models/responses/responses_client_event.rbi +36 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +3385 -53
- data/rbi/openai/models/responses/web_search_tool.rbi +15 -0
- data/rbi/openai/models/responses_model.rbi +25 -0
- data/rbi/openai/models/skill_create_params.rbi +8 -0
- data/rbi/openai/models/skills/version_create_params.rbi +8 -0
- data/rbi/openai/models/uploads/part_create_params.rbi +8 -0
- data/rbi/openai/models/video_create_character_params.rbi +8 -0
- data/rbi/openai/models/video_create_params.rbi +8 -0
- data/rbi/openai/models/video_edit_params.rbi +8 -0
- data/rbi/openai/models/video_extend_params.rbi +8 -0
- data/rbi/openai/net_http_client.rbi +2 -2
- data/rbi/openai/providers.rbi +11 -0
- data/rbi/openai/resources/audio/transcriptions.rbi +14 -2
- data/rbi/openai/resources/audio/translations.rbi +7 -1
- data/rbi/openai/resources/beta/responses.rbi +8 -0
- data/rbi/openai/resources/containers/files.rbi +4 -0
- data/rbi/openai/resources/content_provenance_checks.rbi +4 -0
- data/rbi/openai/resources/files.rbi +5 -1
- data/rbi/openai/resources/images.rbi +20 -0
- data/rbi/openai/resources/responses.rbi +8 -0
- data/rbi/openai/resources/skills/versions.rbi +4 -0
- data/rbi/openai/resources/skills.rbi +4 -0
- data/rbi/openai/resources/uploads/parts.rbi +4 -0
- data/rbi/openai/resources/videos.rbi +16 -0
- data/sig/openai/client.rbs +6 -2
- data/sig/openai/errors.rbs +5 -0
- data/sig/openai/http_client.rbs +37 -2
- data/sig/openai/internal/logging.rbs +88 -0
- data/sig/openai/internal/provider.rbs +3 -1
- data/sig/openai/internal/read_io_adapter.rbs +3 -1
- data/sig/openai/internal/transport/base_client.rbs +33 -5
- data/sig/openai/internal/type/base_model.rbs +13 -0
- data/sig/openai/internal/type/base_page.rbs +8 -1
- data/sig/openai/internal/type/base_stream.rbs +8 -2
- data/sig/openai/internal/util.rbs +12 -0
- data/sig/openai/models/admin/organization/audit_log_list_params.rbs +2 -0
- data/sig/openai/models/admin/organization/audit_log_list_response.rbs +2 -0
- data/sig/openai/models/all_models.rbs +10 -0
- data/sig/openai/models/beta/beta_mcp_tool_call_error.rbs +75 -0
- data/sig/openai/models/beta/beta_response.rbs +14 -1
- data/sig/openai/models/beta/beta_response_input_item.rbs +4 -4
- data/sig/openai/models/beta/beta_response_item.rbs +4 -4
- data/sig/openai/models/beta/beta_response_output_item.rbs +4 -4
- data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +149 -4
- data/sig/openai/models/beta/beta_responses_client_event.rbs +21 -1
- data/sig/openai/models/beta/beta_responses_server_event.rbs +2005 -53
- data/sig/openai/models/beta/beta_web_search_tool.rbs +7 -0
- data/sig/openai/models/beta/response_compact_params.rbs +12 -0
- data/sig/openai/models/beta/response_create_params.rbs +14 -1
- data/sig/openai/models/chat_model.rbs +2 -0
- data/sig/openai/models/completion_usage.rbs +27 -6
- data/sig/openai/models/conversations/conversation_item.rbs +4 -4
- data/sig/openai/models/model.rbs +12 -2
- data/sig/openai/models/responses/mcp_tool_call_error.rbs +73 -0
- data/sig/openai/models/responses/response.rbs +2 -1
- data/sig/openai/models/responses/response_compact_params.rbs +12 -0
- data/sig/openai/models/responses/response_create_params.rbs +2 -1
- data/sig/openai/models/responses/response_input_item.rbs +4 -4
- data/sig/openai/models/responses/response_item.rbs +4 -4
- data/sig/openai/models/responses/response_output_item.rbs +4 -4
- data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +149 -4
- data/sig/openai/models/responses/responses_client_event.rbs +9 -1
- data/sig/openai/models/responses/responses_server_event.rbs +1834 -53
- data/sig/openai/models/responses/web_search_tool.rbs +7 -0
- data/sig/openai/models/responses_model.rbs +10 -0
- data/sig/openai/net_http_client.rbs +2 -2
- data/sig/openai/providers.rbs +7 -0
- metadata +30 -1
|
@@ -292,6 +292,11 @@ module OpenAI
|
|
|
292
292
|
:"gpt-5.5",
|
|
293
293
|
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
294
294
|
)
|
|
295
|
+
GPT_5_5_2026_04_23 =
|
|
296
|
+
T.let(
|
|
297
|
+
:"gpt-5.5-2026-04-23",
|
|
298
|
+
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
299
|
+
)
|
|
295
300
|
GPT_5_4 =
|
|
296
301
|
T.let(
|
|
297
302
|
:"gpt-5.4",
|
|
@@ -732,6 +737,16 @@ module OpenAI
|
|
|
732
737
|
:"computer-use-preview-2025-03-11",
|
|
733
738
|
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
734
739
|
)
|
|
740
|
+
GPT_5_5_PRO =
|
|
741
|
+
T.let(
|
|
742
|
+
:"gpt-5.5-pro",
|
|
743
|
+
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
744
|
+
)
|
|
745
|
+
GPT_5_5_PRO_2026_04_23 =
|
|
746
|
+
T.let(
|
|
747
|
+
:"gpt-5.5-pro-2026-04-23",
|
|
748
|
+
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
749
|
+
)
|
|
735
750
|
GPT_5_CODEX =
|
|
736
751
|
T.let(
|
|
737
752
|
:"gpt-5-codex",
|
|
@@ -752,6 +767,21 @@ module OpenAI
|
|
|
752
767
|
:"gpt-5.1-codex-max",
|
|
753
768
|
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
754
769
|
)
|
|
770
|
+
GPT_DAYBREAK_BLUE_LATEST =
|
|
771
|
+
T.let(
|
|
772
|
+
:"gpt-daybreak-blue-latest",
|
|
773
|
+
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
774
|
+
)
|
|
775
|
+
GPT_DAYBREAK_RED_LATEST =
|
|
776
|
+
T.let(
|
|
777
|
+
:"gpt-daybreak-red-latest",
|
|
778
|
+
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
779
|
+
)
|
|
780
|
+
GPT_5_6_CYBER =
|
|
781
|
+
T.let(
|
|
782
|
+
:"gpt-5.6-cyber",
|
|
783
|
+
OpenAI::Responses::ResponseCompactParams::Model::TaggedSymbol
|
|
784
|
+
)
|
|
755
785
|
end
|
|
756
786
|
|
|
757
787
|
# Text, image, or file inputs to the model, used to generate a response
|
|
@@ -285,6 +285,10 @@ module OpenAI
|
|
|
285
285
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
286
286
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
287
287
|
# request.
|
|
288
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
289
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
290
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
291
|
+
# `service_tier=ultrafast`.
|
|
288
292
|
# - When not set, the default behavior is 'auto'.
|
|
289
293
|
#
|
|
290
294
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -742,6 +746,10 @@ module OpenAI
|
|
|
742
746
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
743
747
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
744
748
|
# request.
|
|
749
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
750
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
751
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
752
|
+
# `service_tier=ultrafast`.
|
|
745
753
|
# - When not set, the default behavior is 'auto'.
|
|
746
754
|
#
|
|
747
755
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -1543,6 +1551,10 @@ module OpenAI
|
|
|
1543
1551
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
1544
1552
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
1545
1553
|
# request.
|
|
1554
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
1555
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
1556
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
1557
|
+
# `service_tier=ultrafast`.
|
|
1546
1558
|
# - When not set, the default behavior is 'auto'.
|
|
1547
1559
|
#
|
|
1548
1560
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -1591,6 +1603,11 @@ module OpenAI
|
|
|
1591
1603
|
:fast,
|
|
1592
1604
|
OpenAI::Responses::ResponseCreateParams::ServiceTier::TaggedSymbol
|
|
1593
1605
|
)
|
|
1606
|
+
ULTRAFAST =
|
|
1607
|
+
T.let(
|
|
1608
|
+
:ultrafast,
|
|
1609
|
+
OpenAI::Responses::ResponseCreateParams::ServiceTier::TaggedSymbol
|
|
1610
|
+
)
|
|
1594
1611
|
|
|
1595
1612
|
sig do
|
|
1596
1613
|
override.returns(
|
|
@@ -3052,7 +3052,17 @@ module OpenAI
|
|
|
3052
3052
|
attr_accessor :approval_request_id
|
|
3053
3053
|
|
|
3054
3054
|
# The error from the tool call, if any.
|
|
3055
|
-
sig
|
|
3055
|
+
sig do
|
|
3056
|
+
returns(
|
|
3057
|
+
T.nilable(
|
|
3058
|
+
T.any(
|
|
3059
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError,
|
|
3060
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError,
|
|
3061
|
+
OpenAI::Responses::McpToolCallError::HTTPError
|
|
3062
|
+
)
|
|
3063
|
+
)
|
|
3064
|
+
)
|
|
3065
|
+
end
|
|
3056
3066
|
attr_accessor :error
|
|
3057
3067
|
|
|
3058
3068
|
# The output from the tool call.
|
|
@@ -3086,7 +3096,14 @@ module OpenAI
|
|
|
3086
3096
|
name: String,
|
|
3087
3097
|
server_label: String,
|
|
3088
3098
|
approval_request_id: T.nilable(String),
|
|
3089
|
-
error:
|
|
3099
|
+
error:
|
|
3100
|
+
T.nilable(
|
|
3101
|
+
T.any(
|
|
3102
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError::OrHash,
|
|
3103
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError::OrHash,
|
|
3104
|
+
OpenAI::Responses::McpToolCallError::HTTPError::OrHash
|
|
3105
|
+
)
|
|
3106
|
+
),
|
|
3090
3107
|
output: T.nilable(String),
|
|
3091
3108
|
status:
|
|
3092
3109
|
OpenAI::Responses::ResponseInputItem::McpCall::Status::OrSymbol,
|
|
@@ -3127,7 +3144,14 @@ module OpenAI
|
|
|
3127
3144
|
server_label: String,
|
|
3128
3145
|
type: Symbol,
|
|
3129
3146
|
approval_request_id: T.nilable(String),
|
|
3130
|
-
error:
|
|
3147
|
+
error:
|
|
3148
|
+
T.nilable(
|
|
3149
|
+
T.any(
|
|
3150
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError,
|
|
3151
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError,
|
|
3152
|
+
OpenAI::Responses::McpToolCallError::HTTPError
|
|
3153
|
+
)
|
|
3154
|
+
),
|
|
3131
3155
|
output: T.nilable(String),
|
|
3132
3156
|
status:
|
|
3133
3157
|
OpenAI::Responses::ResponseInputItem::McpCall::Status::OrSymbol
|
|
@@ -1099,7 +1099,17 @@ module OpenAI
|
|
|
1099
1099
|
attr_accessor :approval_request_id
|
|
1100
1100
|
|
|
1101
1101
|
# The error from the tool call, if any.
|
|
1102
|
-
sig
|
|
1102
|
+
sig do
|
|
1103
|
+
returns(
|
|
1104
|
+
T.nilable(
|
|
1105
|
+
T.any(
|
|
1106
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError,
|
|
1107
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError,
|
|
1108
|
+
OpenAI::Responses::McpToolCallError::HTTPError
|
|
1109
|
+
)
|
|
1110
|
+
)
|
|
1111
|
+
)
|
|
1112
|
+
end
|
|
1103
1113
|
attr_accessor :error
|
|
1104
1114
|
|
|
1105
1115
|
# The output from the tool call.
|
|
@@ -1132,7 +1142,14 @@ module OpenAI
|
|
|
1132
1142
|
name: String,
|
|
1133
1143
|
server_label: String,
|
|
1134
1144
|
approval_request_id: T.nilable(String),
|
|
1135
|
-
error:
|
|
1145
|
+
error:
|
|
1146
|
+
T.nilable(
|
|
1147
|
+
T.any(
|
|
1148
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError::OrHash,
|
|
1149
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError::OrHash,
|
|
1150
|
+
OpenAI::Responses::McpToolCallError::HTTPError::OrHash
|
|
1151
|
+
)
|
|
1152
|
+
),
|
|
1136
1153
|
output: T.nilable(String),
|
|
1137
1154
|
status:
|
|
1138
1155
|
OpenAI::Responses::ResponseItem::McpCall::Status::OrSymbol,
|
|
@@ -1173,7 +1190,14 @@ module OpenAI
|
|
|
1173
1190
|
server_label: String,
|
|
1174
1191
|
type: Symbol,
|
|
1175
1192
|
approval_request_id: T.nilable(String),
|
|
1176
|
-
error:
|
|
1193
|
+
error:
|
|
1194
|
+
T.nilable(
|
|
1195
|
+
T.any(
|
|
1196
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError,
|
|
1197
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError,
|
|
1198
|
+
OpenAI::Responses::McpToolCallError::HTTPError
|
|
1199
|
+
)
|
|
1200
|
+
),
|
|
1177
1201
|
output: T.nilable(String),
|
|
1178
1202
|
status:
|
|
1179
1203
|
OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol
|
|
@@ -829,7 +829,17 @@ module OpenAI
|
|
|
829
829
|
attr_accessor :approval_request_id
|
|
830
830
|
|
|
831
831
|
# The error from the tool call, if any.
|
|
832
|
-
sig
|
|
832
|
+
sig do
|
|
833
|
+
returns(
|
|
834
|
+
T.nilable(
|
|
835
|
+
T.any(
|
|
836
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError,
|
|
837
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError,
|
|
838
|
+
OpenAI::Responses::McpToolCallError::HTTPError
|
|
839
|
+
)
|
|
840
|
+
)
|
|
841
|
+
)
|
|
842
|
+
end
|
|
833
843
|
attr_accessor :error
|
|
834
844
|
|
|
835
845
|
# The output from the tool call.
|
|
@@ -863,7 +873,14 @@ module OpenAI
|
|
|
863
873
|
name: String,
|
|
864
874
|
server_label: String,
|
|
865
875
|
approval_request_id: T.nilable(String),
|
|
866
|
-
error:
|
|
876
|
+
error:
|
|
877
|
+
T.nilable(
|
|
878
|
+
T.any(
|
|
879
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError::OrHash,
|
|
880
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError::OrHash,
|
|
881
|
+
OpenAI::Responses::McpToolCallError::HTTPError::OrHash
|
|
882
|
+
)
|
|
883
|
+
),
|
|
867
884
|
output: T.nilable(String),
|
|
868
885
|
status:
|
|
869
886
|
OpenAI::Responses::ResponseOutputItem::McpCall::Status::OrSymbol,
|
|
@@ -904,7 +921,14 @@ module OpenAI
|
|
|
904
921
|
server_label: String,
|
|
905
922
|
type: Symbol,
|
|
906
923
|
approval_request_id: T.nilable(String),
|
|
907
|
-
error:
|
|
924
|
+
error:
|
|
925
|
+
T.nilable(
|
|
926
|
+
T.any(
|
|
927
|
+
OpenAI::Responses::McpToolCallError::McpProtocolError,
|
|
928
|
+
OpenAI::Responses::McpToolCallError::McpToolExecutionError,
|
|
929
|
+
OpenAI::Responses::McpToolCallError::HTTPError
|
|
930
|
+
)
|
|
931
|
+
),
|
|
908
932
|
output: T.nilable(String),
|
|
909
933
|
status:
|
|
910
934
|
OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol
|
|
@@ -12,7 +12,10 @@ module OpenAI
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
# The output item that was added.
|
|
15
|
+
# The output item that was added. For reasoning items, `encrypted_content` may be
|
|
16
|
+
# incomplete while the item is in progress. Use the reasoning item from the
|
|
17
|
+
# corresponding `response.output_item.done` event when passing it as input to a
|
|
18
|
+
# subsequent request.
|
|
16
19
|
sig { returns(OpenAI::Responses::ResponseOutputItem::Variants) }
|
|
17
20
|
attr_accessor :item
|
|
18
21
|
|
|
@@ -68,7 +71,10 @@ module OpenAI
|
|
|
68
71
|
).returns(T.attached_class)
|
|
69
72
|
end
|
|
70
73
|
def self.new(
|
|
71
|
-
# The output item that was added.
|
|
74
|
+
# The output item that was added. For reasoning items, `encrypted_content` may be
|
|
75
|
+
# incomplete while the item is in progress. Use the reasoning item from the
|
|
76
|
+
# corresponding `response.output_item.done` event when passing it as input to a
|
|
77
|
+
# subsequent request.
|
|
72
78
|
item:,
|
|
73
79
|
# The index of the output item that was added.
|
|
74
80
|
output_index:,
|
|
@@ -12,8 +12,14 @@ module OpenAI
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
#
|
|
16
|
-
sig
|
|
15
|
+
# An annotation that applies to a span of output text.
|
|
16
|
+
sig do
|
|
17
|
+
returns(
|
|
18
|
+
T.nilable(
|
|
19
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::Variants
|
|
20
|
+
)
|
|
21
|
+
)
|
|
22
|
+
end
|
|
17
23
|
attr_accessor :annotation
|
|
18
24
|
|
|
19
25
|
# The index of the annotation within the content part.
|
|
@@ -43,7 +49,15 @@ module OpenAI
|
|
|
43
49
|
# Emitted when an annotation is added to output text content.
|
|
44
50
|
sig do
|
|
45
51
|
params(
|
|
46
|
-
annotation:
|
|
52
|
+
annotation:
|
|
53
|
+
T.nilable(
|
|
54
|
+
T.any(
|
|
55
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::FileCitation::OrHash,
|
|
56
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::URLCitation::OrHash,
|
|
57
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::ContainerFileCitation::OrHash,
|
|
58
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::FilePath::OrHash
|
|
59
|
+
)
|
|
60
|
+
),
|
|
47
61
|
annotation_index: Integer,
|
|
48
62
|
content_index: Integer,
|
|
49
63
|
item_id: String,
|
|
@@ -53,7 +67,7 @@ module OpenAI
|
|
|
53
67
|
).returns(T.attached_class)
|
|
54
68
|
end
|
|
55
69
|
def self.new(
|
|
56
|
-
#
|
|
70
|
+
# An annotation that applies to a span of output text.
|
|
57
71
|
annotation:,
|
|
58
72
|
# The index of the annotation within the content part.
|
|
59
73
|
annotation_index:,
|
|
@@ -73,7 +87,10 @@ module OpenAI
|
|
|
73
87
|
sig do
|
|
74
88
|
override.returns(
|
|
75
89
|
{
|
|
76
|
-
annotation:
|
|
90
|
+
annotation:
|
|
91
|
+
T.nilable(
|
|
92
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::Variants
|
|
93
|
+
),
|
|
77
94
|
annotation_index: Integer,
|
|
78
95
|
content_index: Integer,
|
|
79
96
|
item_id: String,
|
|
@@ -85,6 +102,281 @@ module OpenAI
|
|
|
85
102
|
end
|
|
86
103
|
def to_hash
|
|
87
104
|
end
|
|
105
|
+
|
|
106
|
+
# An annotation that applies to a span of output text.
|
|
107
|
+
module Annotation
|
|
108
|
+
extend OpenAI::Internal::Type::Union
|
|
109
|
+
|
|
110
|
+
Variants =
|
|
111
|
+
T.type_alias do
|
|
112
|
+
T.any(
|
|
113
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::FileCitation,
|
|
114
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::URLCitation,
|
|
115
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::ContainerFileCitation,
|
|
116
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::FilePath
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
class FileCitation < OpenAI::Internal::Type::BaseModel
|
|
121
|
+
OrHash =
|
|
122
|
+
T.type_alias do
|
|
123
|
+
T.any(
|
|
124
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::FileCitation,
|
|
125
|
+
OpenAI::Internal::AnyHash
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# The ID of the file.
|
|
130
|
+
sig { returns(String) }
|
|
131
|
+
attr_accessor :file_id
|
|
132
|
+
|
|
133
|
+
# The filename of the file cited.
|
|
134
|
+
sig { returns(String) }
|
|
135
|
+
attr_accessor :filename
|
|
136
|
+
|
|
137
|
+
# The index of the file in the list of files.
|
|
138
|
+
sig { returns(Integer) }
|
|
139
|
+
attr_accessor :index
|
|
140
|
+
|
|
141
|
+
# The type of the file citation. Always `file_citation`.
|
|
142
|
+
sig { returns(Symbol) }
|
|
143
|
+
attr_accessor :type
|
|
144
|
+
|
|
145
|
+
# A citation to a file.
|
|
146
|
+
sig do
|
|
147
|
+
params(
|
|
148
|
+
file_id: String,
|
|
149
|
+
filename: String,
|
|
150
|
+
index: Integer,
|
|
151
|
+
type: Symbol
|
|
152
|
+
).returns(T.attached_class)
|
|
153
|
+
end
|
|
154
|
+
def self.new(
|
|
155
|
+
# The ID of the file.
|
|
156
|
+
file_id:,
|
|
157
|
+
# The filename of the file cited.
|
|
158
|
+
filename:,
|
|
159
|
+
# The index of the file in the list of files.
|
|
160
|
+
index:,
|
|
161
|
+
# The type of the file citation. Always `file_citation`.
|
|
162
|
+
type: :file_citation
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
sig do
|
|
167
|
+
override.returns(
|
|
168
|
+
{
|
|
169
|
+
file_id: String,
|
|
170
|
+
filename: String,
|
|
171
|
+
index: Integer,
|
|
172
|
+
type: Symbol
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
def to_hash
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
class URLCitation < OpenAI::Internal::Type::BaseModel
|
|
181
|
+
OrHash =
|
|
182
|
+
T.type_alias do
|
|
183
|
+
T.any(
|
|
184
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::URLCitation,
|
|
185
|
+
OpenAI::Internal::AnyHash
|
|
186
|
+
)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# The index of the last character of the URL citation in the message.
|
|
190
|
+
sig { returns(Integer) }
|
|
191
|
+
attr_accessor :end_index
|
|
192
|
+
|
|
193
|
+
# The index of the first character of the URL citation in the message.
|
|
194
|
+
sig { returns(Integer) }
|
|
195
|
+
attr_accessor :start_index
|
|
196
|
+
|
|
197
|
+
# The title of the web resource.
|
|
198
|
+
sig { returns(String) }
|
|
199
|
+
attr_accessor :title
|
|
200
|
+
|
|
201
|
+
# The type of the URL citation. Always `url_citation`.
|
|
202
|
+
sig { returns(Symbol) }
|
|
203
|
+
attr_accessor :type
|
|
204
|
+
|
|
205
|
+
# The URL of the web resource.
|
|
206
|
+
sig { returns(String) }
|
|
207
|
+
attr_accessor :url
|
|
208
|
+
|
|
209
|
+
# A citation for a web resource used to generate a model response.
|
|
210
|
+
sig do
|
|
211
|
+
params(
|
|
212
|
+
end_index: Integer,
|
|
213
|
+
start_index: Integer,
|
|
214
|
+
title: String,
|
|
215
|
+
url: String,
|
|
216
|
+
type: Symbol
|
|
217
|
+
).returns(T.attached_class)
|
|
218
|
+
end
|
|
219
|
+
def self.new(
|
|
220
|
+
# The index of the last character of the URL citation in the message.
|
|
221
|
+
end_index:,
|
|
222
|
+
# The index of the first character of the URL citation in the message.
|
|
223
|
+
start_index:,
|
|
224
|
+
# The title of the web resource.
|
|
225
|
+
title:,
|
|
226
|
+
# The URL of the web resource.
|
|
227
|
+
url:,
|
|
228
|
+
# The type of the URL citation. Always `url_citation`.
|
|
229
|
+
type: :url_citation
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
sig do
|
|
234
|
+
override.returns(
|
|
235
|
+
{
|
|
236
|
+
end_index: Integer,
|
|
237
|
+
start_index: Integer,
|
|
238
|
+
title: String,
|
|
239
|
+
type: Symbol,
|
|
240
|
+
url: String
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
end
|
|
244
|
+
def to_hash
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
class ContainerFileCitation < OpenAI::Internal::Type::BaseModel
|
|
249
|
+
OrHash =
|
|
250
|
+
T.type_alias do
|
|
251
|
+
T.any(
|
|
252
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::ContainerFileCitation,
|
|
253
|
+
OpenAI::Internal::AnyHash
|
|
254
|
+
)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# The ID of the container file.
|
|
258
|
+
sig { returns(String) }
|
|
259
|
+
attr_accessor :container_id
|
|
260
|
+
|
|
261
|
+
# The index of the last character of the container file citation in the message.
|
|
262
|
+
sig { returns(Integer) }
|
|
263
|
+
attr_accessor :end_index
|
|
264
|
+
|
|
265
|
+
# The ID of the file.
|
|
266
|
+
sig { returns(String) }
|
|
267
|
+
attr_accessor :file_id
|
|
268
|
+
|
|
269
|
+
# The filename of the container file cited.
|
|
270
|
+
sig { returns(String) }
|
|
271
|
+
attr_accessor :filename
|
|
272
|
+
|
|
273
|
+
# The index of the first character of the container file citation in the message.
|
|
274
|
+
sig { returns(Integer) }
|
|
275
|
+
attr_accessor :start_index
|
|
276
|
+
|
|
277
|
+
# The type of the container file citation. Always `container_file_citation`.
|
|
278
|
+
sig { returns(Symbol) }
|
|
279
|
+
attr_accessor :type
|
|
280
|
+
|
|
281
|
+
# A citation for a container file used to generate a model response.
|
|
282
|
+
sig do
|
|
283
|
+
params(
|
|
284
|
+
container_id: String,
|
|
285
|
+
end_index: Integer,
|
|
286
|
+
file_id: String,
|
|
287
|
+
filename: String,
|
|
288
|
+
start_index: Integer,
|
|
289
|
+
type: Symbol
|
|
290
|
+
).returns(T.attached_class)
|
|
291
|
+
end
|
|
292
|
+
def self.new(
|
|
293
|
+
# The ID of the container file.
|
|
294
|
+
container_id:,
|
|
295
|
+
# The index of the last character of the container file citation in the message.
|
|
296
|
+
end_index:,
|
|
297
|
+
# The ID of the file.
|
|
298
|
+
file_id:,
|
|
299
|
+
# The filename of the container file cited.
|
|
300
|
+
filename:,
|
|
301
|
+
# The index of the first character of the container file citation in the message.
|
|
302
|
+
start_index:,
|
|
303
|
+
# The type of the container file citation. Always `container_file_citation`.
|
|
304
|
+
type: :container_file_citation
|
|
305
|
+
)
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
sig do
|
|
309
|
+
override.returns(
|
|
310
|
+
{
|
|
311
|
+
container_id: String,
|
|
312
|
+
end_index: Integer,
|
|
313
|
+
file_id: String,
|
|
314
|
+
filename: String,
|
|
315
|
+
start_index: Integer,
|
|
316
|
+
type: Symbol
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
end
|
|
320
|
+
def to_hash
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
class FilePath < OpenAI::Internal::Type::BaseModel
|
|
325
|
+
OrHash =
|
|
326
|
+
T.type_alias do
|
|
327
|
+
T.any(
|
|
328
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::FilePath,
|
|
329
|
+
OpenAI::Internal::AnyHash
|
|
330
|
+
)
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# The ID of the file.
|
|
334
|
+
sig { returns(String) }
|
|
335
|
+
attr_accessor :file_id
|
|
336
|
+
|
|
337
|
+
# The index of the file in the list of files.
|
|
338
|
+
sig { returns(Integer) }
|
|
339
|
+
attr_accessor :index
|
|
340
|
+
|
|
341
|
+
# The type of the file path. Always `file_path`.
|
|
342
|
+
sig { returns(Symbol) }
|
|
343
|
+
attr_accessor :type
|
|
344
|
+
|
|
345
|
+
# A path to a file.
|
|
346
|
+
sig do
|
|
347
|
+
params(file_id: String, index: Integer, type: Symbol).returns(
|
|
348
|
+
T.attached_class
|
|
349
|
+
)
|
|
350
|
+
end
|
|
351
|
+
def self.new(
|
|
352
|
+
# The ID of the file.
|
|
353
|
+
file_id:,
|
|
354
|
+
# The index of the file in the list of files.
|
|
355
|
+
index:,
|
|
356
|
+
# The type of the file path. Always `file_path`.
|
|
357
|
+
type: :file_path
|
|
358
|
+
)
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
sig do
|
|
362
|
+
override.returns(
|
|
363
|
+
{ file_id: String, index: Integer, type: Symbol }
|
|
364
|
+
)
|
|
365
|
+
end
|
|
366
|
+
def to_hash
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
sig do
|
|
371
|
+
override.returns(
|
|
372
|
+
T::Array[
|
|
373
|
+
OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent::Annotation::Variants
|
|
374
|
+
]
|
|
375
|
+
)
|
|
376
|
+
end
|
|
377
|
+
def self.variants
|
|
378
|
+
end
|
|
379
|
+
end
|
|
88
380
|
end
|
|
89
381
|
end
|
|
90
382
|
end
|
|
@@ -49,6 +49,11 @@ module OpenAI
|
|
|
49
49
|
# The encrypted content of the reasoning item. This is populated by default for
|
|
50
50
|
# reasoning items returned by `POST /v1/responses` and WebSocket `response.create`
|
|
51
51
|
# requests.
|
|
52
|
+
#
|
|
53
|
+
# When streaming, use the completed reasoning item and its `encrypted_content`
|
|
54
|
+
# from the `response.output_item.done` event in subsequent requests. The
|
|
55
|
+
# `encrypted_content` in `response.output_item.added` may be incomplete. This is
|
|
56
|
+
# especially important when `store` is `false` or when using Zero Data Retention.
|
|
52
57
|
sig { returns(T.nilable(String)) }
|
|
53
58
|
attr_accessor :encrypted_content
|
|
54
59
|
|
|
@@ -100,6 +105,11 @@ module OpenAI
|
|
|
100
105
|
# The encrypted content of the reasoning item. This is populated by default for
|
|
101
106
|
# reasoning items returned by `POST /v1/responses` and WebSocket `response.create`
|
|
102
107
|
# requests.
|
|
108
|
+
#
|
|
109
|
+
# When streaming, use the completed reasoning item and its `encrypted_content`
|
|
110
|
+
# from the `response.output_item.done` event in subsequent requests. The
|
|
111
|
+
# `encrypted_content` in `response.output_item.added` may be incomplete. This is
|
|
112
|
+
# especially important when `store` is `false` or when using Zero Data Retention.
|
|
103
113
|
encrypted_content: nil,
|
|
104
114
|
# The status of the item. One of `in_progress`, `completed`, or `incomplete`.
|
|
105
115
|
# Populated when items are returned via API.
|