openai 0.27.1 → 0.28.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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/openai/internal/transport/pooled_net_requester.rb +7 -10
  5. data/lib/openai/internal/type/base_stream.rb +0 -17
  6. data/lib/openai/models/batch.rb +23 -1
  7. data/lib/openai/models/batch_usage.rb +84 -0
  8. data/lib/openai/models/responses/response_custom_tool_call_output.rb +47 -4
  9. data/lib/openai/models/responses/response_function_call_arguments_done_event.rb +9 -1
  10. data/lib/openai/models/responses/response_function_call_output_item.rb +26 -0
  11. data/lib/openai/models/responses/response_function_call_output_item_list.rb +11 -0
  12. data/lib/openai/models/responses/response_function_tool_call_output_item.rb +47 -4
  13. data/lib/openai/models/responses/response_input_file_content.rb +52 -0
  14. data/lib/openai/models/responses/response_input_image_content.rb +65 -0
  15. data/lib/openai/models/responses/response_input_item.rb +19 -4
  16. data/lib/openai/models/responses/response_input_text_content.rb +28 -0
  17. data/lib/openai/models.rb +2 -0
  18. data/lib/openai/version.rb +1 -1
  19. data/lib/openai.rb +6 -0
  20. data/rbi/openai/internal/type/base_stream.rbi +0 -15
  21. data/rbi/openai/models/batch.rbi +35 -1
  22. data/rbi/openai/models/batch_usage.rbi +139 -0
  23. data/rbi/openai/models/responses/response_custom_tool_call_output.rbi +77 -5
  24. data/rbi/openai/models/responses/response_function_call_arguments_done_event.rbi +8 -0
  25. data/rbi/openai/models/responses/response_function_call_output_item.rbi +31 -0
  26. data/rbi/openai/models/responses/response_function_call_output_item_list.rbi +15 -0
  27. data/rbi/openai/models/responses/response_function_tool_call_output_item.rbi +72 -5
  28. data/rbi/openai/models/responses/response_input_file_content.rbi +75 -0
  29. data/rbi/openai/models/responses/response_input_image_content.rbi +125 -0
  30. data/rbi/openai/models/responses/response_input_item.rbi +36 -5
  31. data/rbi/openai/models/responses/response_input_text_content.rbi +39 -0
  32. data/rbi/openai/models.rbi +2 -0
  33. data/sig/openai/internal/type/base_stream.rbs +0 -4
  34. data/sig/openai/models/batch.rbs +16 -2
  35. data/sig/openai/models/batch_usage.rbs +60 -0
  36. data/sig/openai/models/responses/response_custom_tool_call_output.rbs +27 -4
  37. data/sig/openai/models/responses/response_function_call_arguments_done_event.rbs +5 -0
  38. data/sig/openai/models/responses/response_function_call_output_item.rbs +16 -0
  39. data/sig/openai/models/responses/response_function_call_output_item_list.rbs +10 -0
  40. data/sig/openai/models/responses/response_function_tool_call_output_item.rbs +27 -4
  41. data/sig/openai/models/responses/response_input_file_content.rbs +42 -0
  42. data/sig/openai/models/responses/response_input_image_content.rbs +49 -0
  43. data/sig/openai/models/responses/response_input_item.rbs +14 -4
  44. data/sig/openai/models/responses/response_input_text_content.rbs +17 -0
  45. data/sig/openai/models.rbs +2 -0
  46. metadata +19 -1
