openai 0.58.0 → 0.59.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73c6650d695d8ce23e2049359d56d6d4d2ae68971afb993c362f09b2f7bcfa37
4
- data.tar.gz: 7a47b51f536ab52ce437c98663f56642d67638a187cba7055be29b79185630a0
3
+ metadata.gz: 0474a27b4d565706e771aa87d26edda2bbed3004cf0c506c19e1c7d629f9db9d
4
+ data.tar.gz: 8af111e9a7f8435f9ffb4acb74b93d7cc679b724ef58855b223f22b4cc844707
5
5
  SHA512:
6
- metadata.gz: 84bf4110e464bab432883383984801d45c6cc9dc9dc40d23a8b70c1ceda3c498d7a835fb55773f9734e7f0891bf763d2fb71d213539b04993027518b158eb9ce
7
- data.tar.gz: fa6a7d0c969bb6a6b70779e827cb5756e8420c21b986a313bd7d8e7d00663f6f300f75d61a51156831080f6510579a79523e2433189c356d63d9ba739f9021b7
6
+ metadata.gz: e806a4a7a030edae725e87613b8eee4b196afcd063c144e1e92f64c9bdd6adaacbb3824eff5e7498045b6c87073df0de1c0f21edd420bee8d97bc913a989d186
7
+ data.tar.gz: b70cb7b78621b602b0d4692c748fe8f7ba7361b704bb9521c113dec82a95d1a488af2286b5abf5398410f2889130d55e3f9f9f65752408af007aae81b4838c94
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.59.0 (2026-04-14)
4
+
5
+ Full Changelog: [v0.58.0...v0.59.0](https://github.com/openai/openai-ruby/compare/v0.58.0...v0.59.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add detail to InputFileContent ([b747a16](https://github.com/openai/openai-ruby/commit/b747a16153e76eafadd54fd21a58db3f71d5e597))
10
+ * **api:** add OAuthErrorCode type ([643311e](https://github.com/openai/openai-ruby/commit/643311e02e36e0cbd58f7ae954735e690d788db2))
11
+
12
+
13
+ ### Documentation
14
+
15
+ * improve examples ([5aa2eba](https://github.com/openai/openai-ruby/commit/5aa2ebae024c57a4e577f52088dd5f86713da8f5))
16
+
3
17
  ## 0.58.0 (2026-04-08)
4
18
 
5
19
  Full Changelog: [v0.57.0...v0.58.0](https://github.com/openai/openai-ruby/compare/v0.57.0...v0.58.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.58.0"
18
+ gem "openai", "~> 0.59.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -10,6 +10,14 @@ module OpenAI
10
10
  # @return [Symbol, :input_file]
11
11
  required :type, const: :input_file
12
12
 
13
+ # @!attribute detail
14
+ # The detail level of the file to be sent to the model. Use `low` for the default
15
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
16
+ # `low`.
17
+ #
18
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputFile::Detail, nil]
19
+ optional :detail, enum: -> { OpenAI::Responses::ResponseInputFile::Detail }
20
+
13
21
  # @!attribute file_data
14
22
  # The content of the file to be sent to the model.
15
23
  #
@@ -34,12 +42,14 @@ module OpenAI
34
42
  # @return [String, nil]
35
43
  optional :filename, String
36
44
 
37
- # @!method initialize(file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
45
+ # @!method initialize(detail: nil, file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
38
46
  # Some parameter documentations has been truncated, see
39
47
  # {OpenAI::Models::Responses::ResponseInputFile} for more details.
40
48
  #
41
49
  # A file input to the model.
42
50
  #
51
+ # @param detail [Symbol, OpenAI::Models::Responses::ResponseInputFile::Detail] The detail level of the file to be sent to the model. Use `low` for the default
52
+ #
43
53
  # @param file_data [String] The content of the file to be sent to the model.
44
54
  #
45
55
  # @param file_id [String, nil] The ID of the file to be sent to the model.
@@ -49,6 +59,21 @@ module OpenAI
49
59
  # @param filename [String] The name of the file to be sent to the model.
50
60
  #
51
61
  # @param type [Symbol, :input_file] The type of the input item. Always `input_file`.
62
+
63
+ # The detail level of the file to be sent to the model. Use `low` for the default
64
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
65
+ # `low`.
66
+ #
67
+ # @see OpenAI::Models::Responses::ResponseInputFile#detail
68
+ module Detail
69
+ extend OpenAI::Internal::Type::Enum
70
+
71
+ LOW = :low
72
+ HIGH = :high
73
+
74
+ # @!method self.values
75
+ # @return [Array<Symbol>]
76
+ end
52
77
  end
53
78
  end
54
79
  end
@@ -10,6 +10,14 @@ module OpenAI
10
10
  # @return [Symbol, :input_file]
11
11
  required :type, const: :input_file
12
12
 
13
+ # @!attribute detail
14
+ # The detail level of the file to be sent to the model. Use `low` for the default
15
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
16
+ # `low`.
17
+ #
18
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputFileContent::Detail, nil]
19
+ optional :detail, enum: -> { OpenAI::Responses::ResponseInputFileContent::Detail }
20
+
13
21
  # @!attribute file_data
14
22
  # The base64-encoded data of the file to be sent to the model.
15
23
  #
@@ -34,9 +42,14 @@ module OpenAI
34
42
  # @return [String, nil]
35
43
  optional :filename, String, nil?: true
36
44
 
37
- # @!method initialize(file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
45
+ # @!method initialize(detail: nil, file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
46
+ # Some parameter documentations has been truncated, see
47
+ # {OpenAI::Models::Responses::ResponseInputFileContent} for more details.
48
+ #
38
49
  # A file input to the model.
39
50
  #
51
+ # @param detail [Symbol, OpenAI::Models::Responses::ResponseInputFileContent::Detail] The detail level of the file to be sent to the model. Use `low` for the default
52
+ #
40
53
  # @param file_data [String, nil] The base64-encoded data of the file to be sent to the model.
41
54
  #
42
55
  # @param file_id [String, nil] The ID of the file to be sent to the model.
@@ -46,6 +59,21 @@ module OpenAI
46
59
  # @param filename [String, nil] The name of the file to be sent to the model.
47
60
  #
48
61
  # @param type [Symbol, :input_file] The type of the input item. Always `input_file`.
62
+
63
+ # The detail level of the file to be sent to the model. Use `low` for the default
64
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
65
+ # `low`.
66
+ #
67
+ # @see OpenAI::Models::Responses::ResponseInputFileContent#detail
68
+ module Detail
69
+ extend OpenAI::Internal::Type::Enum
70
+
71
+ LOW = :low
72
+ HIGH = :high
73
+
74
+ # @!method self.values
75
+ # @return [Array<Symbol>]
76
+ end
49
77
  end
50
78
  end
51
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.58.0"
4
+ VERSION = "0.59.0"
5
5
  end
@@ -16,6 +16,23 @@ module OpenAI
16
16
  sig { returns(Symbol) }
17
17
  attr_accessor :type
18
18
 
19
+ # The detail level of the file to be sent to the model. Use `low` for the default
20
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
21
+ # `low`.
22
+ sig do
23
+ returns(
24
+ T.nilable(OpenAI::Responses::ResponseInputFile::Detail::OrSymbol)
25
+ )
26
+ end
27
+ attr_reader :detail
28
+
29
+ sig do
30
+ params(
31
+ detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol
32
+ ).void
33
+ end
34
+ attr_writer :detail
35
+
19
36
  # The content of the file to be sent to the model.
20
37
  sig { returns(T.nilable(String)) }
21
38
  attr_reader :file_data
@@ -44,6 +61,7 @@ module OpenAI
44
61
  # A file input to the model.
45
62
  sig do
46
63
  params(
64
+ detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol,
47
65
  file_data: String,
48
66
  file_id: T.nilable(String),
49
67
  file_url: String,
@@ -52,6 +70,10 @@ module OpenAI
52
70
  ).returns(T.attached_class)
53
71
  end
54
72
  def self.new(
73
+ # The detail level of the file to be sent to the model. Use `low` for the default
74
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
75
+ # `low`.
76
+ detail: nil,
55
77
  # The content of the file to be sent to the model.
56
78
  file_data: nil,
57
79
  # The ID of the file to be sent to the model.
@@ -69,6 +91,7 @@ module OpenAI
69
91
  override.returns(
70
92
  {
71
93
  type: Symbol,
94
+ detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol,
72
95
  file_data: String,
73
96
  file_id: T.nilable(String),
74
97
  file_url: String,
@@ -78,6 +101,40 @@ module OpenAI
78
101
  end
79
102
  def to_hash
80
103
  end
104
+
105
+ # The detail level of the file to be sent to the model. Use `low` for the default
106
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
107
+ # `low`.
108
+ module Detail
109
+ extend OpenAI::Internal::Type::Enum
110
+
111
+ TaggedSymbol =
112
+ T.type_alias do
113
+ T.all(Symbol, OpenAI::Responses::ResponseInputFile::Detail)
114
+ end
115
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
116
+
117
+ LOW =
118
+ T.let(
119
+ :low,
120
+ OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
121
+ )
122
+ HIGH =
123
+ T.let(
124
+ :high,
125
+ OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
126
+ )
127
+
128
+ sig do
129
+ override.returns(
130
+ T::Array[
131
+ OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
132
+ ]
133
+ )
134
+ end
135
+ def self.values
136
+ end
137
+ end
81
138
  end
82
139
  end
83
140
  end
@@ -16,6 +16,26 @@ module OpenAI
16
16
  sig { returns(Symbol) }
17
17
  attr_accessor :type
18
18
 
19
+ # The detail level of the file to be sent to the model. Use `low` for the default
20
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
21
+ # `low`.
22
+ sig do
23
+ returns(
24
+ T.nilable(
25
+ OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol
26
+ )
27
+ )
28
+ end
29
+ attr_reader :detail
30
+
31
+ sig do
32
+ params(
33
+ detail:
34
+ OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol
35
+ ).void
36
+ end
37
+ attr_writer :detail
38
+
19
39
  # The base64-encoded data of the file to be sent to the model.
20
40
  sig { returns(T.nilable(String)) }
21
41
  attr_accessor :file_data
@@ -35,6 +55,8 @@ module OpenAI
35
55
  # A file input to the model.
36
56
  sig do
37
57
  params(
58
+ detail:
59
+ OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol,
38
60
  file_data: T.nilable(String),
39
61
  file_id: T.nilable(String),
40
62
  file_url: T.nilable(String),
@@ -43,6 +65,10 @@ module OpenAI
43
65
  ).returns(T.attached_class)
44
66
  end
45
67
  def self.new(
68
+ # The detail level of the file to be sent to the model. Use `low` for the default
69
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
70
+ # `low`.
71
+ detail: nil,
46
72
  # The base64-encoded data of the file to be sent to the model.
47
73
  file_data: nil,
48
74
  # The ID of the file to be sent to the model.
@@ -60,6 +86,8 @@ module OpenAI
60
86
  override.returns(
61
87
  {
62
88
  type: Symbol,
89
+ detail:
90
+ OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol,
63
91
  file_data: T.nilable(String),
64
92
  file_id: T.nilable(String),
65
93
  file_url: T.nilable(String),
@@ -69,6 +97,40 @@ module OpenAI
69
97
  end
70
98
  def to_hash
71
99
  end
100
+
101
+ # The detail level of the file to be sent to the model. Use `low` for the default
102
+ # rendering behavior, or `high` to render the file at higher quality. Defaults to
103
+ # `low`.
104
+ module Detail
105
+ extend OpenAI::Internal::Type::Enum
106
+
107
+ TaggedSymbol =
108
+ T.type_alias do
109
+ T.all(Symbol, OpenAI::Responses::ResponseInputFileContent::Detail)
110
+ end
111
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
112
+
113
+ LOW =
114
+ T.let(
115
+ :low,
116
+ OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
117
+ )
118
+ HIGH =
119
+ T.let(
120
+ :high,
121
+ OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
122
+ )
123
+
124
+ sig do
125
+ override.returns(
126
+ T::Array[
127
+ OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
128
+ ]
129
+ )
130
+ end
131
+ def self.values
132
+ end
133
+ end
72
134
  end
73
135
  end
74
136
  end
@@ -4,6 +4,7 @@ module OpenAI
4
4
  type response_input_file =
5
5
  {
6
6
  type: :input_file,
7
+ detail: OpenAI::Models::Responses::ResponseInputFile::detail,
7
8
  file_data: String,
8
9
  file_id: String?,
9
10
  file_url: String,
@@ -13,6 +14,12 @@ module OpenAI
13
14
  class ResponseInputFile < OpenAI::Internal::Type::BaseModel
14
15
  attr_accessor type: :input_file
15
16
 
17
+ attr_reader detail: OpenAI::Models::Responses::ResponseInputFile::detail?
18
+
19
+ def detail=: (
20
+ OpenAI::Models::Responses::ResponseInputFile::detail
21
+ ) -> OpenAI::Models::Responses::ResponseInputFile::detail
22
+
16
23
  attr_reader file_data: String?
17
24
 
18
25
  def file_data=: (String) -> String
@@ -28,6 +35,7 @@ module OpenAI
28
35
  def filename=: (String) -> String
29
36
 
30
37
  def initialize: (
38
+ ?detail: OpenAI::Models::Responses::ResponseInputFile::detail,
31
39
  ?file_data: String,
32
40
  ?file_id: String?,
33
41
  ?file_url: String,
@@ -37,11 +45,23 @@ module OpenAI
37
45
 
38
46
  def to_hash: -> {
39
47
  type: :input_file,
48
+ detail: OpenAI::Models::Responses::ResponseInputFile::detail,
40
49
  file_data: String,
41
50
  file_id: String?,
42
51
  file_url: String,
43
52
  filename: String
44
53
  }
54
+
55
+ type detail = :low | :high
56
+
57
+ module Detail
58
+ extend OpenAI::Internal::Type::Enum
59
+
60
+ LOW: :low
61
+ HIGH: :high
62
+
63
+ def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseInputFile::detail]
64
+ end
45
65
  end
46
66
  end
47
67
  end
@@ -4,6 +4,7 @@ module OpenAI
4
4
  type response_input_file_content =
5
5
  {
6
6
  type: :input_file,
7
+ detail: OpenAI::Models::Responses::ResponseInputFileContent::detail,
7
8
  file_data: String?,
8
9
  file_id: String?,
9
10
  file_url: String?,
@@ -13,6 +14,12 @@ module OpenAI
13
14
  class ResponseInputFileContent < OpenAI::Internal::Type::BaseModel
14
15
  attr_accessor type: :input_file
15
16
 
17
+ attr_reader detail: OpenAI::Models::Responses::ResponseInputFileContent::detail?
18
+
19
+ def detail=: (
20
+ OpenAI::Models::Responses::ResponseInputFileContent::detail
21
+ ) -> OpenAI::Models::Responses::ResponseInputFileContent::detail
22
+
16
23
  attr_accessor file_data: String?
17
24
 
18
25
  attr_accessor file_id: String?
@@ -22,6 +29,7 @@ module OpenAI
22
29
  attr_accessor filename: String?
23
30
 
24
31
  def initialize: (
32
+ ?detail: OpenAI::Models::Responses::ResponseInputFileContent::detail,
25
33
  ?file_data: String?,
26
34
  ?file_id: String?,
27
35
  ?file_url: String?,
@@ -31,11 +39,23 @@ module OpenAI
31
39
 
32
40
  def to_hash: -> {
33
41
  type: :input_file,
42
+ detail: OpenAI::Models::Responses::ResponseInputFileContent::detail,
34
43
  file_data: String?,
35
44
  file_id: String?,
36
45
  file_url: String?,
37
46
  filename: String?
38
47
  }
48
+
49
+ type detail = :low | :high
50
+
51
+ module Detail
52
+ extend OpenAI::Internal::Type::Enum
53
+
54
+ LOW: :low
55
+ HIGH: :high
56
+
57
+ def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseInputFileContent::detail]
58
+ end
39
59
  end
40
60
  end
41
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.0
4
+ version: 0.59.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-08 00:00:00.000000000 Z
11
+ date: 2026-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64