openai 0.23.3 → 0.25.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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/openai/errors.rb +25 -11
  5. data/lib/openai/internal/conversation_cursor_page.rb +1 -1
  6. data/lib/openai/internal/cursor_page.rb +1 -1
  7. data/lib/openai/internal/page.rb +1 -1
  8. data/lib/openai/internal/stream.rb +1 -0
  9. data/lib/openai/internal/transport/base_client.rb +11 -7
  10. data/lib/openai/internal/type/base_page.rb +1 -1
  11. data/lib/openai/internal/type/base_stream.rb +9 -1
  12. data/lib/openai/internal/util.rb +1 -1
  13. data/lib/openai/models/conversations/computer_screenshot_content.rb +2 -0
  14. data/lib/openai/models/conversations/conversation_item.rb +1 -0
  15. data/lib/openai/models/conversations/input_file_content.rb +1 -34
  16. data/lib/openai/models/conversations/input_image_content.rb +1 -54
  17. data/lib/openai/models/conversations/input_text_content.rb +1 -18
  18. data/lib/openai/models/conversations/message.rb +43 -8
  19. data/lib/openai/models/conversations/output_text_content.rb +1 -49
  20. data/lib/openai/models/conversations/refusal_content.rb +1 -18
  21. data/lib/openai/models/conversations/summary_text_content.rb +7 -2
  22. data/lib/openai/models/conversations/text_content.rb +2 -0
  23. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +13 -1
  24. data/lib/openai/models/evals/run_cancel_response.rb +13 -1
  25. data/lib/openai/models/evals/run_create_params.rb +13 -1
  26. data/lib/openai/models/evals/run_create_response.rb +13 -1
  27. data/lib/openai/models/evals/run_list_response.rb +13 -1
  28. data/lib/openai/models/evals/run_retrieve_response.rb +13 -1
  29. data/lib/openai/models/evals/runs/output_item_list_response.rb +49 -4
  30. data/lib/openai/models/evals/runs/output_item_retrieve_response.rb +49 -4
  31. data/lib/openai/models/graders/score_model_grader.rb +56 -3
  32. data/lib/openai/models/responses/response_content.rb +25 -1
  33. data/lib/openai/models/responses/response_content_part_added_event.rb +27 -3
  34. data/lib/openai/models/responses/response_content_part_done_event.rb +27 -3
  35. data/lib/openai/models/responses/response_reasoning_item.rb +6 -8
  36. data/lib/openai/version.rb +1 -1
  37. data/lib/openai.rb +5 -10
  38. data/rbi/openai/errors.rbi +29 -2
  39. data/rbi/openai/internal/transport/base_client.rbi +4 -5
  40. data/rbi/openai/internal/type/base_page.rbi +1 -1
  41. data/rbi/openai/internal/type/base_stream.rbi +16 -1
  42. data/rbi/openai/internal/util.rbi +1 -1
  43. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +1 -0
  44. data/rbi/openai/models/conversations/input_file_content.rbi +1 -64
  45. data/rbi/openai/models/conversations/input_image_content.rbi +1 -105
  46. data/rbi/openai/models/conversations/input_text_content.rbi +1 -30
  47. data/rbi/openai/models/conversations/message.rbi +46 -10
  48. data/rbi/openai/models/conversations/output_text_content.rbi +1 -102
  49. data/rbi/openai/models/conversations/refusal_content.rbi +1 -30
  50. data/rbi/openai/models/conversations/summary_text_content.rbi +9 -1
  51. data/rbi/openai/models/conversations/text_content.rbi +1 -0
  52. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +16 -0
  53. data/rbi/openai/models/evals/run_cancel_response.rbi +18 -0
  54. data/rbi/openai/models/evals/run_create_params.rbi +18 -0
  55. data/rbi/openai/models/evals/run_create_response.rbi +18 -0
  56. data/rbi/openai/models/evals/run_list_response.rbi +18 -0
  57. data/rbi/openai/models/evals/run_retrieve_response.rbi +18 -0
  58. data/rbi/openai/models/evals/runs/output_item_list_response.rbi +88 -5
  59. data/rbi/openai/models/evals/runs/output_item_retrieve_response.rbi +88 -5
  60. data/rbi/openai/models/graders/score_model_grader.rbi +88 -4
  61. data/rbi/openai/models/responses/response_content.rbi +34 -1
  62. data/rbi/openai/models/responses/response_content_part_added_event.rbi +36 -2
  63. data/rbi/openai/models/responses/response_content_part_done_event.rbi +36 -2
  64. data/rbi/openai/models/responses/response_reasoning_item.rbi +6 -4
  65. data/sig/openai/errors.rbs +7 -0
  66. data/sig/openai/internal/type/base_stream.rbs +5 -0
  67. data/sig/openai/models/conversations/input_file_content.rbs +1 -35
  68. data/sig/openai/models/conversations/input_image_content.rbs +1 -43
  69. data/sig/openai/models/conversations/input_text_content.rbs +1 -11
  70. data/sig/openai/models/conversations/message.rbs +18 -5
  71. data/sig/openai/models/conversations/output_text_content.rbs +1 -46
  72. data/sig/openai/models/conversations/refusal_content.rbs +1 -11
  73. data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +5 -0
  74. data/sig/openai/models/evals/run_cancel_response.rbs +5 -0
  75. data/sig/openai/models/evals/run_create_params.rbs +5 -0
  76. data/sig/openai/models/evals/run_create_response.rbs +5 -0
  77. data/sig/openai/models/evals/run_list_response.rbs +5 -0
  78. data/sig/openai/models/evals/run_retrieve_response.rbs +5 -0
  79. data/sig/openai/models/evals/runs/output_item_list_response.rbs +43 -4
  80. data/sig/openai/models/evals/runs/output_item_retrieve_response.rbs +43 -4
  81. data/sig/openai/models/graders/score_model_grader.rbs +44 -5
  82. data/sig/openai/models/responses/response_content.rbs +13 -0
  83. data/sig/openai/models/responses/response_content_part_added_event.rbs +13 -0
  84. data/sig/openai/models/responses/response_content_part_done_event.rbs +13 -0
  85. metadata +2 -17
  86. data/lib/openai/models/conversations/container_file_citation_body.rb +0 -58
  87. data/lib/openai/models/conversations/file_citation_body.rb +0 -42
  88. data/lib/openai/models/conversations/lob_prob.rb +0 -35
  89. data/lib/openai/models/conversations/top_log_prob.rb +0 -29
  90. data/lib/openai/models/conversations/url_citation_body.rb +0 -50
  91. data/rbi/openai/models/conversations/container_file_citation_body.rbi +0 -82
  92. data/rbi/openai/models/conversations/file_citation_body.rbi +0 -61
  93. data/rbi/openai/models/conversations/lob_prob.rbi +0 -50
  94. data/rbi/openai/models/conversations/top_log_prob.rbi +0 -41
  95. data/rbi/openai/models/conversations/url_citation_body.rbi +0 -74
  96. data/sig/openai/models/conversations/container_file_citation_body.rbs +0 -47
  97. data/sig/openai/models/conversations/file_citation_body.rbs +0 -37
  98. data/sig/openai/models/conversations/lob_prob.rbs +0 -37
  99. data/sig/openai/models/conversations/top_log_prob.rbs +0 -28
  100. data/sig/openai/models/conversations/url_citation_body.rbs +0 -42
