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
@@ -0,0 +1,44 @@
1
+ module OpenAI
2
+ module Models
3
+ class ConversationItemList = Conversations::ConversationItemList
4
+
5
+ module Conversations
6
+ type conversation_item_list =
7
+ {
8
+ data: ::Array[OpenAI::Models::Conversations::conversation_item],
9
+ first_id: String,
10
+ has_more: bool,
11
+ last_id: String,
12
+ object: :list
13
+ }
14
+
15
+ class ConversationItemList < OpenAI::Internal::Type::BaseModel
16
+ attr_accessor data: ::Array[OpenAI::Models::Conversations::conversation_item]
17
+
18
+ attr_accessor first_id: String
19
+
20
+ attr_accessor has_more: bool
21
+
22
+ attr_accessor last_id: String
23
+
24
+ attr_accessor object: :list
25
+
26
+ def initialize: (
27
+ data: ::Array[OpenAI::Models::Conversations::conversation_item],
28
+ first_id: String,
29
+ has_more: bool,
30
+ last_id: String,
31
+ ?object: :list
32
+ ) -> void
33
+
34
+ def to_hash: -> {
35
+ data: ::Array[OpenAI::Models::Conversations::conversation_item],
36
+ first_id: String,
37
+ has_more: bool,
38
+ last_id: String,
39
+ object: :list
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation_retrieve_params =
5
+ { } & OpenAI::Internal::Type::request_parameters
6
+
7
+ class ConversationRetrieveParams < 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,26 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type conversation_update_params =
5
+ { metadata: ::Hash[Symbol, String] }
6
+ & OpenAI::Internal::Type::request_parameters
7
+
8
+ class ConversationUpdateParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ attr_accessor metadata: ::Hash[Symbol, String]
13
+
14
+ def initialize: (
15
+ metadata: ::Hash[Symbol, String],
16
+ ?request_options: OpenAI::request_opts
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ metadata: ::Hash[Symbol, String],
21
+ request_options: OpenAI::RequestOptions
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,37 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type file_citation_body =
5
+ {
6
+ file_id: String,
7
+ filename: String,
8
+ index: Integer,
9
+ type: :file_citation
10
+ }
11
+
12
+ class FileCitationBody < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor file_id: String
14
+
15
+ attr_accessor filename: String
16
+
17
+ attr_accessor index: Integer
18
+
19
+ attr_accessor type: :file_citation
20
+
21
+ def initialize: (
22
+ file_id: String,
23
+ filename: String,
24
+ index: Integer,
25
+ ?type: :file_citation
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ file_id: String,
30
+ filename: String,
31
+ index: Integer,
32
+ type: :file_citation
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,41 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type input_file_content =
5
+ {
6
+ file_id: String?,
7
+ type: :input_file,
8
+ file_url: String,
9
+ filename: String
10
+ }
11
+
12
+ class InputFileContent < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor file_id: String?
14
+
15
+ attr_accessor type: :input_file
16
+
17
+ attr_reader file_url: String?
18
+
19
+ def file_url=: (String) -> String
20
+
21
+ attr_reader filename: String?
22
+
23
+ def filename=: (String) -> String
24
+
25
+ def initialize: (
26
+ file_id: String?,
27
+ ?file_url: String,
28
+ ?filename: String,
29
+ ?type: :input_file
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ file_id: String?,
34
+ type: :input_file,
35
+ file_url: String,
36
+ filename: String
37
+ }
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,49 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type input_image_content =
5
+ {
6
+ detail: OpenAI::Models::Conversations::InputImageContent::detail,
7
+ file_id: String?,
8
+ image_url: String?,
9
+ type: :input_image
10
+ }
11
+
12
+ class InputImageContent < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor detail: OpenAI::Models::Conversations::InputImageContent::detail
14
+
15
+ attr_accessor file_id: String?
16
+
17
+ attr_accessor image_url: String?
18
+
19
+ attr_accessor type: :input_image
20
+
21
+ def initialize: (
22
+ detail: OpenAI::Models::Conversations::InputImageContent::detail,
23
+ file_id: String?,
24
+ image_url: String?,
25
+ ?type: :input_image
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ detail: OpenAI::Models::Conversations::InputImageContent::detail,
30
+ file_id: String?,
31
+ image_url: String?,
32
+ type: :input_image
33
+ }
34
+
35
+ type detail = :low | :high | :auto
36
+
37
+ module Detail
38
+ extend OpenAI::Internal::Type::Enum
39
+
40
+ LOW: :low
41
+ HIGH: :high
42
+ AUTO: :auto
43
+
44
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::InputImageContent::detail]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type input_text_content = { text: String, type: :input_text }
5
+
6
+ class InputTextContent < OpenAI::Internal::Type::BaseModel
7
+ attr_accessor text: String
8
+
9
+ attr_accessor type: :input_text
10
+
11
+ def initialize: (text: String, ?type: :input_text) -> void
12
+
13
+ def to_hash: -> { text: String, type: :input_text }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,37 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type item_create_params =
5
+ {
6
+ items: ::Array[OpenAI::Models::Responses::response_input_item],
7
+ include: ::Array[OpenAI::Models::Responses::response_includable]
8
+ }
9
+ & OpenAI::Internal::Type::request_parameters
10
+
11
+ class ItemCreateParams < 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_reader include: ::Array[OpenAI::Models::Responses::response_includable]?
18
+
19
+ def include=: (
20
+ ::Array[OpenAI::Models::Responses::response_includable]
21
+ ) -> ::Array[OpenAI::Models::Responses::response_includable]
22
+
23
+ def initialize: (
24
+ items: ::Array[OpenAI::Models::Responses::response_input_item],
25
+ ?include: ::Array[OpenAI::Models::Responses::response_includable],
26
+ ?request_options: OpenAI::request_opts
27
+ ) -> void
28
+
29
+ def to_hash: -> {
30
+ items: ::Array[OpenAI::Models::Responses::response_input_item],
31
+ include: ::Array[OpenAI::Models::Responses::response_includable],
32
+ request_options: OpenAI::RequestOptions
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,25 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type item_delete_params =
5
+ { conversation_id: String } & OpenAI::Internal::Type::request_parameters
6
+
7
+ class ItemDeleteParams < OpenAI::Internal::Type::BaseModel
8
+ extend OpenAI::Internal::Type::RequestParameters::Converter
9
+ include OpenAI::Internal::Type::RequestParameters
10
+
11
+ attr_accessor conversation_id: String
12
+
13
+ def initialize: (
14
+ conversation_id: String,
15
+ ?request_options: OpenAI::request_opts
16
+ ) -> void
17
+
18
+ def to_hash: -> {
19
+ conversation_id: String,
20
+ request_options: OpenAI::RequestOptions
21
+ }
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,66 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type item_list_params =
5
+ {
6
+ after: String,
7
+ include: ::Array[OpenAI::Models::Responses::response_includable],
8
+ limit: Integer,
9
+ order: OpenAI::Models::Conversations::ItemListParams::order
10
+ }
11
+ & OpenAI::Internal::Type::request_parameters
12
+
13
+ class ItemListParams < OpenAI::Internal::Type::BaseModel
14
+ extend OpenAI::Internal::Type::RequestParameters::Converter
15
+ include OpenAI::Internal::Type::RequestParameters
16
+
17
+ attr_reader after: String?
18
+
19
+ def after=: (String) -> String
20
+
21
+ attr_reader include: ::Array[OpenAI::Models::Responses::response_includable]?
22
+
23
+ def include=: (
24
+ ::Array[OpenAI::Models::Responses::response_includable]
25
+ ) -> ::Array[OpenAI::Models::Responses::response_includable]
26
+
27
+ attr_reader limit: Integer?
28
+
29
+ def limit=: (Integer) -> Integer
30
+
31
+ attr_reader order: OpenAI::Models::Conversations::ItemListParams::order?
32
+
33
+ def order=: (
34
+ OpenAI::Models::Conversations::ItemListParams::order
35
+ ) -> OpenAI::Models::Conversations::ItemListParams::order
36
+
37
+ def initialize: (
38
+ ?after: String,
39
+ ?include: ::Array[OpenAI::Models::Responses::response_includable],
40
+ ?limit: Integer,
41
+ ?order: OpenAI::Models::Conversations::ItemListParams::order,
42
+ ?request_options: OpenAI::request_opts
43
+ ) -> void
44
+
45
+ def to_hash: -> {
46
+ after: String,
47
+ include: ::Array[OpenAI::Models::Responses::response_includable],
48
+ limit: Integer,
49
+ order: OpenAI::Models::Conversations::ItemListParams::order,
50
+ request_options: OpenAI::RequestOptions
51
+ }
52
+
53
+ type order = :asc | :desc
54
+
55
+ module Order
56
+ extend OpenAI::Internal::Type::Enum
57
+
58
+ ASC: :asc
59
+ DESC: :desc
60
+
61
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::ItemListParams::order]
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,37 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type item_retrieve_params =
5
+ {
6
+ conversation_id: String,
7
+ include: ::Array[OpenAI::Models::Responses::response_includable]
8
+ }
9
+ & OpenAI::Internal::Type::request_parameters
10
+
11
+ class ItemRetrieveParams < OpenAI::Internal::Type::BaseModel
12
+ extend OpenAI::Internal::Type::RequestParameters::Converter
13
+ include OpenAI::Internal::Type::RequestParameters
14
+
15
+ attr_accessor conversation_id: String
16
+
17
+ attr_reader include: ::Array[OpenAI::Models::Responses::response_includable]?
18
+
19
+ def include=: (
20
+ ::Array[OpenAI::Models::Responses::response_includable]
21
+ ) -> ::Array[OpenAI::Models::Responses::response_includable]
22
+
23
+ def initialize: (
24
+ conversation_id: String,
25
+ ?include: ::Array[OpenAI::Models::Responses::response_includable],
26
+ ?request_options: OpenAI::request_opts
27
+ ) -> void
28
+
29
+ def to_hash: -> {
30
+ conversation_id: String,
31
+ include: ::Array[OpenAI::Models::Responses::response_includable],
32
+ request_options: OpenAI::RequestOptions
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type lob_prob =
5
+ {
6
+ token: String,
7
+ bytes: ::Array[Integer],
8
+ logprob: Float,
9
+ top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
10
+ }
11
+
12
+ class LobProb < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor token: String
14
+
15
+ attr_accessor bytes: ::Array[Integer]
16
+
17
+ attr_accessor logprob: Float
18
+
19
+ attr_accessor top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
20
+
21
+ def initialize: (
22
+ token: String,
23
+ bytes: ::Array[Integer],
24
+ logprob: Float,
25
+ top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ token: String,
30
+ bytes: ::Array[Integer],
31
+ logprob: Float,
32
+ top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,95 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type message =
5
+ {
6
+ id: String,
7
+ content: ::Array[OpenAI::Models::Conversations::Message::content],
8
+ role: OpenAI::Models::Conversations::Message::role,
9
+ status: OpenAI::Models::Conversations::Message::status,
10
+ type: :message
11
+ }
12
+
13
+ class Message < OpenAI::Internal::Type::BaseModel
14
+ attr_accessor id: String
15
+
16
+ attr_accessor content: ::Array[OpenAI::Models::Conversations::Message::content]
17
+
18
+ attr_accessor role: OpenAI::Models::Conversations::Message::role
19
+
20
+ attr_accessor status: OpenAI::Models::Conversations::Message::status
21
+
22
+ attr_accessor type: :message
23
+
24
+ def initialize: (
25
+ id: String,
26
+ content: ::Array[OpenAI::Models::Conversations::Message::content],
27
+ role: OpenAI::Models::Conversations::Message::role,
28
+ status: OpenAI::Models::Conversations::Message::status,
29
+ ?type: :message
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ id: String,
34
+ content: ::Array[OpenAI::Models::Conversations::Message::content],
35
+ role: OpenAI::Models::Conversations::Message::role,
36
+ status: OpenAI::Models::Conversations::Message::status,
37
+ type: :message
38
+ }
39
+
40
+ type content =
41
+ OpenAI::Conversations::InputTextContent
42
+ | OpenAI::Conversations::OutputTextContent
43
+ | OpenAI::Conversations::TextContent
44
+ | OpenAI::Conversations::SummaryTextContent
45
+ | OpenAI::Conversations::RefusalContent
46
+ | OpenAI::Conversations::InputImageContent
47
+ | OpenAI::Conversations::ComputerScreenshotContent
48
+ | OpenAI::Conversations::InputFileContent
49
+
50
+ module Content
51
+ extend OpenAI::Internal::Type::Union
52
+
53
+ def self?.variants: -> ::Array[OpenAI::Models::Conversations::Message::content]
54
+ end
55
+
56
+ type role =
57
+ :unknown
58
+ | :user
59
+ | :assistant
60
+ | :system
61
+ | :critic
62
+ | :discriminator
63
+ | :developer
64
+ | :tool
65
+
66
+ module Role
67
+ extend OpenAI::Internal::Type::Enum
68
+
69
+ UNKNOWN: :unknown
70
+ USER: :user
71
+ ASSISTANT: :assistant
72
+ SYSTEM: :system
73
+ CRITIC: :critic
74
+ DISCRIMINATOR: :discriminator
75
+ DEVELOPER: :developer
76
+ TOOL: :tool
77
+
78
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::Message::role]
79
+ end
80
+
81
+ type status = :in_progress | :completed | :incomplete
82
+
83
+ module Status
84
+ extend OpenAI::Internal::Type::Enum
85
+
86
+ IN_PROGRESS: :in_progress
87
+ COMPLETED: :completed
88
+ INCOMPLETE: :incomplete
89
+
90
+ def self?.values: -> ::Array[OpenAI::Models::Conversations::Message::status]
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,52 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type output_text_content =
5
+ {
6
+ annotations: ::Array[OpenAI::Models::Conversations::OutputTextContent::annotation],
7
+ text: String,
8
+ type: :output_text,
9
+ logprobs: ::Array[OpenAI::Conversations::LobProb]
10
+ }
11
+
12
+ class OutputTextContent < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor annotations: ::Array[OpenAI::Models::Conversations::OutputTextContent::annotation]
14
+
15
+ attr_accessor text: String
16
+
17
+ attr_accessor type: :output_text
18
+
19
+ attr_reader logprobs: ::Array[OpenAI::Conversations::LobProb]?
20
+
21
+ def logprobs=: (
22
+ ::Array[OpenAI::Conversations::LobProb]
23
+ ) -> ::Array[OpenAI::Conversations::LobProb]
24
+
25
+ def initialize: (
26
+ annotations: ::Array[OpenAI::Models::Conversations::OutputTextContent::annotation],
27
+ text: String,
28
+ ?logprobs: ::Array[OpenAI::Conversations::LobProb],
29
+ ?type: :output_text
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ annotations: ::Array[OpenAI::Models::Conversations::OutputTextContent::annotation],
34
+ text: String,
35
+ type: :output_text,
36
+ logprobs: ::Array[OpenAI::Conversations::LobProb]
37
+ }
38
+
39
+ type annotation =
40
+ OpenAI::Conversations::FileCitationBody
41
+ | OpenAI::Conversations::URLCitationBody
42
+ | OpenAI::Conversations::ContainerFileCitationBody
43
+
44
+ module Annotation
45
+ extend OpenAI::Internal::Type::Union
46
+
47
+ def self?.variants: -> ::Array[OpenAI::Models::Conversations::OutputTextContent::annotation]
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type refusal_content = { refusal: String, type: :refusal }
5
+
6
+ class RefusalContent < OpenAI::Internal::Type::BaseModel
7
+ attr_accessor refusal: String
8
+
9
+ attr_accessor type: :refusal
10
+
11
+ def initialize: (refusal: String, ?type: :refusal) -> void
12
+
13
+ def to_hash: -> { refusal: String, type: :refusal }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type summary_text_content = { text: String, type: :summary_text }
5
+
6
+ class SummaryTextContent < OpenAI::Internal::Type::BaseModel
7
+ attr_accessor text: String
8
+
9
+ attr_accessor type: :summary_text
10
+
11
+ def initialize: (text: String, ?type: :summary_text) -> void
12
+
13
+ def to_hash: -> { text: String, type: :summary_text }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type text_content = { text: String, type: :text }
5
+
6
+ class TextContent < OpenAI::Internal::Type::BaseModel
7
+ attr_accessor text: String
8
+
9
+ attr_accessor type: :text
10
+
11
+ def initialize: (text: String, ?type: :text) -> void
12
+
13
+ def to_hash: -> { text: String, type: :text }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,28 @@
1
+ module OpenAI
2
+ module Models
3
+ module Conversations
4
+ type top_log_prob =
5
+ { token: String, bytes: ::Array[Integer], logprob: Float }
6
+
7
+ class TopLogProb < OpenAI::Internal::Type::BaseModel
8
+ attr_accessor token: String
9
+
10
+ attr_accessor bytes: ::Array[Integer]
11
+
12
+ attr_accessor logprob: Float
13
+
14
+ def initialize: (
15
+ token: String,
16
+ bytes: ::Array[Integer],
17
+ logprob: Float
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ token: String,
22
+ bytes: ::Array[Integer],
23
+ logprob: Float
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end