openai 0.23.3 → 0.24.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/openai/errors.rb +25 -11
- data/lib/openai/internal/conversation_cursor_page.rb +1 -1
- data/lib/openai/internal/cursor_page.rb +1 -1
- data/lib/openai/internal/page.rb +1 -1
- data/lib/openai/internal/stream.rb +1 -0
- data/lib/openai/internal/transport/base_client.rb +11 -7
- data/lib/openai/internal/type/base_page.rb +1 -1
- data/lib/openai/internal/type/base_stream.rb +9 -1
- data/lib/openai/internal/util.rb +1 -1
- data/lib/openai/models/conversations/computer_screenshot_content.rb +2 -0
- data/lib/openai/models/conversations/conversation_item.rb +1 -0
- data/lib/openai/models/conversations/input_file_content.rb +1 -34
- data/lib/openai/models/conversations/input_image_content.rb +1 -54
- data/lib/openai/models/conversations/input_text_content.rb +1 -18
- data/lib/openai/models/conversations/message.rb +19 -8
- data/lib/openai/models/conversations/output_text_content.rb +1 -49
- data/lib/openai/models/conversations/refusal_content.rb +1 -18
- data/lib/openai/models/conversations/summary_text_content.rb +2 -0
- data/lib/openai/models/conversations/text_content.rb +2 -0
- data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +13 -1
- data/lib/openai/models/evals/run_cancel_response.rb +13 -1
- data/lib/openai/models/evals/run_create_params.rb +13 -1
- data/lib/openai/models/evals/run_create_response.rb +13 -1
- data/lib/openai/models/evals/run_list_response.rb +13 -1
- data/lib/openai/models/evals/run_retrieve_response.rb +13 -1
- data/lib/openai/models/evals/runs/output_item_list_response.rb +49 -4
- data/lib/openai/models/evals/runs/output_item_retrieve_response.rb +49 -4
- data/lib/openai/models/graders/score_model_grader.rb +56 -3
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +5 -10
- data/rbi/openai/errors.rbi +29 -2
- data/rbi/openai/internal/transport/base_client.rbi +4 -5
- data/rbi/openai/internal/type/base_page.rbi +1 -1
- data/rbi/openai/internal/type/base_stream.rbi +16 -1
- data/rbi/openai/internal/util.rbi +1 -1
- data/rbi/openai/models/conversations/computer_screenshot_content.rbi +1 -0
- data/rbi/openai/models/conversations/input_file_content.rbi +1 -64
- data/rbi/openai/models/conversations/input_image_content.rbi +1 -105
- data/rbi/openai/models/conversations/input_text_content.rbi +1 -30
- data/rbi/openai/models/conversations/message.rbi +12 -10
- data/rbi/openai/models/conversations/output_text_content.rbi +1 -102
- data/rbi/openai/models/conversations/refusal_content.rbi +1 -30
- data/rbi/openai/models/conversations/summary_text_content.rbi +1 -0
- data/rbi/openai/models/conversations/text_content.rbi +1 -0
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +16 -0
- data/rbi/openai/models/evals/run_cancel_response.rbi +18 -0
- data/rbi/openai/models/evals/run_create_params.rbi +18 -0
- data/rbi/openai/models/evals/run_create_response.rbi +18 -0
- data/rbi/openai/models/evals/run_list_response.rbi +18 -0
- data/rbi/openai/models/evals/run_retrieve_response.rbi +18 -0
- data/rbi/openai/models/evals/runs/output_item_list_response.rbi +88 -5
- data/rbi/openai/models/evals/runs/output_item_retrieve_response.rbi +88 -5
- data/rbi/openai/models/graders/score_model_grader.rbi +88 -4
- data/sig/openai/errors.rbs +7 -0
- data/sig/openai/internal/type/base_stream.rbs +5 -0
- data/sig/openai/models/conversations/input_file_content.rbs +1 -35
- data/sig/openai/models/conversations/input_image_content.rbs +1 -43
- data/sig/openai/models/conversations/input_text_content.rbs +1 -11
- data/sig/openai/models/conversations/message.rbs +5 -5
- data/sig/openai/models/conversations/output_text_content.rbs +1 -46
- data/sig/openai/models/conversations/refusal_content.rbs +1 -11
- data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +5 -0
- data/sig/openai/models/evals/run_cancel_response.rbs +5 -0
- data/sig/openai/models/evals/run_create_params.rbs +5 -0
- data/sig/openai/models/evals/run_create_response.rbs +5 -0
- data/sig/openai/models/evals/run_list_response.rbs +5 -0
- data/sig/openai/models/evals/run_retrieve_response.rbs +5 -0
- data/sig/openai/models/evals/runs/output_item_list_response.rbs +43 -4
- data/sig/openai/models/evals/runs/output_item_retrieve_response.rbs +43 -4
- data/sig/openai/models/graders/score_model_grader.rbs +44 -5
- metadata +2 -17
- data/lib/openai/models/conversations/container_file_citation_body.rb +0 -58
- data/lib/openai/models/conversations/file_citation_body.rb +0 -42
- data/lib/openai/models/conversations/lob_prob.rb +0 -35
- data/lib/openai/models/conversations/top_log_prob.rb +0 -29
- data/lib/openai/models/conversations/url_citation_body.rb +0 -50
- data/rbi/openai/models/conversations/container_file_citation_body.rbi +0 -82
- data/rbi/openai/models/conversations/file_citation_body.rbi +0 -61
- data/rbi/openai/models/conversations/lob_prob.rbi +0 -50
- data/rbi/openai/models/conversations/top_log_prob.rbi +0 -41
- data/rbi/openai/models/conversations/url_citation_body.rbi +0 -74
- data/sig/openai/models/conversations/container_file_citation_body.rbs +0 -47
- data/sig/openai/models/conversations/file_citation_body.rbs +0 -37
- data/sig/openai/models/conversations/lob_prob.rbs +0 -37
- data/sig/openai/models/conversations/top_log_prob.rbs +0 -28
- data/sig/openai/models/conversations/url_citation_body.rbs +0 -42
|
@@ -27,6 +27,12 @@ module OpenAI
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
sig { returns(Integer) }
|
|
31
|
+
attr_reader :status
|
|
32
|
+
|
|
33
|
+
sig { returns(T::Hash[String, String]) }
|
|
34
|
+
attr_reader :headers
|
|
35
|
+
|
|
30
36
|
sig { void }
|
|
31
37
|
def close
|
|
32
38
|
end
|
|
@@ -51,6 +57,7 @@ module OpenAI
|
|
|
51
57
|
T.any(T::Class[T.anything], OpenAI::Internal::Type::Converter),
|
|
52
58
|
url: URI::Generic,
|
|
53
59
|
status: Integer,
|
|
60
|
+
headers: T::Hash[String, String],
|
|
54
61
|
response: Net::HTTPResponse,
|
|
55
62
|
unwrap:
|
|
56
63
|
T.any(
|
|
@@ -62,7 +69,15 @@ module OpenAI
|
|
|
62
69
|
stream: T::Enumerable[Message]
|
|
63
70
|
).void
|
|
64
71
|
end
|
|
65
|
-
def initialize(
|
|
72
|
+
def initialize(
|
|
73
|
+
model:,
|
|
74
|
+
url:,
|
|
75
|
+
status:,
|
|
76
|
+
headers:,
|
|
77
|
+
response:,
|
|
78
|
+
unwrap:,
|
|
79
|
+
stream:
|
|
80
|
+
)
|
|
66
81
|
end
|
|
67
82
|
|
|
68
83
|
# @api private
|
|
@@ -361,7 +361,7 @@ module OpenAI
|
|
|
361
361
|
# Assumes each chunk in stream has `Encoding::BINARY`.
|
|
362
362
|
sig do
|
|
363
363
|
params(
|
|
364
|
-
headers: T
|
|
364
|
+
headers: T::Hash[String, String],
|
|
365
365
|
stream: T::Enumerable[String],
|
|
366
366
|
suppress_error: T::Boolean
|
|
367
367
|
).returns(T.anything)
|
|
@@ -3,70 +3,7 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Conversations
|
|
6
|
-
|
|
7
|
-
OrHash =
|
|
8
|
-
T.type_alias do
|
|
9
|
-
T.any(
|
|
10
|
-
OpenAI::Conversations::InputFileContent,
|
|
11
|
-
OpenAI::Internal::AnyHash
|
|
12
|
-
)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# The ID of the file to be sent to the model.
|
|
16
|
-
sig { returns(T.nilable(String)) }
|
|
17
|
-
attr_accessor :file_id
|
|
18
|
-
|
|
19
|
-
# The type of the input item. Always `input_file`.
|
|
20
|
-
sig { returns(Symbol) }
|
|
21
|
-
attr_accessor :type
|
|
22
|
-
|
|
23
|
-
# The URL of the file to be sent to the model.
|
|
24
|
-
sig { returns(T.nilable(String)) }
|
|
25
|
-
attr_reader :file_url
|
|
26
|
-
|
|
27
|
-
sig { params(file_url: String).void }
|
|
28
|
-
attr_writer :file_url
|
|
29
|
-
|
|
30
|
-
# The name of the file to be sent to the model.
|
|
31
|
-
sig { returns(T.nilable(String)) }
|
|
32
|
-
attr_reader :filename
|
|
33
|
-
|
|
34
|
-
sig { params(filename: String).void }
|
|
35
|
-
attr_writer :filename
|
|
36
|
-
|
|
37
|
-
sig do
|
|
38
|
-
params(
|
|
39
|
-
file_id: T.nilable(String),
|
|
40
|
-
file_url: String,
|
|
41
|
-
filename: String,
|
|
42
|
-
type: Symbol
|
|
43
|
-
).returns(T.attached_class)
|
|
44
|
-
end
|
|
45
|
-
def self.new(
|
|
46
|
-
# The ID of the file to be sent to the model.
|
|
47
|
-
file_id:,
|
|
48
|
-
# The URL of the file to be sent to the model.
|
|
49
|
-
file_url: nil,
|
|
50
|
-
# The name of the file to be sent to the model.
|
|
51
|
-
filename: nil,
|
|
52
|
-
# The type of the input item. Always `input_file`.
|
|
53
|
-
type: :input_file
|
|
54
|
-
)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
sig do
|
|
58
|
-
override.returns(
|
|
59
|
-
{
|
|
60
|
-
file_id: T.nilable(String),
|
|
61
|
-
type: Symbol,
|
|
62
|
-
file_url: String,
|
|
63
|
-
filename: String
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
end
|
|
67
|
-
def to_hash
|
|
68
|
-
end
|
|
69
|
-
end
|
|
6
|
+
InputFileContent = OpenAI::Models::Responses::ResponseInputFile
|
|
70
7
|
end
|
|
71
8
|
end
|
|
72
9
|
end
|
|
@@ -3,111 +3,7 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Conversations
|
|
6
|
-
|
|
7
|
-
OrHash =
|
|
8
|
-
T.type_alias do
|
|
9
|
-
T.any(
|
|
10
|
-
OpenAI::Conversations::InputImageContent,
|
|
11
|
-
OpenAI::Internal::AnyHash
|
|
12
|
-
)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
|
16
|
-
# `auto`. Defaults to `auto`.
|
|
17
|
-
sig do
|
|
18
|
-
returns(
|
|
19
|
-
OpenAI::Conversations::InputImageContent::Detail::TaggedSymbol
|
|
20
|
-
)
|
|
21
|
-
end
|
|
22
|
-
attr_accessor :detail
|
|
23
|
-
|
|
24
|
-
# The ID of the file to be sent to the model.
|
|
25
|
-
sig { returns(T.nilable(String)) }
|
|
26
|
-
attr_accessor :file_id
|
|
27
|
-
|
|
28
|
-
# The URL of the image to be sent to the model. A fully qualified URL or base64
|
|
29
|
-
# encoded image in a data URL.
|
|
30
|
-
sig { returns(T.nilable(String)) }
|
|
31
|
-
attr_accessor :image_url
|
|
32
|
-
|
|
33
|
-
# The type of the input item. Always `input_image`.
|
|
34
|
-
sig { returns(Symbol) }
|
|
35
|
-
attr_accessor :type
|
|
36
|
-
|
|
37
|
-
sig do
|
|
38
|
-
params(
|
|
39
|
-
detail: OpenAI::Conversations::InputImageContent::Detail::OrSymbol,
|
|
40
|
-
file_id: T.nilable(String),
|
|
41
|
-
image_url: T.nilable(String),
|
|
42
|
-
type: Symbol
|
|
43
|
-
).returns(T.attached_class)
|
|
44
|
-
end
|
|
45
|
-
def self.new(
|
|
46
|
-
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
|
47
|
-
# `auto`. Defaults to `auto`.
|
|
48
|
-
detail:,
|
|
49
|
-
# The ID of the file to be sent to the model.
|
|
50
|
-
file_id:,
|
|
51
|
-
# The URL of the image to be sent to the model. A fully qualified URL or base64
|
|
52
|
-
# encoded image in a data URL.
|
|
53
|
-
image_url:,
|
|
54
|
-
# The type of the input item. Always `input_image`.
|
|
55
|
-
type: :input_image
|
|
56
|
-
)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
sig do
|
|
60
|
-
override.returns(
|
|
61
|
-
{
|
|
62
|
-
detail:
|
|
63
|
-
OpenAI::Conversations::InputImageContent::Detail::TaggedSymbol,
|
|
64
|
-
file_id: T.nilable(String),
|
|
65
|
-
image_url: T.nilable(String),
|
|
66
|
-
type: Symbol
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
end
|
|
70
|
-
def to_hash
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
|
74
|
-
# `auto`. Defaults to `auto`.
|
|
75
|
-
module Detail
|
|
76
|
-
extend OpenAI::Internal::Type::Enum
|
|
77
|
-
|
|
78
|
-
TaggedSymbol =
|
|
79
|
-
T.type_alias do
|
|
80
|
-
T.all(Symbol, OpenAI::Conversations::InputImageContent::Detail)
|
|
81
|
-
end
|
|
82
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
83
|
-
|
|
84
|
-
LOW =
|
|
85
|
-
T.let(
|
|
86
|
-
:low,
|
|
87
|
-
OpenAI::Conversations::InputImageContent::Detail::TaggedSymbol
|
|
88
|
-
)
|
|
89
|
-
HIGH =
|
|
90
|
-
T.let(
|
|
91
|
-
:high,
|
|
92
|
-
OpenAI::Conversations::InputImageContent::Detail::TaggedSymbol
|
|
93
|
-
)
|
|
94
|
-
AUTO =
|
|
95
|
-
T.let(
|
|
96
|
-
:auto,
|
|
97
|
-
OpenAI::Conversations::InputImageContent::Detail::TaggedSymbol
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
sig do
|
|
101
|
-
override.returns(
|
|
102
|
-
T::Array[
|
|
103
|
-
OpenAI::Conversations::InputImageContent::Detail::TaggedSymbol
|
|
104
|
-
]
|
|
105
|
-
)
|
|
106
|
-
end
|
|
107
|
-
def self.values
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
6
|
+
InputImageContent = OpenAI::Models::Responses::ResponseInputImage
|
|
111
7
|
end
|
|
112
8
|
end
|
|
113
9
|
end
|
|
@@ -3,36 +3,7 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Conversations
|
|
6
|
-
|
|
7
|
-
OrHash =
|
|
8
|
-
T.type_alias do
|
|
9
|
-
T.any(
|
|
10
|
-
OpenAI::Conversations::InputTextContent,
|
|
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
|
-
sig { params(text: String, type: Symbol).returns(T.attached_class) }
|
|
24
|
-
def self.new(
|
|
25
|
-
# The text input to the model.
|
|
26
|
-
text:,
|
|
27
|
-
# The type of the input item. Always `input_text`.
|
|
28
|
-
type: :input_text
|
|
29
|
-
)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
sig { override.returns({ text: String, type: Symbol }) }
|
|
33
|
-
def to_hash
|
|
34
|
-
end
|
|
35
|
-
end
|
|
6
|
+
InputTextContent = OpenAI::Models::Responses::ResponseInputText
|
|
36
7
|
end
|
|
37
8
|
end
|
|
38
9
|
end
|
|
@@ -33,20 +33,21 @@ module OpenAI
|
|
|
33
33
|
sig { returns(Symbol) }
|
|
34
34
|
attr_accessor :type
|
|
35
35
|
|
|
36
|
+
# A message to or from the model.
|
|
36
37
|
sig do
|
|
37
38
|
params(
|
|
38
39
|
id: String,
|
|
39
40
|
content:
|
|
40
41
|
T::Array[
|
|
41
42
|
T.any(
|
|
42
|
-
OpenAI::
|
|
43
|
-
OpenAI::
|
|
43
|
+
OpenAI::Responses::ResponseInputText::OrHash,
|
|
44
|
+
OpenAI::Responses::ResponseOutputText::OrHash,
|
|
44
45
|
OpenAI::Conversations::TextContent::OrHash,
|
|
45
46
|
OpenAI::Conversations::SummaryTextContent::OrHash,
|
|
46
|
-
OpenAI::
|
|
47
|
-
OpenAI::
|
|
47
|
+
OpenAI::Responses::ResponseOutputRefusal::OrHash,
|
|
48
|
+
OpenAI::Responses::ResponseInputImage::OrHash,
|
|
48
49
|
OpenAI::Conversations::ComputerScreenshotContent::OrHash,
|
|
49
|
-
OpenAI::
|
|
50
|
+
OpenAI::Responses::ResponseInputFile::OrHash
|
|
50
51
|
)
|
|
51
52
|
],
|
|
52
53
|
role: OpenAI::Conversations::Message::Role::OrSymbol,
|
|
@@ -85,20 +86,21 @@ module OpenAI
|
|
|
85
86
|
def to_hash
|
|
86
87
|
end
|
|
87
88
|
|
|
89
|
+
# A text input to the model.
|
|
88
90
|
module Content
|
|
89
91
|
extend OpenAI::Internal::Type::Union
|
|
90
92
|
|
|
91
93
|
Variants =
|
|
92
94
|
T.type_alias do
|
|
93
95
|
T.any(
|
|
94
|
-
OpenAI::
|
|
95
|
-
OpenAI::
|
|
96
|
+
OpenAI::Responses::ResponseInputText,
|
|
97
|
+
OpenAI::Responses::ResponseOutputText,
|
|
96
98
|
OpenAI::Conversations::TextContent,
|
|
97
99
|
OpenAI::Conversations::SummaryTextContent,
|
|
98
|
-
OpenAI::
|
|
99
|
-
OpenAI::
|
|
100
|
+
OpenAI::Responses::ResponseOutputRefusal,
|
|
101
|
+
OpenAI::Responses::ResponseInputImage,
|
|
100
102
|
OpenAI::Conversations::ComputerScreenshotContent,
|
|
101
|
-
OpenAI::
|
|
103
|
+
OpenAI::Responses::ResponseInputFile
|
|
102
104
|
)
|
|
103
105
|
end
|
|
104
106
|
|
|
@@ -3,108 +3,7 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Conversations
|
|
6
|
-
|
|
7
|
-
OrHash =
|
|
8
|
-
T.type_alias do
|
|
9
|
-
T.any(
|
|
10
|
-
OpenAI::Conversations::OutputTextContent,
|
|
11
|
-
OpenAI::Internal::AnyHash
|
|
12
|
-
)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# The annotations of the text output.
|
|
16
|
-
sig do
|
|
17
|
-
returns(
|
|
18
|
-
T::Array[
|
|
19
|
-
OpenAI::Conversations::OutputTextContent::Annotation::Variants
|
|
20
|
-
]
|
|
21
|
-
)
|
|
22
|
-
end
|
|
23
|
-
attr_accessor :annotations
|
|
24
|
-
|
|
25
|
-
# The text output from the model.
|
|
26
|
-
sig { returns(String) }
|
|
27
|
-
attr_accessor :text
|
|
28
|
-
|
|
29
|
-
# The type of the output text. Always `output_text`.
|
|
30
|
-
sig { returns(Symbol) }
|
|
31
|
-
attr_accessor :type
|
|
32
|
-
|
|
33
|
-
sig { returns(T.nilable(T::Array[OpenAI::Conversations::LobProb])) }
|
|
34
|
-
attr_reader :logprobs
|
|
35
|
-
|
|
36
|
-
sig do
|
|
37
|
-
params(
|
|
38
|
-
logprobs: T::Array[OpenAI::Conversations::LobProb::OrHash]
|
|
39
|
-
).void
|
|
40
|
-
end
|
|
41
|
-
attr_writer :logprobs
|
|
42
|
-
|
|
43
|
-
sig do
|
|
44
|
-
params(
|
|
45
|
-
annotations:
|
|
46
|
-
T::Array[
|
|
47
|
-
T.any(
|
|
48
|
-
OpenAI::Conversations::FileCitationBody::OrHash,
|
|
49
|
-
OpenAI::Conversations::URLCitationBody::OrHash,
|
|
50
|
-
OpenAI::Conversations::ContainerFileCitationBody::OrHash
|
|
51
|
-
)
|
|
52
|
-
],
|
|
53
|
-
text: String,
|
|
54
|
-
logprobs: T::Array[OpenAI::Conversations::LobProb::OrHash],
|
|
55
|
-
type: Symbol
|
|
56
|
-
).returns(T.attached_class)
|
|
57
|
-
end
|
|
58
|
-
def self.new(
|
|
59
|
-
# The annotations of the text output.
|
|
60
|
-
annotations:,
|
|
61
|
-
# The text output from the model.
|
|
62
|
-
text:,
|
|
63
|
-
logprobs: nil,
|
|
64
|
-
# The type of the output text. Always `output_text`.
|
|
65
|
-
type: :output_text
|
|
66
|
-
)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
sig do
|
|
70
|
-
override.returns(
|
|
71
|
-
{
|
|
72
|
-
annotations:
|
|
73
|
-
T::Array[
|
|
74
|
-
OpenAI::Conversations::OutputTextContent::Annotation::Variants
|
|
75
|
-
],
|
|
76
|
-
text: String,
|
|
77
|
-
type: Symbol,
|
|
78
|
-
logprobs: T::Array[OpenAI::Conversations::LobProb]
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
end
|
|
82
|
-
def to_hash
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
module Annotation
|
|
86
|
-
extend OpenAI::Internal::Type::Union
|
|
87
|
-
|
|
88
|
-
Variants =
|
|
89
|
-
T.type_alias do
|
|
90
|
-
T.any(
|
|
91
|
-
OpenAI::Conversations::FileCitationBody,
|
|
92
|
-
OpenAI::Conversations::URLCitationBody,
|
|
93
|
-
OpenAI::Conversations::ContainerFileCitationBody
|
|
94
|
-
)
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
sig do
|
|
98
|
-
override.returns(
|
|
99
|
-
T::Array[
|
|
100
|
-
OpenAI::Conversations::OutputTextContent::Annotation::Variants
|
|
101
|
-
]
|
|
102
|
-
)
|
|
103
|
-
end
|
|
104
|
-
def self.variants
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
end
|
|
6
|
+
OutputTextContent = OpenAI::Models::Responses::ResponseOutputText
|
|
108
7
|
end
|
|
109
8
|
end
|
|
110
9
|
end
|
|
@@ -3,36 +3,7 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Conversations
|
|
6
|
-
|
|
7
|
-
OrHash =
|
|
8
|
-
T.type_alias do
|
|
9
|
-
T.any(
|
|
10
|
-
OpenAI::Conversations::RefusalContent,
|
|
11
|
-
OpenAI::Internal::AnyHash
|
|
12
|
-
)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# The refusal explanation from the model.
|
|
16
|
-
sig { returns(String) }
|
|
17
|
-
attr_accessor :refusal
|
|
18
|
-
|
|
19
|
-
# The type of the refusal. Always `refusal`.
|
|
20
|
-
sig { returns(Symbol) }
|
|
21
|
-
attr_accessor :type
|
|
22
|
-
|
|
23
|
-
sig { params(refusal: String, type: Symbol).returns(T.attached_class) }
|
|
24
|
-
def self.new(
|
|
25
|
-
# The refusal explanation from the model.
|
|
26
|
-
refusal:,
|
|
27
|
-
# The type of the refusal. Always `refusal`.
|
|
28
|
-
type: :refusal
|
|
29
|
-
)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
sig { override.returns({ refusal: String, type: Symbol }) }
|
|
33
|
-
def to_hash
|
|
34
|
-
end
|
|
35
|
-
end
|
|
6
|
+
RefusalContent = OpenAI::Models::Responses::ResponseOutputRefusal
|
|
36
7
|
end
|
|
37
8
|
end
|
|
38
9
|
end
|
|
@@ -887,6 +887,14 @@ module OpenAI
|
|
|
887
887
|
sig { params(max_completion_tokens: Integer).void }
|
|
888
888
|
attr_writer :max_completion_tokens
|
|
889
889
|
|
|
890
|
+
# Constrains effort on reasoning for
|
|
891
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
892
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
893
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
894
|
+
# response.
|
|
895
|
+
sig { returns(T.nilable(OpenAI::ReasoningEffort::OrSymbol)) }
|
|
896
|
+
attr_accessor :reasoning_effort
|
|
897
|
+
|
|
890
898
|
# An object specifying the format that the model must output.
|
|
891
899
|
#
|
|
892
900
|
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
@@ -963,6 +971,7 @@ module OpenAI
|
|
|
963
971
|
sig do
|
|
964
972
|
params(
|
|
965
973
|
max_completion_tokens: Integer,
|
|
974
|
+
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
966
975
|
response_format:
|
|
967
976
|
T.any(
|
|
968
977
|
OpenAI::ResponseFormatText::OrHash,
|
|
@@ -978,6 +987,12 @@ module OpenAI
|
|
|
978
987
|
def self.new(
|
|
979
988
|
# The maximum number of tokens in the generated output.
|
|
980
989
|
max_completion_tokens: nil,
|
|
990
|
+
# Constrains effort on reasoning for
|
|
991
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
992
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
993
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
994
|
+
# response.
|
|
995
|
+
reasoning_effort: nil,
|
|
981
996
|
# An object specifying the format that the model must output.
|
|
982
997
|
#
|
|
983
998
|
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
@@ -1006,6 +1021,7 @@ module OpenAI
|
|
|
1006
1021
|
override.returns(
|
|
1007
1022
|
{
|
|
1008
1023
|
max_completion_tokens: Integer,
|
|
1024
|
+
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
1009
1025
|
response_format:
|
|
1010
1026
|
T.any(
|
|
1011
1027
|
OpenAI::ResponseFormatText,
|
|
@@ -1115,6 +1115,14 @@ module OpenAI
|
|
|
1115
1115
|
sig { params(max_completion_tokens: Integer).void }
|
|
1116
1116
|
attr_writer :max_completion_tokens
|
|
1117
1117
|
|
|
1118
|
+
# Constrains effort on reasoning for
|
|
1119
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
1120
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
1121
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
1122
|
+
# response.
|
|
1123
|
+
sig { returns(T.nilable(OpenAI::ReasoningEffort::TaggedSymbol)) }
|
|
1124
|
+
attr_accessor :reasoning_effort
|
|
1125
|
+
|
|
1118
1126
|
# A seed value to initialize the randomness, during sampling.
|
|
1119
1127
|
sig { returns(T.nilable(Integer)) }
|
|
1120
1128
|
attr_reader :seed
|
|
@@ -1201,6 +1209,8 @@ module OpenAI
|
|
|
1201
1209
|
sig do
|
|
1202
1210
|
params(
|
|
1203
1211
|
max_completion_tokens: Integer,
|
|
1212
|
+
reasoning_effort:
|
|
1213
|
+
T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
1204
1214
|
seed: Integer,
|
|
1205
1215
|
temperature: Float,
|
|
1206
1216
|
text:
|
|
@@ -1226,6 +1236,12 @@ module OpenAI
|
|
|
1226
1236
|
def self.new(
|
|
1227
1237
|
# The maximum number of tokens in the generated output.
|
|
1228
1238
|
max_completion_tokens: nil,
|
|
1239
|
+
# Constrains effort on reasoning for
|
|
1240
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
1241
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
1242
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
1243
|
+
# response.
|
|
1244
|
+
reasoning_effort: nil,
|
|
1229
1245
|
# A seed value to initialize the randomness, during sampling.
|
|
1230
1246
|
seed: nil,
|
|
1231
1247
|
# A higher temperature increases randomness in the outputs.
|
|
@@ -1260,6 +1276,8 @@ module OpenAI
|
|
|
1260
1276
|
override.returns(
|
|
1261
1277
|
{
|
|
1262
1278
|
max_completion_tokens: Integer,
|
|
1279
|
+
reasoning_effort:
|
|
1280
|
+
T.nilable(OpenAI::ReasoningEffort::TaggedSymbol),
|
|
1263
1281
|
seed: Integer,
|
|
1264
1282
|
temperature: Float,
|
|
1265
1283
|
text:
|
|
@@ -1073,6 +1073,14 @@ module OpenAI
|
|
|
1073
1073
|
sig { params(max_completion_tokens: Integer).void }
|
|
1074
1074
|
attr_writer :max_completion_tokens
|
|
1075
1075
|
|
|
1076
|
+
# Constrains effort on reasoning for
|
|
1077
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
1078
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
1079
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
1080
|
+
# response.
|
|
1081
|
+
sig { returns(T.nilable(OpenAI::ReasoningEffort::OrSymbol)) }
|
|
1082
|
+
attr_accessor :reasoning_effort
|
|
1083
|
+
|
|
1076
1084
|
# A seed value to initialize the randomness, during sampling.
|
|
1077
1085
|
sig { returns(T.nilable(Integer)) }
|
|
1078
1086
|
attr_reader :seed
|
|
@@ -1176,6 +1184,8 @@ module OpenAI
|
|
|
1176
1184
|
sig do
|
|
1177
1185
|
params(
|
|
1178
1186
|
max_completion_tokens: Integer,
|
|
1187
|
+
reasoning_effort:
|
|
1188
|
+
T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
1179
1189
|
seed: Integer,
|
|
1180
1190
|
temperature: Float,
|
|
1181
1191
|
text:
|
|
@@ -1201,6 +1211,12 @@ module OpenAI
|
|
|
1201
1211
|
def self.new(
|
|
1202
1212
|
# The maximum number of tokens in the generated output.
|
|
1203
1213
|
max_completion_tokens: nil,
|
|
1214
|
+
# Constrains effort on reasoning for
|
|
1215
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
1216
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
1217
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
1218
|
+
# response.
|
|
1219
|
+
reasoning_effort: nil,
|
|
1204
1220
|
# A seed value to initialize the randomness, during sampling.
|
|
1205
1221
|
seed: nil,
|
|
1206
1222
|
# A higher temperature increases randomness in the outputs.
|
|
@@ -1235,6 +1251,8 @@ module OpenAI
|
|
|
1235
1251
|
override.returns(
|
|
1236
1252
|
{
|
|
1237
1253
|
max_completion_tokens: Integer,
|
|
1254
|
+
reasoning_effort:
|
|
1255
|
+
T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
1238
1256
|
seed: Integer,
|
|
1239
1257
|
temperature: Float,
|
|
1240
1258
|
text:
|
|
@@ -1115,6 +1115,14 @@ module OpenAI
|
|
|
1115
1115
|
sig { params(max_completion_tokens: Integer).void }
|
|
1116
1116
|
attr_writer :max_completion_tokens
|
|
1117
1117
|
|
|
1118
|
+
# Constrains effort on reasoning for
|
|
1119
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
1120
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
1121
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
1122
|
+
# response.
|
|
1123
|
+
sig { returns(T.nilable(OpenAI::ReasoningEffort::TaggedSymbol)) }
|
|
1124
|
+
attr_accessor :reasoning_effort
|
|
1125
|
+
|
|
1118
1126
|
# A seed value to initialize the randomness, during sampling.
|
|
1119
1127
|
sig { returns(T.nilable(Integer)) }
|
|
1120
1128
|
attr_reader :seed
|
|
@@ -1201,6 +1209,8 @@ module OpenAI
|
|
|
1201
1209
|
sig do
|
|
1202
1210
|
params(
|
|
1203
1211
|
max_completion_tokens: Integer,
|
|
1212
|
+
reasoning_effort:
|
|
1213
|
+
T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
1204
1214
|
seed: Integer,
|
|
1205
1215
|
temperature: Float,
|
|
1206
1216
|
text:
|
|
@@ -1226,6 +1236,12 @@ module OpenAI
|
|
|
1226
1236
|
def self.new(
|
|
1227
1237
|
# The maximum number of tokens in the generated output.
|
|
1228
1238
|
max_completion_tokens: nil,
|
|
1239
|
+
# Constrains effort on reasoning for
|
|
1240
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
1241
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
1242
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
1243
|
+
# response.
|
|
1244
|
+
reasoning_effort: nil,
|
|
1229
1245
|
# A seed value to initialize the randomness, during sampling.
|
|
1230
1246
|
seed: nil,
|
|
1231
1247
|
# A higher temperature increases randomness in the outputs.
|
|
@@ -1260,6 +1276,8 @@ module OpenAI
|
|
|
1260
1276
|
override.returns(
|
|
1261
1277
|
{
|
|
1262
1278
|
max_completion_tokens: Integer,
|
|
1279
|
+
reasoning_effort:
|
|
1280
|
+
T.nilable(OpenAI::ReasoningEffort::TaggedSymbol),
|
|
1263
1281
|
seed: Integer,
|
|
1264
1282
|
temperature: Float,
|
|
1265
1283
|
text:
|