openai 0.18.1 → 0.20.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 (186) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/helpers/structured_output/boolean.rb +1 -0
  6. data/lib/openai/internal/conversation_cursor_page.rb +92 -0
  7. data/lib/openai/internal/transport/base_client.rb +1 -4
  8. data/lib/openai/internal/transport/pooled_net_requester.rb +1 -9
  9. data/lib/openai/internal/util.rb +1 -1
  10. data/lib/openai/models/audio/transcription.rb +1 -4
  11. data/lib/openai/models/audio/transcription_create_params.rb +2 -7
  12. data/lib/openai/models/audio/transcription_text_done_event.rb +1 -4
  13. data/lib/openai/models/beta/assistant_create_params.rb +6 -19
  14. data/lib/openai/models/beta/assistant_stream_event.rb +6 -24
  15. data/lib/openai/models/beta/assistant_update_params.rb +1 -4
  16. data/lib/openai/models/beta/message_stream_event.rb +1 -4
  17. data/lib/openai/models/beta/run_step_stream_event.rb +1 -4
  18. data/lib/openai/models/beta/thread_create_and_run_params.rb +10 -32
  19. data/lib/openai/models/beta/thread_create_params.rb +7 -22
  20. data/lib/openai/models/beta/threads/message.rb +3 -10
  21. data/lib/openai/models/beta/threads/message_create_params.rb +2 -7
  22. data/lib/openai/models/beta/threads/run.rb +2 -7
  23. data/lib/openai/models/beta/threads/run_create_params.rb +3 -10
  24. data/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +1 -3
  25. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +5 -17
  26. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +1 -3
  27. data/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +4 -12
  28. data/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +1 -4
  29. data/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +1 -4
  30. data/lib/openai/models/beta/threads/text.rb +1 -4
  31. data/lib/openai/models/chat/chat_completion_chunk.rb +1 -3
  32. data/lib/openai/models/chat/chat_completion_custom_tool.rb +2 -7
  33. data/lib/openai/models/chat/chat_completion_message.rb +7 -5
  34. data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +7 -5
  35. data/lib/openai/models/conversations/computer_screenshot_content.rb +38 -0
  36. data/lib/openai/models/conversations/container_file_citation_body.rb +58 -0
  37. data/lib/openai/models/conversations/conversation.rb +51 -0
  38. data/lib/openai/models/conversations/conversation_create_params.rb +39 -0
  39. data/lib/openai/models/conversations/conversation_delete_params.rb +16 -0
  40. data/lib/openai/models/conversations/conversation_deleted.rb +29 -0
  41. data/lib/openai/models/conversations/conversation_deleted_resource.rb +30 -0
  42. data/lib/openai/models/conversations/conversation_item.rb +568 -0
  43. data/lib/openai/models/conversations/conversation_item_list.rb +55 -0
  44. data/lib/openai/models/conversations/conversation_retrieve_params.rb +16 -0
  45. data/lib/openai/models/conversations/conversation_update_params.rb +31 -0
  46. data/lib/openai/models/conversations/file_citation_body.rb +42 -0
  47. data/lib/openai/models/conversations/input_file_content.rb +42 -0
  48. data/lib/openai/models/conversations/input_image_content.rb +62 -0
  49. data/lib/openai/models/conversations/input_text_content.rb +26 -0
  50. data/lib/openai/models/conversations/item_create_params.rb +37 -0
  51. data/lib/openai/models/conversations/item_delete_params.rb +22 -0
  52. data/lib/openai/models/conversations/item_list_params.rb +86 -0
  53. data/lib/openai/models/conversations/item_retrieve_params.rb +36 -0
  54. data/lib/openai/models/conversations/lob_prob.rb +35 -0
  55. data/lib/openai/models/conversations/message.rb +115 -0
  56. data/lib/openai/models/conversations/output_text_content.rb +57 -0
  57. data/lib/openai/models/conversations/refusal_content.rb +26 -0
  58. data/lib/openai/models/conversations/summary_text_content.rb +23 -0
  59. data/lib/openai/models/conversations/text_content.rb +23 -0
  60. data/lib/openai/models/conversations/top_log_prob.rb +29 -0
  61. data/lib/openai/models/conversations/url_citation_body.rb +50 -0
  62. data/lib/openai/models/eval_create_params.rb +6 -20
  63. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +29 -53
  64. data/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb +1 -3
  65. data/lib/openai/models/evals/run_cancel_response.rb +2 -2
  66. data/lib/openai/models/evals/run_create_params.rb +20 -56
  67. data/lib/openai/models/evals/run_create_response.rb +2 -2
  68. data/lib/openai/models/evals/run_list_response.rb +2 -2
  69. data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
  70. data/lib/openai/models/fine_tuning/reinforcement_hyperparameters.rb +1 -4
  71. data/lib/openai/models/moderation.rb +5 -15
  72. data/lib/openai/models/responses/input_item_list_params.rb +1 -9
  73. data/lib/openai/models/responses/response.rb +28 -3
  74. data/lib/openai/models/responses/response_computer_tool_call.rb +2 -6
  75. data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +1 -3
  76. data/lib/openai/models/responses/response_conversation_param.rb +20 -0
  77. data/lib/openai/models/responses/response_create_params.rb +38 -3
  78. data/lib/openai/models/responses/response_function_tool_call.rb +7 -5
  79. data/lib/openai/models/responses/response_function_web_search.rb +35 -1
  80. data/lib/openai/models/responses/response_includable.rb +2 -0
  81. data/lib/openai/models/responses/response_input_item.rb +2 -7
  82. data/lib/openai/models/responses/response_input_message_item.rb +1 -4
  83. data/lib/openai/models/responses/response_output_item.rb +1 -3
  84. data/lib/openai/models/responses/response_output_message.rb +1 -3
  85. data/lib/openai/models/responses/response_output_text.rb +10 -15
  86. data/lib/openai/models/responses/response_stream_event.rb +4 -16
  87. data/lib/openai/models/responses/response_text_delta_event.rb +1 -3
  88. data/lib/openai/models/responses/response_text_done_event.rb +1 -3
  89. data/lib/openai/models/responses/tool.rb +303 -35
  90. data/lib/openai/models.rb +2 -0
  91. data/lib/openai/resources/conversations/items.rb +141 -0
  92. data/lib/openai/resources/conversations.rb +112 -0
  93. data/lib/openai/resources/responses/input_items.rb +1 -3
  94. data/lib/openai/resources/responses.rb +8 -4
  95. data/lib/openai/version.rb +1 -1
  96. data/lib/openai.rb +31 -0
  97. data/rbi/openai/client.rbi +3 -0
  98. data/rbi/openai/errors.rbi +5 -5
  99. data/rbi/openai/internal/conversation_cursor_page.rbi +25 -0
  100. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +60 -0
  101. data/rbi/openai/models/conversations/container_file_citation_body.rbi +82 -0
  102. data/rbi/openai/models/conversations/conversation.rbi +76 -0
  103. data/rbi/openai/models/conversations/conversation_create_params.rbi +144 -0
  104. data/rbi/openai/models/conversations/conversation_delete_params.rbi +32 -0
  105. data/rbi/openai/models/conversations/conversation_deleted.rbi +40 -0
  106. data/rbi/openai/models/conversations/conversation_deleted_resource.rbi +40 -0
  107. data/rbi/openai/models/conversations/conversation_item.rbi +835 -0
  108. data/rbi/openai/models/conversations/conversation_item_list.rbi +101 -0
  109. data/rbi/openai/models/conversations/conversation_retrieve_params.rbi +32 -0
  110. data/rbi/openai/models/conversations/conversation_update_params.rbi +56 -0
  111. data/rbi/openai/models/conversations/file_citation_body.rbi +61 -0
  112. data/rbi/openai/models/conversations/input_file_content.rbi +72 -0
  113. data/rbi/openai/models/conversations/input_image_content.rbi +113 -0
  114. data/rbi/openai/models/conversations/input_text_content.rbi +38 -0
  115. data/rbi/openai/models/conversations/item_create_params.rbi +150 -0
  116. data/rbi/openai/models/conversations/item_delete_params.rbi +40 -0
  117. data/rbi/openai/models/conversations/item_list_params.rbi +178 -0
  118. data/rbi/openai/models/conversations/item_retrieve_params.rbi +70 -0
  119. data/rbi/openai/models/conversations/lob_prob.rbi +50 -0
  120. data/rbi/openai/models/conversations/message.rbi +196 -0
  121. data/rbi/openai/models/conversations/output_text_content.rbi +110 -0
  122. data/rbi/openai/models/conversations/refusal_content.rbi +38 -0
  123. data/rbi/openai/models/conversations/summary_text_content.rbi +31 -0
  124. data/rbi/openai/models/conversations/text_content.rbi +28 -0
  125. data/rbi/openai/models/conversations/top_log_prob.rbi +41 -0
  126. data/rbi/openai/models/conversations/url_citation_body.rbi +74 -0
  127. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +33 -33
  128. data/rbi/openai/models/evals/run_cancel_response.rbi +2 -0
  129. data/rbi/openai/models/evals/run_create_params.rbi +4 -0
  130. data/rbi/openai/models/evals/run_create_response.rbi +2 -0
  131. data/rbi/openai/models/evals/run_list_response.rbi +2 -0
  132. data/rbi/openai/models/evals/run_retrieve_response.rbi +2 -0
  133. data/rbi/openai/models/responses/input_item_list_params.rbi +0 -11
  134. data/rbi/openai/models/responses/response.rbi +50 -0
  135. data/rbi/openai/models/responses/response_conversation_param.rbi +33 -0
  136. data/rbi/openai/models/responses/response_create_params.rbi +62 -0
  137. data/rbi/openai/models/responses/response_function_web_search.rbi +78 -2
  138. data/rbi/openai/models/responses/response_includable.rbi +2 -0
  139. data/rbi/openai/models/responses/tool.rbi +590 -31
  140. data/rbi/openai/models.rbi +2 -0
  141. data/rbi/openai/resources/conversations/items.rbi +154 -0
  142. data/rbi/openai/resources/conversations.rbi +110 -0
  143. data/rbi/openai/resources/responses/input_items.rbi +0 -3
  144. data/rbi/openai/resources/responses.rbi +32 -0
  145. data/sig/openai/client.rbs +2 -0
  146. data/sig/openai/internal/conversation_cursor_page.rbs +15 -0
  147. data/sig/openai/models/conversations/computer_screenshot_content.rbs +28 -0
  148. data/sig/openai/models/conversations/container_file_citation_body.rbs +47 -0
  149. data/sig/openai/models/conversations/conversation.rbs +37 -0
  150. data/sig/openai/models/conversations/conversation_create_params.rbs +33 -0
  151. data/sig/openai/models/conversations/conversation_delete_params.rbs +17 -0
  152. data/sig/openai/models/conversations/conversation_deleted.rbs +28 -0
  153. data/sig/openai/models/conversations/conversation_deleted_resource.rbs +28 -0
  154. data/sig/openai/models/conversations/conversation_item.rbs +403 -0
  155. data/sig/openai/models/conversations/conversation_item_list.rbs +44 -0
  156. data/sig/openai/models/conversations/conversation_retrieve_params.rbs +17 -0
  157. data/sig/openai/models/conversations/conversation_update_params.rbs +26 -0
  158. data/sig/openai/models/conversations/file_citation_body.rbs +37 -0
  159. data/sig/openai/models/conversations/input_file_content.rbs +41 -0
  160. data/sig/openai/models/conversations/input_image_content.rbs +49 -0
  161. data/sig/openai/models/conversations/input_text_content.rbs +17 -0
  162. data/sig/openai/models/conversations/item_create_params.rbs +37 -0
  163. data/sig/openai/models/conversations/item_delete_params.rbs +25 -0
  164. data/sig/openai/models/conversations/item_list_params.rbs +66 -0
  165. data/sig/openai/models/conversations/item_retrieve_params.rbs +37 -0
  166. data/sig/openai/models/conversations/lob_prob.rbs +37 -0
  167. data/sig/openai/models/conversations/message.rbs +95 -0
  168. data/sig/openai/models/conversations/output_text_content.rbs +52 -0
  169. data/sig/openai/models/conversations/refusal_content.rbs +17 -0
  170. data/sig/openai/models/conversations/summary_text_content.rbs +17 -0
  171. data/sig/openai/models/conversations/text_content.rbs +17 -0
  172. data/sig/openai/models/conversations/top_log_prob.rbs +28 -0
  173. data/sig/openai/models/conversations/url_citation_body.rbs +42 -0
  174. data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +22 -22
  175. data/sig/openai/models/responses/input_item_list_params.rbs +0 -7
  176. data/sig/openai/models/responses/response.rbs +15 -0
  177. data/sig/openai/models/responses/response_conversation_param.rbs +15 -0
  178. data/sig/openai/models/responses/response_create_params.rbs +14 -0
  179. data/sig/openai/models/responses/response_function_web_search.rbs +34 -3
  180. data/sig/openai/models/responses/tool.rbs +204 -18
  181. data/sig/openai/models.rbs +2 -0
  182. data/sig/openai/resources/conversations/items.rbs +38 -0
  183. data/sig/openai/resources/conversations.rbs +31 -0
  184. data/sig/openai/resources/responses/input_items.rbs +0 -1
  185. data/sig/openai/resources/responses.rbs +2 -0
  186. metadata +95 -2