@@ -35,10 +35,17 @@ module OpenAI
35
35
  attr_writer :range
36
36
 
37
37
  # The sampling parameters for the model.
38
- sig { returns(T.nilable(T.anything)) }
38
+ sig do
39
+ returns(T.nilable(OpenAI::Graders::ScoreModelGrader::SamplingParams))
40
+ end
39
41
  attr_reader :sampling_params
40
42
 
41
- sig { params(sampling_params: T.anything).void }
43
+ sig do
44
+ params(
45
+ sampling_params:
46
+ OpenAI::Graders::ScoreModelGrader::SamplingParams::OrHash
47
+ ).void
48
+ end
42
49
  attr_writer :sampling_params
43
50
 
44
51
  # A ScoreModelGrader object that uses a model to assign a score to the input.
@@ -48,7 +55,8 @@ module OpenAI
48
55
  model: String,
49
56
  name: String,
50
57
  range: T::Array[Float],
51
- sampling_params: T.anything,
58
+ sampling_params:
59
+ OpenAI::Graders::ScoreModelGrader::SamplingParams::OrHash,
52
60
  type: Symbol
53
61
  ).returns(T.attached_class)
54
62
  end
@@ -76,7 +84,7 @@ module OpenAI
76
84
  name: String,
77
85
  type: Symbol,
