Skip to content

Commit c7bdda2

Browse files
fix(api): manual updates for ruby build
1 parent 1d8a9a9 commit c7bdda2

File tree

5 files changed

+257
-2
lines changed

5 files changed

+257
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 136
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-cded37ac004364c2110ebdacf922ef611b3c51258790c72ca479dcfad4df66aa.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-235aa1c75c6cc178b97d074a4671343469f458c4a306ef7beb4e45ab252aa589.yml
33
openapi_spec_hash: 6e615d34cf8c6bc76e0c6933fc8569af
4-
config_hash: d013f4fdd4dd59c6f376a9ca482b7f9e
4+
config_hash: c028ce402ef5f71da947c3f15bf6046d

lib/openai.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@
385385
require_relative "openai/models/fine_tuning/supervised_method"
386386
require_relative "openai/models/function_definition"
387387
require_relative "openai/models/function_parameters"
388+
require_relative "openai/models/graders/grader_input_item"
388389
require_relative "openai/models/graders/grader_inputs"
389390
require_relative "openai/models/graders/label_model_grader"
390391
require_relative "openai/models/graders/multi_grader"
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# frozen_string_literal: true
2+
3+
module OpenAI
4+
module Models
5+
module Graders
6+
# A single content item: input text, output text, input image, or input audio.
7+
module GraderInputItem
8+
extend OpenAI::Internal::Type::Union
9+
10+
# A text input to the model.
11+
variant String
12+
13+
# A text input to the model.
14+
variant -> { OpenAI::Responses::ResponseInputText }
15+
16+
# A text output from the model.
17+
variant -> { OpenAI::Graders::GraderInputItem::OutputText }
18+
19+
# An image input block used within EvalItem content arrays.
20+
variant -> { OpenAI::Graders::GraderInputItem::InputImage }
21+
22+
# An audio input to the model.
23+
variant -> { OpenAI::Responses::ResponseInputAudio }
24+
25+
class OutputText < OpenAI::Internal::Type::BaseModel
26+
# @!attribute text
27+
# The text output from the model.
28+
#
29+
# @return [String]
30+
required :text, String
31+
32+
# @!attribute type
33+
# The type of the output text. Always `output_text`.
34+
#
35+
# @return [Symbol, :output_text]
36+
required :type, const: :output_text
37+
38+
# @!method initialize(text:, type: :output_text)
39+
# Some parameter documentations has been truncated, see
40+
# {OpenAI::Models::Graders::GraderInputItem::OutputText} for more details.
41+
#
42+
# A text output from the model.
43+
#
44+
# @param text [String] The text output from the model.
45+
#
46+
# @param type [Symbol, :output_text] The type of the output text. Always `output_text`.
47+
end
48+
49+
class InputImage < OpenAI::Internal::Type::BaseModel
50+
# @!attribute image_url
51+
# The URL of the image input.
52+
#
53+
# @return [String]
54+
required :image_url, String
55+
56+
# @!attribute type
57+
# The type of the image input. Always `input_image`.
58+
#
59+
# @return [Symbol, :input_image]
60+
required :type, const: :input_image
61+
62+
# @!attribute detail
63+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
64+
# `auto`. Defaults to `auto`.
65+
#
66+
# @return [String, nil]
67+
optional :detail, String
68+
69+
# @!method initialize(image_url:, detail: nil, type: :input_image)
70+
# Some parameter documentations has been truncated, see
71+
# {OpenAI::Models::Graders::GraderInputItem::InputImage} for more details.
72+
#
73+
# An image input block used within EvalItem content arrays.
74+
#
75+
# @param image_url [String] The URL of the image input.
76+
#
77+
# @param detail [String] The detail level of the image to be sent to the model. One of `high`, `low`, or
78+
#
79+
# @param type [Symbol, :input_image] The type of the image input. Always `input_image`.
80+
end
81+
82+
# @!method self.variants
83+
# @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Graders::GraderInputItem::OutputText, OpenAI::Models::Graders::GraderInputItem::InputImage, OpenAI::Models::Responses::ResponseInputAudio)]
84+
end
85+
end
86+
end
87+
end
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# typed: strong
2+
3+
module OpenAI
4+
module Models
5+
module Graders
6+
# A single content item: input text, output text, input image, or input audio.
7+
module GraderInputItem
8+
extend OpenAI::Internal::Type::Union
9+
10+
Variants =
11+
T.type_alias do
12+
T.any(
13+
String,
14+
OpenAI::Responses::ResponseInputText,
15+
OpenAI::Graders::GraderInputItem::OutputText,
16+
OpenAI::Graders::GraderInputItem::InputImage,
17+
OpenAI::Responses::ResponseInputAudio
18+
)
19+
end
20+
21+
class OutputText < OpenAI::Internal::Type::BaseModel
22+
OrHash =
23+
T.type_alias do
24+
T.any(
25+
OpenAI::Graders::GraderInputItem::OutputText,
26+
OpenAI::Internal::AnyHash
27+
)
28+
end
29+
30+
# The text output from the model.
31+
sig { returns(String) }
32+
attr_accessor :text
33+
34+
# The type of the output text. Always `output_text`.
35+
sig { returns(Symbol) }
36+
attr_accessor :type
37+
38+
# A text output from the model.
39+
sig { params(text: String, type: Symbol).returns(T.attached_class) }
40+
def self.new(
41+
# The text output from the model.
42+
text:,
43+
# The type of the output text. Always `output_text`.
44+
type: :output_text
45+
)
46+
end
47+
48+
sig { override.returns({ text: String, type: Symbol }) }
49+
def to_hash
50+
end
51+
end
52+
53+
class InputImage < OpenAI::Internal::Type::BaseModel
54+
OrHash =
55+
T.type_alias do
56+
T.any(
57+
OpenAI::Graders::GraderInputItem::InputImage,
58+
OpenAI::Internal::AnyHash
59+
)
60+
end
61+
62+
# The URL of the image input.
63+
sig { returns(String) }
64+
attr_accessor :image_url
65+
66+
# The type of the image input. Always `input_image`.
67+
sig { returns(Symbol) }
68+
attr_accessor :type
69+
70+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
71+
# `auto`. Defaults to `auto`.
72+
sig { returns(T.nilable(String)) }
73+
attr_reader :detail
74+
75+
sig { params(detail: String).void }
76+
attr_writer :detail
77+
78+
# An image input block used within EvalItem content arrays.
79+
sig do
80+
params(image_url: String, detail: String, type: Symbol).returns(
81+
T.attached_class
82+
)
83+
end
84+
def self.new(
85+
# The URL of the image input.
86+
image_url:,
87+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
88+
# `auto`. Defaults to `auto`.
89+
detail: nil,
90+
# The type of the image input. Always `input_image`.
91+
type: :input_image
92+
)
93+
end
94+
95+
sig do
96+
override.returns(
97+
{ image_url: String, type: Symbol, detail: String }
98+
)
99+
end
100+
def to_hash
101+
end
102+
end
103+
104+
sig do
105+
override.returns(T::Array[OpenAI::Graders::GraderInputItem::Variants])
106+
end
107+
def self.variants
108+
end
109+
end
110+
end
111+
end
112+
end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
module OpenAI
2+
module Models
3+
module Graders
4+
type grader_input_item =
5+
String
6+
| OpenAI::Responses::ResponseInputText
7+
| OpenAI::Graders::GraderInputItem::OutputText
8+
| OpenAI::Graders::GraderInputItem::InputImage
9+
| OpenAI::Responses::ResponseInputAudio
10+
11+
module GraderInputItem
12+
extend OpenAI::Internal::Type::Union
13+
14+
type output_text = { text: String, type: :output_text }
15+
16+
class OutputText < OpenAI::Internal::Type::BaseModel
17+
attr_accessor text: String
18+
19+
attr_accessor type: :output_text
20+
21+
def initialize: (text: String, ?type: :output_text) -> void
22+
23+
def to_hash: -> { text: String, type: :output_text }
24+
end
25+
26+
type input_image =
27+
{ image_url: String, type: :input_image, detail: String }
28+
29+
class InputImage < OpenAI::Internal::Type::BaseModel
30+
attr_accessor image_url: String
31+
32+
attr_accessor type: :input_image
33+
34+
attr_reader detail: String?
35+
36+
def detail=: (String) -> String
37+
38+
def initialize: (
39+
image_url: String,
40+
?detail: String,
41+
?type: :input_image
42+
) -> void
43+
44+
def to_hash: -> {
45+
image_url: String,
46+
type: :input_image,
47+
detail: String
48+
}
49+
end
50+
51+
def self?.variants: -> ::Array[OpenAI::Models::Graders::grader_input_item]
52+
end
53+
end
54+
end
55+
end

0 commit comments

Comments
 (0)