@@ -40,16 +40,47 @@ module OpenAI
40
40
  module Action
41
41
  extend OpenAI::Internal::Type::Union
42
42
 
43
- type search = { query: String, type: :search }
43
+ type search =
44
+ {
45
+ query: String,
46
+ type: :search,
47
+ sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]
48
+ }
44
49
 
45
50
  class Search < OpenAI::Internal::Type::BaseModel
46
51
  attr_accessor query: String
47
52
 
48
53
  attr_accessor type: :search
49
54
 
50
- def initialize: (query: String, ?type: :search) -> void
55
+ attr_reader sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]?
51
56
 
52
- def to_hash: -> { query: String, type: :search }
57
+ def sources=: (
58
+ ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]
59
+ ) -> ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]
60
+
61
+ def initialize: (
62
+ query: String,
63
+ ?sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source],
64
+ ?type: :search
65
+ ) -> void
66
+
67
+ def to_hash: -> {
68
+ query: String,
69
+ type: :search,
70
+ sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]
71
+ }
72
+
73
+ type source = { type: :url, url: String }
74
+
75
+ class Source < OpenAI::Internal::Type::BaseModel
76
+ attr_accessor type: :url
77
+
78
+ attr_accessor url: String
79
+
80
+ def initialize: (url: String, ?type: :url) -> void
81
+
82
+ def to_hash: -> { type: :url, url: String }
83
+ end
53
84
  end