78
86
  range: T::Array[Float],
79
- sampling_params: T.anything
87
+ sampling_params: OpenAI::Graders::ScoreModelGrader::SamplingParams
80
88
  }
81
89
  )
82
90
  end
@@ -372,6 +380,82 @@ module OpenAI
372
380
  end
373
381
  end
374
382
  end
383
+
384
+ class SamplingParams < OpenAI::Internal::Type::BaseModel
385
+ OrHash =
386
+ T.type_alias do
387
+ T.any(
388
+ OpenAI::Graders::ScoreModelGrader::SamplingParams,
389
+ OpenAI::Internal::AnyHash
390
+ )
391
+ end
392
+
393
+ # The maximum number of tokens the grader model may generate in its response.
394
+ sig { returns(T.nilable(Integer)) }
395
+ attr_accessor :max_completions_tokens
396
+
397
+ # Constrains effort on reasoning for
398
+ # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
399
+ # supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
400
+ # effort can result in faster responses and fewer tokens used on reasoning in a
401
+ # response.
402
+ sig { returns(T.nilable(OpenAI::ReasoningEffort::OrSymbol)) }
403
+ attr_accessor :reasoning_effort
404
+
405
+ # A seed value to initialize the randomness, during sampling.
406
+ sig { returns(T.nilable(Integer)) }
407
+ attr_accessor :seed
408
+
409
+ # A higher temperature increases randomness in the outputs.
410
+ sig { returns(T.nilable(Float)) }
411
+ attr_accessor :temperature
412
+
413
+ # An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
414
+ sig { returns(T.nilable(Float)) }
415
+ attr_accessor :top_p
416
+
417
+ # The sampling parameters for the model.
418
+ sig do
419
+ params(
420
+ max_completions_tokens: T.nilable(Integer),
421
+ reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
422
+ seed: T.nilable(Integer),
423
+ temperature: T.nilable(Float),
424
+ top_p: T.nilable(Float)
425
+ ).returns(T.attached_class)
426
+ end
427
+ def self.new(
428
+ # The maximum number of tokens the grader model may generate in its response.
429
+ max_completions_tokens: nil,
430
+ # Constrains effort on reasoning for
431
+ # [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
432
+ # supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
433
+ # effort can result in faster responses and fewer tokens used on reasoning in a
434
+ # response.
435
+ reasoning_effort: nil,
436
+ # A seed value to initialize the randomness, during sampling.
437
+ seed: nil,
438
+ # A higher temperature increases randomness in the outputs.
439
+ temperature: nil,
440
+ # An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
441
+ top_p: nil
442
+ )
443
+ end
444
+
445
+ sig do
446
+ override.returns(
447
+ {
448
+ max_completions_tokens: T.nilable(Integer),
449
+ reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
450
+ seed: T.nilable(Integer),
451
+ temperature: T.nilable(Float),
452
+ top_p: T.nilable(Float)
453
+ }
454
+ )
455
+ end
456
+ def to_hash
457
+ end
458
+ end
375
459
  end
