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
@@ -0,0 +1,41 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Conversations
6
+ class TopLogProb < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(OpenAI::Conversations::TopLogProb, OpenAI::Internal::AnyHash)
10
+ end
11
+
12
+ sig { returns(String) }
13
+ attr_accessor :token
14
+
15
+ sig { returns(T::Array[Integer]) }
16
+ attr_accessor :bytes
17
+
18
+ sig { returns(Float) }
19
+ attr_accessor :logprob
20
+
21
+ sig do
22
+ params(
23
+ token: String,
24
+ bytes: T::Array[Integer],
25
+ logprob: Float
26
+ ).returns(T.attached_class)
27
+ end
28
+ def self.new(token:, bytes:, logprob:)
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ { token: String, bytes: T::Array[Integer], logprob: Float }
34
+ )
35
+ end
36
+ def to_hash
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Conversations
6
+ class URLCitationBody < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Conversations::URLCitationBody,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The index of the last character of the URL citation in the message.
16
+ sig { returns(Integer) }
17
+ attr_accessor :end_index
18
+
19
+ # The index of the first character of the URL citation in the message.
20
+ sig { returns(Integer) }
21
+ attr_accessor :start_index
22
+
23
+ # The title of the web resource.
24
+ sig { returns(String) }
25
+ attr_accessor :title
26
+
27
+ # The type of the URL citation. Always `url_citation`.
28
+ sig { returns(Symbol) }
29
+ attr_accessor :type
30
+
31
+ # The URL of the web resource.
32
+ sig { returns(String) }
33
+ attr_accessor :url
34
+
35
+ sig do
36
+ params(
37
+ end_index: Integer,
38
+ start_index: Integer,
39
+ title: String,
40
+ url: String,
41
+ type: Symbol
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ # The index of the last character of the URL citation in the message.
46
+ end_index:,
47
+ # The index of the first character of the URL citation in the message.
48
+ start_index:,
49
+ # The title of the web resource.
50
+ title:,
51
+ # The URL of the web resource.
52
+ url:,
53
+ # The type of the URL citation. Always `url_citation`.
54
+ type: :url_citation
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ end_index: Integer,
62
+ start_index: Integer,
63
+ title: String,
64
+ type: Symbol,
65
+ url: String
66
+ }
67
+ )
68
+ end
69
+ def to_hash
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -441,7 +441,7 @@ module OpenAI
441
441
  T::Array[
442
442
  T.any(
443
443
  OpenAI::Responses::EasyInputMessage,
444
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message
444
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem
445
445
  )
446
446
  ]
447
447
  )
@@ -458,7 +458,7 @@ module OpenAI
458
458
  T::Array[
459
459
  T.any(
460
460
  OpenAI::Responses::EasyInputMessage::OrHash,
461
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::OrHash
461
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::OrHash
462
462
  )
463
463
  ],
464
464
  type: Symbol
@@ -480,7 +480,7 @@ module OpenAI
480
480
  T::Array[
481
481
  T.any(
482
482
  OpenAI::Responses::EasyInputMessage,
483
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message
483
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem
484
484
  )
485
485
  ],
486
486
  type: Symbol
@@ -502,15 +502,15 @@ module OpenAI
502
502
  T.type_alias do
503
503
  T.any(
504
504
  OpenAI::Responses::EasyInputMessage,
505
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message
505
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem
506
506
  )
507
507
  end
508
508
 
509
- class Message < OpenAI::Internal::Type::BaseModel
509
+ class EvalItem < OpenAI::Internal::Type::BaseModel
510
510
  OrHash =
511
511
  T.type_alias do
512
512
  T.any(
513
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message,
513
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem,
514
514
  OpenAI::Internal::AnyHash
515
515
  )
516
516
  end
@@ -521,8 +521,8 @@ module OpenAI
521
521
  T.any(
522
522
  String,
523
523
  OpenAI::Responses::ResponseInputText,
524
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText,
525
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::InputImage,
524
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
525
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
526
526
  T::Array[T.anything]
527
527
  )