@@ -0,0 +1,125 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Responses
6
+ class ResponseInputImageContent < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Responses::ResponseInputImageContent,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The type of the input item. Always `input_image`.
16
+ sig { returns(Symbol) }
17
+ attr_accessor :type
18
+
19
+ # The detail level of the image to be sent to the model. One of `high`, `low`, or
20
+ # `auto`. Defaults to `auto`.
21
+ sig do
22
+ returns(
23
+ T.nilable(
24
+ OpenAI::Responses::ResponseInputImageContent::Detail::OrSymbol
25
+ )
26
+ )
27
+ end
28
+ attr_accessor :detail
29
+
30
+ # The ID of the file to be sent to the model.
31
+ sig { returns(T.nilable(String)) }
32
+ attr_accessor :file_id
33
+
34
+ # The URL of the image to be sent to the model. A fully qualified URL or base64
35
+ # encoded image in a data URL.
36
+ sig { returns(T.nilable(String)) }
37
+ attr_accessor :image_url
38
+
39
+ # An image input to the model. Learn about
40
+ # [image inputs](https://platform.openai.com/docs/guides/vision)
41
+ sig do
42
+ params(
43
+ detail:
44
+ T.nilable(
45
+ OpenAI::Responses::ResponseInputImageContent::Detail::OrSymbol
46
+ ),
47
+ file_id: T.nilable(String),
48
+ image_url: T.nilable(String),
49
+ type: Symbol
50
+ ).returns(T.attached_class)
51
+ end
52
+ def self.new(
53
+ # The detail level of the image to be sent to the model. One of `high`, `low`, or
54
+ # `auto`. Defaults to `auto`.
55
+ detail: nil,
56
+ # The ID of the file to be sent to the model.
57
+ file_id: nil,
58
+ # The URL of the image to be sent to the model. A fully qualified URL or base64
59
+ # encoded image in a data URL.
60
+ image_url: nil,
61
+ # The type of the input item. Always `input_image`.
62
+ type: :input_image
63
+ )
64
+ end
65
+
66
+ sig do
67
+ override.returns(
68
+ {
69
+ type: Symbol,
70
+ detail:
71
+ T.nilable(
72
+ OpenAI::Responses::ResponseInputImageContent::Detail::OrSymbol
73
+ ),
74
+ file_id: T.nilable(String),
75
+ image_url: T.nilable(String)
76
+ }
77
+ )
78
+ end
79
+ def to_hash
80
+ end
81
+
82
+ # The detail level of the image to be sent to the model. One of `high`, `low`, or
83
+ # `auto`. Defaults to `auto`.
84
+ module Detail
85
+ extend OpenAI::Internal::Type::Enum
86
+
87
+ TaggedSymbol =
88
+ T.type_alias do
89
+ T.all(
90
+ Symbol,
91
+ OpenAI::Responses::ResponseInputImageContent::Detail
92
+ )
93
+ end
94
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
95
+
96
+ LOW =
97
+ T.let(
98
+ :low,
99
+ OpenAI::Responses::ResponseInputImageContent::Detail::TaggedSymbol
100
+ )
101
+ HIGH =
102
+ T.let(
103
+ :high,
104
+ OpenAI::Responses::ResponseInputImageContent::Detail::TaggedSymbol
105
+ )
106
+ AUTO =
107
+ T.let(
108
+ :auto,
109
+ OpenAI::Responses::ResponseInputImageContent::Detail::TaggedSymbol
110
+ )
111
+
112
+ sig do
113
+ override.returns(
114
+ T::Array[
115
+ OpenAI::Responses::ResponseInputImageContent::Detail::TaggedSymbol
116
+ ]
117
+ )
118
+ end
119
+ def self.values
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -508,8 +508,12 @@ module OpenAI
508
508
  sig { returns(String) }
509
509
  attr_accessor :call_id
510
510
 
511
- # A JSON string of the output of the function tool call.
512
- sig { returns(String) }
511
+ # Text, image, or file output of the function tool call.
512
+ sig do
513
+ returns(
514
+ OpenAI::Responses::ResponseInputItem::FunctionCallOutput::Output::Variants
515
+ )
516
+ end
513
517
  attr_accessor :output
514
518
 
515
519
  # The type of the function tool call output. Always `function_call_output`.
@@ -536,7 +540,8 @@ module OpenAI
536
540
  sig do