376
460
  end
377
461
  end
@@ -15,10 +15,43 @@ module OpenAI
15
15
  OpenAI::Responses::ResponseInputFile,
16
16
  OpenAI::Responses::ResponseInputAudio,
17
17
  OpenAI::Responses::ResponseOutputText,
18
- OpenAI::Responses::ResponseOutputRefusal
18
+ OpenAI::Responses::ResponseOutputRefusal,
19
+ OpenAI::Responses::ResponseContent::ReasoningTextContent
19
20
  )
20
21
  end
21
22
 
23
+ class ReasoningTextContent < OpenAI::Internal::Type::BaseModel
24
+ OrHash =
25
+ T.type_alias do
26
+ T.any(
27
+ OpenAI::Responses::ResponseContent::ReasoningTextContent,
28
+ OpenAI::Internal::AnyHash
29
+ )
30
+ end
31
+
32
+ # The reasoning text from the model.
33
+ sig { returns(String) }
34
+ attr_accessor :text
35
+
36
+ # The type of the reasoning text. Always `reasoning_text`.
37
+ sig { returns(Symbol) }
38
+ attr_accessor :type
39
+
40
+ # Reasoning text from the model.
41
+ sig { params(text: String, type: Symbol).returns(T.attached_class) }
42
+ def self.new(
43
+ # The reasoning text from the model.
44
+ text:,
45
+ # The type of the reasoning text. Always `reasoning_text`.
46
+ type: :reasoning_text
47
+ )
48
+ end
49
+
50
+ sig { override.returns({ text: String, type: Symbol }) }
51
+ def to_hash
52
+ end
53
+ end
54
+
22
55
  sig do
