openai 0.17.1 → 0.19.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 (209) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/helpers/structured_output/array_of.rb +2 -10
  6. data/lib/openai/helpers/structured_output/base_model.rb +4 -11
  7. data/lib/openai/helpers/structured_output/boolean.rb +1 -0
  8. data/lib/openai/helpers/structured_output/json_schema_converter.rb +19 -3
  9. data/lib/openai/helpers/structured_output/union_of.rb +2 -10
  10. data/lib/openai/internal/conversation_cursor_page.rb +92 -0
  11. data/lib/openai/internal/transport/base_client.rb +1 -4
  12. data/lib/openai/internal/transport/pooled_net_requester.rb +1 -9
  13. data/lib/openai/internal/util.rb +1 -1
  14. data/lib/openai/models/audio/transcription.rb +1 -4
  15. data/lib/openai/models/audio/transcription_create_params.rb +2 -7
  16. data/lib/openai/models/audio/transcription_text_done_event.rb +1 -4
  17. data/lib/openai/models/batch_create_params.rb +38 -1
  18. data/lib/openai/models/beta/assistant_create_params.rb +6 -19
  19. data/lib/openai/models/beta/assistant_stream_event.rb +6 -24
  20. data/lib/openai/models/beta/assistant_update_params.rb +1 -4
  21. data/lib/openai/models/beta/message_stream_event.rb +1 -4
  22. data/lib/openai/models/beta/run_step_stream_event.rb +1 -4
  23. data/lib/openai/models/beta/thread_create_and_run_params.rb +12 -34
  24. data/lib/openai/models/beta/thread_create_params.rb +7 -22
  25. data/lib/openai/models/beta/threads/message.rb +3 -10
  26. data/lib/openai/models/beta/threads/message_create_params.rb +2 -7
  27. data/lib/openai/models/beta/threads/run.rb +4 -9
  28. data/lib/openai/models/beta/threads/run_create_params.rb +5 -12
  29. data/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +1 -3
  30. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +5 -17
  31. data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +1 -3
  32. data/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +4 -12
  33. data/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +1 -4
  34. data/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +1 -4
  35. data/lib/openai/models/beta/threads/text.rb +1 -4
  36. data/lib/openai/models/chat/chat_completion.rb +6 -6
  37. data/lib/openai/models/chat/chat_completion_chunk.rb +7 -9
  38. data/lib/openai/models/chat/chat_completion_custom_tool.rb +2 -7
  39. data/lib/openai/models/chat/completion_create_params.rb +7 -7
  40. data/lib/openai/models/conversations/computer_screenshot_content.rb +38 -0
  41. data/lib/openai/models/conversations/container_file_citation_body.rb +58 -0
  42. data/lib/openai/models/conversations/conversation.rb +51 -0
  43. data/lib/openai/models/conversations/conversation_create_params.rb +39 -0
  44. data/lib/openai/models/conversations/conversation_delete_params.rb +16 -0
  45. data/lib/openai/models/conversations/conversation_deleted.rb +29 -0
  46. data/lib/openai/models/conversations/conversation_deleted_resource.rb +30 -0
  47. data/lib/openai/models/conversations/conversation_item.rb +568 -0
  48. data/lib/openai/models/conversations/conversation_item_list.rb +55 -0
  49. data/lib/openai/models/conversations/conversation_retrieve_params.rb +16 -0
  50. data/lib/openai/models/conversations/conversation_update_params.rb +31 -0
  51. data/lib/openai/models/conversations/file_citation_body.rb +42 -0
  52. data/lib/openai/models/conversations/input_file_content.rb +42 -0
  53. data/lib/openai/models/conversations/input_image_content.rb +62 -0
  54. data/lib/openai/models/conversations/input_text_content.rb +26 -0
  55. data/lib/openai/models/conversations/item_create_params.rb +37 -0
  56. data/lib/openai/models/conversations/item_delete_params.rb +22 -0
  57. data/lib/openai/models/conversations/item_list_params.rb +84 -0
  58. data/lib/openai/models/conversations/item_retrieve_params.rb +36 -0
  59. data/lib/openai/models/conversations/lob_prob.rb +35 -0
  60. data/lib/openai/models/conversations/message.rb +115 -0
  61. data/lib/openai/models/conversations/output_text_content.rb +57 -0
  62. data/lib/openai/models/conversations/refusal_content.rb +26 -0
  63. data/lib/openai/models/conversations/summary_text_content.rb +23 -0
  64. data/lib/openai/models/conversations/text_content.rb +23 -0
  65. data/lib/openai/models/conversations/top_log_prob.rb +29 -0
  66. data/lib/openai/models/conversations/url_citation_body.rb +50 -0
  67. data/lib/openai/models/eval_create_params.rb +6 -20
  68. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +29 -53
  69. data/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb +1 -3
  70. data/lib/openai/models/evals/run_create_params.rb +18 -54
  71. data/lib/openai/models/file_create_params.rb +37 -1
  72. data/lib/openai/models/fine_tuning/reinforcement_hyperparameters.rb +1 -4
  73. data/lib/openai/models/graders/text_similarity_grader.rb +6 -5
  74. data/lib/openai/models/moderation.rb +5 -15
  75. data/lib/openai/models/reasoning.rb +1 -1
  76. data/lib/openai/models/responses/input_item_list_params.rb +1 -9
  77. data/lib/openai/models/responses/response.rb +32 -9
  78. data/lib/openai/models/responses/response_computer_tool_call.rb +2 -6
  79. data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +1 -3
  80. data/lib/openai/models/responses/response_conversation_param.rb +20 -0
  81. data/lib/openai/models/responses/response_create_params.rb +40 -9
  82. data/lib/openai/models/responses/response_input_item.rb +2 -7
  83. data/lib/openai/models/responses/response_input_message_item.rb +1 -4
  84. data/lib/openai/models/responses/response_output_item.rb +1 -3
  85. data/lib/openai/models/responses/response_output_message.rb +1 -3
  86. data/lib/openai/models/responses/response_output_text.rb +3 -10
  87. data/lib/openai/models/responses/response_stream_event.rb +4 -16
  88. data/lib/openai/models/responses/response_text_delta_event.rb +1 -3
  89. data/lib/openai/models/responses/response_text_done_event.rb +1 -3
  90. data/lib/openai/models/responses/tool.rb +145 -34
  91. data/lib/openai/models/upload_create_params.rb +37 -1
  92. data/lib/openai/models.rb +2 -0
  93. data/lib/openai/resources/batches.rb +3 -1
  94. data/lib/openai/resources/conversations/items.rb +141 -0
  95. data/lib/openai/resources/conversations.rb +112 -0
  96. data/lib/openai/resources/files.rb +4 -2
  97. data/lib/openai/resources/responses/input_items.rb +1 -3
  98. data/lib/openai/resources/responses.rb +8 -4
  99. data/lib/openai/resources/uploads.rb +3 -1
  100. data/lib/openai/version.rb +1 -1
  101. data/lib/openai.rb +31 -0
  102. data/rbi/openai/client.rbi +3 -0
  103. data/rbi/openai/errors.rbi +5 -5
  104. data/rbi/openai/helpers/structured_output/array_of.rbi +0 -3
  105. data/rbi/openai/helpers/structured_output/json_schema_converter.rbi +10 -0
  106. data/rbi/openai/internal/conversation_cursor_page.rbi +25 -0
  107. data/rbi/openai/models/batch_create_params.rbi +60 -0
  108. data/rbi/openai/models/beta/thread_create_and_run_params.rbi +3 -3
  109. data/rbi/openai/models/beta/threads/run.rbi +3 -3
  110. data/rbi/openai/models/beta/threads/run_create_params.rbi +3 -3
  111. data/rbi/openai/models/chat/chat_completion.rbi +6 -9
  112. data/rbi/openai/models/chat/chat_completion_chunk.rbi +6 -9
  113. data/rbi/openai/models/chat/completion_create_params.rbi +8 -11
  114. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +60 -0
  115. data/rbi/openai/models/conversations/container_file_citation_body.rbi +82 -0
  116. data/rbi/openai/models/conversations/conversation.rbi +76 -0
  117. data/rbi/openai/models/conversations/conversation_create_params.rbi +144 -0
  118. data/rbi/openai/models/conversations/conversation_delete_params.rbi +32 -0
  119. data/rbi/openai/models/conversations/conversation_deleted.rbi +40 -0
  120. data/rbi/openai/models/conversations/conversation_deleted_resource.rbi +40 -0
  121. data/rbi/openai/models/conversations/conversation_item.rbi +835 -0
  122. data/rbi/openai/models/conversations/conversation_item_list.rbi +101 -0
  123. data/rbi/openai/models/conversations/conversation_retrieve_params.rbi +32 -0
  124. data/rbi/openai/models/conversations/conversation_update_params.rbi +56 -0
  125. data/rbi/openai/models/conversations/file_citation_body.rbi +61 -0
  126. data/rbi/openai/models/conversations/input_file_content.rbi +72 -0
  127. data/rbi/openai/models/conversations/input_image_content.rbi +113 -0
  128. data/rbi/openai/models/conversations/input_text_content.rbi +38 -0
  129. data/rbi/openai/models/conversations/item_create_params.rbi +150 -0
  130. data/rbi/openai/models/conversations/item_delete_params.rbi +40 -0
  131. data/rbi/openai/models/conversations/item_list_params.rbi +174 -0
  132. data/rbi/openai/models/conversations/item_retrieve_params.rbi +70 -0
  133. data/rbi/openai/models/conversations/lob_prob.rbi +50 -0
  134. data/rbi/openai/models/conversations/message.rbi +196 -0
  135. data/rbi/openai/models/conversations/output_text_content.rbi +110 -0
  136. data/rbi/openai/models/conversations/refusal_content.rbi +38 -0
  137. data/rbi/openai/models/conversations/summary_text_content.rbi +31 -0
  138. data/rbi/openai/models/conversations/text_content.rbi +28 -0
  139. data/rbi/openai/models/conversations/top_log_prob.rbi +41 -0
  140. data/rbi/openai/models/conversations/url_citation_body.rbi +74 -0
  141. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +33 -33
  142. data/rbi/openai/models/file_create_params.rbi +56 -0
  143. data/rbi/openai/models/graders/text_similarity_grader.rbi +11 -6
  144. data/rbi/openai/models/reasoning.rbi +1 -1
  145. data/rbi/openai/models/responses/input_item_list_params.rbi +0 -11
  146. data/rbi/openai/models/responses/response.rbi +57 -11
  147. data/rbi/openai/models/responses/response_conversation_param.rbi +33 -0
  148. data/rbi/openai/models/responses/response_create_params.rbi +62 -11
  149. data/rbi/openai/models/responses/tool.rbi +243 -31
  150. data/rbi/openai/models/upload_create_params.rbi +56 -0
  151. data/rbi/openai/models.rbi +2 -0
  152. data/rbi/openai/resources/batches.rbi +5 -0
  153. data/rbi/openai/resources/beta/threads/runs.rbi +2 -2
  154. data/rbi/openai/resources/beta/threads.rbi +2 -2
  155. data/rbi/openai/resources/chat/completions.rbi +6 -8
  156. data/rbi/openai/resources/conversations/items.rbi +152 -0
  157. data/rbi/openai/resources/conversations.rbi +110 -0
  158. data/rbi/openai/resources/files.rbi +5 -1
  159. data/rbi/openai/resources/responses/input_items.rbi +0 -3
  160. data/rbi/openai/resources/responses.rbi +32 -8
  161. data/rbi/openai/resources/uploads.rbi +4 -0
  162. data/sig/openai/client.rbs +2 -0
  163. data/sig/openai/internal/conversation_cursor_page.rbs +15 -0
  164. data/sig/openai/models/batch_create_params.rbs +22 -1
  165. data/sig/openai/models/conversations/computer_screenshot_content.rbs +28 -0
  166. data/sig/openai/models/conversations/container_file_citation_body.rbs +47 -0
  167. data/sig/openai/models/conversations/conversation.rbs +37 -0
  168. data/sig/openai/models/conversations/conversation_create_params.rbs +33 -0
  169. data/sig/openai/models/conversations/conversation_delete_params.rbs +17 -0
  170. data/sig/openai/models/conversations/conversation_deleted.rbs +28 -0
  171. data/sig/openai/models/conversations/conversation_deleted_resource.rbs +28 -0
  172. data/sig/openai/models/conversations/conversation_item.rbs +403 -0
  173. data/sig/openai/models/conversations/conversation_item_list.rbs +44 -0
  174. data/sig/openai/models/conversations/conversation_retrieve_params.rbs +17 -0
  175. data/sig/openai/models/conversations/conversation_update_params.rbs +26 -0
  176. data/sig/openai/models/conversations/file_citation_body.rbs +37 -0
  177. data/sig/openai/models/conversations/input_file_content.rbs +41 -0
  178. data/sig/openai/models/conversations/input_image_content.rbs +49 -0
  179. data/sig/openai/models/conversations/input_text_content.rbs +17 -0
  180. data/sig/openai/models/conversations/item_create_params.rbs +37 -0
  181. data/sig/openai/models/conversations/item_delete_params.rbs +25 -0
  182. data/sig/openai/models/conversations/item_list_params.rbs +66 -0
  183. data/sig/openai/models/conversations/item_retrieve_params.rbs +37 -0
  184. data/sig/openai/models/conversations/lob_prob.rbs +37 -0
  185. data/sig/openai/models/conversations/message.rbs +95 -0
  186. data/sig/openai/models/conversations/output_text_content.rbs +52 -0
  187. data/sig/openai/models/conversations/refusal_content.rbs +17 -0
  188. data/sig/openai/models/conversations/summary_text_content.rbs +17 -0
  189. data/sig/openai/models/conversations/text_content.rbs +17 -0
  190. data/sig/openai/models/conversations/top_log_prob.rbs +28 -0
  191. data/sig/openai/models/conversations/url_citation_body.rbs +42 -0
  192. data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +22 -22
  193. data/sig/openai/models/file_create_params.rbs +22 -1
  194. data/sig/openai/models/graders/text_similarity_grader.rbs +3 -1
  195. data/sig/openai/models/responses/input_item_list_params.rbs +0 -7
  196. data/sig/openai/models/responses/response.rbs +15 -0
  197. data/sig/openai/models/responses/response_conversation_param.rbs +15 -0
  198. data/sig/openai/models/responses/response_create_params.rbs +14 -0
  199. data/sig/openai/models/responses/tool.rbs +83 -18
  200. data/sig/openai/models/upload_create_params.rbs +22 -1
  201. data/sig/openai/models.rbs +2 -0
  202. data/sig/openai/resources/batches.rbs +1 -0
  203. data/sig/openai/resources/conversations/items.rbs +38 -0
  204. data/sig/openai/resources/conversations.rbs +31 -0
  205. data/sig/openai/resources/files.rbs +1 -0
  206. data/sig/openai/resources/responses/input_items.rbs +0 -1
  207. data/sig/openai/resources/responses.rbs +2 -0
  208. data/sig/openai/resources/uploads.rbs +1 -0
  209. metadata +95 -2