528
528
  )
@@ -533,7 +533,7 @@ module OpenAI
533
533
  # `developer`.
534
534
  sig do
535
535
  returns(
536
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::OrSymbol
536
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol
537
537
  )
538
538
  end
539
539
  attr_accessor :role
@@ -542,7 +542,7 @@ module OpenAI
542
542
  sig do
543
543
  returns(
544
544
  T.nilable(
545
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol
545
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
546
546
  )
547
547
  )
548
548
  end
@@ -551,7 +551,7 @@ module OpenAI
551
551
  sig do
552
552
  params(
553
553
  type:
554
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol
554
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
555
555
  ).void
556
556
  end
557
557
  attr_writer :type
@@ -567,14 +567,14 @@ module OpenAI
567
567
  T.any(
568
568
  String,
569
569
  OpenAI::Responses::ResponseInputText::OrHash,
570
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText::OrHash,
571
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::InputImage::OrHash,
570
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
571
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
572
572
  T::Array[T.anything]
573
573
  ),
574
574
  role:
575
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::OrSymbol,
575
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
576
576
  type:
577
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol
577
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
578
578
  ).returns(T.attached_class)
579
579
  end
580
580
  def self.new(
@@ -595,14 +595,14 @@ module OpenAI
595
595
  T.any(
596
596
  String,
597
597
  OpenAI::Responses::ResponseInputText,
598
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText,
599
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::InputImage,
598
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
599
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
600
600
  T::Array[T.anything]
601
601
  ),
602
602
  role:
603
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::OrSymbol,
603
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
604
604
  type:
605
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::OrSymbol
605
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
606
606
  }
607
607
  )
608
608
  end
@@ -618,8 +618,8 @@ module OpenAI
618
618
  T.any(
619
619
  String,
620
620
  OpenAI::Responses::ResponseInputText,
621
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText,
622
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::InputImage,
621
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
622
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
623
623
  T::Array[T.anything]
624
624
  )
625
625
  end
@@ -628,7 +628,7 @@ module OpenAI
628
628
  OrHash =
629
629
  T.type_alias do
630
630
  T.any(
631
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::OutputText,
631
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
632
632
  OpenAI::Internal::AnyHash
633
633
  )
634
634
  end
@@ -664,7 +664,7 @@ module OpenAI
664
664
  OrHash =
665
665
  T.type_alias do
666
666
  T.any(
667
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::InputImage,
667
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
668
668
  OpenAI::Internal::AnyHash
669
669
  )
670
670
  end
@@ -716,7 +716,7 @@ module OpenAI
716
716
  sig do
717
717
  override.returns(
718
718
  T::Array[
719
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Content::Variants
719
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::Variants
720
720
  ]
721
721
  )
722
722
  end
@@ -741,7 +741,7 @@ module OpenAI
741
741
  T.type_alias do
742
742
  T.all(
743
743
  Symbol,
744
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role
744
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role
745
745
  )
746
746
  end
747
747
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -749,28 +749,28 @@ module OpenAI
749
749
  USER =
750
750
  T.let(
751
751
  :user,
752
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol
752
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
753
753
  )
754
754
  ASSISTANT =
755
755
  T.let(
756
756
  :assistant,
757
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol
757
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
758
758
  )
759
759
  SYSTEM =
760
760
  T.let(
761
761
  :system,
762
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol
762
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
763
763
  )
764
764
  DEVELOPER =
765
765
  T.let(
766
766
  :developer,
767
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol
767
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
768
768
  )
769
769
 
770
770
  sig do
771
771
  override.returns(
772
772
  T::Array[
773
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Role::TaggedSymbol
773
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
774
774
  ]
775
775
  )
776
776
  end
@@ -786,7 +786,7 @@ module OpenAI
786
786
  T.type_alias do