23
56
  override.returns(
24
57
  T::Array[OpenAI::Responses::ResponseContent::Variants]
@@ -49,7 +49,8 @@ module OpenAI
49
49
  part:
50
50
  T.any(
51
51
  OpenAI::Responses::ResponseOutputText::OrHash,
52
- OpenAI::Responses::ResponseOutputRefusal::OrHash
52
+ OpenAI::Responses::ResponseOutputRefusal::OrHash,
53
+ OpenAI::Responses::ResponseContentPartAddedEvent::Part::ReasoningText::OrHash
53
54
  ),
54
55
  sequence_number: Integer,
55
56
  type: Symbol
@@ -95,10 +96,43 @@ module OpenAI
95
96
  T.type_alias do
96
97
  T.any(
97
98
  OpenAI::Responses::ResponseOutputText,
98
- OpenAI::Responses::ResponseOutputRefusal
99
+ OpenAI::Responses::ResponseOutputRefusal,
100
+ OpenAI::Responses::ResponseContentPartAddedEvent::Part::ReasoningText
99
101
  )
100
102
  end
101
103
 
104
+ class ReasoningText < OpenAI::Internal::Type::BaseModel
105
+ OrHash =
106
+ T.type_alias do
107
+ T.any(
108
+ OpenAI::Responses::ResponseContentPartAddedEvent::Part::ReasoningText,
109
+ OpenAI::Internal::AnyHash
110
+ )
111
+ end
112
+
113
+ # The reasoning text from the model.
114
+ sig { returns(String) }
115
+ attr_accessor :text
116
+
117
+ # The type of the reasoning text. Always `reasoning_text`.
118
+ sig { returns(Symbol) }
119
+ attr_accessor :type
120
+
121
+ # Reasoning text from the model.
122
+ sig { params(text: String, type: Symbol).returns(T.attached_class) }
123
+ def self.new(
124
+ # The reasoning text from the model.
125
+ text:,
126
+ # The type of the reasoning text. Always `reasoning_text`.
127
+ type: :reasoning_text
128
+ )
129
+ end
130
+
131
+ sig { override.returns({ text: String, type: Symbol }) }
132
+ def to_hash
133
+ end
134
+ end
135
+
102
136
  sig do
103
137
  override.returns(
104
138
  T::Array[
@@ -49,7 +49,8 @@ module OpenAI
49
49
  part:
50
50
  T.any(
51
51
  OpenAI::Responses::ResponseOutputText::OrHash,
52
- OpenAI::Responses::ResponseOutputRefusal::OrHash
52
+ OpenAI::Responses::ResponseOutputRefusal::OrHash,
53
+ OpenAI::Responses::ResponseContentPartDoneEvent::Part::ReasoningText::OrHash
53
54
  ),
54
55
  sequence_number: Integer,
55
56
  type: Symbol
@@ -95,10 +96,43 @@ module OpenAI
95
96
  T.type_alias do
96
97
  T.any(
97
98
  OpenAI::Responses::ResponseOutputText,
98
- OpenAI::Responses::ResponseOutputRefusal
99
+ OpenAI::Responses::ResponseOutputRefusal,
100
+ OpenAI::Responses::ResponseContentPartDoneEvent::Part::ReasoningText
99
101
  )
100
102
  end
101
103
 
104
+ class ReasoningText < OpenAI::Internal::Type::BaseModel
105
+ OrHash =
106
+ T.type_alias do
107
+ T.any(
108
+ OpenAI::Responses::ResponseContentPartDoneEvent::Part::ReasoningText,
109
+ OpenAI::Internal::AnyHash
110
+ )
111
+ end
112
+
113
+ # The reasoning text from the model.
114
+ sig { returns(String) }
115
+ attr_accessor :text
116
+
117
+ # The type of the reasoning text. Always `reasoning_text`.
118
+ sig { returns(Symbol) }
119
+ attr_accessor :type
120
+
121
+ # Reasoning text from the model.
122
+ sig { params(text: String, type: Symbol).returns(T.attached_class) }
123
+ def self.new(
124
+ # The reasoning text from the model.
125
+ text:,
126
+ # The type of the reasoning text. Always `reasoning_text`.
127
+ type: :reasoning_text
128
+ )
129
+ end
130
+
131
+ sig { override.returns({ text: String, type: Symbol }) }
132
+ def to_hash
133
+ end
134
+ end
135
+
102
136
  sig do
103
137
  override.returns(
104
138
  T::Array[
@@ -141,6 +141,7 @@ module OpenAI
141
141
  sig { returns(Symbol) }
142
142
  attr_accessor :type
143
143
 
144
+ # A summary text from the model.
144
145
  sig { params(text: String, type: Symbol).returns(T.attached_class) }
145
146
  def self.new(
146
147
  # A summary of the reasoning output from the model so far.
@@ -164,19 +165,20 @@ module OpenAI
164
165
  )
165
166
  end
166
167
 
167
- # Reasoning text output from the model.
168
+ # The reasoning text from the model.
168
169
  sig { returns(String) }
169
170
  attr_accessor :text
170
171
 
171
- # The type of the object. Always `reasoning_text`.
172
+ # The type of the reasoning text. Always `reasoning_text`.
172
173
  sig { returns(Symbol) }
173
174
  attr_accessor :type
174
175
 
176
+ # Reasoning text from the model.
175
177
  sig { params(text: String, type: Symbol).returns(T.attached_class) }
176
178
  def self.new(
177
- # Reasoning text output from the model.
179
+ # The reasoning text from the model.
178
180
  text:,
179
- # The type of the object. Always `reasoning_text`.
181
+ # The type of the reasoning text. Always `reasoning_text`.
180
182
  type: :reasoning_text
181
183
  )
182
184
  end
@@ -21,6 +21,8 @@ module OpenAI
21
21
 
22
22
  attr_accessor status: Integer?
23
23
 
24
+ attr_accessor headers: ::Hash[String, String]?
25
+
24
26
  attr_accessor body: top?
25
27
 
26
28
  attr_accessor code: String?
@@ -32,6 +34,7 @@ module OpenAI
32
34
  def initialize: (
33
35
  url: URI::Generic,
34
36
  ?status: Integer?,
37
+ ?headers: ::Hash[String, String]?,
35
38
  ?body: Object?,
36
39
  ?request: nil,
37
40
  ?response: nil,
@@ -43,6 +46,7 @@ module OpenAI
43
46
  def initialize: (
44
47
  url: URI::Generic,
45
48
  ?status: nil,
49
+ ?headers: ::Hash[String, String]?,
46
50
  ?body: nil,
47
51
  ?request: nil,
48
52
  ?response: nil,
@@ -54,6 +58,7 @@ module OpenAI
54
58
  def initialize: (
55
59
  url: URI::Generic,
56
60
  ?status: nil,
61
+ ?headers: ::Hash[String, String]?,
57
62
  ?body: nil,
58
63
  ?request: nil,
59
64
  ?response: nil,
@@ -65,6 +70,7 @@ module OpenAI
65
70
  def self.for: (
66
71
  url: URI::Generic,
67
72
  status: Integer,
73
+ headers: ::Hash[String, String]?,
68
74
  body: Object?,
69
75
  request: nil,
70
76
  response: nil,
@@ -74,6 +80,7 @@ module OpenAI
74
80
  def initialize: (
75
81
  url: URI::Generic,
76
82
  status: Integer,
83
+ headers: ::Hash[String, String]?,
77
84
  body: Object?,
78
85
  request: nil,
79
86
  response: nil,
@@ -8,6 +8,10 @@ module OpenAI
8
8
  Enumerable[top] stream
9
9
  ) -> (^(Integer arg0) -> void)
10
10
 
11
+ attr_reader status: Integer
12
+
13
+ attr_reader headers: ::Hash[String, String]
14
+
11
15
  def close: -> void
12
16
 
13
17
  private def iterator: -> Enumerable[Elem]
@@ -22,6 +26,7 @@ module OpenAI
22
26
  model: Class | OpenAI::Internal::Type::Converter,
23
27
  url: URI::Generic,
24
28
  status: Integer,
29
+ headers: ::Hash[String, String],
25
30
  response: top,
26
31
  unwrap: Symbol
27
32
  | Integer
@@ -1,41 +1,7 @@
1
1
  module OpenAI
2
2
  module Models
3
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
4
+ class InputFileContent = OpenAI::Models::Responses::ResponseInputFile
39
5
  end
40
6
  end
41
7
  end
@@ -1,49 +1,7 @@
1
1
  module OpenAI
2
2
  module Models
3
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
4
+ class InputImageContent = OpenAI::Models::Responses::ResponseInputImage
47
5
  end
48
6
  end
49
7
  end
@@ -1,17 +1,7 @@
1
1
  module OpenAI
2
2
  module Models
3
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
4
+ class InputTextContent = OpenAI::Models::Responses::ResponseInputText
15
5
  end
16
6
  end
17
7
  end
@@ -38,18 +38,31 @@ module OpenAI
38
38
  }
39
39
 
40
40
  type content =
41
- OpenAI::Conversations::InputTextContent
42
- | OpenAI::Conversations::OutputTextContent
41
+ OpenAI::Responses::ResponseInputText
42
+ | OpenAI::Responses::ResponseOutputText
43
43
  | OpenAI::Conversations::TextContent
44
44
  | OpenAI::Conversations::SummaryTextContent
45
- | OpenAI::Conversations::RefusalContent
46
- | OpenAI::Conversations::InputImageContent
45
+ | OpenAI::Conversations::Message::Content::ReasoningText
46
+ | OpenAI::Responses::ResponseOutputRefusal
47
+ | OpenAI::Responses::ResponseInputImage
47
48
  | OpenAI::Conversations::ComputerScreenshotContent
48
- | OpenAI::Conversations::InputFileContent
49
+ | OpenAI::Responses::ResponseInputFile
49
50
 
50
51
  module Content
51
52
  extend OpenAI::Internal::Type::Union
52
53
 
54
+ type reasoning_text = { text: String, type: :reasoning_text }
55
+
56
+ class ReasoningText < OpenAI::Internal::Type::BaseModel
57
+ attr_accessor text: String
58
+
59
+ attr_accessor type: :reasoning_text
60
+
61
+ def initialize: (text: String, ?type: :reasoning_text) -> void
62
+
63
+ def to_hash: -> { text: String, type: :reasoning_text }
64
+ end
65
+
53
66
  def self?.variants: -> ::Array[OpenAI::Models::Conversations::Message::content]
54
67
  end
55
68
 
@@ -1,52 +1,7 @@
1
1
  module OpenAI
2
2
  module Models
3
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
4
+ class OutputTextContent = OpenAI::Models::Responses::ResponseOutputText
50
5
  end
51
6
  end
52
7
  end
@@ -1,17 +1,7 @@
1
1
  module OpenAI
2
2
  module Models
3
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
4
+ class RefusalContent = OpenAI::Models::Responses::ResponseOutputRefusal
15
5
  end
16
6
  end
17
7
  end
@@ -333,6 +333,7 @@ module OpenAI
333
333
  type sampling_params =
334
334
  {
335
335
  max_completion_tokens: Integer,
336
+ reasoning_effort: OpenAI::Models::reasoning_effort?,
336
337
  response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
337
338
  seed: Integer,
338
339
  temperature: Float,
@@ -345,6 +346,8 @@ module OpenAI
345
346
 
346
347
  def max_completion_tokens=: (Integer) -> Integer
347
348
 
349
+ attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort?
350
+
348
351
  attr_reader response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format?
349
352
 
350
353
  def response_format=: (
@@ -371,6 +374,7 @@ module OpenAI
371
374
 
372
375
  def initialize: (
373
376
  ?max_completion_tokens: Integer,
377
+ ?reasoning_effort: OpenAI::Models::reasoning_effort?,
374
378
  ?response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
375
379
  ?seed: Integer,
376
380
  ?temperature: Float,
@@ -380,6 +384,7 @@ module OpenAI
380
384
 
381
385
  def to_hash: -> {
382
386
  max_completion_tokens: Integer,
387
+ reasoning_effort: OpenAI::Models::reasoning_effort?,
383
388
  response_format: OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams::response_format,
384
389
  seed: Integer,
385
390
  temperature: Float,
@@ -459,6 +459,7 @@ module OpenAI
459
459
  type sampling_params =
460
460
  {
461
461
  max_completion_tokens: Integer,
462
+ reasoning_effort: OpenAI::Models::reasoning_effort?,
462
463
  seed: Integer,
463
464
  temperature: Float,
464
465
  text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text,
@@ -471,6 +472,8 @@ module OpenAI
471
472
 
472
473
  def max_completion_tokens=: (Integer) -> Integer
473
474
 
475
+ attr_accessor reasoning_effort: OpenAI::Models::reasoning_effort?
476
+
474
477
  attr_reader seed: Integer?
475
478
 
476
479
  def seed=: (Integer) -> Integer
@@ -497,6 +500,7 @@ module OpenAI
497
500
 
498
501
  def initialize: (
499
502
  ?max_completion_tokens: Integer,
503
+ ?reasoning_effort: OpenAI::Models::reasoning_effort?,
500
504
  ?seed: Integer,
501
505
  ?temperature: Float,
502
506
  ?text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text,
@@ -506,6 +510,7 @@ module OpenAI
506
510
 
507
511
  def to_hash: -> {
508
512
  max_completion_tokens: Integer,
513
+ reasoning_effort: OpenAI::Models::reasoning_effort?,
509
514
  seed: Integer,
510
515
  temperature: Float,
511
516
  text: OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams::Text,