54
85
 
55
86
  type open_page = { type: :open_page, url: String }
@@ -10,31 +10,162 @@ module OpenAI
10
10
  | OpenAI::Responses::Tool::ImageGeneration
11
11
  | OpenAI::Responses::Tool::LocalShell
12
12
  | OpenAI::Responses::CustomTool
13
+ | OpenAI::Responses::Tool::WebSearchTool
13
14
  | OpenAI::Responses::WebSearchTool
14
15
 
15
16
  module Tool
16
17
  extend OpenAI::Internal::Type::Union
17
18
 
19
+ type web_search_tool =
20
+ {
21
+ type: OpenAI::Models::Responses::Tool::WebSearchTool::type_,
22
+ filters: OpenAI::Responses::Tool::WebSearchTool::Filters?,
23
+ search_context_size: OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size,
24
+ user_location: OpenAI::Responses::Tool::WebSearchTool::UserLocation?
25
+ }
26
+
27
+ class WebSearchTool < OpenAI::Internal::Type::BaseModel
28
+ attr_accessor type: OpenAI::Models::Responses::Tool::WebSearchTool::type_
29
+
30
+ attr_accessor filters: OpenAI::Responses::Tool::WebSearchTool::Filters?
31
+
32
+ attr_reader search_context_size: OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size?
33
+
34
+ def search_context_size=: (
35
+ OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size
36
+ ) -> OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size
37
+
38
+ attr_accessor user_location: OpenAI::Responses::Tool::WebSearchTool::UserLocation?
39
+
40
+ def initialize: (
41
+ type: OpenAI::Models::Responses::Tool::WebSearchTool::type_,
42
+ ?filters: OpenAI::Responses::Tool::WebSearchTool::Filters?,
43
+ ?search_context_size: OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size,
44
+ ?user_location: OpenAI::Responses::Tool::WebSearchTool::UserLocation?
45
+ ) -> void
46
+
47
+ def to_hash: -> {
48
+ type: OpenAI::Models::Responses::Tool::WebSearchTool::type_,
49
+ filters: OpenAI::Responses::Tool::WebSearchTool::Filters?,
50
+ search_context_size: OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size,
51
+ user_location: OpenAI::Responses::Tool::WebSearchTool::UserLocation?
52
+ }
53
+
54
+ type type_ = :web_search | :web_search_2025_08_26
55
+
56
+ module Type
57
+ extend OpenAI::Internal::Type::Enum
58
+
59
+ WEB_SEARCH: :web_search
60
+ WEB_SEARCH_2025_08_26: :web_search_2025_08_26
61
+
62
+ def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::WebSearchTool::type_]
63
+ end
64
+
65
+ type filters = { allowed_domains: ::Array[String]? }
66
+
67
+ class Filters < OpenAI::Internal::Type::BaseModel
68
+ attr_accessor allowed_domains: ::Array[String]?
69
+
70
+ def initialize: (?allowed_domains: ::Array[String]?) -> void
71
+
72
+ def to_hash: -> { allowed_domains: ::Array[String]? }
73
+ end
74
+
75
+ type search_context_size = :low | :medium | :high
76
+
77
+ module SearchContextSize
78
+ extend OpenAI::Internal::Type::Enum
79
+
80
+ LOW: :low
81
+ MEDIUM: :medium
82
+ HIGH: :high
83
+
84
+ def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::WebSearchTool::search_context_size]
85
+ end
86
+
87
+ type user_location =
88
+ {
89
+ city: String?,
90
+ country: String?,
91
+ region: String?,
92
+ timezone: String?,
93
+ type: OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_
94
+ }
95
+
96
+ class UserLocation < OpenAI::Internal::Type::BaseModel
97
+ attr_accessor city: String?
98
+
99
+ attr_accessor country: String?
100
+
101
+ attr_accessor region: String?
102
+
103
+ attr_accessor timezone: String?
104
+
105
+ attr_reader type: OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_?
106
+
107
+ def type=: (
108
+ OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_
109
+ ) -> OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_
110
+
111
+ def initialize: (
112
+ ?city: String?,
113
+ ?country: String?,
114
+ ?region: String?,
115
+ ?timezone: String?,
116
+ ?type: OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_
117
+ ) -> void
118
+
119
+ def to_hash: -> {
120
+ city: String?,
121
+ country: String?,
122
+ region: String?,
123
+ timezone: String?,
124
+ type: OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_
125
+ }
126
+
127
+ type type_ = :approximate
128
+
129
+ module Type
130
+ extend OpenAI::Internal::Type::Enum
131
+
132
+ APPROXIMATE: :approximate
133
+
134
+ def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::WebSearchTool::UserLocation::type_]
135
+ end
136
+ end
137
+ end
138
+
18
139
  type mcp =