787
787
  T.all(
788
788
  Symbol,
789
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type
789
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type
790
790
  )
791
791
  end
792
792
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -794,13 +794,13 @@ module OpenAI
794
794
  MESSAGE =
795
795
  T.let(
796
796
  :message,
797
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::TaggedSymbol
797
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol
798
798
  )
799
799
 
800
800
  sig do
801
801
  override.returns(
802
802
  T::Array[
803
- OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::Message::Type::TaggedSymbol
803
+ OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol
804
804
  ]
805
805
  )
806
806
  end
@@ -1175,6 +1175,7 @@ module OpenAI
1175
1175
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1176
1176
  OpenAI::Responses::Tool::LocalShell::OrHash,
1177
1177
  OpenAI::Responses::CustomTool::OrHash,
1178
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1178
1179
  OpenAI::Responses::WebSearchTool::OrHash
1179
1180
  )
1180
1181
  ]
@@ -1207,6 +1208,7 @@ module OpenAI
1207
1208
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1208
1209
  OpenAI::Responses::Tool::LocalShell::OrHash,
1209
1210
  OpenAI::Responses::CustomTool::OrHash,
1211
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1210
1212
  OpenAI::Responses::WebSearchTool::OrHash
1211
1213
  )
1212
1214
  ],
@@ -1126,6 +1126,7 @@ module OpenAI
1126
1126
  OpenAI::Responses::Tool::ImageGeneration,
1127
1127
  OpenAI::Responses::Tool::LocalShell,
1128
1128
  OpenAI::Responses::CustomTool,
1129
+ OpenAI::Responses::Tool::WebSearchTool,
1129
1130
  OpenAI::Responses::WebSearchTool
1130
1131
  )
1131
1132
  ]
@@ -1147,6 +1148,7 @@ module OpenAI
1147
1148
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1148
1149
  OpenAI::Responses::Tool::LocalShell::OrHash,
1149
1150
  OpenAI::Responses::CustomTool::OrHash,
1151
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1150
1152
  OpenAI::Responses::WebSearchTool::OrHash
1151
1153
  )
1152
1154
  ]
@@ -1179,6 +1181,7 @@ module OpenAI
1179
1181
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1180
1182
  OpenAI::Responses::Tool::LocalShell::OrHash,
1181
1183
  OpenAI::Responses::CustomTool::OrHash,
1184
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1182
1185
  OpenAI::Responses::WebSearchTool::OrHash
1183
1186
  )
1184
1187
  ],
@@ -1237,6 +1240,7 @@ module OpenAI
1237
1240
  OpenAI::Responses::Tool::ImageGeneration,
1238
1241
  OpenAI::Responses::Tool::LocalShell,
1239
1242
  OpenAI::Responses::CustomTool,
1243
+ OpenAI::Responses::Tool::WebSearchTool,
1240
1244
  OpenAI::Responses::WebSearchTool
1241
1245
  )
1242
1246
  ],
@@ -1175,6 +1175,7 @@ module OpenAI
1175
1175
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1176
1176
  OpenAI::Responses::Tool::LocalShell::OrHash,
1177
1177
  OpenAI::Responses::CustomTool::OrHash,
1178
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1178
1179
  OpenAI::Responses::WebSearchTool::OrHash
1179
1180
  )
1180
1181
  ]
@@ -1207,6 +1208,7 @@ module OpenAI
1207
1208
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1208
1209
  OpenAI::Responses::Tool::LocalShell::OrHash,
1209
1210
  OpenAI::Responses::CustomTool::OrHash,
1211
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1210
1212
  OpenAI::Responses::WebSearchTool::OrHash
1211
1213
  )
1212
1214
  ],
@@ -1171,6 +1171,7 @@ module OpenAI
1171
1171
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1172
1172
  OpenAI::Responses::Tool::LocalShell::OrHash,
1173
1173
  OpenAI::Responses::CustomTool::OrHash,