@@ -5,7 +5,8 @@ module OpenAI
5
5
  completion_window: OpenAI::Models::BatchCreateParams::completion_window,
6
6
  endpoint: OpenAI::Models::BatchCreateParams::endpoint,
7
7
  input_file_id: String,
8
- metadata: OpenAI::Models::metadata?
8
+ metadata: OpenAI::Models::metadata?,
9
+ output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter
9
10
  }
10
11
  & OpenAI::Internal::Type::request_parameters
11
12
 
@@ -21,11 +22,18 @@ module OpenAI
21
22
 
22
23
  attr_accessor metadata: OpenAI::Models::metadata?
23
24
 
25
+ attr_reader output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter?
26
+
27
+ def output_expires_after=: (
28
+ OpenAI::BatchCreateParams::OutputExpiresAfter
29
+ ) -> OpenAI::BatchCreateParams::OutputExpiresAfter
30
+
24
31
  def initialize: (
25
32
  completion_window: OpenAI::Models::BatchCreateParams::completion_window,
26
33
  endpoint: OpenAI::Models::BatchCreateParams::endpoint,
27
34
  input_file_id: String,
28
35
  ?metadata: OpenAI::Models::metadata?,
36
+ ?output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter,
29
37
  ?request_options: OpenAI::request_opts
30
38
  ) -> void
