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
|
@@ -459,6 +459,16 @@ module OpenAI
|
|
|
459
459
|
# @return [Integer, nil]
|
|
460
460
|
optional :max_completion_tokens, Integer
|
|
461
461
|
|
|
462
|
+
# @!attribute reasoning_effort
|
|
463
|
+
# Constrains effort on reasoning for
|
|
464
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
465
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
466
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
467
|
+
# response.
|
|
468
|
+
#
|
|
469
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
470
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
471
|
+
|
|
462
472
|
# @!attribute response_format
|
|
463
473
|
# An object specifying the format that the model must output.
|
|
464
474
|
#
|
|
@@ -501,13 +511,15 @@ module OpenAI
|
|
|
501
511
|
# @return [Float, nil]
|
|
502
512
|
optional :top_p, Float
|
|
503
513
|
|
|
504
|
-
# @!method initialize(max_completion_tokens: nil, response_format: nil, seed: nil, temperature: nil, tools: nil, top_p: nil)
|
|
514
|
+
# @!method initialize(max_completion_tokens: nil, reasoning_effort: nil, response_format: nil, seed: nil, temperature: nil, tools: nil, top_p: nil)
|
|
505
515
|
# Some parameter documentations has been truncated, see
|
|
506
516
|
# {OpenAI::Models::Evals::CreateEvalCompletionsRunDataSource::SamplingParams} for
|
|
507
517
|
# more details.
|
|
508
518
|
#
|
|
509
519
|
# @param max_completion_tokens [Integer] The maximum number of tokens in the generated output.
|
|
510
520
|
#
|
|
521
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
522
|
+
#
|
|
511
523
|
# @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output.
|
|
512
524
|
#
|
|
513
525
|
# @param seed [Integer] A seed value to initialize the randomness, during sampling.
|
|
@@ -654,6 +654,16 @@ module OpenAI
|
|
|
654
654
|
# @return [Integer, nil]
|
|
655
655
|
optional :max_completion_tokens, Integer
|
|
656
656
|
|
|
657
|
+
# @!attribute reasoning_effort
|
|
658
|
+
# Constrains effort on reasoning for
|
|
659
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
660
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
661
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
662
|
+
# response.
|
|
663
|
+
#
|
|
664
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
665
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
666
|
+
|
|
657
667
|
# @!attribute seed
|
|
658
668
|
# A seed value to initialize the randomness, during sampling.
|
|
659
669
|
#
|
|
@@ -702,13 +712,15 @@ module OpenAI
|
|
|
702
712
|
# @return [Float, nil]
|
|
703
713
|
optional :top_p, Float
|
|
704
714
|
|
|
705
|
-
# @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
715
|
+
# @!method initialize(max_completion_tokens: nil, reasoning_effort: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
706
716
|
# Some parameter documentations has been truncated, see
|
|
707
717
|
# {OpenAI::Models::Evals::RunCancelResponse::DataSource::Responses::SamplingParams}
|
|
708
718
|
# for more details.
|
|
709
719
|
#
|
|
710
720
|
# @param max_completion_tokens [Integer] The maximum number of tokens in the generated output.
|
|
711
721
|
#
|
|
722
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
723
|
+
#
|
|
712
724
|
# @param seed [Integer] A seed value to initialize the randomness, during sampling.
|
|
713
725
|
#
|
|
714
726
|
# @param temperature [Float] A higher temperature increases randomness in the outputs.
|
|
@@ -582,6 +582,16 @@ module OpenAI
|
|
|
582
582
|
# @return [Integer, nil]
|
|
583
583
|
optional :max_completion_tokens, Integer
|
|
584
584
|
|
|
585
|
+
# @!attribute reasoning_effort
|
|
586
|
+
# Constrains effort on reasoning for
|
|
587
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
588
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
589
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
590
|
+
# response.
|
|
591
|
+
#
|
|
592
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
593
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
594
|
+
|
|
585
595
|
# @!attribute seed
|
|
586
596
|
# A seed value to initialize the randomness, during sampling.
|
|
587
597
|
#
|
|
@@ -630,13 +640,15 @@ module OpenAI
|
|
|
630
640
|
# @return [Float, nil]
|
|
631
641
|
optional :top_p, Float
|
|
632
642
|
|
|
633
|
-
# @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
643
|
+
# @!method initialize(max_completion_tokens: nil, reasoning_effort: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
634
644
|
# Some parameter documentations has been truncated, see
|
|
635
645
|
# {OpenAI::Models::Evals::RunCreateParams::DataSource::CreateEvalResponsesRunDataSource::SamplingParams}
|
|
636
646
|
# for more details.
|
|
637
647
|
#
|
|
638
648
|
# @param max_completion_tokens [Integer] The maximum number of tokens in the generated output.
|
|
639
649
|
#
|
|
650
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
651
|
+
#
|
|
640
652
|
# @param seed [Integer] A seed value to initialize the randomness, during sampling.
|
|
641
653
|
#
|
|
642
654
|
# @param temperature [Float] A higher temperature increases randomness in the outputs.
|
|
@@ -654,6 +654,16 @@ module OpenAI
|
|
|
654
654
|
# @return [Integer, nil]
|
|
655
655
|
optional :max_completion_tokens, Integer
|
|
656
656
|
|
|
657
|
+
# @!attribute reasoning_effort
|
|
658
|
+
# Constrains effort on reasoning for
|
|
659
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
660
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
661
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
662
|
+
# response.
|
|
663
|
+
#
|
|
664
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
665
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
666
|
+
|
|
657
667
|
# @!attribute seed
|
|
658
668
|
# A seed value to initialize the randomness, during sampling.
|
|
659
669
|
#
|
|
@@ -702,13 +712,15 @@ module OpenAI
|
|
|
702
712
|
# @return [Float, nil]
|
|
703
713
|
optional :top_p, Float
|
|
704
714
|
|
|
705
|
-
# @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
715
|
+
# @!method initialize(max_completion_tokens: nil, reasoning_effort: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
706
716
|
# Some parameter documentations has been truncated, see
|
|
707
717
|
# {OpenAI::Models::Evals::RunCreateResponse::DataSource::Responses::SamplingParams}
|
|
708
718
|
# for more details.
|
|
709
719
|
#
|
|
710
720
|
# @param max_completion_tokens [Integer] The maximum number of tokens in the generated output.
|
|
711
721
|
#
|
|
722
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
723
|
+
#
|
|
712
724
|
# @param seed [Integer] A seed value to initialize the randomness, during sampling.
|
|
713
725
|
#
|
|
714
726
|
# @param temperature [Float] A higher temperature increases randomness in the outputs.
|
|
@@ -654,6 +654,16 @@ module OpenAI
|
|
|
654
654
|
# @return [Integer, nil]
|
|
655
655
|
optional :max_completion_tokens, Integer
|
|
656
656
|
|
|
657
|
+
# @!attribute reasoning_effort
|
|
658
|
+
# Constrains effort on reasoning for
|
|
659
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
660
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
661
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
662
|
+
# response.
|
|
663
|
+
#
|
|
664
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
665
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
666
|
+
|
|
657
667
|
# @!attribute seed
|
|
658
668
|
# A seed value to initialize the randomness, during sampling.
|
|
659
669
|
#
|
|
@@ -701,13 +711,15 @@ module OpenAI
|
|
|
701
711
|
# @return [Float, nil]
|
|
702
712
|
optional :top_p, Float
|
|
703
713
|
|
|
704
|
-
# @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
714
|
+
# @!method initialize(max_completion_tokens: nil, reasoning_effort: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
705
715
|
# Some parameter documentations has been truncated, see
|
|
706
716
|
# {OpenAI::Models::Evals::RunListResponse::DataSource::Responses::SamplingParams}
|
|
707
717
|
# for more details.
|
|
708
718
|
#
|
|
709
719
|
# @param max_completion_tokens [Integer] The maximum number of tokens in the generated output.
|
|
710
720
|
#
|
|
721
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
722
|
+
#
|
|
711
723
|
# @param seed [Integer] A seed value to initialize the randomness, during sampling.
|
|
712
724
|
#
|
|
713
725
|
# @param temperature [Float] A higher temperature increases randomness in the outputs.
|
|
@@ -658,6 +658,16 @@ module OpenAI
|
|
|
658
658
|
# @return [Integer, nil]
|
|
659
659
|
optional :max_completion_tokens, Integer
|
|
660
660
|
|
|
661
|
+
# @!attribute reasoning_effort
|
|
662
|
+
# Constrains effort on reasoning for
|
|
663
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
664
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
665
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
666
|
+
# response.
|
|
667
|
+
#
|
|
668
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
669
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
670
|
+
|
|
661
671
|
# @!attribute seed
|
|
662
672
|
# A seed value to initialize the randomness, during sampling.
|
|
663
673
|
#
|
|
@@ -706,13 +716,15 @@ module OpenAI
|
|
|
706
716
|
# @return [Float, nil]
|
|
707
717
|
optional :top_p, Float
|
|
708
718
|
|
|
709
|
-
# @!method initialize(max_completion_tokens: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
719
|
+
# @!method initialize(max_completion_tokens: nil, reasoning_effort: nil, seed: nil, temperature: nil, text: nil, tools: nil, top_p: nil)
|
|
710
720
|
# Some parameter documentations has been truncated, see
|
|
711
721
|
# {OpenAI::Models::Evals::RunRetrieveResponse::DataSource::Responses::SamplingParams}
|
|
712
722
|
# for more details.
|
|
713
723
|
#
|
|
714
724
|
# @param max_completion_tokens [Integer] The maximum number of tokens in the generated output.
|
|
715
725
|
#
|
|
726
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
727
|
+
#
|
|
716
728
|
# @param seed [Integer] A seed value to initialize the randomness, during sampling.
|
|
717
729
|
#
|
|
718
730
|
# @param temperature [Float] A higher temperature increases randomness in the outputs.
|
|
@@ -43,11 +43,11 @@ module OpenAI
|
|
|
43
43
|
required :object, const: :"eval.run.output_item"
|
|
44
44
|
|
|
45
45
|
# @!attribute results
|
|
46
|
-
# A list of results
|
|
46
|
+
# A list of grader results for this output item.
|
|
47
47
|
#
|
|
48
|
-
# @return [Array<
|
|
48
|
+
# @return [Array<OpenAI::Models::Evals::Runs::OutputItemListResponse::Result>]
|
|
49
49
|
required :results,
|
|
50
|
-
OpenAI::Internal::Type::ArrayOf[OpenAI::
|
|
50
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Evals::Runs::OutputItemListResponse::Result] }
|
|
51
51
|
|
|
52
52
|
# @!attribute run_id
|
|
53
53
|
# The identifier of the evaluation run associated with this output item.
|
|
@@ -80,7 +80,7 @@ module OpenAI
|
|
|
80
80
|
#
|
|
81
81
|
# @param eval_id [String] The identifier of the evaluation group.
|
|
82
82
|
#
|
|
83
|
-
# @param results [Array<
|
|
83
|
+
# @param results [Array<OpenAI::Models::Evals::Runs::OutputItemListResponse::Result>] A list of grader results for this output item.
|
|
84
84
|
#
|
|
85
85
|
# @param run_id [String] The identifier of the evaluation run associated with this output item.
|
|
86
86
|
#
|
|
@@ -90,6 +90,51 @@ module OpenAI
|
|
|
90
90
|
#
|
|
91
91
|
# @param object [Symbol, :"eval.run.output_item"] The type of the object. Always "eval.run.output_item".
|
|
92
92
|
|
|
93
|
+
class Result < OpenAI::Internal::Type::BaseModel
|
|
94
|
+
# @!attribute name
|
|
95
|
+
# The name of the grader.
|
|
96
|
+
#
|
|
97
|
+
# @return [String]
|
|
98
|
+
required :name, String
|
|
99
|
+
|
|
100
|
+
# @!attribute passed
|
|
101
|
+
# Whether the grader considered the output a pass.
|
|
102
|
+
#
|
|
103
|
+
# @return [Boolean]
|
|
104
|
+
required :passed, OpenAI::Internal::Type::Boolean
|
|
105
|
+
|
|
106
|
+
# @!attribute score
|
|
107
|
+
# The numeric score produced by the grader.
|
|
108
|
+
#
|
|
109
|
+
# @return [Float]
|
|
110
|
+
required :score, Float
|
|
111
|
+
|
|
112
|
+
# @!attribute sample
|
|
113
|
+
# Optional sample or intermediate data produced by the grader.
|
|
114
|
+
#
|
|
115
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
116
|
+
optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], nil?: true
|
|
117
|
+
|
|
118
|
+
# @!attribute type
|
|
119
|
+
# The grader type (for example, "string-check-grader").
|
|
120
|
+
#
|
|
121
|
+
# @return [String, nil]
|
|
122
|
+
optional :type, String
|
|
123
|
+
|
|
124
|
+
# @!method initialize(name:, passed:, score:, sample: nil, type: nil)
|
|
125
|
+
# A single grader result for an evaluation run output item.
|
|
126
|
+
#
|
|
127
|
+
# @param name [String] The name of the grader.
|
|
128
|
+
#
|
|
129
|
+
# @param passed [Boolean] Whether the grader considered the output a pass.
|
|
130
|
+
#
|
|
131
|
+
# @param score [Float] The numeric score produced by the grader.
|
|
132
|
+
#
|
|
133
|
+
# @param sample [Hash{Symbol=>Object}, nil] Optional sample or intermediate data produced by the grader.
|
|
134
|
+
#
|
|
135
|
+
# @param type [String] The grader type (for example, "string-check-grader").
|
|
136
|
+
end
|
|
137
|
+
|
|
93
138
|
# @see OpenAI::Models::Evals::Runs::OutputItemListResponse#sample
|
|
94
139
|
class Sample < OpenAI::Internal::Type::BaseModel
|
|
95
140
|
# @!attribute error
|
|
@@ -43,11 +43,11 @@ module OpenAI
|
|
|
43
43
|
required :object, const: :"eval.run.output_item"
|
|
44
44
|
|
|
45
45
|
# @!attribute results
|
|
46
|
-
# A list of results
|
|
46
|
+
# A list of grader results for this output item.
|
|
47
47
|
#
|
|
48
|
-
# @return [Array<
|
|
48
|
+
# @return [Array<OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Result>]
|
|
49
49
|
required :results,
|
|
50
|
-
OpenAI::Internal::Type::ArrayOf[OpenAI::
|
|
50
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Result] }
|
|
51
51
|
|
|
52
52
|
# @!attribute run_id
|
|
53
53
|
# The identifier of the evaluation run associated with this output item.
|
|
@@ -80,7 +80,7 @@ module OpenAI
|
|
|
80
80
|
#
|
|
81
81
|
# @param eval_id [String] The identifier of the evaluation group.
|
|
82
82
|
#
|
|
83
|
-
# @param results [Array<
|
|
83
|
+
# @param results [Array<OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse::Result>] A list of grader results for this output item.
|
|
84
84
|
#
|
|
85
85
|
# @param run_id [String] The identifier of the evaluation run associated with this output item.
|
|
86
86
|
#
|
|
@@ -90,6 +90,51 @@ module OpenAI
|
|
|
90
90
|
#
|
|
91
91
|
# @param object [Symbol, :"eval.run.output_item"] The type of the object. Always "eval.run.output_item".
|
|
92
92
|
|
|
93
|
+
class Result < OpenAI::Internal::Type::BaseModel
|
|
94
|
+
# @!attribute name
|
|
95
|
+
# The name of the grader.
|
|
96
|
+
#
|
|
97
|
+
# @return [String]
|
|
98
|
+
required :name, String
|
|
99
|
+
|
|
100
|
+
# @!attribute passed
|
|
101
|
+
# Whether the grader considered the output a pass.
|
|
102
|
+
#
|
|
103
|
+
# @return [Boolean]
|
|
104
|
+
required :passed, OpenAI::Internal::Type::Boolean
|
|
105
|
+
|
|
106
|
+
# @!attribute score
|
|
107
|
+
# The numeric score produced by the grader.
|
|
108
|
+
#
|
|
109
|
+
# @return [Float]
|
|
110
|
+
required :score, Float
|
|
111
|
+
|
|
112
|
+
# @!attribute sample
|
|
113
|
+
# Optional sample or intermediate data produced by the grader.
|
|
114
|
+
#
|
|
115
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
116
|
+
optional :sample, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], nil?: true
|
|
117
|
+
|
|
118
|
+
# @!attribute type
|
|
119
|
+
# The grader type (for example, "string-check-grader").
|
|
120
|
+
#
|
|
121
|
+
# @return [String, nil]
|
|
122
|
+
optional :type, String
|
|
123
|
+
|
|
124
|
+
# @!method initialize(name:, passed:, score:, sample: nil, type: nil)
|
|
125
|
+
# A single grader result for an evaluation run output item.
|
|
126
|
+
#
|
|
127
|
+
# @param name [String] The name of the grader.
|
|
128
|
+
#
|
|
129
|
+
# @param passed [Boolean] Whether the grader considered the output a pass.
|
|
130
|
+
#
|
|
131
|
+
# @param score [Float] The numeric score produced by the grader.
|
|
132
|
+
#
|
|
133
|
+
# @param sample [Hash{Symbol=>Object}, nil] Optional sample or intermediate data produced by the grader.
|
|
134
|
+
#
|
|
135
|
+
# @param type [String] The grader type (for example, "string-check-grader").
|
|
136
|
+
end
|
|
137
|
+
|
|
93
138
|
# @see OpenAI::Models::Evals::Runs::OutputItemRetrieveResponse#sample
|
|
94
139
|
class Sample < OpenAI::Internal::Type::BaseModel
|
|
95
140
|
# @!attribute error
|
|
@@ -37,8 +37,8 @@ module OpenAI
|
|
|
37
37
|
# @!attribute sampling_params
|
|
38
38
|
# The sampling parameters for the model.
|
|
39
39
|
#
|
|
40
|
-
# @return [
|
|
41
|
-
optional :sampling_params, OpenAI::
|
|
40
|
+
# @return [OpenAI::Models::Graders::ScoreModelGrader::SamplingParams, nil]
|
|
41
|
+
optional :sampling_params, -> { OpenAI::Graders::ScoreModelGrader::SamplingParams }
|
|
42
42
|
|
|
43
43
|
# @!method initialize(input:, model:, name:, range: nil, sampling_params: nil, type: :score_model)
|
|
44
44
|
# A ScoreModelGrader object that uses a model to assign a score to the input.
|
|
@@ -51,7 +51,7 @@ module OpenAI
|
|
|
51
51
|
#
|
|
52
52
|
# @param range [Array<Float>] The range of the score. Defaults to `[0, 1]`.
|
|
53
53
|
#
|
|
54
|
-
# @param sampling_params [
|
|
54
|
+
# @param sampling_params [OpenAI::Models::Graders::ScoreModelGrader::SamplingParams] The sampling parameters for the model.
|
|
55
55
|
#
|
|
56
56
|
# @param type [Symbol, :score_model] The object type, which is always `score_model`.
|
|
57
57
|
|
|
@@ -210,6 +210,59 @@ module OpenAI
|
|
|
210
210
|
# @return [Array<Symbol>]
|
|
211
211
|
end
|
|
212
212
|
end
|
|
213
|
+
|
|
214
|
+
# @see OpenAI::Models::Graders::ScoreModelGrader#sampling_params
|
|
215
|
+
class SamplingParams < OpenAI::Internal::Type::BaseModel
|
|
216
|
+
# @!attribute max_completions_tokens
|
|
217
|
+
# The maximum number of tokens the grader model may generate in its response.
|
|
218
|
+
#
|
|
219
|
+
# @return [Integer, nil]
|
|
220
|
+
optional :max_completions_tokens, Integer, nil?: true
|
|
221
|
+
|
|
222
|
+
# @!attribute reasoning_effort
|
|
223
|
+
# Constrains effort on reasoning for
|
|
224
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
|
225
|
+
# supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
|
|
226
|
+
# effort can result in faster responses and fewer tokens used on reasoning in a
|
|
227
|
+
# response.
|
|
228
|
+
#
|
|
229
|
+
# @return [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
230
|
+
optional :reasoning_effort, enum: -> { OpenAI::ReasoningEffort }, nil?: true
|
|
231
|
+
|
|
232
|
+
# @!attribute seed
|
|
233
|
+
# A seed value to initialize the randomness, during sampling.
|
|
234
|
+
#
|
|
235
|
+
# @return [Integer, nil]
|
|
236
|
+
optional :seed, Integer, nil?: true
|
|
237
|
+
|
|
238
|
+
# @!attribute temperature
|
|
239
|
+
# A higher temperature increases randomness in the outputs.
|
|
240
|
+
#
|
|
241
|
+
# @return [Float, nil]
|
|
242
|
+
optional :temperature, Float, nil?: true
|
|
243
|
+
|
|
244
|
+
# @!attribute top_p
|
|
245
|
+
# An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
|
|
246
|
+
#
|
|
247
|
+
# @return [Float, nil]
|
|
248
|
+
optional :top_p, Float, nil?: true
|
|
249
|
+
|
|
250
|
+
# @!method initialize(max_completions_tokens: nil, reasoning_effort: nil, seed: nil, temperature: nil, top_p: nil)
|
|
251
|
+
# Some parameter documentations has been truncated, see
|
|
252
|
+
# {OpenAI::Models::Graders::ScoreModelGrader::SamplingParams} for more details.
|
|
253
|
+
#
|
|
254
|
+
# The sampling parameters for the model.
|
|
255
|
+
#
|
|
256
|
+
# @param max_completions_tokens [Integer, nil] The maximum number of tokens the grader model may generate in its response.
|
|
257
|
+
#
|
|
258
|
+
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil] Constrains effort on reasoning for
|
|
259
|
+
#
|
|
260
|
+
# @param seed [Integer, nil] A seed value to initialize the randomness, during sampling.
|
|
261
|
+
#
|
|
262
|
+
# @param temperature [Float, nil] A higher temperature increases randomness in the outputs.
|
|
263
|
+
#
|
|
264
|
+
# @param top_p [Float, nil] An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
|
|
265
|
+
end
|
|
213
266
|
end
|
|
214
267
|
end
|
|
215
268
|
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -62,6 +62,11 @@ require_relative "openai/helpers/structured_output"
|
|
|
62
62
|
require_relative "openai/structured_output"
|
|
63
63
|
require_relative "openai/models/reasoning_effort"
|
|
64
64
|
require_relative "openai/models/chat/chat_completion_message"
|
|
65
|
+
require_relative "openai/models/responses/response_input_file"
|
|
66
|
+
require_relative "openai/models/responses/response_input_image"
|
|
67
|
+
require_relative "openai/models/responses/response_input_text"
|
|
68
|
+
require_relative "openai/models/responses/response_output_text"
|
|
69
|
+
require_relative "openai/models/responses/response_output_refusal"
|
|
65
70
|
require_relative "openai/models/graders/score_model_grader"
|
|
66
71
|
require_relative "openai/models/graders/python_grader"
|
|
67
72
|
require_relative "openai/models/graders/text_similarity_grader"
|
|
@@ -248,7 +253,6 @@ require_relative "openai/models/containers/file_retrieve_params"
|
|
|
248
253
|
require_relative "openai/models/containers/file_retrieve_response"
|
|
249
254
|
require_relative "openai/models/containers/files/content_retrieve_params"
|
|
250
255
|
require_relative "openai/models/conversations/computer_screenshot_content"
|
|
251
|
-
require_relative "openai/models/conversations/container_file_citation_body"
|
|
252
256
|
require_relative "openai/models/conversations/conversation"
|
|
253
257
|
require_relative "openai/models/conversations/conversation_create_params"
|
|
254
258
|
require_relative "openai/models/conversations/conversation_deleted"
|
|
@@ -258,7 +262,6 @@ require_relative "openai/models/conversations/conversation_item"
|
|
|
258
262
|
require_relative "openai/models/conversations/conversation_item_list"
|
|
259
263
|
require_relative "openai/models/conversations/conversation_retrieve_params"
|
|
260
264
|
require_relative "openai/models/conversations/conversation_update_params"
|
|
261
|
-
require_relative "openai/models/conversations/file_citation_body"
|
|
262
265
|
require_relative "openai/models/conversations/input_file_content"
|
|
263
266
|
require_relative "openai/models/conversations/input_image_content"
|
|
264
267
|
require_relative "openai/models/conversations/input_text_content"
|
|
@@ -266,14 +269,11 @@ require_relative "openai/models/conversations/item_create_params"
|
|
|
266
269
|
require_relative "openai/models/conversations/item_delete_params"
|
|
267
270
|
require_relative "openai/models/conversations/item_list_params"
|
|
268
271
|
require_relative "openai/models/conversations/item_retrieve_params"
|
|
269
|
-
require_relative "openai/models/conversations/lob_prob"
|
|
270
272
|
require_relative "openai/models/conversations/message"
|
|
271
273
|
require_relative "openai/models/conversations/output_text_content"
|
|
272
274
|
require_relative "openai/models/conversations/refusal_content"
|
|
273
275
|
require_relative "openai/models/conversations/summary_text_content"
|
|
274
276
|
require_relative "openai/models/conversations/text_content"
|
|
275
|
-
require_relative "openai/models/conversations/top_log_prob"
|
|
276
|
-
require_relative "openai/models/conversations/url_citation_body"
|
|
277
277
|
require_relative "openai/models/create_embedding_response"
|
|
278
278
|
require_relative "openai/models/custom_tool_input_format"
|
|
279
279
|
require_relative "openai/models/embedding"
|
|
@@ -549,12 +549,9 @@ require_relative "openai/models/responses/response_in_progress_event"
|
|
|
549
549
|
require_relative "openai/models/responses/response_input"
|
|
550
550
|
require_relative "openai/models/responses/response_input_audio"
|
|
551
551
|
require_relative "openai/models/responses/response_input_content"
|
|
552
|
-
require_relative "openai/models/responses/response_input_file"
|
|
553
|
-
require_relative "openai/models/responses/response_input_image"
|
|
554
552
|
require_relative "openai/models/responses/response_input_item"
|
|
555
553
|
require_relative "openai/models/responses/response_input_message_content_list"
|
|
556
554
|
require_relative "openai/models/responses/response_input_message_item"
|
|
557
|
-
require_relative "openai/models/responses/response_input_text"
|
|
558
555
|
require_relative "openai/models/responses/response_item"
|
|
559
556
|
require_relative "openai/models/responses/response_item_list"
|
|
560
557
|
require_relative "openai/models/responses/response_mcp_call_arguments_delta_event"
|
|
@@ -570,8 +567,6 @@ require_relative "openai/models/responses/response_output_item"
|
|
|
570
567
|
require_relative "openai/models/responses/response_output_item_added_event"
|
|
571
568
|
require_relative "openai/models/responses/response_output_item_done_event"
|
|
572
569
|
require_relative "openai/models/responses/response_output_message"
|
|
573
|
-
require_relative "openai/models/responses/response_output_refusal"
|
|
574
|
-
require_relative "openai/models/responses/response_output_text"
|
|
575
570
|
require_relative "openai/models/responses/response_output_text_annotation_added_event"
|
|
576
571
|
require_relative "openai/models/responses/response_prompt"
|
|
577
572
|
require_relative "openai/models/responses/response_queued_event"
|
data/rbi/openai/errors.rbi
CHANGED
|
@@ -33,6 +33,9 @@ module OpenAI
|
|
|
33
33
|
sig { returns(T.nilable(Integer)) }
|
|
34
34
|
attr_accessor :status
|
|
35
35
|
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
attr_accessor :headers
|
|
38
|
+
|
|
36
39
|
sig { returns(T.nilable(T.anything)) }
|
|
37
40
|
attr_accessor :body
|
|
38
41
|
|
|
@@ -50,6 +53,7 @@ module OpenAI
|
|
|
50
53
|
params(
|
|
51
54
|
url: URI::Generic,
|
|
52
55
|
status: T.nilable(Integer),
|
|
56
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
53
57
|
body: T.nilable(Object),
|
|
54
58
|
request: NilClass,
|
|
55
59
|
response: NilClass,
|
|
@@ -59,6 +63,7 @@ module OpenAI
|
|
|
59
63
|
def self.new(
|
|
60
64
|
url:,
|
|
61
65
|
status: nil,
|
|
66
|
+
headers: nil,
|
|
62
67
|
body: nil,
|
|
63
68
|
request: nil,
|
|
64
69
|
response: nil,
|
|
@@ -88,6 +93,7 @@ module OpenAI
|
|
|
88
93
|
params(
|
|
89
94
|
url: URI::Generic,
|
|
90
95
|
status: NilClass,
|
|
96
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
91
97
|
body: NilClass,
|
|
92
98
|
request: NilClass,
|
|
93
99
|
response: NilClass,
|
|
@@ -97,6 +103,7 @@ module OpenAI
|
|
|
97
103
|
def self.new(
|
|
98
104
|
url:,
|
|
99
105
|
status: nil,
|
|
106
|
+
headers: nil,
|
|
100
107
|
body: nil,
|
|
101
108
|
request: nil,
|
|
102
109
|
response: nil,
|
|
@@ -111,6 +118,7 @@ module OpenAI
|
|
|
111
118
|
params(
|
|
112
119
|
url: URI::Generic,
|
|
113
120
|
status: NilClass,
|
|
121
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
114
122
|
body: NilClass,
|
|
115
123
|
request: NilClass,
|
|
116
124
|
response: NilClass,
|
|
@@ -120,6 +128,7 @@ module OpenAI
|
|
|
120
128
|
def self.new(
|
|
121
129
|
url:,
|
|
122
130
|
status: nil,
|
|
131
|
+
headers: nil,
|
|
123
132
|
body: nil,
|
|
124
133
|
request: nil,
|
|
125
134
|
response: nil,
|
|
@@ -134,13 +143,22 @@ module OpenAI
|
|
|
134
143
|
params(
|
|
135
144
|
url: URI::Generic,
|
|
136
145
|
status: Integer,
|
|
146
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
137
147
|
body: T.nilable(Object),
|
|
138
148
|
request: NilClass,
|
|
139
149
|
response: NilClass,
|
|
140
150
|
message: T.nilable(String)
|
|
141
151
|
).returns(T.attached_class)
|
|
142
152
|
end
|
|
143
|
-
def self.for(
|
|
153
|
+
def self.for(
|
|
154
|
+
url:,
|
|
155
|
+
status:,
|
|
156
|
+
headers:,
|
|
157
|
+
body:,
|
|
158
|
+
request:,
|
|
159
|
+
response:,
|
|
160
|
+
message: nil
|
|
161
|
+
)
|
|
144
162
|
end
|
|
145
163
|
|
|
146
164
|
sig { returns(Integer) }
|
|
@@ -160,13 +178,22 @@ module OpenAI
|
|
|
160
178
|
params(
|
|
161
179
|
url: URI::Generic,
|
|
162
180
|
status: Integer,
|
|
181
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
163
182
|
body: T.nilable(Object),
|
|
164
183
|
request: NilClass,
|
|
165
184
|
response: NilClass,
|
|
166
185
|
message: T.nilable(String)
|
|
167
186
|
).returns(T.attached_class)
|
|
168
187
|
end
|
|
169
|
-
def self.new(
|
|
188
|
+
def self.new(
|
|
189
|
+
url:,
|
|
190
|
+
status:,
|
|
191
|
+
headers:,
|
|
192
|
+
body:,
|
|
193
|
+
request:,
|
|
194
|
+
response:,
|
|
195
|
+
message: nil
|
|
196
|
+
)
|
|
170
197
|
end
|
|
171
198
|
end
|
|
172
199
|
|
|
@@ -92,10 +92,9 @@ module OpenAI
|
|
|
92
92
|
|
|
93
93
|
# @api private
|
|
94
94
|
sig do
|
|
95
|
-
params(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
).returns(T::Boolean)
|
|
95
|
+
params(status: Integer, headers: T::Hash[String, String]).returns(
|
|
96
|
+
T::Boolean
|
|
97
|
+
)
|
|
99
98
|
end
|
|
100
99
|
def should_retry?(status, headers:)
|
|
101
100
|
end
|
|
@@ -105,7 +104,7 @@ module OpenAI
|
|
|
105
104
|
params(
|
|
106
105
|
request: OpenAI::Internal::Transport::BaseClient::RequestInput,
|
|
107
106
|
status: Integer,
|
|
108
|
-
response_headers: T
|
|
107
|
+
response_headers: T::Hash[String, String]
|
|
109
108
|
).returns(OpenAI::Internal::Transport::BaseClient::RequestInput)
|
|
110
109
|
end
|
|
111
110
|
def follow_redirect(request, status:, response_headers:)
|
|
@@ -30,7 +30,7 @@ module OpenAI
|
|
|
30
30
|
params(
|
|
31
31
|
client: OpenAI::Internal::Transport::BaseClient,
|
|
32
32
|
req: OpenAI::Internal::Transport::BaseClient::RequestComponents,
|
|
33
|
-
headers: T
|
|
33
|
+
headers: T::Hash[String, String],
|
|
34
34
|
page_data: T.anything
|
|
35
35
|
).void
|
|
36
36
|
end
|