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
|
@@ -13,6 +13,15 @@ module OpenAI
|
|
|
13
13
|
sig { returns(OpenAI::Responses::WebSearchTool::Type::OrSymbol) }
|
|
14
14
|
attr_accessor :type
|
|
15
15
|
|
|
16
|
+
# Allow live internet access for web search. Defaults to true when omitted. When
|
|
17
|
+
# false, the web search tool runs in offline/cache-only mode and will not fetch
|
|
18
|
+
# new external content.
|
|
19
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
20
|
+
attr_reader :external_web_access
|
|
21
|
+
|
|
22
|
+
sig { params(external_web_access: T::Boolean).void }
|
|
23
|
+
attr_writer :external_web_access
|
|
24
|
+
|
|
16
25
|
# Filters for the search.
|
|
17
26
|
sig { returns(T.nilable(OpenAI::Responses::WebSearchTool::Filters)) }
|
|
18
27
|
attr_reader :filters
|
|
@@ -63,6 +72,7 @@ module OpenAI
|
|
|
63
72
|
sig do
|
|
64
73
|
params(
|
|
65
74
|
type: OpenAI::Responses::WebSearchTool::Type::OrSymbol,
|
|
75
|
+
external_web_access: T::Boolean,
|
|
66
76
|
filters:
|
|
67
77
|
T.nilable(OpenAI::Responses::WebSearchTool::Filters::OrHash),
|
|
68
78
|
search_context_size:
|
|
@@ -74,6 +84,10 @@ module OpenAI
|
|
|
74
84
|
def self.new(
|
|
75
85
|
# The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
|
|
76
86
|
type:,
|
|
87
|
+
# Allow live internet access for web search. Defaults to true when omitted. When
|
|
88
|
+
# false, the web search tool runs in offline/cache-only mode and will not fetch
|
|
89
|
+
# new external content.
|
|
90
|
+
external_web_access: nil,
|
|
77
91
|
# Filters for the search.
|
|
78
92
|
filters: nil,
|
|
79
93
|
# High level guidance for the amount of context window space to use for the
|
|
@@ -88,6 +102,7 @@ module OpenAI
|
|
|
88
102
|
override.returns(
|
|
89
103
|
{
|
|
90
104
|
type: OpenAI::Responses::WebSearchTool::Type::OrSymbol,
|
|
105
|
+
external_web_access: T::Boolean,
|
|
91
106
|
filters: T.nilable(OpenAI::Responses::WebSearchTool::Filters),
|
|
92
107
|
search_context_size:
|
|
93
108
|
OpenAI::Responses::WebSearchTool::SearchContextSize::OrSymbol,
|
|
@@ -73,6 +73,16 @@ module OpenAI
|
|
|
73
73
|
:"computer-use-preview-2025-03-11",
|
|
74
74
|
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
75
75
|
)
|
|
76
|
+
GPT_5_5_PRO =
|
|
77
|
+
T.let(
|
|
78
|
+
:"gpt-5.5-pro",
|
|
79
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
80
|
+
)
|
|
81
|
+
GPT_5_5_PRO_2026_04_23 =
|
|
82
|
+
T.let(
|
|
83
|
+
:"gpt-5.5-pro-2026-04-23",
|
|
84
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
85
|
+
)
|
|
76
86
|
GPT_5_CODEX =
|
|
77
87
|
T.let(
|
|
78
88
|
:"gpt-5-codex",
|
|
@@ -93,6 +103,21 @@ module OpenAI
|
|
|
93
103
|
:"gpt-5.1-codex-max",
|
|
94
104
|
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
95
105
|
)
|
|
106
|
+
GPT_DAYBREAK_BLUE_LATEST =
|
|
107
|
+
T.let(
|
|
108
|
+
:"gpt-daybreak-blue-latest",
|
|
109
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
110
|
+
)
|
|
111
|
+
GPT_DAYBREAK_RED_LATEST =
|
|
112
|
+
T.let(
|
|
113
|
+
:"gpt-daybreak-red-latest",
|
|
114
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
115
|
+
)
|
|
116
|
+
GPT_5_6_CYBER =
|
|
117
|
+
T.let(
|
|
118
|
+
:"gpt-5.6-cyber",
|
|
119
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
|
120
|
+
)
|
|
96
121
|
|
|
97
122
|
sig do
|
|
98
123
|
override.returns(
|
|
@@ -12,6 +12,10 @@ module OpenAI
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# Skill files to upload (directory upload) or a single zip file.
|
|
15
|
+
#
|
|
16
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
17
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
18
|
+
# content type.
|
|
15
19
|
sig { returns(T.nilable(OpenAI::SkillCreateParams::Files::Variants)) }
|
|
16
20
|
attr_reader :files
|
|
17
21
|
|
|
@@ -26,6 +30,10 @@ module OpenAI
|
|
|
26
30
|
end
|
|
27
31
|
def self.new(
|
|
28
32
|
# Skill files to upload (directory upload) or a single zip file.
|
|
33
|
+
#
|
|
34
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
35
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
36
|
+
# content type.
|
|
29
37
|
files: nil,
|
|
30
38
|
request_options: {}
|
|
31
39
|
)
|
|
@@ -26,6 +26,10 @@ module OpenAI
|
|
|
26
26
|
attr_writer :default
|
|
27
27
|
|
|
28
28
|
# Skill files to upload (directory upload) or a single zip file.
|
|
29
|
+
#
|
|
30
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
31
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
32
|
+
# content type.
|
|
29
33
|
sig do
|
|
30
34
|
returns(
|
|
31
35
|
T.nilable(OpenAI::Skills::VersionCreateParams::Files::Variants)
|
|
@@ -53,6 +57,10 @@ module OpenAI
|
|
|
53
57
|
# Whether to set this version as the default.
|
|
54
58
|
default: nil,
|
|
55
59
|
# Skill files to upload (directory upload) or a single zip file.
|
|
60
|
+
#
|
|
61
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
62
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
63
|
+
# content type.
|
|
56
64
|
files: nil,
|
|
57
65
|
request_options: {}
|
|
58
66
|
)
|
|
@@ -16,6 +16,10 @@ module OpenAI
|
|
|
16
16
|
attr_accessor :upload_id
|
|
17
17
|
|
|
18
18
|
# The chunk of bytes for this Part.
|
|
19
|
+
#
|
|
20
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
21
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
22
|
+
# content type.
|
|
19
23
|
sig { returns(OpenAI::Internal::FileInput) }
|
|
20
24
|
attr_accessor :data
|
|
21
25
|
|
|
@@ -29,6 +33,10 @@ module OpenAI
|
|
|
29
33
|
def self.new(
|
|
30
34
|
upload_id:,
|
|
31
35
|
# The chunk of bytes for this Part.
|
|
36
|
+
#
|
|
37
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
38
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
39
|
+
# content type.
|
|
32
40
|
data:,
|
|
33
41
|
request_options: {}
|
|
34
42
|
)
|
|
@@ -16,6 +16,10 @@ module OpenAI
|
|
|
16
16
|
attr_accessor :name
|
|
17
17
|
|
|
18
18
|
# Video file used to create a character.
|
|
19
|
+
#
|
|
20
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
21
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
22
|
+
# content type.
|
|
19
23
|
sig { returns(OpenAI::Internal::FileInput) }
|
|
20
24
|
attr_accessor :video
|
|
21
25
|
|
|
@@ -30,6 +34,10 @@ module OpenAI
|
|
|
30
34
|
# Display name for this API character.
|
|
31
35
|
name:,
|
|
32
36
|
# Video file used to create a character.
|
|
37
|
+
#
|
|
38
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
39
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
40
|
+
# content type.
|
|
33
41
|
video:,
|
|
34
42
|
request_options: {}
|
|
35
43
|
)
|
|
@@ -16,6 +16,10 @@ module OpenAI
|
|
|
16
16
|
attr_accessor :prompt
|
|
17
17
|
|
|
18
18
|
# Optional reference asset upload or reference object that guides generation.
|
|
19
|
+
#
|
|
20
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
21
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
22
|
+
# content type.
|
|
19
23
|
sig do
|
|
20
24
|
returns(
|
|
21
25
|
T.nilable(
|
|
@@ -77,6 +81,10 @@ module OpenAI
|
|
|
77
81
|
# Text prompt that describes the video to generate.
|
|
78
82
|
prompt:,
|
|
79
83
|
# Optional reference asset upload or reference object that guides generation.
|
|
84
|
+
#
|
|
85
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
86
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
87
|
+
# content type.
|
|
80
88
|
input_reference: nil,
|
|
81
89
|
# The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
|
|
82
90
|
# to `sora-2`.
|
|
@@ -16,6 +16,10 @@ module OpenAI
|
|
|
16
16
|
attr_accessor :prompt
|
|
17
17
|
|
|
18
18
|
# Reference to the completed video to edit.
|
|
19
|
+
#
|
|
20
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
21
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
22
|
+
# content type.
|
|
19
23
|
sig do
|
|
20
24
|
returns(
|
|
21
25
|
T.any(
|
|
@@ -41,6 +45,10 @@ module OpenAI
|
|
|
41
45
|
# Text prompt that describes how to edit the source video.
|
|
42
46
|
prompt:,
|
|
43
47
|
# Reference to the completed video to edit.
|
|
48
|
+
#
|
|
49
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
50
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
51
|
+
# content type.
|
|
44
52
|
video:,
|
|
45
53
|
request_options: {}
|
|
46
54
|
)
|
|
@@ -21,6 +21,10 @@ module OpenAI
|
|
|
21
21
|
attr_accessor :seconds
|
|
22
22
|
|
|
23
23
|
# Reference to the completed video to extend.
|
|
24
|
+
#
|
|
25
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
26
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
27
|
+
# content type.
|
|
24
28
|
sig do
|
|
25
29
|
returns(
|
|
26
30
|
T.any(
|
|
@@ -50,6 +54,10 @@ module OpenAI
|
|
|
50
54
|
# 8, 12, 16, 20).
|
|
51
55
|
seconds:,
|
|
52
56
|
# Reference to the completed video to extend.
|
|
57
|
+
#
|
|
58
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
59
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
60
|
+
# content type.
|
|
53
61
|
video:,
|
|
54
62
|
request_options: {}
|
|
55
63
|
)
|
|
@@ -10,7 +10,7 @@ module OpenAI
|
|
|
10
10
|
private def connect(url:)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
sig { params(conn: Net::HTTP, deadline: Float).void }
|
|
13
|
+
sig { params(conn: Net::HTTP, deadline: T.nilable(Float)).void }
|
|
14
14
|
private def calibrate_socket_timeout(conn, deadline)
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ module OpenAI
|
|
|
26
26
|
sig do
|
|
27
27
|
params(
|
|
28
28
|
url: URI::Generic,
|
|
29
|
-
deadline: Float,
|
|
29
|
+
deadline: T.nilable(Float),
|
|
30
30
|
blk: T.proc.params(arg0: Net::HTTP).void
|
|
31
31
|
).void
|
|
32
32
|
end
|
data/rbi/openai/providers.rbi
CHANGED
|
@@ -5,6 +5,16 @@ module OpenAI
|
|
|
5
5
|
class << self
|
|
6
6
|
sig do
|
|
7
7
|
params(
|
|
8
|
+
endpoint: T.nilable(String),
|
|
9
|
+
api_key: T.nilable(String),
|
|
10
|
+
token_provider: T.nilable(T.proc.returns(String))
|
|
11
|
+
).returns(OpenAI::Provider)
|
|
12
|
+
end
|
|
13
|
+
def azure(endpoint: nil, api_key: nil, token_provider: nil); end
|
|
14
|
+
|
|
15
|
+
sig do
|
|
16
|
+
params(
|
|
17
|
+
endpoint: T.nilable(T.any(String, Symbol)),
|
|
8
18
|
region: T.nilable(String),
|
|
9
19
|
base_url: T.nilable(String),
|
|
10
20
|
api_key: T.nilable(String),
|
|
@@ -17,6 +27,7 @@ module OpenAI
|
|
|
17
27
|
).returns(OpenAI::Provider)
|
|
18
28
|
end
|
|
19
29
|
def bedrock(
|
|
30
|
+
endpoint: nil,
|
|
20
31
|
region: nil,
|
|
21
32
|
base_url: nil,
|
|
22
33
|
api_key: nil,
|
|
@@ -44,7 +44,13 @@ module OpenAI
|
|
|
44
44
|
end
|
|
45
45
|
def create(
|
|
46
46
|
# The audio file object (not file name) to transcribe, in one of these formats:
|
|
47
|
-
# flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
|
|
47
|
+
# flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include
|
|
48
|
+
# enough format metadata for the file to be identified. We recommend an
|
|
49
|
+
# extension-bearing filename and an appropriate content type.
|
|
50
|
+
#
|
|
51
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
52
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
53
|
+
# content type.
|
|
48
54
|
file:,
|
|
49
55
|
# ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
|
|
50
56
|
# `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
|
|
@@ -159,7 +165,13 @@ module OpenAI
|
|
|
159
165
|
end
|
|
160
166
|
def create_streaming(
|
|
161
167
|
# The audio file object (not file name) to transcribe, in one of these formats:
|
|
162
|
-
# flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
|
|
168
|
+
# flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include
|
|
169
|
+
# enough format metadata for the file to be identified. We recommend an
|
|
170
|
+
# extension-bearing filename and an appropriate content type.
|
|
171
|
+
#
|
|
172
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
173
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
174
|
+
# content type.
|
|
163
175
|
file:,
|
|
164
176
|
# ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
|
|
165
177
|
# `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
|
|
@@ -19,7 +19,13 @@ module OpenAI
|
|
|
19
19
|
end
|
|
20
20
|
def create(
|
|
21
21
|
# The audio file object (not file name) translate, in one of these formats: flac,
|
|
22
|
-
# mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
|
|
22
|
+
# mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include enough
|
|
23
|
+
# format metadata for the file to be identified. We recommend an extension-bearing
|
|
24
|
+
# filename and an appropriate content type.
|
|
25
|
+
#
|
|
26
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
27
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
28
|
+
# content type.
|
|
23
29
|
file:,
|
|
24
30
|
# ID of the model to use. Only `whisper-1` (which is powered by our open source
|
|
25
31
|
# Whisper V2 model) is currently available.
|
|
@@ -269,6 +269,10 @@ module OpenAI
|
|
|
269
269
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
270
270
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
271
271
|
# request.
|
|
272
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
273
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
274
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
275
|
+
# `service_tier=ultrafast`.
|
|
272
276
|
# - When not set, the default behavior is 'auto'.
|
|
273
277
|
#
|
|
274
278
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -616,6 +620,10 @@ module OpenAI
|
|
|
616
620
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
617
621
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
618
622
|
# request.
|
|
623
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
624
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
625
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
626
|
+
# `service_tier=ultrafast`.
|
|
619
627
|
# - When not set, the default behavior is 'auto'.
|
|
620
628
|
#
|
|
621
629
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -22,6 +22,10 @@ module OpenAI
|
|
|
22
22
|
def create(
|
|
23
23
|
container_id,
|
|
24
24
|
# The File object (not file name) to be uploaded.
|
|
25
|
+
#
|
|
26
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
27
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
28
|
+
# content type.
|
|
25
29
|
file: nil,
|
|
26
30
|
# Name of the file to create.
|
|
27
31
|
file_id: nil,
|
|
@@ -20,6 +20,10 @@ module OpenAI
|
|
|
20
20
|
end
|
|
21
21
|
def create(
|
|
22
22
|
# The image or audio file to check for supported OpenAI provenance signals.
|
|
23
|
+
#
|
|
24
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
25
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
26
|
+
# content type.
|
|
23
27
|
file:,
|
|
24
28
|
request_options: {}
|
|
25
29
|
)
|
|
@@ -42,6 +42,10 @@ module OpenAI
|
|
|
42
42
|
end
|
|
43
43
|
def create(
|
|
44
44
|
# The File object (not file name) to be uploaded.
|
|
45
|
+
#
|
|
46
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
47
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
48
|
+
# content type.
|
|
45
49
|
file:,
|
|
46
50
|
# The intended purpose of the uploaded file. One of:
|
|
47
51
|
#
|
|
@@ -115,7 +119,7 @@ module OpenAI
|
|
|
115
119
|
)
|
|
116
120
|
end
|
|
117
121
|
|
|
118
|
-
# Returns the contents of the specified file.
|
|
122
|
+
# Returns a response containing the contents of the specified file.
|
|
119
123
|
sig do
|
|
120
124
|
params(
|
|
121
125
|
file_id: String,
|
|
@@ -22,6 +22,10 @@ module OpenAI
|
|
|
22
22
|
def create_variation(
|
|
23
23
|
# The image to use as the basis for the variation(s). Must be a valid PNG file,
|
|
24
24
|
# less than 4MB, and square.
|
|
25
|
+
#
|
|
26
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
27
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
28
|
+
# content type.
|
|
25
29
|
image:,
|
|
26
30
|
# The model to use for image generation. Only `dall-e-2` is supported at this
|
|
27
31
|
# time.
|
|
@@ -82,6 +86,10 @@ module OpenAI
|
|
|
82
86
|
#
|
|
83
87
|
# For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
84
88
|
# file less than 4MB.
|
|
89
|
+
#
|
|
90
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
91
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
92
|
+
# content type.
|
|
85
93
|
image:,
|
|
86
94
|
# A text description of the desired image(s). The maximum length is 1000
|
|
87
95
|
# characters for `dall-e-2`, and 32000 characters for the GPT image models.
|
|
@@ -108,6 +116,10 @@ module OpenAI
|
|
|
108
116
|
# indicate where `image` should be edited. If there are multiple images provided,
|
|
109
117
|
# the mask will be applied on the first image. Must be a valid PNG file, less than
|
|
110
118
|
# 4MB, and have the same dimensions as `image`.
|
|
119
|
+
#
|
|
120
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
121
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
122
|
+
# content type.
|
|
111
123
|
mask: nil,
|
|
112
124
|
# The model to use for image generation. One of `dall-e-2` or a GPT image model
|
|
113
125
|
# (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
@@ -203,6 +215,10 @@ module OpenAI
|
|
|
203
215
|
#
|
|
204
216
|
# For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
205
217
|
# file less than 4MB.
|
|
218
|
+
#
|
|
219
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
220
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
221
|
+
# content type.
|
|
206
222
|
image:,
|
|
207
223
|
# A text description of the desired image(s). The maximum length is 1000
|
|
208
224
|
# characters for `dall-e-2`, and 32000 characters for the GPT image models.
|
|
@@ -229,6 +245,10 @@ module OpenAI
|
|
|
229
245
|
# indicate where `image` should be edited. If there are multiple images provided,
|
|
230
246
|
# the mask will be applied on the first image. Must be a valid PNG file, less than
|
|
231
247
|
# 4MB, and have the same dimensions as `image`.
|
|
248
|
+
#
|
|
249
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
250
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
251
|
+
# content type.
|
|
232
252
|
mask: nil,
|
|
233
253
|
# The model to use for image generation. One of `dall-e-2` or a GPT image model
|
|
234
254
|
# (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
@@ -266,6 +266,10 @@ module OpenAI
|
|
|
266
266
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
267
267
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
268
268
|
# request.
|
|
269
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
270
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
271
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
272
|
+
# `service_tier=ultrafast`.
|
|
269
273
|
# - When not set, the default behavior is 'auto'.
|
|
270
274
|
#
|
|
271
275
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -606,6 +610,10 @@ module OpenAI
|
|
|
606
610
|
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
607
611
|
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
608
612
|
# request.
|
|
613
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
614
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
615
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
616
|
+
# `service_tier=ultrafast`.
|
|
609
617
|
# - When not set, the default behavior is 'auto'.
|
|
610
618
|
#
|
|
611
619
|
# When the `service_tier` parameter is set, the response body will include the
|
|
@@ -22,6 +22,10 @@ module OpenAI
|
|
|
22
22
|
# Whether to set this version as the default.
|
|
23
23
|
default: nil,
|
|
24
24
|
# Skill files to upload (directory upload) or a single zip file.
|
|
25
|
+
#
|
|
26
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
27
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
28
|
+
# content type.
|
|
25
29
|
files: nil,
|
|
26
30
|
request_options: {}
|
|
27
31
|
)
|
|
@@ -18,6 +18,10 @@ module OpenAI
|
|
|
18
18
|
end
|
|
19
19
|
def create(
|
|
20
20
|
# Skill files to upload (directory upload) or a single zip file.
|
|
21
|
+
#
|
|
22
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
23
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
24
|
+
# content type.
|
|
21
25
|
files: nil,
|
|
22
26
|
request_options: {}
|
|
23
27
|
)
|
|
@@ -27,6 +27,10 @@ module OpenAI
|
|
|
27
27
|
# The ID of the Upload.
|
|
28
28
|
upload_id,
|
|
29
29
|
# The chunk of bytes for this Part.
|
|
30
|
+
#
|
|
31
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
32
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
33
|
+
# content type.
|
|
30
34
|
data:,
|
|
31
35
|
request_options: {}
|
|
32
36
|
)
|
|
@@ -22,6 +22,10 @@ module OpenAI
|
|
|
22
22
|
# Text prompt that describes the video to generate.
|
|
23
23
|
prompt:,
|
|
24
24
|
# Optional reference asset upload or reference object that guides generation.
|
|
25
|
+
#
|
|
26
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
27
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
28
|
+
# content type.
|
|
25
29
|
input_reference: nil,
|
|
26
30
|
# The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
|
|
27
31
|
# to `sora-2`.
|
|
@@ -96,6 +100,10 @@ module OpenAI
|
|
|
96
100
|
# Display name for this API character.
|
|
97
101
|
name:,
|
|
98
102
|
# Video file used to create a character.
|
|
103
|
+
#
|
|
104
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
105
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
106
|
+
# content type.
|
|
99
107
|
video:,
|
|
100
108
|
request_options: {}
|
|
101
109
|
)
|
|
@@ -137,6 +145,10 @@ module OpenAI
|
|
|
137
145
|
# Text prompt that describes how to edit the source video.
|
|
138
146
|
prompt:,
|
|
139
147
|
# Reference to the completed video to edit.
|
|
148
|
+
#
|
|
149
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
150
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
151
|
+
# content type.
|
|
140
152
|
video:,
|
|
141
153
|
request_options: {}
|
|
142
154
|
)
|
|
@@ -162,6 +174,10 @@ module OpenAI
|
|
|
162
174
|
# 8, 12, 16, 20).
|
|
163
175
|
seconds:,
|
|
164
176
|
# Reference to the completed video to extend.
|
|
177
|
+
#
|
|
178
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
179
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
180
|
+
# content type.
|
|
165
181
|
video:,
|
|
166
182
|
request_options: {}
|
|
167
183
|
)
|
data/sig/openai/client.rbs
CHANGED
|
@@ -91,11 +91,15 @@ module OpenAI
|
|
|
91
91
|
?webhook_secret: String?,
|
|
92
92
|
?provider: OpenAI::Provider?,
|
|
93
93
|
?base_url: String?,
|
|
94
|
+
?default_headers: ::Hash[String, String?]?,
|
|
94
95
|
?max_retries: Integer,
|
|
95
|
-
?timeout: Float
|
|
96
|
+
?timeout: Float?,
|
|
96
97
|
?initial_retry_delay: Float,
|
|
97
98
|
?max_retry_delay: Float,
|
|
98
|
-
?http_client: OpenAI::_HTTPClient
|
|
99
|
+
?http_client: OpenAI::_HTTPClient?,
|
|
100
|
+
?logger: OpenAI::_Logger?,
|
|
101
|
+
?log_level: (Symbol | String)?,
|
|
102
|
+
?on_retry: (^(OpenAI::RetryEvent) -> void)?
|
|
99
103
|
) -> void
|
|
100
104
|
end
|
|
101
105
|
end
|
data/sig/openai/errors.rbs
CHANGED
|
@@ -31,6 +31,11 @@ module OpenAI
|
|
|
31
31
|
|
|
32
32
|
attr_accessor type: String?
|
|
33
33
|
|
|
34
|
+
# The ID of the API request, returned via the `x-request-id` response
|
|
35
|
+
# header. This is nil when no HTTP response was received or the response
|
|
36
|
+
# did not include the header.
|
|
37
|
+
def request_id: -> String?
|
|
38
|
+
|
|
34
39
|
def initialize: (
|
|
35
40
|
url: URI::Generic,
|
|
36
41
|
?status: Integer?,
|
data/sig/openai/http_client.rbs
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
module OpenAI
|
|
2
|
+
interface _Logger
|
|
3
|
+
def debug: (String message) -> untyped
|
|
4
|
+
def info: (String message) -> untyped
|
|
5
|
+
def warn: (String message) -> untyped
|
|
6
|
+
def error: (String message) -> untyped
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class ResponseMetadata
|
|
10
|
+
attr_reader status: Integer
|
|
11
|
+
attr_reader headers: ::Hash[String, String]
|
|
12
|
+
attr_reader request_id: String?
|
|
13
|
+
|
|
14
|
+
def initialize: (status: Integer, headers: ::Hash[String, String]) -> void
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class RetryEvent
|
|
18
|
+
attr_reader attempt: Integer
|
|
19
|
+
attr_reader max_attempts: Integer
|
|
20
|
+
attr_reader delay: Float
|
|
21
|
+
attr_reader response: OpenAI::ResponseMetadata?
|
|
22
|
+
attr_reader error: OpenAI::Errors::APIConnectionError?
|
|
23
|
+
|
|
24
|
+
def initialize: (
|
|
25
|
+
attempt: Integer,
|
|
26
|
+
max_attempts: Integer,
|
|
27
|
+
delay: Float,
|
|
28
|
+
response: OpenAI::ResponseMetadata?,
|
|
29
|
+
error: OpenAI::Errors::APIConnectionError?
|
|
30
|
+
) -> void
|
|
31
|
+
|
|
32
|
+
def status: -> Integer?
|
|
33
|
+
def request_id: -> String?
|
|
34
|
+
end
|
|
35
|
+
|
|
2
36
|
interface _HTTPClient
|
|
3
37
|
def execute: (
|
|
4
38
|
OpenAI::HTTPClient::Request request
|
|
@@ -11,14 +45,14 @@ module OpenAI
|
|
|
11
45
|
attr_reader url: URI::Generic
|
|
12
46
|
attr_reader headers: ::Hash[String, String]
|
|
13
47
|
attr_reader body: top
|
|
14
|
-
attr_reader timeout: Float
|
|
48
|
+
attr_reader timeout: Float?
|
|
15
49
|
|
|
16
50
|
def initialize: (
|
|
17
51
|
method: Symbol,
|
|
18
52
|
url: URI::Generic,
|
|
19
53
|
headers: ::Hash[String, String],
|
|
20
54
|
body: top,
|
|
21
|
-
timeout: Float
|
|
55
|
+
timeout: Float?
|
|
22
56
|
) -> void
|
|
23
57
|
end
|
|
24
58
|
|
|
@@ -26,6 +60,7 @@ module OpenAI
|
|
|
26
60
|
attr_reader status: Integer
|
|
27
61
|
attr_reader headers: ::Hash[String, String]
|
|
28
62
|
attr_reader body: Enumerable[String]
|
|
63
|
+
attr_reader metadata: OpenAI::ResponseMetadata
|
|
29
64
|
|
|
30
65
|
def initialize: (
|
|
31
66
|
status: Integer,
|