19
140
  {
20
141
  server_label: String,
21
- server_url: String,
22
142
  type: :mcp,
23
143
  allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?,
144
+ authorization: String,
145
+ connector_id: OpenAI::Models::Responses::Tool::Mcp::connector_id,
24
146
  headers: ::Hash[Symbol, String]?,
25
147
  require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?,
26
- server_description: String
148
+ server_description: String,
149
+ server_url: String
27
150
  }
28
151
 
29
152
  class Mcp < OpenAI::Internal::Type::BaseModel
30
153
  attr_accessor server_label: String
31
154
 
32
- attr_accessor server_url: String
33
-
34
155
  attr_accessor type: :mcp
35
156
 
36
157
  attr_accessor allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?
37
158
 
159
+ attr_reader authorization: String?
160
+
161
+ def authorization=: (String) -> String
162
+
163
+ attr_reader connector_id: OpenAI::Models::Responses::Tool::Mcp::connector_id?
164
+
165
+ def connector_id=: (
166
+ OpenAI::Models::Responses::Tool::Mcp::connector_id
167
+ ) -> OpenAI::Models::Responses::Tool::Mcp::connector_id
168
+
38
169
  attr_accessor headers: ::Hash[Symbol, String]?
39
170
 
40
171
  attr_accessor require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?
@@ -43,43 +174,59 @@ module OpenAI
43
174
 
44
175
  def server_description=: (String) -> String
45
176
 
177
+ attr_reader server_url: String?
178
+
179
+ def server_url=: (String) -> String
180
+
46
181
  def initialize: (
47
182
  server_label: String,
48
- server_url: String,
49
183
  ?allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?,
184
+ ?authorization: String,
185
+ ?connector_id: OpenAI::Models::Responses::Tool::Mcp::connector_id,
50
186
  ?headers: ::Hash[Symbol, String]?,
51
187
  ?require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?,
52
188
  ?server_description: String,
189
+ ?server_url: String,
53
190
  ?type: :mcp
54
191
  ) -> void
55
192
 
