openai 0.13.0 → 0.13.1
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 +13 -0
- data/README.md +1 -1
- data/lib/openai/helpers/structured_output/json_schema_converter.rb +34 -10
- data/lib/openai/models/eval_create_params.rb +50 -5
- data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +50 -5
- data/lib/openai/models/evals/run_cancel_response.rb +48 -5
- data/lib/openai/models/evals/run_create_params.rb +50 -5
- data/lib/openai/models/evals/run_create_response.rb +48 -5
- data/lib/openai/models/evals/run_list_response.rb +48 -5
- data/lib/openai/models/evals/run_retrieve_response.rb +48 -5
- data/lib/openai/models/graders/label_model_grader.rb +48 -5
- data/lib/openai/models/graders/score_model_grader.rb +48 -5
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/helpers/structured_output/json_schema_converter.rbi +4 -0
- data/rbi/openai/models/eval_create_params.rbi +76 -7
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +76 -7
- data/rbi/openai/models/evals/run_cancel_response.rbi +70 -5
- data/rbi/openai/models/evals/run_create_params.rbi +76 -7
- data/rbi/openai/models/evals/run_create_response.rbi +70 -5
- data/rbi/openai/models/evals/run_list_response.rbi +70 -5
- data/rbi/openai/models/evals/run_retrieve_response.rbi +70 -5
- data/rbi/openai/models/graders/label_model_grader.rbi +74 -7
- data/rbi/openai/models/graders/score_model_grader.rbi +74 -7
- data/sig/openai/models/eval_create_params.rbs +29 -0
- data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +29 -0
- data/sig/openai/models/evals/run_cancel_response.rbs +33 -0
- data/sig/openai/models/evals/run_create_params.rbs +33 -0
- data/sig/openai/models/evals/run_create_response.rbs +33 -0
- data/sig/openai/models/evals/run_list_response.rbs +33 -0
- data/sig/openai/models/evals/run_retrieve_response.rbs +33 -0
- data/sig/openai/models/graders/label_model_grader.rbs +29 -0
- data/sig/openai/models/graders/score_model_grader.rbs +29 -0
- metadata +2 -2
@@ -749,7 +749,7 @@ module OpenAI
|
|
749
749
|
)
|
750
750
|
end
|
751
751
|
|
752
|
-
#
|
752
|
+
# Inputs to the model - can contain template strings.
|
753
753
|
sig do
|
754
754
|
returns(
|
755
755
|
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::Variants
|
@@ -795,7 +795,9 @@ module OpenAI
|
|
795
795
|
T.any(
|
796
796
|
String,
|
797
797
|
OpenAI::Responses::ResponseInputText::OrHash,
|
798
|
-
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash
|
798
|
+
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
|
799
|
+
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
|
800
|
+
T::Array[T.anything]
|
799
801
|
),
|
800
802
|
role:
|
801
803
|
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
@@ -804,7 +806,7 @@ module OpenAI
|
|
804
806
|
).returns(T.attached_class)
|
805
807
|
end
|
806
808
|
def self.new(
|
807
|
-
#
|
809
|
+
# Inputs to the model - can contain template strings.
|
808
810
|
content:,
|
809
811
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
810
812
|
# `developer`.
|
@@ -829,7 +831,7 @@ module OpenAI
|
|
829
831
|
def to_hash
|
830
832
|
end
|
831
833
|
|
832
|
-
#
|
834
|
+
# Inputs to the model - can contain template strings.
|
833
835
|
module Content
|
834
836
|
extend OpenAI::Internal::Type::Union
|
835
837
|
|
@@ -838,7 +840,9 @@ module OpenAI
|
|
838
840
|
T.any(
|
839
841
|
String,
|
840
842
|
OpenAI::Responses::ResponseInputText,
|
841
|
-
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText
|
843
|
+
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
844
|
+
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
845
|
+
T::Array[T.anything]
|
842
846
|
)
|
843
847
|
end
|
844
848
|
|
@@ -878,6 +882,59 @@ module OpenAI
|
|
878
882
|
end
|
879
883
|
end
|
880
884
|
|
885
|
+
class InputImage < OpenAI::Internal::Type::BaseModel
|
886
|
+
OrHash =
|
887
|
+
T.type_alias do
|
888
|
+
T.any(
|
889
|
+
OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
890
|
+
OpenAI::Internal::AnyHash
|
891
|
+
)
|
892
|
+
end
|
893
|
+
|
894
|
+
# The URL of the image input.
|
895
|
+
sig { returns(String) }
|
896
|
+
attr_accessor :image_url
|
897
|
+
|
898
|
+
# The type of the image input. Always `input_image`.
|
899
|
+
sig { returns(Symbol) }
|
900
|
+
attr_accessor :type
|
901
|
+
|
902
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
903
|
+
# `auto`. Defaults to `auto`.
|
904
|
+
sig { returns(T.nilable(String)) }
|
905
|
+
attr_reader :detail
|
906
|
+
|
907
|
+
sig { params(detail: String).void }
|
908
|
+
attr_writer :detail
|
909
|
+
|
910
|
+
# An image input to the model.
|
911
|
+
sig do
|
912
|
+
params(
|
913
|
+
image_url: String,
|
914
|
+
detail: String,
|
915
|
+
type: Symbol
|
916
|
+
).returns(T.attached_class)
|
917
|
+
end
|
918
|
+
def self.new(
|
919
|
+
# The URL of the image input.
|
920
|
+
image_url:,
|
921
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
922
|
+
# `auto`. Defaults to `auto`.
|
923
|
+
detail: nil,
|
924
|
+
# The type of the image input. Always `input_image`.
|
925
|
+
type: :input_image
|
926
|
+
)
|
927
|
+
end
|
928
|
+
|
929
|
+
sig do
|
930
|
+
override.returns(
|
931
|
+
{ image_url: String, type: Symbol, detail: String }
|
932
|
+
)
|
933
|
+
end
|
934
|
+
def to_hash
|
935
|
+
end
|
936
|
+
end
|
937
|
+
|
881
938
|
sig do
|
882
939
|
override.returns(
|
883
940
|
T::Array[
|
@@ -887,6 +944,14 @@ module OpenAI
|
|
887
944
|
end
|
888
945
|
def self.variants
|
889
946
|
end
|
947
|
+
|
948
|
+
AnArrayOfInputTextAndInputImageArray =
|
949
|
+
T.let(
|
950
|
+
OpenAI::Internal::Type::ArrayOf[
|
951
|
+
OpenAI::Internal::Type::Unknown
|
952
|
+
],
|
953
|
+
OpenAI::Internal::Type::Converter
|
954
|
+
)
|
890
955
|
end
|
891
956
|
|
892
957
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
@@ -693,13 +693,15 @@ module OpenAI
|
|
693
693
|
)
|
694
694
|
end
|
695
695
|
|
696
|
-
#
|
696
|
+
# Inputs to the model - can contain template strings.
|
697
697
|
sig do
|
698
698
|
returns(
|
699
699
|
T.any(
|
700
700
|
String,
|
701
701
|
OpenAI::Responses::ResponseInputText,
|
702
|
-
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText
|
702
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
703
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
704
|
+
T::Array[T.anything]
|
703
705
|
)
|
704
706
|
)
|
705
707
|
end
|
@@ -743,7 +745,9 @@ module OpenAI
|
|
743
745
|
T.any(
|
744
746
|
String,
|
745
747
|
OpenAI::Responses::ResponseInputText::OrHash,
|
746
|
-
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash
|
748
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
|
749
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
|
750
|
+
T::Array[T.anything]
|
747
751
|
),
|
748
752
|
role:
|
749
753
|
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
@@ -752,7 +756,7 @@ module OpenAI
|
|
752
756
|
).returns(T.attached_class)
|
753
757
|
end
|
754
758
|
def self.new(
|
755
|
-
#
|
759
|
+
# Inputs to the model - can contain template strings.
|
756
760
|
content:,
|
757
761
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
758
762
|
# `developer`.
|
@@ -769,7 +773,9 @@ module OpenAI
|
|
769
773
|
T.any(
|
770
774
|
String,
|
771
775
|
OpenAI::Responses::ResponseInputText,
|
772
|
-
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText
|
776
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
777
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
778
|
+
T::Array[T.anything]
|
773
779
|
),
|
774
780
|
role:
|
775
781
|
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
@@ -781,7 +787,7 @@ module OpenAI
|
|
781
787
|
def to_hash
|
782
788
|
end
|
783
789
|
|
784
|
-
#
|
790
|
+
# Inputs to the model - can contain template strings.
|
785
791
|
module Content
|
786
792
|
extend OpenAI::Internal::Type::Union
|
787
793
|
|
@@ -790,7 +796,9 @@ module OpenAI
|
|
790
796
|
T.any(
|
791
797
|
String,
|
792
798
|
OpenAI::Responses::ResponseInputText,
|
793
|
-
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText
|
799
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
800
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
801
|
+
T::Array[T.anything]
|
794
802
|
)
|
795
803
|
end
|
796
804
|
|
@@ -830,6 +838,59 @@ module OpenAI
|
|
830
838
|
end
|
831
839
|
end
|
832
840
|
|
841
|
+
class InputImage < OpenAI::Internal::Type::BaseModel
|
842
|
+
OrHash =
|
843
|
+
T.type_alias do
|
844
|
+
T.any(
|
845
|
+
OpenAI::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
846
|
+
OpenAI::Internal::AnyHash
|
847
|
+
)
|
848
|
+
end
|
849
|
+
|
850
|
+
# The URL of the image input.
|
851
|
+
sig { returns(String) }
|
852
|
+
attr_accessor :image_url
|
853
|
+
|
854
|
+
# The type of the image input. Always `input_image`.
|
855
|
+
sig { returns(Symbol) }
|
856
|
+
attr_accessor :type
|
857
|
+
|
858
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
859
|
+
# `auto`. Defaults to `auto`.
|
860
|
+
sig { returns(T.nilable(String)) }
|
861
|
+
attr_reader :detail
|
862
|
+
|
863
|
+
sig { params(detail: String).void }
|
864
|
+
attr_writer :detail
|
865
|
+
|
866
|
+
# An image input to the model.
|
867
|
+
sig do
|
868
|
+
params(
|
869
|
+
image_url: String,
|
870
|
+
detail: String,
|
871
|
+
type: Symbol
|
872
|
+
).returns(T.attached_class)
|
873
|
+
end
|
874
|
+
def self.new(
|
875
|
+
# The URL of the image input.
|
876
|
+
image_url:,
|
877
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
878
|
+
# `auto`. Defaults to `auto`.
|
879
|
+
detail: nil,
|
880
|
+
# The type of the image input. Always `input_image`.
|
881
|
+
type: :input_image
|
882
|
+
)
|
883
|
+
end
|
884
|
+
|
885
|
+
sig do
|
886
|
+
override.returns(
|
887
|
+
{ image_url: String, type: Symbol, detail: String }
|
888
|
+
)
|
889
|
+
end
|
890
|
+
def to_hash
|
891
|
+
end
|
892
|
+
end
|
893
|
+
|
833
894
|
sig do
|
834
895
|
override.returns(
|
835
896
|
T::Array[
|
@@ -839,6 +900,14 @@ module OpenAI
|
|
839
900
|
end
|
840
901
|
def self.variants
|
841
902
|
end
|
903
|
+
|
904
|
+
AnArrayOfInputTextAndInputImageArray =
|
905
|
+
T.let(
|
906
|
+
OpenAI::Internal::Type::ArrayOf[
|
907
|
+
OpenAI::Internal::Type::Unknown
|
908
|
+
],
|
909
|
+
OpenAI::Internal::Type::Converter
|
910
|
+
)
|
842
911
|
end
|
843
912
|
|
844
913
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
@@ -749,7 +749,7 @@ module OpenAI
|
|
749
749
|
)
|
750
750
|
end
|
751
751
|
|
752
|
-
#
|
752
|
+
# Inputs to the model - can contain template strings.
|
753
753
|
sig do
|
754
754
|
returns(
|
755
755
|
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::Variants
|
@@ -795,7 +795,9 @@ module OpenAI
|
|
795
795
|
T.any(
|
796
796
|
String,
|
797
797
|
OpenAI::Responses::ResponseInputText::OrHash,
|
798
|
-
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash
|
798
|
+
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
|
799
|
+
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
|
800
|
+
T::Array[T.anything]
|
799
801
|
),
|
800
802
|
role:
|
801
803
|
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
@@ -804,7 +806,7 @@ module OpenAI
|
|
804
806
|
).returns(T.attached_class)
|
805
807
|
end
|
806
808
|
def self.new(
|
807
|
-
#
|
809
|
+
# Inputs to the model - can contain template strings.
|
808
810
|
content:,
|
809
811
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
810
812
|
# `developer`.
|
@@ -829,7 +831,7 @@ module OpenAI
|
|
829
831
|
def to_hash
|
830
832
|
end
|
831
833
|
|
832
|
-
#
|
834
|
+
# Inputs to the model - can contain template strings.
|
833
835
|
module Content
|
834
836
|
extend OpenAI::Internal::Type::Union
|
835
837
|
|
@@ -838,7 +840,9 @@ module OpenAI
|
|
838
840
|
T.any(
|
839
841
|
String,
|
840
842
|
OpenAI::Responses::ResponseInputText,
|
841
|
-
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText
|
843
|
+
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
844
|
+
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
845
|
+
T::Array[T.anything]
|
842
846
|
)
|
843
847
|
end
|
844
848
|
|
@@ -878,6 +882,59 @@ module OpenAI
|
|
878
882
|
end
|
879
883
|
end
|
880
884
|
|
885
|
+
class InputImage < OpenAI::Internal::Type::BaseModel
|
886
|
+
OrHash =
|
887
|
+
T.type_alias do
|
888
|
+
T.any(
|
889
|
+
OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
890
|
+
OpenAI::Internal::AnyHash
|
891
|
+
)
|
892
|
+
end
|
893
|
+
|
894
|
+
# The URL of the image input.
|
895
|
+
sig { returns(String) }
|
896
|
+
attr_accessor :image_url
|
897
|
+
|
898
|
+
# The type of the image input. Always `input_image`.
|
899
|
+
sig { returns(Symbol) }
|
900
|
+
attr_accessor :type
|
901
|
+
|
902
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
903
|
+
# `auto`. Defaults to `auto`.
|
904
|
+
sig { returns(T.nilable(String)) }
|
905
|
+
attr_reader :detail
|
906
|
+
|
907
|
+
sig { params(detail: String).void }
|
908
|
+
attr_writer :detail
|
909
|
+
|
910
|
+
# An image input to the model.
|
911
|
+
sig do
|
912
|
+
params(
|
913
|
+
image_url: String,
|
914
|
+
detail: String,
|
915
|
+
type: Symbol
|
916
|
+
).returns(T.attached_class)
|
917
|
+
end
|
918
|
+
def self.new(
|
919
|
+
# The URL of the image input.
|
920
|
+
image_url:,
|
921
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
922
|
+
# `auto`. Defaults to `auto`.
|
923
|
+
detail: nil,
|
924
|
+
# The type of the image input. Always `input_image`.
|
925
|
+
type: :input_image
|
926
|
+
)
|
927
|
+
end
|
928
|
+
|
929
|
+
sig do
|
930
|
+
override.returns(
|
931
|
+
{ image_url: String, type: Symbol, detail: String }
|
932
|
+
)
|
933
|
+
end
|
934
|
+
def to_hash
|
935
|
+
end
|
936
|
+
end
|
937
|
+
|
881
938
|
sig do
|
882
939
|
override.returns(
|
883
940
|
T::Array[
|
@@ -887,6 +944,14 @@ module OpenAI
|
|
887
944
|
end
|
888
945
|
def self.variants
|
889
946
|
end
|
947
|
+
|
948
|
+
AnArrayOfInputTextAndInputImageArray =
|
949
|
+
T.let(
|
950
|
+
OpenAI::Internal::Type::ArrayOf[
|
951
|
+
OpenAI::Internal::Type::Unknown
|
952
|
+
],
|
953
|
+
OpenAI::Internal::Type::Converter
|
954
|
+
)
|
890
955
|
end
|
891
956
|
|
892
957
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
@@ -745,7 +745,7 @@ module OpenAI
|
|
745
745
|
)
|
746
746
|
end
|
747
747
|
|
748
|
-
#
|
748
|
+
# Inputs to the model - can contain template strings.
|
749
749
|
sig do
|
750
750
|
returns(
|
751
751
|
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::Variants
|
@@ -791,7 +791,9 @@ module OpenAI
|
|
791
791
|
T.any(
|
792
792
|
String,
|
793
793
|
OpenAI::Responses::ResponseInputText::OrHash,
|
794
|
-
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash
|
794
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
|
795
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
|
796
|
+
T::Array[T.anything]
|
795
797
|
),
|
796
798
|
role:
|
797
799
|
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
@@ -800,7 +802,7 @@ module OpenAI
|
|
800
802
|
).returns(T.attached_class)
|
801
803
|
end
|
802
804
|
def self.new(
|
803
|
-
#
|
805
|
+
# Inputs to the model - can contain template strings.
|
804
806
|
content:,
|
805
807
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
806
808
|
# `developer`.
|
@@ -825,7 +827,7 @@ module OpenAI
|
|
825
827
|
def to_hash
|
826
828
|
end
|
827
829
|
|
828
|
-
#
|
830
|
+
# Inputs to the model - can contain template strings.
|
829
831
|
module Content
|
830
832
|
extend OpenAI::Internal::Type::Union
|
831
833
|
|
@@ -834,7 +836,9 @@ module OpenAI
|
|
834
836
|
T.any(
|
835
837
|
String,
|
836
838
|
OpenAI::Responses::ResponseInputText,
|
837
|
-
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText
|
839
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
840
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
841
|
+
T::Array[T.anything]
|
838
842
|
)
|
839
843
|
end
|
840
844
|
|
@@ -874,6 +878,59 @@ module OpenAI
|
|
874
878
|
end
|
875
879
|
end
|
876
880
|
|
881
|
+
class InputImage < OpenAI::Internal::Type::BaseModel
|
882
|
+
OrHash =
|
883
|
+
T.type_alias do
|
884
|
+
T.any(
|
885
|
+
OpenAI::Models::Evals::RunListResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
886
|
+
OpenAI::Internal::AnyHash
|
887
|
+
)
|
888
|
+
end
|
889
|
+
|
890
|
+
# The URL of the image input.
|
891
|
+
sig { returns(String) }
|
892
|
+
attr_accessor :image_url
|
893
|
+
|
894
|
+
# The type of the image input. Always `input_image`.
|
895
|
+
sig { returns(Symbol) }
|
896
|
+
attr_accessor :type
|
897
|
+
|
898
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
899
|
+
# `auto`. Defaults to `auto`.
|
900
|
+
sig { returns(T.nilable(String)) }
|
901
|
+
attr_reader :detail
|
902
|
+
|
903
|
+
sig { params(detail: String).void }
|
904
|
+
attr_writer :detail
|
905
|
+
|
906
|
+
# An image input to the model.
|
907
|
+
sig do
|
908
|
+
params(
|
909
|
+
image_url: String,
|
910
|
+
detail: String,
|
911
|
+
type: Symbol
|
912
|
+
).returns(T.attached_class)
|
913
|
+
end
|
914
|
+
def self.new(
|
915
|
+
# The URL of the image input.
|
916
|
+
image_url:,
|
917
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
918
|
+
# `auto`. Defaults to `auto`.
|
919
|
+
detail: nil,
|
920
|
+
# The type of the image input. Always `input_image`.
|
921
|
+
type: :input_image
|
922
|
+
)
|
923
|
+
end
|
924
|
+
|
925
|
+
sig do
|
926
|
+
override.returns(
|
927
|
+
{ image_url: String, type: Symbol, detail: String }
|
928
|
+
)
|
929
|
+
end
|
930
|
+
def to_hash
|
931
|
+
end
|
932
|
+
end
|
933
|
+
|
877
934
|
sig do
|
878
935
|
override.returns(
|
879
936
|
T::Array[
|
@@ -883,6 +940,14 @@ module OpenAI
|
|
883
940
|
end
|
884
941
|
def self.variants
|
885
942
|
end
|
943
|
+
|
944
|
+
AnArrayOfInputTextAndInputImageArray =
|
945
|
+
T.let(
|
946
|
+
OpenAI::Internal::Type::ArrayOf[
|
947
|
+
OpenAI::Internal::Type::Unknown
|
948
|
+
],
|
949
|
+
OpenAI::Internal::Type::Converter
|
950
|
+
)
|
886
951
|
end
|
887
952
|
|
888
953
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
@@ -751,7 +751,7 @@ module OpenAI
|
|
751
751
|
)
|
752
752
|
end
|
753
753
|
|
754
|
-
#
|
754
|
+
# Inputs to the model - can contain template strings.
|
755
755
|
sig do
|
756
756
|
returns(
|
757
757
|
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::Variants
|
@@ -797,7 +797,9 @@ module OpenAI
|
|
797
797
|
T.any(
|
798
798
|
String,
|
799
799
|
OpenAI::Responses::ResponseInputText::OrHash,
|
800
|
-
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash
|
800
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
|
801
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
|
802
|
+
T::Array[T.anything]
|
801
803
|
),
|
802
804
|
role:
|
803
805
|
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
@@ -806,7 +808,7 @@ module OpenAI
|
|
806
808
|
).returns(T.attached_class)
|
807
809
|
end
|
808
810
|
def self.new(
|
809
|
-
#
|
811
|
+
# Inputs to the model - can contain template strings.
|
810
812
|
content:,
|
811
813
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|
812
814
|
# `developer`.
|
@@ -831,7 +833,7 @@ module OpenAI
|
|
831
833
|
def to_hash
|
832
834
|
end
|
833
835
|
|
834
|
-
#
|
836
|
+
# Inputs to the model - can contain template strings.
|
835
837
|
module Content
|
836
838
|
extend OpenAI::Internal::Type::Union
|
837
839
|
|
@@ -840,7 +842,9 @@ module OpenAI
|
|
840
842
|
T.any(
|
841
843
|
String,
|
842
844
|
OpenAI::Responses::ResponseInputText,
|
843
|
-
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText
|
845
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
846
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
847
|
+
T::Array[T.anything]
|
844
848
|
)
|
845
849
|
end
|
846
850
|
|
@@ -880,6 +884,59 @@ module OpenAI
|
|
880
884
|
end
|
881
885
|
end
|
882
886
|
|
887
|
+
class InputImage < OpenAI::Internal::Type::BaseModel
|
888
|
+
OrHash =
|
889
|
+
T.type_alias do
|
890
|
+
T.any(
|
891
|
+
OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
892
|
+
OpenAI::Internal::AnyHash
|
893
|
+
)
|
894
|
+
end
|
895
|
+
|
896
|
+
# The URL of the image input.
|
897
|
+
sig { returns(String) }
|
898
|
+
attr_accessor :image_url
|
899
|
+
|
900
|
+
# The type of the image input. Always `input_image`.
|
901
|
+
sig { returns(Symbol) }
|
902
|
+
attr_accessor :type
|
903
|
+
|
904
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
905
|
+
# `auto`. Defaults to `auto`.
|
906
|
+
sig { returns(T.nilable(String)) }
|
907
|
+
attr_reader :detail
|
908
|
+
|
909
|
+
sig { params(detail: String).void }
|
910
|
+
attr_writer :detail
|
911
|
+
|
912
|
+
# An image input to the model.
|
913
|
+
sig do
|
914
|
+
params(
|
915
|
+
image_url: String,
|
916
|
+
detail: String,
|
917
|
+
type: Symbol
|
918
|
+
).returns(T.attached_class)
|
919
|
+
end
|
920
|
+
def self.new(
|
921
|
+
# The URL of the image input.
|
922
|
+
image_url:,
|
923
|
+
# The detail level of the image to be sent to the model. One of `high`, `low`, or
|
924
|
+
# `auto`. Defaults to `auto`.
|
925
|
+
detail: nil,
|
926
|
+
# The type of the image input. Always `input_image`.
|
927
|
+
type: :input_image
|
928
|
+
)
|
929
|
+
end
|
930
|
+
|
931
|
+
sig do
|
932
|
+
override.returns(
|
933
|
+
{ image_url: String, type: Symbol, detail: String }
|
934
|
+
)
|
935
|
+
end
|
936
|
+
def to_hash
|
937
|
+
end
|
938
|
+
end
|
939
|
+
|
883
940
|
sig do
|
884
941
|
override.returns(
|
885
942
|
T::Array[
|
@@ -889,6 +946,14 @@ module OpenAI
|
|
889
946
|
end
|
890
947
|
def self.variants
|
891
948
|
end
|
949
|
+
|
950
|
+
AnArrayOfInputTextAndInputImageArray =
|
951
|
+
T.let(
|
952
|
+
OpenAI::Internal::Type::ArrayOf[
|
953
|
+
OpenAI::Internal::Type::Unknown
|
954
|
+
],
|
955
|
+
OpenAI::Internal::Type::Converter
|
956
|
+
)
|
892
957
|
end
|
893
958
|
|
894
959
|
# The role of the message input. One of `user`, `assistant`, `system`, or
|