31
39
 
@@ -34,6 +42,7 @@ module OpenAI
34
42
  endpoint: OpenAI::Models::BatchCreateParams::endpoint,
35
43
  input_file_id: String,
36
44
  metadata: OpenAI::Models::metadata?,
45
+ output_expires_after: OpenAI::BatchCreateParams::OutputExpiresAfter,
37
46
  request_options: OpenAI::RequestOptions
38
47
  }
39
48
 
@@ -63,6 +72,18 @@ module OpenAI
63
72
 
64
73
  def self?.values: -> ::Array[OpenAI::Models::BatchCreateParams::endpoint]
65
74
  end
75
+
76
+ type output_expires_after = { anchor: :created_at, seconds: Integer }
77
+
78
+ class OutputExpiresAfter < OpenAI::Internal::Type::BaseModel
79
+ attr_accessor anchor: :created_at
80
+
81
+ attr_accessor seconds: Integer
82
+
83
+ def initialize: (seconds: Integer, ?anchor: :created_at) -> void
84
+
85
+ def to_hash: -> { anchor: :created_at, seconds: Integer }
86
+ end
66
87
  end
67
88
  end
68
89
  end
@@ -0,0 +1,28 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type computer_screenshot_content =
5
+ { file_id: String?, image_url: String?, type: :computer_screenshot }
6
+
7
+ class ComputerScreenshotContent < OpenAI::Internal::Type::BaseModel
8
+ attr_accessor file_id: String?
9
+
10
+ attr_accessor image_url: String?
11
+
12
+ attr_accessor type: :computer_screenshot
13
+
14
+ def initialize: (
15
+ file_id: String?,
16
+ image_url: String?,
17
+ ?type: :computer_screenshot
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ file_id: String?,
22
+ image_url: String?,
23
+ type: :computer_screenshot
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,47 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type container_file_citation_body =
5
+ {
6
+ container_id: String,
7
+ end_index: Integer,
8
+ file_id: String,
9
+ filename: String,
10
+ start_index: Integer,
11
+ type: :container_file_citation
12
+ }
13
+
14
+ class ContainerFileCitationBody < OpenAI::Internal::Type::BaseModel
15
+ attr_accessor container_id: String
16
+
17
+ attr_accessor end_index: Integer
18
+
19
+ attr_accessor file_id: String
20
+
21
+ attr_accessor filename: String
22
+
23
+ attr_accessor start_index: Integer
24
+
25
+ attr_accessor type: :container_file_citation
26
+
27
+ def initialize: (
28
+ container_id: String,
29
+ end_index: Integer,
30
+ file_id: String,
31
+ filename: String,
32
+ start_index: Integer,
33
+ ?type: :container_file_citation
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ container_id: String,
38
+ end_index: Integer,
39
+ file_id: String,
40
+ filename: String,
41
+ start_index: Integer,
42
+ type: :container_file_citation
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,37 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation =
5
+ {
6
+ id: String,
7
+ created_at: Integer,
8
+ metadata: top,
9
+ object: :conversation
10
+ }
11
+
12
+ class Conversation < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor id: String
14
+
15
+ attr_accessor created_at: Integer
16
+
17
+ attr_accessor metadata: top
18
+
19
+ attr_accessor object: :conversation
20
+
21
+ def initialize: (
22
+ id: String,
23
+ created_at: Integer,
24
+ metadata: top,
25
+ ?object: :conversation
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ id: String,
30
+ created_at: Integer,
31
+ metadata: top,
32
+ object: :conversation
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,33 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation_create_params =
5
+ {
6
+ items: ::Array[OpenAI::Models::Responses::response_input_item]?,
7
+ metadata: OpenAI::Models::metadata?
8
+ }
9
+ & OpenAI::Internal::Type::request_parameters
10
+
11
+ class ConversationCreateParams < OpenAI::Internal::Type::BaseModel
12
+ extend OpenAI::Internal::Type::RequestParameters::Converter
13
+ include OpenAI::Internal::Type::RequestParameters
14
+
15
+ attr_accessor items: ::Array[OpenAI::Models::Responses::response_input_item]?
16
+
17
+ attr_accessor metadata: OpenAI::Models::metadata?
18
+
19
+ def initialize: (
20
+ ?items: ::Array[OpenAI::Models::Responses::response_input_item]?,
21
+ ?metadata: OpenAI::Models::metadata?,
22
+ ?request_options: OpenAI::request_opts
23
+ ) -> void
24
+
25
+ def to_hash: -> {
26
+ items: ::Array[OpenAI::Models::Responses::response_input_item]?,
27
+ metadata: OpenAI::Models::metadata?,
28
+ request_options: OpenAI::RequestOptions
29
+ }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation_delete_params =
5
+ { } & OpenAI::Internal::Type::request_parameters
6
+
7
+ class ConversationDeleteParams < OpenAI::Internal::Type::BaseModel
8
+ extend OpenAI::Internal::Type::RequestParameters::Converter
9
+ include OpenAI::Internal::Type::RequestParameters
10
+
11
+ def initialize: (?request_options: OpenAI::request_opts) -> void
12
+
13
+ def to_hash: -> { request_options: OpenAI::RequestOptions }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,28 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation_deleted =
5
+ { id: String, deleted: bool, object: :"conversation.deleted" }
6
+
7
+ class ConversationDeleted < OpenAI::Internal::Type::BaseModel
8
+ attr_accessor id: String
9
+
10
+ attr_accessor deleted: bool
11
+
12
+ attr_accessor object: :"conversation.deleted"
13
+
14
+ def initialize: (
15
+ id: String,
16
+ deleted: bool,
17
+ ?object: :"conversation.deleted"
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ id: String,
22
+ deleted: bool,
23
+ object: :"conversation.deleted"
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation_deleted_resource =
5
+ { id: String, deleted: bool, object: :"conversation.deleted" }
6
+
7
+ class ConversationDeletedResource < OpenAI::Internal::Type::BaseModel
8
+ attr_accessor id: String
9
+
10
+ attr_accessor deleted: bool
11
+
12
+ attr_accessor object: :"conversation.deleted"
13
+
14
+ def initialize: (
15
+ id: String,
16
+ deleted: bool,
17
+ ?object: :"conversation.deleted"
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ id: String,
22
+ deleted: bool,
23
+ object: :"conversation.deleted"
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,403 @@
1
+ module OpenAI
2
+ module Models
3
+ module ConversationItem = Conversations::ConversationItem
4
+
5
+ module Conversations
6
+ type conversation_item =
7
+ OpenAI::Conversations::Message
8
+ | OpenAI::Responses::ResponseFunctionToolCallItem
9
+ | OpenAI::Responses::ResponseFunctionToolCallOutputItem
10
+ | OpenAI::Responses::ResponseFileSearchToolCall
11
+ | OpenAI::Responses::ResponseFunctionWebSearch
12
+ | OpenAI::Conversations::ConversationItem::ImageGenerationCall
13
+ | OpenAI::Responses::ResponseComputerToolCall
14
+ | OpenAI::Responses::ResponseComputerToolCallOutputItem
15
+ | OpenAI::Responses::ResponseReasoningItem
16
+ | OpenAI::Responses::ResponseCodeInterpreterToolCall
17
+ | OpenAI::Conversations::ConversationItem::LocalShellCall
18
+ | OpenAI::Conversations::ConversationItem::LocalShellCallOutput
19
+ | OpenAI::Conversations::ConversationItem::McpListTools
20
+ | OpenAI::Conversations::ConversationItem::McpApprovalRequest
21
+ | OpenAI::Conversations::ConversationItem::McpApprovalResponse
22
+ | OpenAI::Conversations::ConversationItem::McpCall
23
+ | OpenAI::Responses::ResponseCustomToolCall
24
+ | OpenAI::Responses::ResponseCustomToolCallOutput
25
+
26
+ module ConversationItem
27
+ extend OpenAI::Internal::Type::Union
28
+
29
+ type image_generation_call =
30
+ {
31
+ id: String,
32
+ result: String?,
33
+ status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status,
34
+ type: :image_generation_call
35
+ }
36
+
37
+ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel
38
+ attr_accessor id: String
39
+
40
+ attr_accessor result: String?
41
+
42
+ attr_accessor status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status
43
+
44
+ attr_accessor type: :image_generation_call
45
+
46
+ def initialize: (
47
+ id: String,
48
+ result: String?,
49
+ status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status,
50
+ ?type: :image_generation_call
51
+ ) -> void
52
+
53
+ def to_hash: -> {
54
+ id: String,
55
+ result: String?,
56
+ status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status,
57
+ type: :image_generation_call
58
+ }
59
+
60
+ type status = :in_progress | :completed | :generating | :failed
61
+
62
+ module Status
63
+ extend OpenAI::Internal::Type::Enum
64
+
65
+ IN_PROGRESS: :in_progress
66
+ COMPLETED: :completed
67
+ GENERATING: :generating
68
+ FAILED: :failed
69
+
70
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status]
71
+ end
72
+ end
73
+
74
+ type local_shell_call =
75
+ {
76
+ id: String,
77
+ action: OpenAI::Conversations::ConversationItem::LocalShellCall::Action,
78
+ call_id: String,
79
+ status: OpenAI::Models::Conversations::ConversationItem::LocalShellCall::status,
80
+ type: :local_shell_call
81
+ }
82
+
83
+ class LocalShellCall < OpenAI::Internal::Type::BaseModel
84
+ attr_accessor id: String
85
+
86
+ attr_accessor action: OpenAI::Conversations::ConversationItem::LocalShellCall::Action
87
+
88
+ attr_accessor call_id: String
89
+
90
+ attr_accessor status: OpenAI::Models::Conversations::ConversationItem::LocalShellCall::status
91
+
92
+ attr_accessor type: :local_shell_call
93
+
94
+ def initialize: (
95
+ id: String,
96
+ action: OpenAI::Conversations::ConversationItem::LocalShellCall::Action,
97
+ call_id: String,
98
+ status: OpenAI::Models::Conversations::ConversationItem::LocalShellCall::status,
99
+ ?type: :local_shell_call
100
+ ) -> void
101
+
102
+ def to_hash: -> {
103
+ id: String,
104
+ action: OpenAI::Conversations::ConversationItem::LocalShellCall::Action,
105
+ call_id: String,
106
+ status: OpenAI::Models::Conversations::ConversationItem::LocalShellCall::status,
107
+ type: :local_shell_call
108
+ }
109
+
110
+ type action =
111
+ {
112
+ command: ::Array[String],
113
+ env: ::Hash[Symbol, String],
114
+ type: :exec,
115
+ timeout_ms: Integer?,
116
+ user: String?,
117
+ working_directory: String?
118
+ }
119
+
120
+ class Action < OpenAI::Internal::Type::BaseModel
121
+ attr_accessor command: ::Array[String]
122
+
123
+ attr_accessor env: ::Hash[Symbol, String]
124
+
125
+ attr_accessor type: :exec
126
+
127
+ attr_accessor timeout_ms: Integer?
128
+
129
+ attr_accessor user: String?
130
+
131
+ attr_accessor working_directory: String?
132
+
133
+ def initialize: (
134
+ command: ::Array[String],
135
+ env: ::Hash[Symbol, String],
136
+ ?timeout_ms: Integer?,
137
+ ?user: String?,
138
+ ?working_directory: String?,
139
+ ?type: :exec
140
+ ) -> void
141
+
142
+ def to_hash: -> {
143
+ command: ::Array[String],
144
+ env: ::Hash[Symbol, String],
145
+ type: :exec,
146
+ timeout_ms: Integer?,
147
+ user: String?,
148
+ working_directory: String?
149
+ }
150
+ end
151
+
152
+ type status = :in_progress | :completed | :incomplete
153
+
154
+ module Status
155
+ extend OpenAI::Internal::Type::Enum
156
+
157
+ IN_PROGRESS: :in_progress
158
+ COMPLETED: :completed
159
+ INCOMPLETE: :incomplete
160
+
161
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::LocalShellCall::status]
162
+ end
163
+ end
164
+
165
+ type local_shell_call_output =
166
+ {
167
+ id: String,
168
+ output: String,
169
+ type: :local_shell_call_output,
170
+ status: OpenAI::Models::Conversations::ConversationItem::LocalShellCallOutput::status?
171
+ }
172
+
173
+ class LocalShellCallOutput < OpenAI::Internal::Type::BaseModel
174
+ attr_accessor id: String
175
+
176
+ attr_accessor output: String
177
+
178
+ attr_accessor type: :local_shell_call_output
179
+
180
+ attr_accessor status: OpenAI::Models::Conversations::ConversationItem::LocalShellCallOutput::status?
181
+
182
+ def initialize: (
183
+ id: String,
184
+ output: String,
185
+ ?status: OpenAI::Models::Conversations::ConversationItem::LocalShellCallOutput::status?,
186
+ ?type: :local_shell_call_output
187
+ ) -> void
188
+
189
+ def to_hash: -> {
190
+ id: String,
191
+ output: String,
192
+ type: :local_shell_call_output,
193
+ status: OpenAI::Models::Conversations::ConversationItem::LocalShellCallOutput::status?
194
+ }
195
+
196
+ type status = :in_progress | :completed | :incomplete
197
+
198
+ module Status
199
+ extend OpenAI::Internal::Type::Enum
200
+
201
+ IN_PROGRESS: :in_progress
202
+ COMPLETED: :completed
203
+ INCOMPLETE: :incomplete
204
+
205
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::LocalShellCallOutput::status]
206
+ end
207
+ end
208
+
209
+ type mcp_list_tools =
210
+ {
211
+ id: String,
212
+ server_label: String,
213
+ tools: ::Array[OpenAI::Conversations::ConversationItem::McpListTools::Tool],
214
+ type: :mcp_list_tools,
215
+ error: String?
216
+ }
217
+
218
+ class McpListTools < OpenAI::Internal::Type::BaseModel
219
+ attr_accessor id: String
220
+
221
+ attr_accessor server_label: String
222
+
223
+ attr_accessor tools: ::Array[OpenAI::Conversations::ConversationItem::McpListTools::Tool]
224
+
225
+ attr_accessor type: :mcp_list_tools
226
+
227
+ attr_accessor error: String?
228
+
229
+ def initialize: (
230
+ id: String,
231
+ server_label: String,
232
+ tools: ::Array[OpenAI::Conversations::ConversationItem::McpListTools::Tool],
233
+ ?error: String?,
234
+ ?type: :mcp_list_tools
235
+ ) -> void
236
+
237
+ def to_hash: -> {
238
+ id: String,
239
+ server_label: String,
240
+ tools: ::Array[OpenAI::Conversations::ConversationItem::McpListTools::Tool],
241
+ type: :mcp_list_tools,
242
+ error: String?
243
+ }
244
+
245
+ type tool =
246
+ {
247
+ input_schema: top,
248
+ name: String,
249
+ annotations: top?,
250
+ description: String?
251
+ }
252
+
253
+ class Tool < OpenAI::Internal::Type::BaseModel
254
+ attr_accessor input_schema: top
255
+
256
+ attr_accessor name: String
257
+
258
+ attr_accessor annotations: top?
259
+
260
+ attr_accessor description: String?
261
+
262
+ def initialize: (
263
+ input_schema: top,
264
+ name: String,
265
+ ?annotations: top?,
266
+ ?description: String?
267
+ ) -> void
268
+
269
+ def to_hash: -> {
270
+ input_schema: top,
271
+ name: String,
272
+ annotations: top?,
273
+ description: String?
274
+ }
275
+ end
276
+ end
277
+
278
+ type mcp_approval_request =
279
+ {
280
+ id: String,
281
+ arguments: String,
282
+ name: String,
283
+ server_label: String,
284
+ type: :mcp_approval_request
285
+ }
286
+
287
+ class McpApprovalRequest < OpenAI::Internal::Type::BaseModel
288
+ attr_accessor id: String
289
+
290
+ attr_accessor arguments: String
291
+
292
+ attr_accessor name: String
293
+
294
+ attr_accessor server_label: String
295
+
296
+ attr_accessor type: :mcp_approval_request
297
+
298
+ def initialize: (
299
+ id: String,
300
+ arguments: String,
301
+ name: String,
302
+ server_label: String,
303
+ ?type: :mcp_approval_request
304
+ ) -> void
305
+
306
+ def to_hash: -> {
307
+ id: String,
308
+ arguments: String,
309
+ name: String,
310
+ server_label: String,
311
+ type: :mcp_approval_request
312
+ }
313
+ end
314
+
315
+ type mcp_approval_response =
316
+ {
317
+ id: String,
318
+ approval_request_id: String,
319
+ approve: bool,
320
+ type: :mcp_approval_response,
321
+ reason: String?
322
+ }
323
+
324
+ class McpApprovalResponse < OpenAI::Internal::Type::BaseModel
325
+ attr_accessor id: String
326
+
327
+ attr_accessor approval_request_id: String
328
+
329
+ attr_accessor approve: bool
330
+
331
+ attr_accessor type: :mcp_approval_response
332
+
333
+ attr_accessor reason: String?
334
+
335
+ def initialize: (
336
+ id: String,
337
+ approval_request_id: String,
338
+ approve: bool,
339
+ ?reason: String?,
340
+ ?type: :mcp_approval_response
341
+ ) -> void
342
+
343
+ def to_hash: -> {
344
+ id: String,
345
+ approval_request_id: String,
346
+ approve: bool,
347
+ type: :mcp_approval_response,
348
+ reason: String?
349
+ }
350
+ end
351
+
352
+ type mcp_call =
353
+ {
354
+ id: String,
355
+ arguments: String,
356
+ name: String,
357
+ server_label: String,
358
+ type: :mcp_call,
359
+ error: String?,
360
+ output: String?
361
+ }
362
+
363
+ class McpCall < OpenAI::Internal::Type::BaseModel
364
+ attr_accessor id: String
365
+
366
+ attr_accessor arguments: String
367
+
368
+ attr_accessor name: String
369
+
370
+ attr_accessor server_label: String
371
+
372
+ attr_accessor type: :mcp_call
373
+
374
+ attr_accessor error: String?
375
+
376
+ attr_accessor output: String?
377
+
378
+ def initialize: (
379
+ id: String,
380
+ arguments: String,
381
+ name: String,
382
+ server_label: String,
383
+ ?error: String?,
384
+ ?output: String?,
385
+ ?type: :mcp_call
386
+ ) -> void
387
+
388
+ def to_hash: -> {
389
+ id: String,
390
+ arguments: String,
391
+ name: String,
392
+ server_label: String,
393
+ type: :mcp_call,
394
+ error: String?,
395
+ output: String?
396
+ }
397
+ end
398
+
399
+ def self?.variants: -> ::Array[OpenAI::Models::Conversations::conversation_item]
400
+ end
401
+ end
402
+ end
403
+ end