1174
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1174
1175
  OpenAI::Responses::WebSearchTool::OrHash
1175
1176
  )
1176
1177
  ]
@@ -1203,6 +1204,7 @@ module OpenAI
1203
1204
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1204
1205
  OpenAI::Responses::Tool::LocalShell::OrHash,
1205
1206
  OpenAI::Responses::CustomTool::OrHash,
1207
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1206
1208
  OpenAI::Responses::WebSearchTool::OrHash
1207
1209
  )
1208
1210
  ],
@@ -1177,6 +1177,7 @@ module OpenAI
1177
1177
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1178
1178
  OpenAI::Responses::Tool::LocalShell::OrHash,
1179
1179
  OpenAI::Responses::CustomTool::OrHash,
1180
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1180
1181
  OpenAI::Responses::WebSearchTool::OrHash
1181
1182
  )
1182
1183
  ]
@@ -1209,6 +1210,7 @@ module OpenAI
1209
1210
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
1210
1211
  OpenAI::Responses::Tool::LocalShell::OrHash,
1211
1212
  OpenAI::Responses::CustomTool::OrHash,
1213
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
1212
1214
  OpenAI::Responses::WebSearchTool::OrHash
1213
1215
  )
1214
1216
  ],
@@ -22,13 +22,6 @@ module OpenAI
22
22
  sig { params(after: String).void }
23
23
  attr_writer :after
24
24
 
25
- # An item ID to list items before, used in pagination.
26
- sig { returns(T.nilable(String)) }
27
- attr_reader :before
28
-
29
- sig { params(before: String).void }
30
- attr_writer :before
31
-
32
25
  # Additional fields to include in the response. See the `include` parameter for
33
26
  # Response creation above for more information.
34
27
  sig do
@@ -74,7 +67,6 @@ module OpenAI
74
67
  sig do
75
68
  params(
76
69
  after: String,
77
- before: String,
78
70
  include: T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol],
79
71
  limit: Integer,
80
72
  order: OpenAI::Responses::InputItemListParams::Order::OrSymbol,
@@ -84,8 +76,6 @@ module OpenAI
84
76
  def self.new(
85
77
  # An item ID to list items after, used in pagination.
86
78
  after: nil,
87
- # An item ID to list items before, used in pagination.
88
- before: nil,
89
79
  # Additional fields to include in the response. See the `include` parameter for
90
80
  # Response creation above for more information.
91
81
  include: nil,
@@ -105,7 +95,6 @@ module OpenAI
105
95
  override.returns(
106
96
  {
107
97
  after: String,
108
- before: String,
109
98
  include:
110
99
  T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol],
111
100
  limit: Integer,
@@ -136,6 +136,19 @@ module OpenAI
136
136
  sig { returns(T.nilable(T::Boolean)) }
137
137
  attr_accessor :background
138
138
 
139
+ # The conversation that this response belongs to. Input items and output items
140
+ # from this response are automatically added to this conversation.
141
+ sig { returns(T.nilable(OpenAI::Responses::Response::Conversation)) }
142
+ attr_reader :conversation
143
+
144
+ sig do
145
+ params(
146
+ conversation:
147
+ T.nilable(OpenAI::Responses::Response::Conversation::OrHash)
148
+ ).void
149
+ end
150
+ attr_writer :conversation
151
+
139
152
  # An upper bound for the number of tokens that can be generated for a response,
140
153
  # including visible output tokens and
141
154
  # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
@@ -152,6 +165,7 @@ module OpenAI
152
165
  # The unique ID of the previous response to the model. Use this to create
153
166
  # multi-turn conversations. Learn more about
154
167
  # [conversation state](https://platform.openai.com/docs/guides/conversation-state).
168
+ # Cannot be used in conjunction with `conversation`.
155
169
  sig { returns(T.nilable(String)) }
156
170
  attr_accessor :previous_response_id
157
171
 
@@ -335,11 +349,14 @@ module OpenAI
335
349
  OpenAI::Responses::Tool::ImageGeneration::OrHash,
336
350
  OpenAI::Responses::Tool::LocalShell::OrHash,
337
351
  OpenAI::Responses::CustomTool::OrHash,
352
+ OpenAI::Responses::Tool::WebSearchTool::OrHash,
338
353
  OpenAI::Responses::WebSearchTool::OrHash
339
354
  )
340
355
  ],