56
193
  def to_hash: -> {
57
194
  server_label: String,
58
- server_url: String,
59
195
  type: :mcp,
60
196
  allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?,
197
+ authorization: String,
198
+ connector_id: OpenAI::Models::Responses::Tool::Mcp::connector_id,
61
199
  headers: ::Hash[Symbol, String]?,
62
200
  require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?,
63
- server_description: String
201
+ server_description: String,
202
+ server_url: String
64
203
  }
65
204
 
66
205
  type allowed_tools =
67
206
  ::Array[String]
68
- | OpenAI::Responses::Tool::Mcp::AllowedTools::McpAllowedToolsFilter
207
+ | OpenAI::Responses::Tool::Mcp::AllowedTools::McpToolFilter
69
208
 
70
209
  module AllowedTools
71
210
  extend OpenAI::Internal::Type::Union
72
211
 
73
- type mcp_allowed_tools_filter = { tool_names: ::Array[String] }
212
+ type mcp_tool_filter =
213
+ { read_only: bool, tool_names: ::Array[String] }
214
+
215
+ class McpToolFilter < OpenAI::Internal::Type::BaseModel
216
+ attr_reader read_only: bool?
217
+
218
+ def read_only=: (bool) -> bool
74
219
 
75
- class McpAllowedToolsFilter < OpenAI::Internal::Type::BaseModel
76
220
  attr_reader tool_names: ::Array[String]?
77
221
 
78
222
  def tool_names=: (::Array[String]) -> ::Array[String]
79
223
 
80
- def initialize: (?tool_names: ::Array[String]) -> void
224
+ def initialize: (
225
+ ?read_only: bool,
226
+ ?tool_names: ::Array[String]
227
+ ) -> void
81
228
 
82
- def to_hash: -> { tool_names: ::Array[String] }
229
+ def to_hash: -> { read_only: bool, tool_names: ::Array[String] }
83
230
  end
84
231
 
85
232
  def self?.variants: -> ::Array[OpenAI::Models::Responses::Tool::Mcp::allowed_tools]
@@ -87,6 +234,31 @@ module OpenAI
87
234
  StringArray: OpenAI::Internal::Type::Converter
88
235
  end
89
236
 
237
+ type connector_id =
238
+ :connector_dropbox
239
+ | :connector_gmail
240
+ | :connector_googlecalendar
241
+ | :connector_googledrive
242
+ | :connector_microsoftteams
243
+ | :connector_outlookcalendar
244
+ | :connector_outlookemail
245
+ | :connector_sharepoint
246
+
247
+ module ConnectorID
248
+ extend OpenAI::Internal::Type::Enum
249
+
250
+ CONNECTOR_DROPBOX: :connector_dropbox
251
+ CONNECTOR_GMAIL: :connector_gmail
252
+ CONNECTOR_GOOGLECALENDAR: :connector_googlecalendar
253
+ CONNECTOR_GOOGLEDRIVE: :connector_googledrive
254
+ CONNECTOR_MICROSOFTTEAMS: :connector_microsoftteams
255
+ CONNECTOR_OUTLOOKCALENDAR: :connector_outlookcalendar
256
+ CONNECTOR_OUTLOOKEMAIL: :connector_outlookemail
257
+ CONNECTOR_SHAREPOINT: :connector_sharepoint
258
+
259
+ def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::Mcp::connector_id]
260
+ end
261
+
90
262
  type require_approval =
91
263
  OpenAI::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter
92
264
  | OpenAI::Models::Responses::Tool::Mcp::RequireApproval::mcp_tool_approval_setting
@@ -123,28 +295,42 @@ module OpenAI
123
295
  never: OpenAI::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never
124
296
  }
125
297
 
126
- type always = { tool_names: ::Array[String] }
298
+ type always = { read_only: bool, tool_names: ::Array[String] }
127
299
 
128
300
  class Always < OpenAI::Internal::Type::BaseModel
301
+ attr_reader read_only: bool?
302
+
303
+ def read_only=: (bool) -> bool
304
+
129
305
  attr_reader tool_names: ::Array[String]?
130
306
 
131
307
  def tool_names=: (::Array[String]) -> ::Array[String]
132
308
 
133
- def initialize: (?tool_names: ::Array[String]) -> void
309
+ def initialize: (
310
+ ?read_only: bool,
311
+ ?tool_names: ::Array[String]
312
+ ) -> void
134
313
 
135
- def to_hash: -> { tool_names: ::Array[String] }
314
+ def to_hash: -> { read_only: bool, tool_names: ::Array[String] }
136
315
  end
137
316
 
138
- type never = { tool_names: ::Array[String] }
317
+ type never = { read_only: bool, tool_names: ::Array[String] }
139
318
 
140
319
  class Never < OpenAI::Internal::Type::BaseModel
320
+ attr_reader read_only: bool?
321
+
322
+ def read_only=: (bool) -> bool
323
+
141
324
  attr_reader tool_names: ::Array[String]?
142
325
 
143
326
  def tool_names=: (::Array[String]) -> ::Array[String]
144
327
 
145
- def initialize: (?tool_names: ::Array[String]) -> void
328
+ def initialize: (
329
+ ?read_only: bool,
330
+ ?tool_names: ::Array[String]
331
+ ) -> void
146
332
 
147
- def to_hash: -> { tool_names: ::Array[String] }
333
+ def to_hash: -> { read_only: bool, tool_names: ::Array[String] }
148
334
  end
149
335
  end
150
336
 
@@ -51,6 +51,8 @@ module OpenAI
51
51
 