537
541
  params(
538
542
  call_id: String,
539
- output: String,
543
+ output:
544
+ OpenAI::Responses::ResponseInputItem::FunctionCallOutput::Output::Variants,
540
545
  id: T.nilable(String),
541
546
  status:
542
547
  T.nilable(
@@ -548,7 +553,7 @@ module OpenAI
548
553
  def self.new(
549
554
  # The unique ID of the function tool call generated by the model.
550
555
  call_id:,
551
- # A JSON string of the output of the function tool call.
556
+ # Text, image, or file output of the function tool call.
552
557
  output:,
553
558
  # The unique ID of the function tool call output. Populated when this item is
554
559
  # returned via API.
@@ -565,7 +570,8 @@ module OpenAI
565
570
  override.returns(
566
571
  {
567
572
  call_id: String,
568
- output: String,
573
+ output:
574
+ OpenAI::Responses::ResponseInputItem::FunctionCallOutput::Output::Variants,
569
575
  type: Symbol,
570
576
  id: T.nilable(String),
571
577
  status:
@@ -578,6 +584,31 @@ module OpenAI
578
584
  def to_hash
579
585
  end
580
586
 
587
+ # Text, image, or file output of the function tool call.
588
+ module Output
589
+ extend OpenAI::Internal::Type::Union
590
+
591
+ Variants =
592
+ T.type_alias do
593
+ T.any(
594
+ String,
595
+ T::Array[
596
+ OpenAI::Responses::ResponseFunctionCallOutputItem::Variants
597
+ ]
598
+ )
599
+ end
600
+
601
+ sig do
602
+ override.returns(
603
+ T::Array[
604
+ OpenAI::Responses::ResponseInputItem::FunctionCallOutput::Output::Variants
605
+ ]
606
+ )
607
+ end
608
+ def self.variants
609
+ end
610
+ end
611
+
581
612
  # The status of the item. One of `in_progress`, `completed`, or `incomplete`.
582
613
  # Populated when items are returned via API.
583
614
  module Status
@@ -0,0 +1,39 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Responses
6
+ class ResponseInputTextContent < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Responses::ResponseInputTextContent,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The text input to the model.
16
+ sig { returns(String) }
17
+ attr_accessor :text
18
+
19
+ # The type of the input item. Always `input_text`.
20
+ sig { returns(Symbol) }
21
+ attr_accessor :type
22
+
23
+ # A text input to the model.
24
+ sig { params(text: String, type: Symbol).returns(T.attached_class) }
25
+ def self.new(
26
+ # The text input to the model.
27
+ text:,
28
+ # The type of the input item. Always `input_text`.
29
+ type: :input_text
30
+ )
31
+ end
32
+
33
+ sig { override.returns({ text: String, type: Symbol }) }
34
+ def to_hash
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -25,6 +25,8 @@ module OpenAI
25
25
 
26
26
  BatchRetrieveParams = OpenAI::Models::BatchRetrieveParams
27
27
 
28
+ BatchUsage = OpenAI::Models::BatchUsage
29
+
28
30
  Beta = OpenAI::Models::Beta
29
31
 
30
32
  Chat = OpenAI::Models::Chat
@@ -4,10 +4,6 @@ module OpenAI
4
4
  module BaseStream[Message, Elem]
5
5
  include Enumerable[Elem]
6
6
 
7
- def self.defer_closing: (
8
- Enumerable[top] stream
9
- ) -> (^(Integer arg0) -> void)
10
-
11
7
  attr_reader status: Integer
12
8
 
13
9
  attr_reader headers: ::Hash[String, String]
@@ -20,8 +20,10 @@ module OpenAI
20
20
  finalizing_at: Integer,
21
21
  in_progress_at: Integer,
22
22
  metadata: OpenAI::Models::metadata?,
23
+ model: String,
23
24
  output_file_id: String,
24
- request_counts: OpenAI::BatchRequestCounts
25
+ request_counts: OpenAI::BatchRequestCounts,
26
+ usage: OpenAI::BatchUsage
25
27
  }
26
28
 
27
29
  class Batch < OpenAI::Internal::Type::BaseModel
@@ -81,6 +83,10 @@ module OpenAI
81
83
 
82
84
  attr_accessor metadata: OpenAI::Models::metadata?
83
85
 
86
+ attr_reader model: String?
87
+
88
+ def model=: (String) -> String
89
+
84
90
  attr_reader output_file_id: String?
85
91
 
86
92
  def output_file_id=: (String) -> String
@@ -91,6 +97,10 @@ module OpenAI
91
97
  OpenAI::BatchRequestCounts
92
98
  ) -> OpenAI::BatchRequestCounts
93
99
 
100
+ attr_reader usage: OpenAI::BatchUsage?
101
+
102
+ def usage=: (OpenAI::BatchUsage) -> OpenAI::BatchUsage
103
+
94
104
  def initialize: (
95
105
  id: String,
96
106
  completion_window: String,
@@ -109,8 +119,10 @@ module OpenAI
109
119
  ?finalizing_at: Integer,
110
120
  ?in_progress_at: Integer,
111
121
  ?metadata: OpenAI::Models::metadata?,
122
+ ?model: String,
112
123
  ?output_file_id: String,
113
124
  ?request_counts: OpenAI::BatchRequestCounts,
125
+ ?usage: OpenAI::BatchUsage,
114
126
  ?object: :batch
115
127
  ) -> void
116
128
 
@@ -133,8 +145,10 @@ module OpenAI
133
145
  finalizing_at: Integer,
134
146
  in_progress_at: Integer,
135
147
  metadata: OpenAI::Models::metadata?,
148
+ model: String,
136
149
  output_file_id: String,
137
- request_counts: OpenAI::BatchRequestCounts
150
+ request_counts: OpenAI::BatchRequestCounts,
151
+ usage: OpenAI::BatchUsage
138
152
  }
139
153
 
140
154
  type status =
@@ -0,0 +1,60 @@
1
+ module OpenAI
2
+ module Models
3
+ type batch_usage =
4
+ {
5
+ input_tokens: Integer,
6
+ input_tokens_details: OpenAI::BatchUsage::InputTokensDetails,
7
+ output_tokens: Integer,
8
+ output_tokens_details: OpenAI::BatchUsage::OutputTokensDetails,
9
+ total_tokens: Integer
10
+ }
11
+
12
+ class BatchUsage < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor input_tokens: Integer
14
+
15
+ attr_accessor input_tokens_details: OpenAI::BatchUsage::InputTokensDetails
16
+
17
+ attr_accessor output_tokens: Integer
18
+
19
+ attr_accessor output_tokens_details: OpenAI::BatchUsage::OutputTokensDetails
20
+
21
+ attr_accessor total_tokens: Integer
22
+
23
+ def initialize: (
24
+ input_tokens: Integer,
25
+ input_tokens_details: OpenAI::BatchUsage::InputTokensDetails,
26
+ output_tokens: Integer,
27
+ output_tokens_details: OpenAI::BatchUsage::OutputTokensDetails,
28
+ total_tokens: Integer
29
+ ) -> void
30
+
31
+ def to_hash: -> {
32
+ input_tokens: Integer,
33
+ input_tokens_details: OpenAI::BatchUsage::InputTokensDetails,
34
+ output_tokens: Integer,
35
+ output_tokens_details: OpenAI::BatchUsage::OutputTokensDetails,
36
+ total_tokens: Integer
37
+ }
38
+
39
+ type input_tokens_details = { cached_tokens: Integer }
40
+
41
+ class InputTokensDetails < OpenAI::Internal::Type::BaseModel
42
+ attr_accessor cached_tokens: Integer
43
+
44
+ def initialize: (cached_tokens: Integer) -> void
45
+
46
+ def to_hash: -> { cached_tokens: Integer }
47
+ end
48
+
49
+ type output_tokens_details = { reasoning_tokens: Integer }
50
+
51
+ class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
52
+ attr_accessor reasoning_tokens: Integer
53
+
54
+ def initialize: (reasoning_tokens: Integer) -> void
55
+
56
+ def to_hash: -> { reasoning_tokens: Integer }
57
+ end
58
+ end
59
+ end
60
+ end
@@ -4,7 +4,7 @@ module OpenAI
4
4
  type response_custom_tool_call_output =
5
5
  {
6
6
  call_id: String,
7
- output: String,
7
+ output: OpenAI::Models::Responses::ResponseCustomToolCallOutput::output,
8
8
  type: :custom_tool_call_output,
9
9
  id: String
10
10
  }
@@ -12,7 +12,7 @@ module OpenAI
12
12
  class ResponseCustomToolCallOutput < OpenAI::Internal::Type::BaseModel
13
13
  attr_accessor call_id: String
14
14
 
15
- attr_accessor output: String
15
+ attr_accessor output: OpenAI::Models::Responses::ResponseCustomToolCallOutput::output
16
16
 
17
17
  attr_accessor type: :custom_tool_call_output
18
18
 
@@ -22,17 +22,40 @@ module OpenAI
22
22
 
23
23
  def initialize: (
24
24
  call_id: String,
25
- output: String,
25
+ output: OpenAI::Models::Responses::ResponseCustomToolCallOutput::output,
26
26
  ?id: String,
27
27
  ?type: :custom_tool_call_output
28
28
  ) -> void
29
29
 
30
30
  def to_hash: -> {
31
31
  call_id: String,
32
- output: String,
32
+ output: OpenAI::Models::Responses::ResponseCustomToolCallOutput::output,
33
33
  type: :custom_tool_call_output,
34
34
  id: String
35
35
  }
36
+
37
+ type output =
38
+ String
39
+ | ::Array[OpenAI::Models::Responses::ResponseCustomToolCallOutput::Output::output_content_list]
40
+
41
+ module Output
42
+ extend OpenAI::Internal::Type::Union
43
+
44
+ type output_content_list =
45
+ OpenAI::Responses::ResponseInputText
46
+ | OpenAI::Responses::ResponseInputImage
47
+ | OpenAI::Responses::ResponseInputFile
48
+
49
+ module OutputContentList
50
+ extend OpenAI::Internal::Type::Union
51
+
52
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseCustomToolCallOutput::Output::output_content_list]
53
+ end
54
+
55
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseCustomToolCallOutput::output]
56
+
57
+ OutputContentListArray: OpenAI::Internal::Type::Converter
58
+ end
36
59
  end