341
356
  top_p: T.nilable(Float),
342
357
  background: T.nilable(T::Boolean),
358
+ conversation:
359
+ T.nilable(OpenAI::Responses::Response::Conversation::OrHash),
343
360
  max_output_tokens: T.nilable(Integer),
344
361
  max_tool_calls: T.nilable(Integer),
345
362
  previous_response_id: T.nilable(String),
@@ -432,6 +449,9 @@ module OpenAI
432
449
  # Whether to run the model response in the background.
433
450
  # [Learn more](https://platform.openai.com/docs/guides/background).
434
451
  background: nil,
452
+ # The conversation that this response belongs to. Input items and output items
453
+ # from this response are automatically added to this conversation.
454
+ conversation: nil,
435
455
  # An upper bound for the number of tokens that can be generated for a response,
436
456
  # including visible output tokens and
437
457
  # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
@@ -444,6 +464,7 @@ module OpenAI
444
464
  # The unique ID of the previous response to the model. Use this to create
445
465
  # multi-turn conversations. Learn more about
446
466
  # [conversation state](https://platform.openai.com/docs/guides/conversation-state).
467
+ # Cannot be used in conjunction with `conversation`.
447
468
  previous_response_id: nil,
448
469
  # Reference to a prompt template and its variables.
449
470
  # [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
@@ -534,6 +555,8 @@ module OpenAI
534
555
  tools: T::Array[OpenAI::Responses::Tool::Variants],
535
556
  top_p: T.nilable(Float),
536
557
  background: T.nilable(T::Boolean),
558
+ conversation:
559
+ T.nilable(OpenAI::Responses::Response::Conversation),
537
560
  max_output_tokens: T.nilable(Integer),
538
561
  max_tool_calls: T.nilable(Integer),
539
562
  previous_response_id: T.nilable(String),
@@ -707,6 +730,33 @@ module OpenAI
707
730
  end
708
731
  end
709
732
 
733
+ class Conversation < OpenAI::Internal::Type::BaseModel
734
+ OrHash =
735
+ T.type_alias do
736
+ T.any(
737
+ OpenAI::Responses::Response::Conversation,
738
+ OpenAI::Internal::AnyHash
739
+ )
740
+ end
741
+
742
+ # The unique ID of the conversation.
743
+ sig { returns(String) }
744
+ attr_accessor :id
745
+
746
+ # The conversation that this response belongs to. Input items and output items
747
+ # from this response are automatically added to this conversation.
748
+ sig { params(id: String).returns(T.attached_class) }
749
+ def self.new(
750
+ # The unique ID of the conversation.
751
+ id:
752
+ )
753
+ end
754
+
755
+ sig { override.returns({ id: String }) }
756
+ def to_hash
757
+ end
758
+ end
759
+
710
760
  # Specifies the processing type used for serving the request.
711
761
  #
712
762
  # - If set to 'auto', then the request will be processed with the service tier
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Responses
6
+ class ResponseConversationParam < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Responses::ResponseConversationParam,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The unique ID of the conversation.
16
+ sig { returns(String) }
17
+ attr_accessor :id
18
+
19
+ # The conversation that this response belongs to.
20
+ sig { params(id: String).returns(T.attached_class) }
21
+ def self.new(
22
+ # The unique ID of the conversation.
23
+ id:
24
+ )
25
+ end
26
+
27
+ sig { override.returns({ id: String }) }
28
+ def to_hash
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end