52
52
  module Containers = OpenAI::Models::Containers
53
53
 
54
+ module Conversations = OpenAI::Models::Conversations
55
+
54
56
  class CreateEmbeddingResponse = OpenAI::Models::CreateEmbeddingResponse
55
57
 
56
58
  module CustomToolInputFormat = OpenAI::Models::CustomToolInputFormat
@@ -0,0 +1,38 @@
1
+ module OpenAI
2
+ module Resources
3
+ class Conversations
4
+ class Items
5
+ def create: (
6
+ String conversation_id,
7
+ items: ::Array[OpenAI::Models::Responses::response_input_item],
8
+ ?include: ::Array[OpenAI::Models::Responses::response_includable],
9
+ ?request_options: OpenAI::request_opts
10
+ ) -> OpenAI::Conversations::ConversationItemList
11
+
12
+ def retrieve: (
13
+ String item_id,
14
+ conversation_id: String,
15
+ ?include: ::Array[OpenAI::Models::Responses::response_includable],
16
+ ?request_options: OpenAI::request_opts
17
+ ) -> OpenAI::Models::Conversations::conversation_item
18
+
19
+ def list: (
20
+ String conversation_id,
21
+ ?after: String,
22
+ ?include: ::Array[OpenAI::Models::Responses::response_includable],
23
+ ?limit: Integer,
24
+ ?order: OpenAI::Models::Conversations::ItemListParams::order,
25
+ ?request_options: OpenAI::request_opts
26
+ ) -> OpenAI::Internal::ConversationCursorPage[OpenAI::Models::Conversations::conversation_item]
27
+
28
+ def delete: (
29
+ String item_id,
30
+ conversation_id: String,
31
+ ?request_options: OpenAI::request_opts
32
+ ) -> OpenAI::Conversations::Conversation
33
+
34
+ def initialize: (client: OpenAI::Client) -> void
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,31 @@
1
+ module OpenAI
2
+ module Resources
3
+ class Conversations
4
+ attr_reader items: OpenAI::Resources::Conversations::Items
5
+
6
+ def create: (
7
+ ?items: ::Array[OpenAI::Models::Responses::response_input_item]?,
8
+ ?metadata: OpenAI::Models::metadata?,
9
+ ?request_options: OpenAI::request_opts
10
+ ) -> OpenAI::Conversations::Conversation
11
+
12
+ def retrieve: (
13
+ String conversation_id,
14
+ ?request_options: OpenAI::request_opts
15
+ ) -> OpenAI::Conversations::Conversation
16
+
17
+ def update: (
18
+ String conversation_id,
19
+ metadata: ::Hash[Symbol, String],
20
+ ?request_options: OpenAI::request_opts
21
+ ) -> OpenAI::Conversations::Conversation
22
+
23
+ def delete: (
24
+ String conversation_id,
25
+ ?request_options: OpenAI::request_opts
26
+ ) -> OpenAI::Conversations::ConversationDeletedResource
27
+
28
+ def initialize: (client: OpenAI::Client) -> void
29
+ end
30
+ end
31
+ end
@@ -5,7 +5,6 @@ module OpenAI
5
5
  def list: (
6
6
  String response_id,
7
7
  ?after: String,
8
- ?before: String,
9
8
  ?include: ::Array[OpenAI::Models::Responses::response_includable],
10
9
  ?limit: Integer,
11
10
  ?order: OpenAI::Models::Responses::InputItemListParams::order,
@@ -5,6 +5,7 @@ module OpenAI
5
5
 
6
6
  def create: (
7
7
  ?background: bool?,
8
+ ?conversation: OpenAI::Models::Responses::ResponseCreateParams::conversation?,
8
9
  ?include: ::Array[OpenAI::Models::Responses::response_includable]?,
9
10
  ?input: OpenAI::Models::Responses::ResponseCreateParams::input,
10
11
  ?instructions: String?,
@@ -34,6 +35,7 @@ module OpenAI
34
35
 
35
36
  def stream_raw: (
36
37
  ?background: bool?,
38
+ ?conversation: OpenAI::Models::Responses::ResponseCreateParams::conversation?,
37
39
  ?include: ::Array[OpenAI::Models::Responses::response_includable]?,
38
40
  ?input: OpenAI::Models::Responses::ResponseCreateParams::input,
39
41
  ?instructions: String?,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-19 00:00:00.000000000 Z
11
+ date: 2025-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -50,6 +50,7 @@ files:
50
50
  - lib/openai/helpers/structured_output/parsed_json.rb
51
51
  - lib/openai/helpers/structured_output/union_of.rb
52
52
  - lib/openai/internal.rb
53
+ - lib/openai/internal/conversation_cursor_page.rb
53
54
  - lib/openai/internal/cursor_page.rb
54
55
  - lib/openai/internal/page.rb
55
56
  - lib/openai/internal/stream.rb
@@ -250,6 +251,33 @@ files:
250
251
  - lib/openai/models/containers/file_retrieve_params.rb
251
252
  - lib/openai/models/containers/file_retrieve_response.rb
252
253
  - lib/openai/models/containers/files/content_retrieve_params.rb
254
+ - lib/openai/models/conversations/computer_screenshot_content.rb
255
+ - lib/openai/models/conversations/container_file_citation_body.rb
256
+ - lib/openai/models/conversations/conversation.rb
257
+ - lib/openai/models/conversations/conversation_create_params.rb
258
+ - lib/openai/models/conversations/conversation_delete_params.rb
259
+ - lib/openai/models/conversations/conversation_deleted.rb
260
+ - lib/openai/models/conversations/conversation_deleted_resource.rb
261
+ - lib/openai/models/conversations/conversation_item.rb
262
+ - lib/openai/models/conversations/conversation_item_list.rb
263
+ - lib/openai/models/conversations/conversation_retrieve_params.rb
264
+ - lib/openai/models/conversations/conversation_update_params.rb
265
+ - lib/openai/models/conversations/file_citation_body.rb
266
+ - lib/openai/models/conversations/input_file_content.rb
267
+ - lib/openai/models/conversations/input_image_content.rb
268
+ - lib/openai/models/conversations/input_text_content.rb
269
+ - lib/openai/models/conversations/item_create_params.rb
270
+ - lib/openai/models/conversations/item_delete_params.rb
271
+ - lib/openai/models/conversations/item_list_params.rb
272
+ - lib/openai/models/conversations/item_retrieve_params.rb
273
+ - lib/openai/models/conversations/lob_prob.rb
274
+ - lib/openai/models/conversations/message.rb
275
+ - lib/openai/models/conversations/output_text_content.rb
276
+ - lib/openai/models/conversations/refusal_content.rb
277
+ - lib/openai/models/conversations/summary_text_content.rb
278
+ - lib/openai/models/conversations/text_content.rb
279
+ - lib/openai/models/conversations/top_log_prob.rb
280
+ - lib/openai/models/conversations/url_citation_body.rb
253
281
  - lib/openai/models/create_embedding_response.rb
254
282
  - lib/openai/models/custom_tool_input_format.rb
255
283
  - lib/openai/models/embedding.rb
@@ -392,6 +420,7 @@ files:
392
420
  - lib/openai/models/responses/response_content.rb
393
421
  - lib/openai/models/responses/response_content_part_added_event.rb
394
422
  - lib/openai/models/responses/response_content_part_done_event.rb
423
+ - lib/openai/models/responses/response_conversation_param.rb
395
424
  - lib/openai/models/responses/response_create_params.rb
396
425
  - lib/openai/models/responses/response_created_event.rb
397
426
  - lib/openai/models/responses/response_custom_tool_call.rb
@@ -545,6 +574,8 @@ files:
545
574
  - lib/openai/resources/containers.rb
546
575
  - lib/openai/resources/containers/files.rb
547
576
  - lib/openai/resources/containers/files/content.rb
577
+ - lib/openai/resources/conversations.rb
578
+ - lib/openai/resources/conversations/items.rb
548
579
  - lib/openai/resources/embeddings.rb
549
580
  - lib/openai/resources/evals.rb
550
581
  - lib/openai/resources/evals/runs.rb
@@ -588,6 +619,7 @@ files:
588
619
  - rbi/openai/helpers/structured_output/json_schema_converter.rbi
589
620
  - rbi/openai/helpers/structured_output/union_of.rbi
590
621
  - rbi/openai/internal.rbi
622
+ - rbi/openai/internal/conversation_cursor_page.rbi
591
623
  - rbi/openai/internal/cursor_page.rbi
592
624
  - rbi/openai/internal/page.rbi
593
625
  - rbi/openai/internal/stream.rbi
@@ -788,6 +820,33 @@ files:
788
820
  - rbi/openai/models/containers/file_retrieve_params.rbi
789
821
  - rbi/openai/models/containers/file_retrieve_response.rbi
790
822
  - rbi/openai/models/containers/files/content_retrieve_params.rbi
823
+ - rbi/openai/models/conversations/computer_screenshot_content.rbi
824
+ - rbi/openai/models/conversations/container_file_citation_body.rbi
825
+ - rbi/openai/models/conversations/conversation.rbi
826
+ - rbi/openai/models/conversations/conversation_create_params.rbi
827
+ - rbi/openai/models/conversations/conversation_delete_params.rbi
828
+ - rbi/openai/models/conversations/conversation_deleted.rbi
829
+ - rbi/openai/models/conversations/conversation_deleted_resource.rbi
830
+ - rbi/openai/models/conversations/conversation_item.rbi
831
+ - rbi/openai/models/conversations/conversation_item_list.rbi
832
+ - rbi/openai/models/conversations/conversation_retrieve_params.rbi
833
+ - rbi/openai/models/conversations/conversation_update_params.rbi
834
+ - rbi/openai/models/conversations/file_citation_body.rbi
835
+ - rbi/openai/models/conversations/input_file_content.rbi
836
+ - rbi/openai/models/conversations/input_image_content.rbi
837
+ - rbi/openai/models/conversations/input_text_content.rbi
838
+ - rbi/openai/models/conversations/item_create_params.rbi
839
+ - rbi/openai/models/conversations/item_delete_params.rbi
840
+ - rbi/openai/models/conversations/item_list_params.rbi
841
+ - rbi/openai/models/conversations/item_retrieve_params.rbi
842
+ - rbi/openai/models/conversations/lob_prob.rbi
843
+ - rbi/openai/models/conversations/message.rbi
844
+ - rbi/openai/models/conversations/output_text_content.rbi
845
+ - rbi/openai/models/conversations/refusal_content.rbi
846
+ - rbi/openai/models/conversations/summary_text_content.rbi
847
+ - rbi/openai/models/conversations/text_content.rbi
848
+ - rbi/openai/models/conversations/top_log_prob.rbi
849
+ - rbi/openai/models/conversations/url_citation_body.rbi
791
850
  - rbi/openai/models/create_embedding_response.rbi
792
851
  - rbi/openai/models/custom_tool_input_format.rbi
793
852
  - rbi/openai/models/embedding.rbi
@@ -930,6 +989,7 @@ files:
930
989
  - rbi/openai/models/responses/response_content.rbi
931
990
  - rbi/openai/models/responses/response_content_part_added_event.rbi
932
991
  - rbi/openai/models/responses/response_content_part_done_event.rbi
992
+ - rbi/openai/models/responses/response_conversation_param.rbi
933
993
  - rbi/openai/models/responses/response_create_params.rbi
934
994
  - rbi/openai/models/responses/response_created_event.rbi
935
995
  - rbi/openai/models/responses/response_custom_tool_call.rbi
@@ -1083,6 +1143,8 @@ files:
1083
1143
  - rbi/openai/resources/containers.rbi
1084
1144
  - rbi/openai/resources/containers/files.rbi
1085
1145
  - rbi/openai/resources/containers/files/content.rbi
1146
+ - rbi/openai/resources/conversations.rbi
1147
+ - rbi/openai/resources/conversations/items.rbi
1086
1148
  - rbi/openai/resources/embeddings.rbi
1087
1149
  - rbi/openai/resources/evals.rbi
1088
1150
  - rbi/openai/resources/evals/runs.rbi
@@ -1116,6 +1178,7 @@ files:
1116
1178
  - sig/openai/errors.rbs
1117
1179
  - sig/openai/file_part.rbs
1118
1180
  - sig/openai/internal.rbs
1181
+ - sig/openai/internal/conversation_cursor_page.rbs
1119
1182
  - sig/openai/internal/cursor_page.rbs
1120
1183
  - sig/openai/internal/page.rbs
1121
1184
  - sig/openai/internal/stream.rbs
@@ -1316,6 +1379,33 @@ files:
1316
1379
  - sig/openai/models/containers/file_retrieve_params.rbs
1317
1380
  - sig/openai/models/containers/file_retrieve_response.rbs
1318
1381
  - sig/openai/models/containers/files/content_retrieve_params.rbs
1382
+ - sig/openai/models/conversations/computer_screenshot_content.rbs
1383
+ - sig/openai/models/conversations/container_file_citation_body.rbs
1384
+ - sig/openai/models/conversations/conversation.rbs
1385
+ - sig/openai/models/conversations/conversation_create_params.rbs
1386
+ - sig/openai/models/conversations/conversation_delete_params.rbs
1387
+ - sig/openai/models/conversations/conversation_deleted.rbs
1388
+ - sig/openai/models/conversations/conversation_deleted_resource.rbs
1389
+ - sig/openai/models/conversations/conversation_item.rbs
1390
+ - sig/openai/models/conversations/conversation_item_list.rbs
1391
+ - sig/openai/models/conversations/conversation_retrieve_params.rbs
1392
+ - sig/openai/models/conversations/conversation_update_params.rbs
1393
+ - sig/openai/models/conversations/file_citation_body.rbs
1394
+ - sig/openai/models/conversations/input_file_content.rbs
1395
+ - sig/openai/models/conversations/input_image_content.rbs
1396
+ - sig/openai/models/conversations/input_text_content.rbs
1397
+ - sig/openai/models/conversations/item_create_params.rbs
1398
+ - sig/openai/models/conversations/item_delete_params.rbs
1399
+ - sig/openai/models/conversations/item_list_params.rbs
1400
+ - sig/openai/models/conversations/item_retrieve_params.rbs
1401
+ - sig/openai/models/conversations/lob_prob.rbs
1402
+ - sig/openai/models/conversations/message.rbs
1403
+ - sig/openai/models/conversations/output_text_content.rbs
1404
+ - sig/openai/models/conversations/refusal_content.rbs
1405
+ - sig/openai/models/conversations/summary_text_content.rbs
1406
+ - sig/openai/models/conversations/text_content.rbs
1407
+ - sig/openai/models/conversations/top_log_prob.rbs
1408
+ - sig/openai/models/conversations/url_citation_body.rbs
1319
1409
  - sig/openai/models/create_embedding_response.rbs
1320
1410
  - sig/openai/models/custom_tool_input_format.rbs
1321
1411
  - sig/openai/models/embedding.rbs
@@ -1458,6 +1548,7 @@ files:
1458
1548
  - sig/openai/models/responses/response_content.rbs
1459
1549
  - sig/openai/models/responses/response_content_part_added_event.rbs
1460
1550
  - sig/openai/models/responses/response_content_part_done_event.rbs
1551
+ - sig/openai/models/responses/response_conversation_param.rbs
1461
1552
  - sig/openai/models/responses/response_create_params.rbs
1462
1553
  - sig/openai/models/responses/response_created_event.rbs
1463
1554
  - sig/openai/models/responses/response_custom_tool_call.rbs
@@ -1611,6 +1702,8 @@ files:
1611
1702
  - sig/openai/resources/containers.rbs
1612
1703
  - sig/openai/resources/containers/files.rbs
1613
1704
  - sig/openai/resources/containers/files/content.rbs
1705
+ - sig/openai/resources/conversations.rbs
1706
+ - sig/openai/resources/conversations/items.rbs
1614
1707
  - sig/openai/resources/embeddings.rbs
1615
1708
  - sig/openai/resources/evals.rbs
1616
1709
  - sig/openai/resources/evals/runs.rbs