37
60
  end
38
61
  end
@@ -5,6 +5,7 @@ module OpenAI
5
5
  {
6
6
  arguments: String,
7
7
  item_id: String,
8
+ name: String,
8
9
  output_index: Integer,
9
10
  sequence_number: Integer,
10
11
  type: :"response.function_call_arguments.done"
@@ -15,6 +16,8 @@ module OpenAI
15
16
 
16
17
  attr_accessor item_id: String
17
18
 
19
+ attr_accessor name: String
20
+
18
21
  attr_accessor output_index: Integer
19
22
 
20
23
  attr_accessor sequence_number: Integer
@@ -24,6 +27,7 @@ module OpenAI
24
27
  def initialize: (
25
28
  arguments: String,
26
29
  item_id: String,
30
+ name: String,
27
31
  output_index: Integer,
28
32
  sequence_number: Integer,
29
33
  ?type: :"response.function_call_arguments.done"
@@ -32,6 +36,7 @@ module OpenAI
32
36
  def to_hash: -> {
33
37
  arguments: String,
34
38
  item_id: String,
39
+ name: String,
35
40
  output_index: Integer,
36
41
  sequence_number: Integer,
37
42
  type: :"response.function_call_arguments.done"
@@ -0,0 +1,16 @@
1
+ module OpenAI
2
+ module Models
3
+ module Responses
4
+ type response_function_call_output_item =
5
+ OpenAI::Responses::ResponseInputTextContent
6
+ | OpenAI::Responses::ResponseInputImageContent
7
+ | OpenAI::Responses::ResponseInputFileContent
8
+
9
+ module ResponseFunctionCallOutputItem
10
+ extend OpenAI::Internal::Type::Union
11
+
12
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::response_function_call_output_item]
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ module OpenAI
2
+ module Models
3
+ module Responses
4
+ type response_function_call_output_item_list =
5
+ ::Array[OpenAI::Models::Responses::response_function_call_output_item]
6
+
7
+ ResponseFunctionCallOutputItemList: OpenAI::Internal::Type::Converter
8
+ end
9
+ end
10
+ end
@@ -5,7 +5,7 @@ module OpenAI
5
5
  {
6
6
  id: String,
7
7
  call_id: String,
8
- output: String,
8
+ output: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::output,
9
9
  type: :function_call_output,
10
10
  status: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::status
11
11
  }
@@ -15,7 +15,7 @@ module OpenAI
15
15
 
16
16
  attr_accessor call_id: String
17
17
 
18
- attr_accessor output: String
18
+ attr_accessor output: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::output
19
19
 
20
20
  attr_accessor type: :function_call_output
21
21
 
@@ -28,7 +28,7 @@ module OpenAI
28
28
  def initialize: (
29
29
  id: String,
30
30
  call_id: String,
31
- output: String,
31
+ output: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::output,
32
32
  ?status: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::status,
33
33
  ?type: :function_call_output
34
34
  ) -> void
@@ -36,11 +36,34 @@ module OpenAI
36
36
  def to_hash: -> {
37
37
  id: String,
38
38
  call_id: String,
39
- output: String,
39
+ output: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::output,
40
40
  type: :function_call_output,
41
41
  status: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::status
42
42
  }
43
43
 
44
+ type output =
45
+ String
46
+ | ::Array[OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Output::output_content_list]
47
+
48
+ module Output
49
+ extend OpenAI::Internal::Type::Union
50
+
51
+ type output_content_list =
52
+ OpenAI::Responses::ResponseInputText
53
+ | OpenAI::Responses::ResponseInputImage
54
+ | OpenAI::Responses::ResponseInputFile
55
+
56
+ module OutputContentList
57
+ extend OpenAI::Internal::Type::Union
58
+
59
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Output::output_content_list]
60
+ end
61
+
62
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::output]
63
+
64
+ OutputContentListArray: OpenAI::Internal::Type::Converter
65
+ end
66
+
44
67
  type status = :in_progress | :completed | :incomplete
45
68
 
46
69
  module Status
@@ -0,0 +1,42 @@
1
+ module OpenAI
2
+ module Models
3
+ module Responses
4
+ type response_input_file_content =
5
+ {
6
+ type: :input_file,
7
+ file_data: String?,
8
+ file_id: String?,
9
+ file_url: String?,
10
+ filename: String?
11
+ }
12
+
13
+ class ResponseInputFileContent < OpenAI::Internal::Type::BaseModel
14
+ attr_accessor type: :input_file
15
+
16
+ attr_accessor file_data: String?
17
+
18
+ attr_accessor file_id: String?
19
+
20
+ attr_accessor file_url: String?
21
+
22
+ attr_accessor filename: String?
23
+
24
+ def initialize: (
25
+ ?file_data: String?,
26
+ ?file_id: String?,
27
+ ?file_url: String?,
28
+ ?filename: String?,
29
+ ?type: :input_file
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ type: :input_file,
34
+ file_data: String?,
35
+ file_id: String?,
36
+ file_url: String?,
37
+ filename: String?
38
+ }
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,49 @@
1
+ module OpenAI
2
+ module Models
3
+ module Responses
4
+ type response_input_image_content =
5
+ {
6
+ type: :input_image,
7
+ detail: OpenAI::Models::Responses::ResponseInputImageContent::detail?,
8
+ file_id: String?,
9
+ image_url: String?
10
+ }
11
+
12
+ class ResponseInputImageContent < OpenAI::Internal::Type::BaseModel
13
+ attr_accessor type: :input_image
14
+
15
+ attr_accessor detail: OpenAI::Models::Responses::ResponseInputImageContent::detail?
16
+
17
+ attr_accessor file_id: String?
18
+
19
+ attr_accessor image_url: String?
20
+
21
+ def initialize: (
22
+ ?detail: OpenAI::Models::Responses::ResponseInputImageContent::detail?,
23
+ ?file_id: String?,
24
+ ?image_url: String?,
25
+ ?type: :input_image
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ type: :input_image,
30
+ detail: OpenAI::Models::Responses::ResponseInputImageContent::detail?,
31
+ file_id: String?,
32
+ image_url: String?
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::Responses::ResponseInputImageContent::detail]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end